1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-11-23 12:36:13 -06:00

Merge branch 'bottom-nav'

# Conflicts:
#	.idea/misc.xml
#	.idea/modules.xml
This commit is contained in:
RicomenPL 2017-07-14 12:09:47 +02:00
commit 538721003e
32 changed files with 408 additions and 16 deletions

View File

@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "io.github.wulkanowy"
minSdkVersion 14
@ -10,6 +10,7 @@ android {
versionCode 1
versionName "0.1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
@ -27,5 +28,8 @@ dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'org.jsoup:jsoup:1.10.2'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
}

View File

@ -3,7 +3,7 @@
package="io.github.wulkanowy">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
@ -14,8 +14,8 @@
android:theme="@android:style/Theme.DeviceDefault">
<activity
android:name=".activity.started.StartedActivity"
android:theme = "@style/NoActionBar"
android:noHistory="true">
android:noHistory="true"
android:theme="@style/NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -24,8 +24,11 @@
</activity>
<activity
android:name=".activity.main.MainActivity"
android:label="@string/login_title">
</activity>
android:label="@string/login_title" />
<activity
android:name=".activity.dashboard.DashboardActivity"
android:label="@string/title_activity_dashboard"
android:theme="@style/Theme.AppCompat" />
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View File

@ -0,0 +1,97 @@
package io.github.wulkanowy.activity.dashboard;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.support.v4.app.FragmentTransaction;
import io.github.wulkanowy.R;
import io.github.wulkanowy.activity.dashboard.attendance.AttendanceFragment;
import io.github.wulkanowy.activity.dashboard.board.BoardFragment;
import io.github.wulkanowy.activity.dashboard.lessonplan.LessonplanFragment;
import io.github.wulkanowy.activity.dashboard.marks.MarksFragment;
public class DashboardActivity extends AppCompatActivity {
MarksFragment marksFragment = new MarksFragment();
AttendanceFragment attendanceFragment = new AttendanceFragment();
BoardFragment boardFragment = new BoardFragment();
LessonplanFragment lessonplanFragment = new LessonplanFragment();
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
= new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
switch (item.getItemId()) {
case R.id.navigation_marks:
setTitle(R.string.title_marks);
transaction.replace(R.id.fragment_container, marksFragment);
transaction.commit();
return true;
case R.id.navigation_attendance:
setTitle(R.string.title_attendance);
transaction.replace(R.id.fragment_container, attendanceFragment);
transaction.commit();
return true;
case R.id.navigation_dashboard:
setTitle(R.string.title_dashboard);
transaction.replace(R.id.fragment_container, boardFragment);
transaction.commit();
return true;
case R.id.navigation_lessonplan:
setTitle(R.string.title_lessonplan);
transaction.replace(R.id.fragment_container, lessonplanFragment);
transaction.commit();
return true;
/*
case R.id.navigation_settings:
return true;
*/
}
return false;
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard);
setTitle(R.string.title_dashboard);
BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
navigation.setSelectedItemId(R.id.navigation_dashboard);
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, boardFragment).commit();
}
public void onBackPressed() {
BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
if (navigation.getSelectedItemId() != R.id.navigation_dashboard) {
navigation.setSelectedItemId(R.id.navigation_dashboard);
}
else if (navigation.getSelectedItemId() == R.id.navigation_dashboard){
moveTaskToBack(true);
}
}
}

View File

@ -0,0 +1,25 @@
package io.github.wulkanowy.activity.dashboard.attendance;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import io.github.wulkanowy.R;
public class AttendanceFragment extends Fragment {
public AttendanceFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_attendance, container, false);
}
}

View File

@ -0,0 +1,25 @@
package io.github.wulkanowy.activity.dashboard.board;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import io.github.wulkanowy.R;
public class BoardFragment extends Fragment {
public BoardFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_board, container, false);
}
}

View File

@ -0,0 +1,25 @@
package io.github.wulkanowy.activity.dashboard.lessonplan;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import io.github.wulkanowy.R;
public class LessonplanFragment extends Fragment {
public LessonplanFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_lessonplan, container, false);
}
}

View File

@ -0,0 +1,25 @@
package io.github.wulkanowy.activity.dashboard.marks;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import io.github.wulkanowy.R;
public class MarksFragment extends Fragment {
public MarksFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_marks, container, false);
}
}

View File

@ -2,6 +2,7 @@ package io.github.wulkanowy.activity.main;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.widget.Toast;
@ -14,6 +15,7 @@ import java.io.IOException;
import java.util.Map;
import io.github.wulkanowy.R;
import io.github.wulkanowy.activity.dashboard.DashboardActivity;
public class Login extends AsyncTask<Void, Void, Void> {
@ -142,5 +144,11 @@ public class Login extends AsyncTask<Void, Void, Void> {
if (!userMesage.isEmpty()){
Toast.makeText(activity, userMesage , Toast.LENGTH_LONG).show();
}
if (userMesage.equals(activity.getString(R.string.login_accepted))){
Intent intent = new Intent(activity,DashboardActivity.class);
activity.startActivity(intent);
}
}
}

View File

