mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 13:48:20 +01:00
[UI/Lists] Add missing item dividers. Try to improve attendance & grades design.
This commit is contained in:
parent
d7d0c6f822
commit
1bfb3781ab
@ -105,7 +105,7 @@ public class GradeDetailsDialog {
|
|||||||
|
|
||||||
b.setDevMode(App.Companion.getDevMode());
|
b.setDevMode(App.Companion.getDevMode());
|
||||||
|
|
||||||
b.gradeName.setTextColor(ColorUtils.calculateLuminance(gradeColor) > 0.25 ? 0xff000000 : 0xffffffff);
|
b.gradeName.setTextColor(ColorUtils.calculateLuminance(gradeColor) > 0.3 ? 0xff000000 : 0xffffffff);
|
||||||
b.gradeName.getBackground().setColorFilter(new PorterDuffColorFilter(gradeColor, PorterDuff.Mode.MULTIPLY));
|
b.gradeName.getBackground().setColorFilter(new PorterDuffColorFilter(gradeColor, PorterDuff.Mode.MULTIPLY));
|
||||||
|
|
||||||
AsyncTask.execute(() -> {
|
AsyncTask.execute(() -> {
|
||||||
|
@ -36,6 +36,7 @@ import pl.szczodrzynski.edziennik.R;
|
|||||||
import pl.szczodrzynski.edziennik.data.db.entity.Subject;
|
import pl.szczodrzynski.edziennik.data.db.entity.Subject;
|
||||||
import pl.szczodrzynski.edziennik.data.db.full.AttendanceFull;
|
import pl.szczodrzynski.edziennik.data.db.full.AttendanceFull;
|
||||||
import pl.szczodrzynski.edziennik.databinding.FragmentAttendanceBinding;
|
import pl.szczodrzynski.edziennik.databinding.FragmentAttendanceBinding;
|
||||||
|
import pl.szczodrzynski.edziennik.utils.SimpleDividerItemDecoration;
|
||||||
import pl.szczodrzynski.edziennik.utils.Themes;
|
import pl.szczodrzynski.edziennik.utils.Themes;
|
||||||
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem;
|
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem;
|
||||||
|
|
||||||
@ -178,6 +179,7 @@ public class AttendanceFragment extends Fragment {
|
|||||||
|
|
||||||
b.attendanceView.setHasFixedSize(true);
|
b.attendanceView.setHasFixedSize(true);
|
||||||
b.attendanceView.setLayoutManager(linearLayoutManager);
|
b.attendanceView.setLayoutManager(linearLayoutManager);
|
||||||
|
b.attendanceView.addItemDecoration(new SimpleDividerItemDecoration(getContext()));
|
||||||
|
|
||||||
App.db.attendanceDao().getAll(App.Companion.getProfileId()).observe(this, attendance -> {
|
App.db.attendanceDao().getAll(App.Companion.getProfileId()).observe(this, attendance -> {
|
||||||
if (app == null || activity == null || b == null || !isAdded())
|
if (app == null || activity == null || b == null || !isAdded())
|
||||||
|
@ -3,7 +3,6 @@ package pl.szczodrzynski.edziennik.ui.modules.grades;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.PorterDuffColorFilter;
|
import android.graphics.PorterDuffColorFilter;
|
||||||
import android.graphics.Typeface;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -65,8 +64,8 @@ public class GradesListAdapter extends RecyclerView.Adapter<GradesListAdapter.Vi
|
|||||||
|
|
||||||
holder.gradesListName.setText(grade.name);
|
holder.gradesListName.setText(grade.name);
|
||||||
holder.gradesListName.setSelected(true);
|
holder.gradesListName.setSelected(true);
|
||||||
holder.gradesListName.setTypeface(null, Typeface.BOLD);
|
//holder.gradesListName.setTypeface(null, Typeface.BOLD);
|
||||||
holder.gradesListName.setTextColor(ColorUtils.calculateLuminance(gradeColor) > 0.25 ? 0xff000000 : 0xffffffff);
|
holder.gradesListName.setTextColor(ColorUtils.calculateLuminance(gradeColor) > 0.3 ? 0xff000000 : 0xffffffff);
|
||||||
holder.gradesListName.getBackground().setColorFilter(new PorterDuffColorFilter(gradeColor, PorterDuff.Mode.MULTIPLY));
|
holder.gradesListName.getBackground().setColorFilter(new PorterDuffColorFilter(gradeColor, PorterDuff.Mode.MULTIPLY));
|
||||||
|
|
||||||
if (grade.description.trim().isEmpty()) {
|
if (grade.description.trim().isEmpty()) {
|
||||||
|
@ -14,7 +14,6 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
|
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -27,6 +26,7 @@ import pl.szczodrzynski.edziennik.data.db.entity.Message;
|
|||||||
import pl.szczodrzynski.edziennik.data.db.full.MessageFull;
|
import pl.szczodrzynski.edziennik.data.db.full.MessageFull;
|
||||||
import pl.szczodrzynski.edziennik.data.db.full.MessageRecipientFull;
|
import pl.szczodrzynski.edziennik.data.db.full.MessageRecipientFull;
|
||||||
import pl.szczodrzynski.edziennik.databinding.MessagesListBinding;
|
import pl.szczodrzynski.edziennik.databinding.MessagesListBinding;
|
||||||
|
import pl.szczodrzynski.edziennik.utils.SimpleDividerItemDecoration;
|
||||||
import pl.szczodrzynski.edziennik.utils.Themes;
|
import pl.szczodrzynski.edziennik.utils.Themes;
|
||||||
|
|
||||||
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
|
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
|
||||||
@ -164,7 +164,7 @@ public class MessagesListFragment extends Fragment {
|
|||||||
viewParent = (ViewGroup) view.getParent();
|
viewParent = (ViewGroup) view.getParent();
|
||||||
|
|
||||||
b.emailList.setLayoutManager(new LinearLayoutManager(view.getContext()));
|
b.emailList.setLayoutManager(new LinearLayoutManager(view.getContext()));
|
||||||
b.emailList.addItemDecoration(new DividerItemDecoration(view.getContext(), LinearLayoutManager.VERTICAL));
|
b.emailList.addItemDecoration(new SimpleDividerItemDecoration(view.getContext()));
|
||||||
b.emailList.setAdapter(messagesAdapter);
|
b.emailList.setAdapter(messagesAdapter);
|
||||||
|
|
||||||
if (messageType == Message.TYPE_RECEIVED) {
|
if (messageType == Message.TYPE_RECEIVED) {
|
||||||
|
@ -45,14 +45,16 @@
|
|||||||
android:layout_width="72dp"
|
android:layout_width="72dp"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
android:background="@drawable/bg_rounded_16dp"
|
android:background="@drawable/bg_rounded_16dp"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="serif-monospace"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:padding="8dp"
|
||||||
android:text="@{grade.name}"
|
android:text="@{grade.name}"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:textSize="36sp"
|
android:textSize="36sp"
|
||||||
app:autoSizeMaxTextSize="36sp"
|
android:textStyle="bold"
|
||||||
|
app:autoSizeMaxTextSize="56sp"
|
||||||
app:autoSizeTextType="uniform"
|
app:autoSizeTextType="uniform"
|
||||||
tools:background="#ff0000"
|
tools:background="#ff4caf50"
|
||||||
tools:text="1-" />
|
tools:text="1-" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_marginBottom="0dp"
|
|
||||||
android:background="@drawable/bg_rounded_8dp"
|
android:background="@drawable/bg_rounded_8dp"
|
||||||
|
android:fontFamily="serif-monospace"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
@ -51,8 +51,8 @@
|
|||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/attendanceDate"
|
app:layout_constraintEnd_toStartOf="@+id/attendanceDate"
|
||||||
app:layout_constraintStart_toEndOf="@+id/attendanceType"
|
app:layout_constraintStart_toEndOf="@+id/attendanceType"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/attendanceLessonTopic"
|
app:layout_constraintTop_toBottomOf="@+id/attendanceLessonTopic"
|
||||||
@ -68,6 +68,7 @@
|
|||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/attendanceDate"
|
app:layout_constraintEnd_toStartOf="@+id/attendanceDate"
|
||||||
app:layout_constraintStart_toEndOf="@+id/attendanceType"
|
app:layout_constraintStart_toEndOf="@+id/attendanceType"
|
||||||
@ -82,7 +83,7 @@
|
|||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:layout_marginBottom="0dp"
|
android:layout_marginBottom="0dp"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/attendanceLessonTopic"
|
app:layout_constraintTop_toBottomOf="@+id/attendanceLessonTopic"
|
||||||
@ -95,7 +96,7 @@
|
|||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
tools:text="19.11.2018"
|
tools:text="19.11.2018"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/attendanceLessonTopic"
|
app:layout_constraintBottom_toBottomOf="@+id/attendanceLessonTopic"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/attendanceLessonTopic" />
|
app:layout_constraintTop_toTopOf="@+id/attendanceLessonTopic" />
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?selectableItemBackground"
|
android:background="?selectableItemBackground"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
@ -15,15 +16,25 @@
|
|||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:background="@drawable/bg_rounded_8dp"
|
android:background="@drawable/bg_rounded_8dp"
|
||||||
android:fontFamily="sans-serif-light"
|
android:fontFamily="serif-monospace"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:padding="2dp"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
app:autoSizeMaxTextSize="24sp"
|
android:textStyle="bold"
|
||||||
|
app:autoSizeMaxTextSize="32sp"
|
||||||
app:autoSizeTextType="uniform"
|
app:autoSizeTextType="uniform"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:background="#4caf50"
|
tools:background="#4caf50"
|
||||||
tools:text="5+" />
|
tools:text="NB" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/gradesListCategoryColumn"
|
android:id="@+id/gradesListCategoryColumn"
|
||||||
@ -33,32 +44,25 @@
|
|||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:ellipsize="marquee"
|
android:layout_weight="1"
|
||||||
android:focusableInTouchMode="false"
|
android:ellipsize="end"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
|
||||||
android:scrollHorizontally="true"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
tools:text="kraje hehe no jak zwykle jedynka z geografii. to jest baaardzo długi tekst ale szkoda że się nie scrolluje."
|
tools:text="kraje hehe no jak zwykle jedynka z geografii. to jest baaardzo długi tekst ale szkoda że się nie scrolluje." />
|
||||||
app:layout_constraintBottom_toTopOf="@+id/gradesListCategoryDescription"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/gradesListAddedDate"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/gradesListName"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/gradesListName"
|
|
||||||
app:layout_constraintVertical_bias="1.0" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/gradesListCategoryDescription"
|
android:id="@+id/gradesListAddedDate"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:ellipsize="end"
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
android:maxLines="1"
|
tools:text="14.10.2015" />
|
||||||
tools:text="Kartkówki - K1"
|
</LinearLayout>
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/gradesListName"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/gradesListTeacher"
|
<LinearLayout
|
||||||
app:layout_constraintStart_toEndOf="@+id/gradesListWeight" />
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/gradesListWeight"
|
android:id="@+id/gradesListWeight"
|
||||||
@ -67,34 +71,34 @@
|
|||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/gradesListCategoryDescription"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/gradesListName"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/gradesListCategoryDescription"
|
|
||||||
app:layout_constraintVertical_bias="1.0"
|
|
||||||
tools:text="waga 30"
|
tools:text="waga 30"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/gradesListTeacher"
|
android:id="@+id/gradesListCategoryDescription"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:textAppearance="@style/NavView.TextView.Small"
|
android:ellipsize="end"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/gradesListCategoryDescription"
|
android:maxWidth="200dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:maxLines="1"
|
||||||
app:layout_constraintTop_toTopOf="@+id/gradesListCategoryDescription"
|
tools:text="Kartkówki - K1 123456789 12345678" />
|
||||||
tools:text="Anna Jakaśtam-Cośtam" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/gradesListAddedDate"
|
android:id="@+id/gradesListTeacher"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
tools:text="14.10.2015"
|
android:layout_weight="1"
|
||||||
android:textAppearance="@style/NavView.TextView.Small"
|
android:ellipsize="end"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/gradesListCategoryColumn"
|
android:gravity="end"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:maxLines="1"
|
||||||
app:layout_constraintTop_toTopOf="@+id/gradesListCategoryColumn" />
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
tools:text="Anna Jakaśtam-Cośtam" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user