[UI] Refactor homework fragment and fix typos

This commit is contained in:
Kacper Ziubryniewicz
2019-09-27 23:27:15 +02:00
parent 6b93ea25c6
commit b844914654
31 changed files with 402 additions and 522 deletions

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoIndicator
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorSurface_6dp"
app:tabIndicatorColor="?colorPrimary"
app:tabMode="auto"
app:tabSelectedTextColor="?colorPrimary"
app:tabTextColor="?android:textColorPrimary" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</LinearLayout>
</pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoIndicator>
</layout>

View File

@ -1,121 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoIndicator
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:fontFamily="sans-serif-medium"
android:text="@string/homework_current_title"
android:textSize="20sp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_weight="2">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/homeworksCurrentView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:id="@+id/homeworksCurrentNoData"
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible">
<com.mikepenz.iconics.view.IconicsImageView
android:layout_width="match_parent"
android:layout_height="92dp"
app:iiv_color="?android:textColorPrimary"
app:iiv_icon="szf-file-document-edit"
app:iiv_size="92dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="@string/homework_current_no_data"
android:textSize="18sp"
android:textStyle="italic" />
</LinearLayout>
</FrameLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:fontFamily="sans-serif-medium"
android:text="@string/homework_past_title"
android:textSize="20sp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_weight="3">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/homeworksPastView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:id="@+id/homeworksPastNoData"
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible">
<com.mikepenz.iconics.view.IconicsImageView
android:layout_width="match_parent"
android:layout_height="92dp"
app:iiv_color="?android:textColorPrimary"
app:iiv_icon="szf-file-document-edit"
app:iiv_size="92dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="@string/homework_past_no_data"
android:textSize="18sp"
android:textStyle="italic" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
</pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoIndicator>
</layout>

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/homeworkView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:id="@+id/homeworkNoData"
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible">
<com.mikepenz.iconics.view.IconicsImageView
android:layout_width="match_parent"
android:layout_height="92dp"
app:iiv_color="?android:textColorPrimary"
app:iiv_icon="szf-file-document-edit"
app:iiv_size="92dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="@string/homework_no_data"
android:textSize="18sp"
android:textStyle="italic" />
</LinearLayout>
</LinearLayout>
</layout>

View File

@ -5,20 +5,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoIndicator
android:id="@+id/refreshLayout"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/emailList"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/emailList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:transitionGroup="false"
tools:listitem="@layout/messages_item"
tools:targetApi="lollipop" />
</pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoIndicator>
android:layout_height="match_parent"
android:clipChildren="false"
android:transitionGroup="false"
tools:listitem="@layout/messages_item"
tools:targetApi="lollipop" />
<ProgressBar
android:id="@+id/progressBar"
@ -26,4 +20,4 @@
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</FrameLayout>
</layout>
</layout>

View File

@ -7,7 +7,7 @@
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="@+id/homeworksItemCard"
android:id="@+id/homeworkItemCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
@ -31,7 +31,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/homeworksItemHomeworkDate"
android:id="@+id/homeworkItemHomeworkDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
@ -41,7 +41,7 @@
android:layout_marginEnd="16dp" />
<com.mikepenz.iconics.view.IconicsTextView
android:id="@+id/homeworksItemSharedBy"
android:id="@+id/homeworkItemSharedBy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
@ -61,7 +61,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/homeworksItemTopic"
android:id="@+id/homeworkItemTopic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -72,7 +72,7 @@
tools:text="topic???" />
<com.google.android.material.button.MaterialButton
android:id="@+id/homeworksItemEdit"
android:id="@+id/homeworkItemEdit"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -89,7 +89,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/homeworksItemSubjectTeacher"
android:id="@+id/homeworkItemSubjectTeacher"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
@ -100,7 +100,7 @@
tools:text="subjectName, teacherName" />
<TextView
android:id="@+id/homeworksItemTeamDate"
android:id="@+id/homeworkItemTeamDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
@ -110,4 +110,4 @@
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</LinearLayout>

View File