@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import io.github.wulkanowy.activity.dashboard.DashboardActivity;
import io.github.wulkanowy.activity.main.MainActivity;
public class LoadingTask extends AsyncTask<Void, Void, Void> {
@ -27,10 +28,10 @@ public class LoadingTask extends AsyncTask<Void, Void, Void> {
protected void onPostExecute(Void result) {
/* Intent intent = new Intent(activity,MainActivity.class);
activity.startActivity(intent); */
Intent intent = new Intent(activity,MainActivity.class);
activity.startActivity(intent);
}
}

View File

@ -17,8 +17,5 @@ public class StartedActivity extends Activity {
public void Task(){
new LoadingTask(this).execute();
}
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#cfd5dd" android:state_checked="true" />
<item android:color="#ffffff" />
</selector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
</vector>

View File

@ -0,0 +1,8 @@
<!-- drawable/table_edit.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#ffffff" android:pathData="M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.08 20.21,11.08 20.42,11.3L21.7,12.58C21.92,12.79 21.92,13.14 21.7,13.35M12,18.94L18.07,12.88L20.12,14.93L14.06,21H12V18.94M4,2H18A2,2 0 0,1 20,4V8.17L16.17,12H12V16.17L10.17,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M4,6V10H10V6H4M12,6V10H18V6H12M4,12V16H10V12H4Z" />
</vector>

View File

@ -0,0 +1,8 @@
<!-- drawable/calendar_text.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#ffffff" android:pathData="M14,14H7V16H14M19,19H5V8H19M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M17,10H7V12H17V10Z" />
</vector>

View File

@ -0,0 +1,8 @@
<!-- drawable/numeric_6_box_multiple_outline.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="26dp"
android:width="26dp"
android:viewportWidth="26"
android:viewportHeight="26">
<path android:fillColor="#ffffff" android:pathData="M13,11H15V13H13M13,15H15A2,2 0 0,0 17,13V11C17,9.89 16.1,9 15,9H13V7H17V5H13A2,2 0 0,0 11,7V13C11,14.11 11.9,15 13,15M21,17H7V3H21M21,1H7A2,2 0 0,0 5,3V17A2,2 0 0,0 7,19H21A2,2 0 0,0 23,17V3A2,2 0 0,0 21,1M3,5H1V21A2,2 0 0,0 3,23H19V21H3V5Z" />
</vector>

View File

@ -0,0 +1,8 @@
<!-- drawable/settings.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#ffffff" android:pathData="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z" />
</vector>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="io.github.wulkanowy.activity.dashboard.DashboardActivity"
android:weightSum="1">
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?android:attr/windowBackground"
app:menu="@menu/navigation"
app:itemIconTint="@color/bottomnavi_color"
app:itemTextColor="@color/bottomnavi_color"/>
</LinearLayout>

View File

@ -0,0 +1,12 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="io.github.wulkanowy.activity.dashboard.attendance.AttendanceFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fragment Frekwencja" />
</FrameLayout>

View File

@ -0,0 +1,14 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="io.github.wulkanowy.activity.dashboard.board.BoardFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fragment Dashboard" />
</FrameLayout>

View File

@ -0,0 +1,12 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="io.github.wulkanowy.activity.dashboard.lessonplan.LessonplanFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fragment Plan lekcji" />
</FrameLayout>

View File

@ -0,0 +1,17 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="io.github.wulkanowy.activity.dashboard.marks.MarksFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Fragment Oceny" />
<ExpandableListView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_marks"
android:icon="@drawable/icon_marks_26dp"
android:title="@string/title_marks" />
<item
android:id="@+id/navigation_attendance"
android:icon="@drawable/icon_attendance_24dp"
android:title="@string/title_attendance" />
<item
android:id="@+id/navigation_dashboard"
android:icon="@drawable/ic_dashboard_black_24dp"
android:title="@string/title_dashboard" />
<item
android:id="@+id/navigation_lessonplan"
android:icon="@drawable/icon_lessonplan_24dp"
android:title="@string/title_lessonplan" />
<item
android:id="@+id/navigation_settings"
android:icon="@drawable/icon_other_24dp"
android:title="@string/title_settings" />
</menu>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Wulkanowy</string>
<string name="under_logo">Surowa wersja</string>
@ -13,5 +12,11 @@
<string name="error_feature_text">Funkcja którą chciałeś uruchomić nie działa</string>
<string name="login_accepted">Pomyślnie zalogowano</string>
<string name="login_denied">Logowanie nie powiodło się</string>
<string name="please_wait">Proszę czekać...</string>
</resources>
<string name="please_wait">Proszę czekać…</string>
<string name="title_activity_dashboard">Aktywność dashboard</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_marks">Oceny</string>
<string name="title_attendance">Frekwencja</string>
<string name="title_lessonplan">Plan lekcji</string>
<string name="title_settings">Ustawienia</string>
</resources>

View File

@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>

View File

@ -0,0 +1,5 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>

View File

@ -12,5 +12,11 @@
<string name="error_feature_text">The function you wanted to run does not work</string>
<string name="login_accepted">Login is successful</string>
<string name="login_denied">Login is failed</string>
<string name="please_wait">Please wait...</string>
<string name="please_wait">Please wait…</string>
<string name="title_activity_dashboard">Dashboard Activity</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_marks">Marks</string>
<string name="title_attendance">Attendance</string>
<string name="title_lessonplan">Lesson Plan</string>
<string name="title_settings">Settings</string>
</resources>