From ee6d11fe4461894cd7b9fbcec53ef81225a353e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mieszko=20Wrzeszczy=C5=84ski?= Date: Sun, 2 Dec 2018 16:28:20 +0100 Subject: [PATCH] Improve colors & margins --- app/build.gradle | 1 + .../activity/UsersListFragment.java | 15 +- app/src/main/res/drawable/blue_gradient.xml | 8 + .../res/drawable/ic_user_account_icon.xml | 9 + app/src/main/res/drawable/user_photo.xml | 9 + app/src/main/res/layout/duty_hours_item.xml | 9 + app/src/main/res/layout/user_list_modal.xml | 242 +++++++++++++----- app/src/main/res/values-pl/strings.xml | 2 + app/src/main/res/values/colors.xml | 2 + app/src/main/res/values/strings.xml | 2 + 10 files changed, 231 insertions(+), 68 deletions(-) create mode 100644 app/src/main/res/drawable/blue_gradient.xml create mode 100644 app/src/main/res/drawable/ic_user_account_icon.xml create mode 100644 app/src/main/res/drawable/user_photo.xml create mode 100644 app/src/main/res/layout/duty_hours_item.xml diff --git a/app/build.gradle b/app/build.gradle index e5042a6..d7e6c83 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -33,6 +33,7 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:preference-v7:27.1.1' implementation 'com.android.support:appcompat-v7:27.1.1' + implementation 'com.android.support:cardview-v7:27.1.1' implementation 'com.android.support:design:27.1.1' implementation 'com.android.support:support-v4:27.1.1' implementation 'com.android.support:support-vector-drawable:27.1.1' diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/UsersListFragment.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/UsersListFragment.java index 1f26899..4430e89 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/UsersListFragment.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/UsersListFragment.java @@ -9,7 +9,6 @@ import android.support.v7.app.AlertDialog; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -33,7 +32,6 @@ import com.uam.wmi.findmytutor.utils.RecyclerTouchListener; import com.uam.wmi.findmytutor.utils.RestApiHelper; import java.text.Collator; -import java.text.Normalizer; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -149,17 +147,26 @@ public class UsersListFragment extends Fragment { @Override public void onSuccess(TutorTabViewModel tutorTabViewModel) { final AlertDialog alertDialog = alertDialogBuilderUserInput.create(); + String userNoteText = tutorTabViewModel.getNote(); List dutyHoursList = Stream.of(tutorTabViewModel.getDutyHours()) .map(DutyHourViewModel::getSummary).toList(); + if(dutyHoursList.isEmpty()){ + dutyHoursList.add(getString(R.string.lack_duty_hours)); + } + + if(tutorTabViewModel.getNote().isEmpty()){ + userNoteText = getString(R.string.lack_note); + } + userRoom.setText(String.format("%s: %s", getString(R.string.userRoom), tutorTabViewModel.getRoom())); userEmail.setText(String.format("%s: %s", getString(R.string.userEmail), tutorTabViewModel.getEmailTutorTab())); - userNote.setText(String.format("%s: %s", getString(R.string.userNote), tutorTabViewModel.getNote())); + userNote.setText(String.format("%s: %s", getString(R.string.userNote), userNoteText)); department.setText(String.format("%s: %s", getString(R.string.userDepartment), user.getDepartment())); userDutyHoursTitle.setText(String.format("%s:", getString(R.string.userDutyHoursHeader))); final ArrayAdapter arrayAdapter = new ArrayAdapter<>(getActivity(), - android.R.layout.test_list_item, dutyHoursList); + R.layout.duty_hours_item, dutyHoursList); userDutyHours.setAdapter(arrayAdapter); alertDialog.show(); diff --git a/app/src/main/res/drawable/blue_gradient.xml b/app/src/main/res/drawable/blue_gradient.xml new file mode 100644 index 0000000..5024c28 --- /dev/null +++ b/app/src/main/res/drawable/blue_gradient.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_user_account_icon.xml b/app/src/main/res/drawable/ic_user_account_icon.xml new file mode 100644 index 0000000..6b5dc28 --- /dev/null +++ b/app/src/main/res/drawable/ic_user_account_icon.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/user_photo.xml b/app/src/main/res/drawable/user_photo.xml new file mode 100644 index 0000000..c0a725a --- /dev/null +++ b/app/src/main/res/drawable/user_photo.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/layout/duty_hours_item.xml b/app/src/main/res/layout/duty_hours_item.xml new file mode 100644 index 0000000..44c8531 --- /dev/null +++ b/app/src/main/res/layout/duty_hours_item.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/app/src/main/res/layout/user_list_modal.xml b/app/src/main/res/layout/user_list_modal.xml index f154ef3..0e022d5 100644 --- a/app/src/main/res/layout/user_list_modal.xml +++ b/app/src/main/res/layout/user_list_modal.xml @@ -1,73 +1,187 @@ + android:background="@color/background_user_modal" + android:orientation="vertical"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + >\ + + + + + + + + / + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 194554a..8bc8102 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -159,6 +159,8 @@ Błąd sieci! Błąd podczas pobierania danych. Błąd podczas pobierania statusów. + Brak informacji o dyzurze. + Brak notatki. diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index be1a4f3..f9f153e 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -70,5 +70,7 @@ #B2000000 #808080 #f1f1f1 + #EEF4F2 + #415B76 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d1dc9eb..4ae10ab 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -228,4 +228,6 @@ Network Error! Error handling status fetch Error handling status fetch + Lack information about duty hours + Lack of note.