@ -1,148 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation 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/nav_main"
app:startDestination="@+id/homeFragment">
<fragment
android:id="@+id/loadingFragment"
android:name="pl.szczodrzynski.edziennik.fragments.LoadingFragment"
android:label="LoadingFragment"
tools:layout="@layout/fragment_loading">
<action
android:id="@+id/action_loadingFragment_to_homeFragment"
app:destination="@id/homeFragment" />
</fragment>
<fragment
android:id="@+id/homeFragment"
android:name="pl.szczodrzynski.edziennik.fragments.HomeFragment"
android:label="fragment_home"
tools:layout="@layout/fragment_home">
<action
android:id="@+id/action_homeFragment_to_timetableFragment"
app:destination="@id/timetableFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_gradesFragment"
app:destination="@id/gradesFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_messagesFragment"
app:destination="@id/messagesFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_agendaFragment"
app:destination="@id/agendaFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_noticesFragment"
app:destination="@id/noticesFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_announcementsFragment"
app:destination="@id/announcementsFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_attendancesFragment"
app:destination="@id/attendancesFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_homeworkFragment"
app:destination="@id/homeworkFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_notificationsFragment"
app:destination="@id/notificationsFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_settingsFragment"
app:destination="@id/settingsFragment"
app:popUpTo="@+id/homeFragment" />
<action
android:id="@+id/action_homeFragment_to_profileManagerFragment"
app:destination="@id/profileManagerFragment" />
<action
android:id="@+id/action_homeFragment_to_helpFragment"
app:destination="@id/helpFragment"
app:popUpTo="@+id/homeFragment" />
</fragment>
<fragment
android:id="@+id/gradesFragment"
android:name="pl.szczodrzynski.edziennik.fragments.RegisterGradesFragment"
android:label="fragment_register_grades"
tools:layout="@layout/fragment_register_grades">
<action
android:id="@+id/action_gradesFragment_to_gradesEditorFragment"
app:destination="@id/gradesEditorFragment" />
</fragment>
<fragment
android:id="@+id/gradesEditorFragment"
android:name="pl.szczodrzynski.edziennik.fragments.GradesEditorFragment"
android:label="fragment_grades_editor"
tools:layout="@layout/fragment_grades_editor" />
<fragment
android:id="@+id/timetableFragment"
android:name="pl.szczodrzynski.edziennik.fragments.RegisterTimetableFragment"
android:label="fragment_register_timetable"
tools:layout="@layout/fragment_register_timetable" />
<fragment
android:id="@+id/messagesFragment"
android:name="pl.szczodrzynski.edziennik.messages.MessagesListFragment"
android:label="messages_list"
tools:layout="@layout/messages_list">
<action
android:id="@+id/action_messagesFragment_to_messagesDetailsFragment"
app:destination="@id/messagesDetailsFragment" />
</fragment>
<fragment
android:id="@+id/messagesDetailsFragment"
android:name="pl.szczodrzynski.edziennik.messages.MessagesDetailsFragment"
android:label="messages_details"
tools:layout="@layout/messages_details" />
<fragment
android:id="@+id/agendaFragment"
android:name="pl.szczodrzynski.edziennik.fragments.RegisterAgendaDefaultFragment"
android:label="fragment_register_agenda_default"
tools:layout="@layout/fragment_register_agenda_default" />
<fragment
android:id="@+id/homeworkFragment"
android:name="pl.szczodrzynski.edziennik.fragments.RegisterHomeworksFragment"
android:label="fragment_register_homeworks"
tools:layout="@layout/fragment_register_homeworks" />
<fragment
android:id="@+id/noticesFragment"
android:name="pl.szczodrzynski.edziennik.fragments.RegisterNoticesFragment"
android:label="fragment_register_notices"
tools:layout="@layout/fragment_register_notices" />
<fragment
android:id="@+id/attendancesFragment"
android:name="pl.szczodrzynski.edziennik.fragments.RegisterAttendancesFragment"
android:label="fragment_register_attendances"
tools:layout="@layout/fragment_register_attendances" />
<fragment
android:id="@+id/announcementsFragment"
android:name="pl.szczodrzynski.edziennik.fragments.RegisterAnnouncementsFragment"
android:label="fragment_register_school_notices"
tools:layout="@layout/fragment_register_school_notices" />
<fragment
android:id="@+id/notificationsFragment"
android:name="pl.szczodrzynski.edziennik.fragments.RegisterNotificationsFragment"
android:label="fragment_register_notifications"
tools:layout="@layout/fragment_register_notifications" />
<fragment
android:id="@+id/settingsFragment"
android:name="pl.szczodrzynski.edziennik.fragments.SettingsNewFragment"
android:label="fragment_register_settings" />
<fragment
android:id="@+id/profileManagerFragment"
android:name="pl.szczodrzynski.edziennik.fragments.ProfileManagerFragment"
android:label="fragment_profile_manager"
tools:layout="@layout/fragment_profile_manager" />
<fragment
android:id="@+id/helpFragment"
android:name="pl.szczodrzynski.edziennik.fragments.HelpFragment"
android:label="fragment_help"
tools:layout="@layout/fragment_help" />
</navigation>

