Changing fragments via bottom navigation view works well now! Also started work on SettingsFragment.kt

This commit is contained in:
denizk0461
2023-04-13 12:25:43 +02:00
parent 53c2a2a9c4
commit fb50711d36
12 changed files with 338 additions and 11 deletions
+2 -1
View File
@@ -7,6 +7,7 @@
android:fitsSystemWindows="true"
tools:context=".activity.MainActivity">
<include layout="@layout/content_main"/>
<include layout="@layout/content_main"
android:id="@+id/content_main"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
+4 -2
View File
@@ -15,9 +15,10 @@
app:layout_constraintEnd_toEndOf="parent">
<TextView
android:id="@+id/app_title_bar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/your_schedule"
android:text="@string/title_schedule"
android:textSize="32sp"
android:fontFamily="@font/lato_bolditalic"
android:layout_marginHorizontal="16dp"
@@ -25,7 +26,7 @@
</com.google.android.material.appbar.AppBarLayout>
<fragment
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment_content_main"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
@@ -42,6 +43,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
app:menu="@menu/nav_view_items"
app:labelVisibilityMode="selected"
app:itemActiveIndicatorStyle="@style/NavigationViewItemIndicator"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
+2 -1
View File
@@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.EventFragment">
tools:context=".fragment.EventFragment"
android:background="?android:colorBackground">
<com.google.android.material.tabs.TabLayout
android:id="@+id/day_tab_layout"
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:colorBackground">
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.SettingsFragment"
android:background="?android:colorBackground">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginVertical="4dp"
style="@style/Widget.Material3.CardView.Outlined">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:textSize="22sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_misc"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="16dp"/>
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"/>
<!-- Academic quarter -->
<androidx.appcompat.widget.LinearLayoutCompat
android:background="@drawable/layout_ripple"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_quarter_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_quarter_subtitle"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- App version -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_app_version"
android:background="@drawable/layout_ripple"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_app_version"/>
<TextView
android:id="@+id/app_version_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/with_love"
android:textSize="10sp"
android:layout_marginTop="4dp"
android:textAlignment="center"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>