Improve colors & margins

This commit is contained in:
Mieszko Wrzeszczyński 2018-12-02 16:28:20 +01:00
parent 957cee1b23
commit ee6d11fe44
10 changed files with 231 additions and 68 deletions

View File

@ -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'

View File

@ -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<String> 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<String> arrayAdapter = new ArrayAdapter<>(getActivity(),
android.R.layout.test_list_item, dutyHoursList);
R.layout.duty_hours_item, dutyHoursList);
userDutyHours.setAdapter(arrayAdapter);
alertDialog.show();

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:angle="45"
android:startColor="@color/mapboxGrayFaint"
android:endColor="@color/mapboxGrayLight"
/>
</shape>

View File

@ -0,0 +1,9 @@
<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="#FF000000"
android:pathData="M9,11.75c-0.69,0 -1.25,0.56 -1.25,1.25s0.56,1.25 1.25,1.25 1.25,-0.56 1.25,-1.25 -0.56,-1.25 -1.25,-1.25zM15,11.75c-0.69,0 -1.25,0.56 -1.25,1.25s0.56,1.25 1.25,1.25 1.25,-0.56 1.25,-1.25 -0.56,-1.25 -1.25,-1.25zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8 0,-0.29 0.02,-0.58 0.05,-0.86 2.36,-1.05 4.23,-2.98 5.21,-5.37C11.07,8.33 14.05,10 17.42,10c0.78,0 1.53,-0.09 2.25,-0.26 0.21,0.71 0.33,1.47 0.33,2.26 0,4.41 -3.59,8 -8,8z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,5c1.66,0 3,1.34 3,3s-1.34,3 -3,3 -3,-1.34 -3,-3 1.34,-3 3,-3zM12,19.2c-2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22z"/>
</vector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:fontFamily="sans-serif"
android:textColor="@color/mapboxWhite" />

View File

@ -1,73 +1,187 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin">
android:background="@color/background_user_modal"
android:orientation="vertical">
<TextView android:id="@+id/userName"
android:layout_width="wrap_content"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="sans-serif">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="125dp"
android:background="@color/white_user_modal">
<ImageView
android:id="@+id/imageView2"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_marginTop="15dp"
android:src="@drawable/ic_user_account_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/userName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen_10"
android:layout_marginBottom="10dp"
android:fontFamily="sans-serif-medium"
android:lineSpacingExtra="8sp"
android:textColor="@color/colorAccent"
android:gravity="center_horizontal"
android:text="asdsd"
android:textColor="@color/white_user_modal"
android:textSize="@dimen/lbl_new_note_title"
android:textStyle="normal" />
android:textStyle="normal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</android.support.constraint.ConstraintLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="300dp"
android:layout_height="350dp"
android:layout_marginTop="25dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="10dp">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp" />
<!--android:src="@drawable/ic_email_black_24dp"/-->
<TextView
android:id="@+id/userDepartment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="10dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text"
/>
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:paddingLeft="10dp">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp" />
<!--android:src="@drawable/ic_phone_android_black_24dp"/-->
<TextView
android:id="@+id/userRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="10dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text"
/>
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:paddingLeft="10dp">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp" />
<!--android:src="@drawable/ic_phone_android_black_24dp"/-->
<TextView
android:id="@+id/userEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="10dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text" />
android:layout_marginTop="15dp"
android:orientation="horizontal"
android:paddingLeft="10dp">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp" />
<!--android:src="@drawable/ic_forum_black_24dp"/-->>\
<TextView
android:id="@+id/userDutyHoursTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text"
tools:text="@string/dutyHours" />
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:textColor="@color/mapboxWhite">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp" />
<!-- android:src="@drawable/ic_group_add_black_24dp"-->/
<ListView
android:id="@+id/userDutyHours"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="@dimen/activity_margin"
android:textColor="@color/colorAccent" />
android:paddingLeft="25dp"
android:paddingTop="-10dp"
android:textColor="@color/mapboxWhite"
/>
</LinearLayout>
<TextView
android:id="@+id/userNote"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="8sp"
android:paddingTop="5dp"
android:textColor="@color/note_list_text" />
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:paddingLeft="10dp">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp" />
<!--android:src="@drawable/ic_phone_android_black_24dp"/-->
<TextView
android:id="@+id/userNote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="10dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<!--<Button
android:textColor="#fff"
android:background="@drawable/buttonstyleithgradient"
android:layout_marginTop="35dp"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Follow Me"/>-->
</LinearLayout>

View File

@ -159,6 +159,8 @@
<string name="network_error">Błąd sieci!</string>
<string name="manual_status_error">Błąd podczas pobierania danych.</string>
<string name="error_status_fetch">Błąd podczas pobierania statusów.</string>
<string name="lack_duty_hours">Brak informacji o dyzurze.</string>
<string name="lack_note">Brak notatki.</string>
</resources>

View File

@ -70,5 +70,7 @@
<color name="black_semi_transparent">#B2000000</color>
<color name="half_black">#808080</color>
<color name="white_pressed">#f1f1f1</color>
<color name="white_user_modal">#EEF4F2</color>
<color name="background_user_modal">#415B76</color>
</resources>

View File

@ -228,4 +228,6 @@
<string name="network_error">Network Error!</string>
<string name="manual_status_error">Error handling status fetch</string>
<string name="error_status_fetch">Error handling status fetch</string>
<string name="lack_duty_hours">Lack information about duty hours</string>
<string name="lack_note">Lack of note.</string>
</resources>