Android Notifications implementation (#33)
* Fix bug with the number of grades in snackbar * Add basic grade notification * Add notification icons * Add intent to notification * Improve login activity appearance * Improve dashboard appearance * Small amendments * Change splash logo
@ -5,7 +5,7 @@ apply plugin: 'org.greenrobot.greendao'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
buildToolsVersion "27.0.0"
|
||||
buildToolsVersion "27.0.1"
|
||||
defaultConfig {
|
||||
applicationId "io.github.wulkanowy"
|
||||
testApplicationId "io.github.tests.wulkanowy"
|
||||
@ -44,25 +44,23 @@ greendao {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.android.support:appcompat-v7:27.0.0'
|
||||
compile 'com.android.support:appcompat-v7:27.0.1'
|
||||
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
||||
compile 'com.android.support:design:27.0.0'
|
||||
compile 'com.android.support:support-vector-drawable:27.0.0'
|
||||
compile 'com.android.support:support-v4:27.0.0'
|
||||
compile 'com.android.support:recyclerview-v7:27.0.0'
|
||||
compile 'com.android.support:cardview-v7:27.0.0'
|
||||
compile 'com.android.support:design:27.0.1'
|
||||
compile 'com.android.support:support-vector-drawable:27.0.1'
|
||||
compile 'com.android.support:support-v4:27.0.1'
|
||||
compile 'com.android.support:recyclerview-v7:27.0.1'
|
||||
compile 'com.android.support:cardview-v7:27.0.1'
|
||||
compile 'com.android.support:customtabs:27.0.1'
|
||||
compile 'com.firebase:firebase-jobdispatcher:0.8.4'
|
||||
compile 'com.thoughtbot:expandablerecyclerview:1.3'
|
||||
compile 'org.apache.commons:commons-lang3:3.6'
|
||||
compile 'org.apache.commons:commons-collections4:4.1'
|
||||
compile 'org.jsoup:jsoup:1.10.3'
|
||||
compile 'org.greenrobot:greendao:3.2.2'
|
||||
compile 'com.android.support:customtabs:27.0.0'
|
||||
|
||||
debugCompile 'com.amitshekhar.android:debug-db:1.0.1'
|
||||
debugCompile 'net.zetetic:android-database-sqlcipher:3.5.7@aar'
|
||||
|
||||
androidTestCompile 'org.mockito:mockito-android:2.11.0'
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile 'org.mockito:mockito-core:2.11.0'
|
||||
@ -70,8 +68,9 @@ dependencies {
|
||||
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
androidTestCompile 'com.android.support:support-annotations:27.0.0'
|
||||
androidTestCompile 'com.android.support:support-annotations:27.0.1'
|
||||
androidTestCompile 'com.android.support.test:runner:1.0.1'
|
||||
androidTestCompile 'com.android.support.test:rules:1.0.1'
|
||||
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
|
||||
androidTestCompile 'org.mockito:mockito-android:2.11.0'
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class DatabaseAccessTest extends DatabaseAccess {
|
||||
daoSession.getGradeDao().insert(new Grade()
|
||||
.setIsNew(true));
|
||||
|
||||
Assert.assertEquals(1, DatabaseAccess.getNewGrades(daoSession).size());
|
||||
Assert.assertEquals(1, new DatabaseAccess().getNewGrades(daoSession).size());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 19 KiB |
@ -66,17 +66,23 @@ public class DashboardActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_dashboard);
|
||||
|
||||
BottomNavigationView navigation = findViewById(R.id.navigation);
|
||||
navigation.setSelectedItemId(R.id.navigation_dashboard);
|
||||
navigation.setSelectedItemId(R.id.navigation_marks);
|
||||
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
currentFragment = getSupportFragmentManager().getFragment(savedInstanceState, "currentFragment");
|
||||
setTitle(savedInstanceState.getString("activityTitle"));
|
||||
} else {
|
||||
currentFragment = boardFragment;
|
||||
currentFragment = gradesFragment;
|
||||
setTitle(R.string.dashboard_text);
|
||||
}
|
||||
|
||||
int cardID = getIntent().getIntExtra("cardID", 0);
|
||||
|
||||
if (cardID == 1) {
|
||||
currentFragment = gradesFragment;
|
||||
}
|
||||
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragment_container, currentFragment).commit();
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class GradesAdapter extends ExpandableRecyclerViewAdapter<GradesAdapter.S
|
||||
averageGrades.setText(activity.getResources().getString(R.string.info_average_grades, average));
|
||||
}
|
||||
subjectName.setText(group.getTitle());
|
||||
numberOfGrades.setText(activity.getResources().getQuantityString(R.plurals.numberOfGrades, volumeGrades, volumeGrades));
|
||||
numberOfGrades.setText(activity.getResources().getQuantityString(R.plurals.numberOfGradesPlurals, volumeGrades, volumeGrades));
|
||||
|
||||
for (Grade grade : gradeList) {
|
||||
if (!grade.getRead()) {
|
||||
|
@ -46,6 +46,7 @@ public class GradesFragment extends Fragment {
|
||||
DaoSession daoSession;
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_grades, container, false);
|
||||
view.findViewById(R.id.fragment_no_grades).setVisibility(View.GONE);
|
||||
|
||||
if (getActivity() != null) {
|
||||
daoSession = ((WulkanowyApp) getActivity().getApplication()).getDaoSession();
|
||||
@ -136,6 +137,9 @@ public class GradesFragment extends Fragment {
|
||||
super.onPostExecute(result);
|
||||
createExpList(mainView.get(), activity.get());
|
||||
mainView.get().findViewById(R.id.loadingPanel).setVisibility(View.INVISIBLE);
|
||||
if (subjectWithGradesList.size() == 0) {
|
||||
mainView.get().findViewById(R.id.fragment_no_grades).setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +180,7 @@ public class GradesFragment extends Fragment {
|
||||
createExpList(mainView.get(), activity.get());
|
||||
}
|
||||
|
||||
int volumeGrades = DatabaseAccess.getNewGrades(daoSession).size();
|
||||
int volumeGrades = new DatabaseAccess().getNewGrades(daoSession).size();
|
||||
|
||||
if (volumeGrades == 0) {
|
||||
Snackbar.make(activity.get().findViewById(R.id.fragment_container),
|
||||
|
@ -11,9 +11,6 @@ import io.github.wulkanowy.R;
|
||||
|
||||
public class LessonPlanFragment extends Fragment {
|
||||
|
||||
public LessonPlanFragment() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
@ -161,11 +161,12 @@ public class LoginActivity extends Activity {
|
||||
// form field with an error.
|
||||
focusView.requestFocus();
|
||||
} else {
|
||||
// Show a progress spinner, and kick off a background task to
|
||||
// Show a progress spinner and kick off a background task to
|
||||
// perform the user login attempt.
|
||||
LoginTask authTask = new LoginTask(this, email, password, symbol);
|
||||
authTask.showProgress(true);
|
||||
authTask.execute();
|
||||
hideSoftKeyboard();
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,6 +178,15 @@ public class LoginActivity extends Activity {
|
||||
return password.length() > 7;
|
||||
}
|
||||
|
||||
private void hideSoftKeyboard() {
|
||||
InputMethodManager manager = (InputMethodManager)
|
||||
getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (manager != null) {
|
||||
manager.hideSoftInputFromWindow(getWindow()
|
||||
.getDecorView().getApplicationWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
|
||||
@ -192,15 +202,13 @@ public class LoginActivity extends Activity {
|
||||
|| ev.getAction() == MotionEvent.ACTION_MOVE) && view instanceof EditText
|
||||
&& !view.getClass().getName().startsWith("android.webkit.")) {
|
||||
|
||||
int scrcoords[] = new int[2];
|
||||
view.getLocationOnScreen(scrcoords);
|
||||
float x = ev.getRawX() + view.getLeft() - scrcoords[0];
|
||||
float y = ev.getRawY() + view.getTop() - scrcoords[1];
|
||||
int coordinators[] = new int[2];
|
||||
view.getLocationOnScreen(coordinators);
|
||||
float x = ev.getRawX() + view.getLeft() - coordinators[0];
|
||||
float y = ev.getRawY() + view.getTop() - coordinators[1];
|
||||
if (x < view.getLeft() || x > view.getRight() || y < view.getTop()
|
||||
|| y > view.getBottom()) {
|
||||
((InputMethodManager) getSystemService(
|
||||
Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(
|
||||
(getWindow().getDecorView().getApplicationWindowToken()), 0);
|
||||
hideSoftKeyboard();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,11 +3,13 @@ package io.github.wulkanowy.activity.login;
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -118,6 +120,7 @@ public class LoginTask extends AsyncTask<Void, String, Integer> {
|
||||
EditText passwordView = activity.get().findViewById(R.id.password);
|
||||
passwordView.setError(activity.get().getString(R.string.error_incorrect_password));
|
||||
passwordView.requestFocus();
|
||||
showSoftKeyboard(passwordView);
|
||||
break;
|
||||
|
||||
// if no permission
|
||||
@ -129,6 +132,7 @@ public class LoginTask extends AsyncTask<Void, String, Integer> {
|
||||
EditText symbolView = activity.get().findViewById(R.id.symbol);
|
||||
symbolView.setError(activity.get().getString(R.string.error_bad_account_permission));
|
||||
symbolView.requestFocus();
|
||||
showSoftKeyboard(symbolView);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -156,6 +160,15 @@ public class LoginTask extends AsyncTask<Void, String, Integer> {
|
||||
changeProgressVisibility(show, animTime);
|
||||
}
|
||||
|
||||
private void showSoftKeyboard(EditText editText) {
|
||||
InputMethodManager manager = (InputMethodManager)
|
||||
activity.get().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (manager != null) {
|
||||
manager.showSoftInput(editText,
|
||||
InputMethodManager.SHOW_IMPLICIT);
|
||||
}
|
||||
}
|
||||
|
||||
private void changeLoginFormVisibility(final boolean show, final int animTime) {
|
||||
loginFormView.get().setVisibility(show ? View.GONE : View.VISIBLE);
|
||||
loginFormView.get().animate().setDuration(animTime).alpha(
|
||||
|
@ -9,7 +9,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.github.wulkanowy.api.StudentAndParent;
|
||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||
|
||||
public class SubjectsList {
|
||||
|
||||
|
@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.github.wulkanowy.api.StudentAndParent;
|
||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||
|
||||
public class AchievementsList {
|
||||
|
||||
|
@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.github.wulkanowy.api.StudentAndParent;
|
||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||
|
||||
public class NotesList {
|
||||
|
||||
|
@ -5,7 +5,6 @@ import org.jsoup.nodes.Element;
|
||||
import java.io.IOException;
|
||||
|
||||
import io.github.wulkanowy.api.StudentAndParent;
|
||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||
|
||||
public class SchoolInfo {
|
||||
|
||||
|
@ -9,7 +9,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.github.wulkanowy.api.StudentAndParent;
|
||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||
|
||||
public class TeachersInfo {
|
||||
|
||||
|
@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.github.wulkanowy.api.StudentAndParent;
|
||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||
|
||||
public class FamilyInformation {
|
||||
|
||||
|
@ -8,9 +8,9 @@ import io.github.wulkanowy.dao.entities.DaoSession;
|
||||
import io.github.wulkanowy.dao.entities.Grade;
|
||||
import io.github.wulkanowy.dao.entities.GradeDao;
|
||||
|
||||
public abstract class DatabaseAccess {
|
||||
public class DatabaseAccess {
|
||||
|
||||
public static List<Grade> getNewGrades(DaoSession daoSession) {
|
||||
public List<Grade> getNewGrades(DaoSession daoSession) {
|
||||
Query<Grade> gradeQuery = daoSession.getGradeDao().queryBuilder()
|
||||
.where(GradeDao.Properties.IsNew.eq(1))
|
||||
.build();
|
||||
|
@ -1,5 +1,9 @@
|
||||
package io.github.wulkanowy.services.jobs;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import com.firebase.jobdispatcher.Constraint;
|
||||
import com.firebase.jobdispatcher.FirebaseJobDispatcher;
|
||||
import com.firebase.jobdispatcher.Job;
|
||||
@ -8,16 +12,23 @@ import com.firebase.jobdispatcher.RetryStrategy;
|
||||
import com.firebase.jobdispatcher.Trigger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import io.github.wulkanowy.R;
|
||||
import io.github.wulkanowy.activity.WulkanowyApp;
|
||||
import io.github.wulkanowy.activity.dashboard.DashboardActivity;
|
||||
import io.github.wulkanowy.api.Vulcan;
|
||||
import io.github.wulkanowy.api.login.AccountPermissionException;
|
||||
import io.github.wulkanowy.api.login.BadCredentialsException;
|
||||
import io.github.wulkanowy.api.login.NotLoggedInErrorException;
|
||||
import io.github.wulkanowy.dao.DatabaseAccess;
|
||||
import io.github.wulkanowy.dao.entities.DaoSession;
|
||||
import io.github.wulkanowy.dao.entities.Grade;
|
||||
import io.github.wulkanowy.security.CryptoException;
|
||||
import io.github.wulkanowy.services.LoginSession;
|
||||
import io.github.wulkanowy.services.VulcanSynchronization;
|
||||
import io.github.wulkanowy.services.notifications.NotificationHelper;
|
||||
|
||||
public class GradeJob extends VulcanJobHelper {
|
||||
|
||||
@ -52,6 +63,28 @@ public class GradeJob extends VulcanJobHelper {
|
||||
VulcanSynchronization vulcanSynchronization = new VulcanSynchronization(new LoginSession());
|
||||
vulcanSynchronization.loginCurrentUser(getApplicationContext(), daoSession, new Vulcan());
|
||||
vulcanSynchronization.syncGrades();
|
||||
|
||||
List<Grade> newGradeList = new DatabaseAccess().getNewGrades(daoSession);
|
||||
|
||||
if (newGradeList.size() == 1) {
|
||||
buildNotify(getResources().getQuantityString(R.plurals.newGradePlurals, 1),
|
||||
newGradeList.get(0).getSubject());
|
||||
} else if (newGradeList.size() > 1) {
|
||||
buildNotify(getResources().getQuantityString(R.plurals.newGradePlurals, 2),
|
||||
getResources().getQuantityString(R.plurals.receivedNewGradePlurals, newGradeList.size(), newGradeList.size()));
|
||||
}
|
||||
}
|
||||
|
||||
private void buildNotify(String title, String bodyText) {
|
||||
Intent intent = new Intent(getApplicationContext(), DashboardActivity.class);
|
||||
intent.putExtra("cardID", 1);
|
||||
PendingIntent pendingIntent = PendingIntent
|
||||
.getActivity(getApplicationContext(), 0, intent, 0);
|
||||
|
||||
NotificationHelper notificationHelper = new NotificationHelper(getApplicationContext());
|
||||
NotificationCompat.Builder builder = notificationHelper
|
||||
.getNotifications(title, bodyText, pendingIntent);
|
||||
notificationHelper.getManager().notify(new Random().nextInt(10000), builder.build());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,60 @@
|
||||
package io.github.wulkanowy.services.notifications;
|
||||
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import io.github.wulkanowy.R;
|
||||
|
||||
public class NotificationHelper extends ContextWrapper {
|
||||
|
||||
private NotificationManager manager;
|
||||
|
||||
public static final String CHANNEL_ID = "Wulkanowy_New_Grade_Channel";
|
||||
|
||||
public static final String CHANNEL_NAME = "New Grade Channel";
|
||||
|
||||
public NotificationHelper(Context context) {
|
||||
super(context);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
createChannel();
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(26)
|
||||
private void createChannel() {
|
||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME,
|
||||
NotificationManager.IMPORTANCE_HIGH);
|
||||
notificationChannel.enableLights(true);
|
||||
notificationChannel.enableVibration(true);
|
||||
notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
|
||||
getManager().createNotificationChannel(notificationChannel);
|
||||
}
|
||||
|
||||
public NotificationCompat.Builder getNotifications(String title, String bodyText, PendingIntent pendingIntent) {
|
||||
return new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID)
|
||||
.setContentTitle(title)
|
||||
.setContentText(bodyText)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setAutoCancel(true)
|
||||
.setContentIntent(pendingIntent)
|
||||
.setChannelId(CHANNEL_ID)
|
||||
.setDefaults(NotificationCompat.DEFAULT_ALL)
|
||||
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
||||
.setColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
|
||||
public NotificationManager getManager() {
|
||||
if (manager == null) {
|
||||
manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
}
|
@ -35,6 +35,9 @@ public class GradesSynchronisation {
|
||||
|
||||
Account account = accountDao.load(loginSession.getUserId());
|
||||
|
||||
account.resetGradeList();
|
||||
account.resetSubjectList();
|
||||
|
||||
List<Grade> gradesFromDb = account.getGradeList();
|
||||
List<Grade> gradeEntitiesList = ConversionVulcanObject.gradesToGradeEntities(gradesList.getAll());
|
||||
List<Grade> updatedList = EntitiesCompare.compareGradeList(gradeEntitiesList, gradesFromDb);
|
||||
|
@ -3,7 +3,6 @@ package io.github.wulkanowy.services.synchronisation;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
BIN
app/src/main/res/drawable-hdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 94 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 730 B |
Before Width: | Height: | Size: 47 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 150 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 327 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 542 KiB |
13
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="51.67464"
|
||||
android:viewportHeight="51.67464">
|
||||
<group
|
||||
android:translateX="13.83732"
|
||||
android:translateY="13.83732">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M10.545,11h-2.215c-0.158,-1.234 -0.428,-1.971 -2.092,-2.691 -1.38,-0.598 -2.238,-1.83 -2.238,-3.218 0,-2.021 1.652,-3.317 3.286,-3.459 0.625,-0.999 1.731,-1.632 2.94,-1.632 0.877,0 1.697,0.325 2.323,0.892 0.793,-0.576 1.747,-0.892 2.743,-0.892 2.596,0 4.708,2.1 4.708,4.682s-2.112,4.682 -4.708,4.682c-0.606,0 -1.165,-0.129 -1.658,-0.242 -1.001,-0.231 -2.327,-0.563 -3.089,1.878zM6.012,5.091c0,0.871 0.788,1.279 1.029,1.384 0.84,0.364 1.926,0.834 2.609,2.102 0.815,-1.108 1.755,-1.632 2.904,-1.632 0.858,0 2.083,0.419 2.737,0.419 1.487,0 2.697,-1.203 2.697,-2.682 0,-2.79 -3.694,-3.635 -5.517,-1.166 -0.707,-2.031 -3.865,-1.937 -3.887,0.219 -0.67,-0.61 -2.572,-0.331 -2.572,1.356zM17,14l-2.154,3 -3.846,-5c-0.364,0.316 -0.932,0.474 -1.5,0.474s-1.136,-0.158 -1.5,-0.474l-8,12h24l-7,-10zM7.005,17.097l1.12,0.903 1.5,-1.604 1.667,1.604 1.083,-0.933 2.527,3.285 2.078,-2.894 3.179,4.542h-16.422l3.268,-4.903z" />
|
||||
</group>
|
||||
</vector>
|
BIN
app/src/main/res/drawable/ic_logo_splash.png
Normal file
After Width: | Height: | Size: 33 KiB |
21
app/src/main/res/drawable/ic_wrench_construction.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M 5.898438 2.199219 L 10 6.300781 C 10 6.300781 10 7.5 8.800781 8.800781 C 7.5
|
||||
10 6.300781 10 6.300781 10 L 2.199219 5.898438 C 1.601563 8.199219 2.398438 11
|
||||
4.101563 12.699219 C 6.699219 15.300781 9.898438 13 10.601563 13.699219 C
|
||||
14.199219 17.300781 17.101563 21 17.300781 21.199219 C 18.398438 22.300781
|
||||
20.199219 22.300781 21.199219 21.300781 C 22.300781 20.199219 22.199219 18.5
|
||||
21.101563 17.398438 C 21 17.300781 17.101563 14.199219 13.5 10.601563 C
|
||||
12.800781 9.898438 15.300781 6.800781 12.601563 4.101563 C 11 2.398438 8.199219
|
||||
1.601563 5.898438 2.199219 Z M 20.199219 19 C 20.199219 19.699219 19.699219
|
||||
20.199219 19 20.199219 C 18.300781 20.199219 17.800781 19.699219 17.800781 19 C
|
||||
17.800781 18.300781 18.300781 17.800781 19 17.800781 C 19.699219 17.800781
|
||||
20.199219 18.300781 20.199219 19 Z" />
|
||||
</vector>
|
10
app/src/main/res/drawable/icon_grade_26dp.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<!-- 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="#000000"
|
||||
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>
|
@ -1,8 +0,0 @@
|
||||
<!-- 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>
|
@ -15,10 +15,12 @@
|
||||
android:id="@+id/login_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginTop="178dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone"
|
||||
>
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/login_progress_horizontal"
|
||||
@ -28,10 +30,9 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="91dp"
|
||||
android:minHeight="30dp"
|
||||
android:indeterminate="true"
|
||||
android:minWidth="220dp"
|
||||
/>
|
||||
android:minHeight="30dp"
|
||||
android:minWidth="220dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_progress_text"
|
||||
@ -39,8 +40,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/login_progress_horizontal"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="42dp"
|
||||
/>
|
||||
android:layout_marginBottom="42dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ScrollView
|
||||
|
@ -11,7 +11,7 @@
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="70dp"
|
||||
android:src="@drawable/logo_image"
|
||||
android:src="@drawable/ic_logo_splash"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
|
@ -2,11 +2,34 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context="io.github.wulkanowy.activity.dashboard.attendance.AttendanceFragment">
|
||||
|
||||
<TextView
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Fragment Frekwencja" />
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/wrench_under_construction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/textView3"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="45dp"
|
||||
android:contentDescription="@string/activity_dashboard_text"
|
||||
android:minHeight="100dp"
|
||||
android:minWidth="100dp"
|
||||
app:srcCompat="@drawable/ic_wrench_construction" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="46dp"
|
||||
android:text="@string/activity_under_construction"
|
||||
android:textSize="17sp"
|
||||
android:textAlignment="center"
|
||||
android:id="@+id/textView3" />
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
@ -1,12 +1,35 @@
|
||||
<android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="io.github.wulkanowy.activity.dashboard.board.BoardFragment">
|
||||
|
||||
<TextView
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Fragment Dashboard" />
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/wrench_under_construction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/textView3"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="45dp"
|
||||
android:contentDescription="@string/activity_dashboard_text"
|
||||
android:minHeight="100dp"
|
||||
android:minWidth="100dp"
|
||||
app:srcCompat="@drawable/ic_wrench_construction" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="46dp"
|
||||
android:text="@string/activity_under_construction"
|
||||
android:textSize="17sp"
|
||||
android:textAlignment="center"
|
||||
android:id="@+id/textView3" />
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
@ -1,10 +1,39 @@
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/coordinator_grade"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="io.github.wulkanowy.activity.dashboard.grades.GradesFragment">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:id="@+id/fragment_no_grades">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/wrench_under_construction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/textView3"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="40dp"
|
||||
android:contentDescription="@string/activity_dashboard_text"
|
||||
android:minHeight="100dp"
|
||||
android:minWidth="100dp"
|
||||
app:srcCompat="@drawable/icon_grade_26dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="46dp"
|
||||
android:text="@string/fragment_no_grades"
|
||||
android:textSize="20sp"
|
||||
android:textAlignment="center"
|
||||
android:id="@+id/textView3" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/loadingPanel"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -2,11 +2,34 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context="io.github.wulkanowy.activity.dashboard.lessonplan.LessonPlanFragment">
|
||||
|
||||
<TextView
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Fragment Plan lekcji" />
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/wrench_under_construction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/textView3"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="45dp"
|
||||
android:contentDescription="@string/activity_dashboard_text"
|
||||
android:minHeight="100dp"
|
||||
android:minWidth="100dp"
|
||||
app:srcCompat="@drawable/ic_wrench_construction" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="46dp"
|
||||
android:text="@string/activity_under_construction"
|
||||
android:textSize="17sp"
|
||||
android:textAlignment="center"
|
||||
android:id="@+id/textView3" />
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
@ -4,11 +4,11 @@
|
||||
android:id="@+id/grade_cardview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:foreground="?attr/selectableItemBackgroundBorderless"
|
||||
card_view:cardElevation="0dp">
|
||||
|
||||
@ -19,7 +19,8 @@
|
||||
android:layout_marginEnd="7dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:layout_marginStart="7dp">
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="7dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/grade_text"
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_marks"
|
||||
android:icon="@drawable/icon_marks_26dp"
|
||||
android:icon="@drawable/icon_grade_26dp"
|
||||
android:title="@string/grades_text" />
|
||||
|
||||
<item
|
||||
|
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 12 KiB |
@ -23,38 +23,59 @@
|
||||
<string name="action_create_account">Nie masz jeszcze konta? Załóż je</string>
|
||||
<string name="action_forgot_password">Zapomniałeś hasła?</string>
|
||||
|
||||
<string name="color_black_text">Czarny</string>
|
||||
<string name="color_red_text">Czerwony</string>
|
||||
<string name="color_blue_text">Niebieski</string>
|
||||
<string name="color_green_text">Zielony</string>
|
||||
<string name="noColor_text">Brak koloru</string>
|
||||
|
||||
<string name="activity_dashboard_text">Aktywność dashboard</string>
|
||||
<string name="dashboard_text">Dashboard</string>
|
||||
<string name="grades_text">Oceny</string>
|
||||
<string name="attendance_text">Frekwencja</string>
|
||||
<string name="lessonplan_text">Plan lekcji</string>
|
||||
<string name="settings_text">Ustawienia</string>
|
||||
<string name="activity_under_construction">Ta część aplikacji jest w budowie</string>
|
||||
<string name="fragment_no_grades">Brak ocen</string>
|
||||
|
||||
<string name="noInternet_text">Brak połączenia z internetem</string>
|
||||
<string name="root_failed_text">To urządzenie posiada posiada podwyższone uprawnienia (root). Automatyczne logowanie zosatło wyłączone.</string>
|
||||
<string name="encrypt_failed_text">Szyfrowanie nie powiodło się. Automatyczne logowanie zostało wyłączone</string>
|
||||
<string name="version_text">Wersja %1$s</string>
|
||||
<string name="refresh_error_text">"Podczas odświeżania zawartości wystąpił błąd. "</string>
|
||||
|
||||
<string name="dialog_description_text">Opis</string>
|
||||
<string name="dialog_weight_text">Waga</string>
|
||||
<string name="noDescription_text">Brak opisu</string>
|
||||
<string name="dialog_teacher_text">Nauczyciel</string>
|
||||
<string name="dialog_date_text">Data</string>
|
||||
<string name="dialog_color_text">Kolor</string>
|
||||
<string name="color_black_text">Czarny</string>
|
||||
<string name="color_red_text">Czerwony</string>
|
||||
<string name="color_blue_text">Niebieski</string>
|
||||
<string name="color_green_text">Zielony</string>
|
||||
<string name="noColor_text">Brak koloru</string>
|
||||
<string name="dialog_close">Zamknij</string>
|
||||
<string name="refresh_error_text">"Podczas odświeżania zawartości wystąpił błąd. "</string>
|
||||
|
||||
<string name="snackbar_no_grades">Brak nowych ocen</string>
|
||||
<string name="snackbar_new_grade">Ilość nowych ocen: %1$d</string>
|
||||
|
||||
<plurals name="numberOfGrades">
|
||||
<string name="info_average_grades">Średnia: %1$.2f</string>
|
||||
<string name="info_no_average">Brak średniej</string>
|
||||
|
||||
<plurals name="numberOfGradesPlurals">
|
||||
<item quantity="one">%d ocena</item>
|
||||
<item quantity="few">%d oceny</item>
|
||||
<item quantity="many">%d ocen</item>
|
||||
<item quantity="other">%d ocen</item>
|
||||
</plurals>
|
||||
<string name="info_average_grades">Średnia: %1$.2f</string>
|
||||
<string name="info_no_average">Brak średniej</string>
|
||||
|
||||
<plurals name="newGradePlurals">
|
||||
<item quantity="one">Nowa ocena</item>
|
||||
<item quantity="few">Nowe oceny</item>
|
||||
<item quantity="many">Nowych ocen</item>
|
||||
<item quantity="other">Nowych ocen</item>
|
||||
</plurals>
|
||||
|
||||
<plurals name="receivedNewGradePlurals">
|
||||
<item quantity="one">Dostałeś %1$d ocenę</item>
|
||||
<item quantity="few">"Dostałeś %1$d oceny</item>
|
||||
<item quantity="many">Dostałeś %1$d ocen</item>
|
||||
<item quantity="other">Dostałeś %1$d ocen</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
|
4
app/src/main/res/values/ic_launcher_background.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
</resources>
|
@ -35,6 +35,8 @@
|
||||
<string name="attendance_text">Attendance</string>
|
||||
<string name="lessonplan_text">Lesson Plan</string>
|
||||
<string name="settings_text">Settings</string>
|
||||
<string name="activity_under_construction">This section of app is under construction.</string>
|
||||
<string name="fragment_no_grades">No grades</string>
|
||||
|
||||
<string name="noInternet_text">No internet connection</string>
|
||||
<string name="root_failed_text">This device is rooted. Automatic login has been disabled</string>
|
||||
@ -53,10 +55,21 @@
|
||||
<string name="snackbar_no_grades">No new grades</string>
|
||||
<string name="snackbar_new_grade">Number of new grades: %1$d</string>
|
||||
|
||||
<plurals name="numberOfGrades">
|
||||
<string name="info_average_grades">Average: %1$.2f</string>
|
||||
<string name="info_no_average">No average</string>
|
||||
|
||||
<plurals name="numberOfGradesPlurals">
|
||||
<item quantity="one">%d grade</item>
|
||||
<item quantity="other">%d grades</item>
|
||||
</plurals>
|
||||
<string name="info_average_grades">Average: %1$.2f</string>
|
||||
<string name="info_no_average">No average</string>
|
||||
|
||||
<plurals name="newGradePlurals">
|
||||
<item quantity="one">New grade</item>
|
||||
<item quantity="other">New grades</item>
|
||||
</plurals>
|
||||
|
||||
<plurals name="receivedNewGradePlurals">
|
||||
<item quantity="one">You received %1$d grade</item>
|
||||
<item quantity="other">You received %1$d grades</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
|