View File

@ -607,7 +607,7 @@
<string name="settings_sync_customize_endpoint_classrooms">Classrooms</string>
<string name="settings_sync_customize_endpoint_events">Events/agenda</string>
<string name="settings_sync_customize_endpoint_grades">Grades</string>
<string name="settings_sync_customize_endpoint_homeworks">Homework</string>
<string name="settings_sync_customize_endpoint_homework">Homework</string>
<string name="settings_sync_customize_endpoint_lucky_numbers">Lucky number</string>
<string name="settings_sync_customize_endpoint_messages_inbox">Messages - received</string>
<string name="settings_sync_customize_endpoint_messages_outbox">Messages - sent</string>
@ -753,7 +753,7 @@
<string name="sync_feature_announcements">Syncing announcements…</string>
<string name="sync_feature_attendances">Syncing attendances…</string>
<string name="sync_feature_grades">Syncing grades…</string>
<string name="sync_feature_homeworks">Syncing homeworks</string>
<string name="sync_feature_homework">Syncing homework…</string>
<string name="sync_feature_messages_inbox">Syncing received messages…</string>
<string name="sync_feature_messages_outbox">Syncing sent messages…</string>
<string name="sync_feature_notices">Syncing notices…</string>
@ -827,4 +827,4 @@
<string name="yesterday">yesterday</string>
<string name="you_are_offline_text">You\'re offline. Try enabling Wi-Fi or mobile data.</string>
<string name="you_are_offline_title">Internet connection</string>
</resources>
</resources>

View File

@ -313,8 +313,8 @@
<string name="homework_edit">Edytuj</string>
<string name="homework_past_no_data">Brak poprzednich zadań domowych.</string>
<string name="homework_past_title">Poprzednie zadania</string>
<string name="homeworks_subject_teacher_format" translatable="false">%s, %s</string>
<string name="homeworks_team_date_format" translatable="false">%s %s</string>
<string name="homework_subject_teacher_format" translatable="false">%s, %s</string>
<string name="homework_team_date_format" translatable="false">%s %s</string>
<string name="i_agree">Zgadzam się</string>
<string name="i_disagree">Nie zgadzam się</string>
<string name="incorrect_format">Nieprawidłowy format</string>
@ -652,7 +652,7 @@
<string name="settings_sync_customize_endpoint_classrooms">Sale lekcyjne</string>
<string name="settings_sync_customize_endpoint_events">Wydarzenia/terminarz</string>
<string name="settings_sync_customize_endpoint_grades">Oceny</string>
<string name="settings_sync_customize_endpoint_homeworks">Zadania domowe</string>
<string name="settings_sync_customize_endpoint_homework">Zadania domowe</string>
<string name="settings_sync_customize_endpoint_lucky_numbers">Szczęśliwy numerek</string>
<string name="settings_sync_customize_endpoint_messages_inbox">Wiadomości odebrane</string>
<string name="settings_sync_customize_endpoint_messages_outbox">Wiadomości wysłane</string>
@ -800,7 +800,7 @@
<string name="sync_feature_announcements">Pobieram tablicę ogłoszeń…</string>
<string name="sync_feature_attendances">Pobieram obecności…</string>
<string name="sync_feature_grades">Pobieram oceny…</string>
<string name="sync_feature_homeworks">Pobieram zadania domowe…</string>
<string name="sync_feature_homework">Pobieram zadania domowe…</string>
<string name="sync_feature_messages_inbox">Pobieram wiadomości odebrane…</string>
<string name="sync_feature_messages_outbox">Pobieram wiadomości wysłane…</string>
<string name="sync_feature_notices">Pobieram uwagi…</string>
@ -909,4 +909,7 @@
<string name="settings_about_discord_subtext">Dołącz do naszego serwera Discord!</string>
<string name="menu_debug">Debugowanie</string>
<string name="sync_action_syncing_school_free_days">Pobieranie dni wolnych szkoły</string>
<string name="homework_tab_current">Aktualne</string>
<string name="homework_tab_past">Minione</string>
<string name="homework_no_data">Brak zadań domowych.</string>
</resources>