Archived
Scrolling ability has been added to the toolbars of the fragments, but in the process, I ducked up the canteen fragment. TODO: figure out a solution for where to put the chip group
This commit is contained in:
@@ -9,6 +9,7 @@ import android.util.TypedValue
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.AttrRes
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
import com.denizk0461.studip.R
|
||||
import com.denizk0461.studip.exception.AcademicQuarterNotApplicableException
|
||||
import com.denizk0461.studip.exception.ParcelNotFoundException
|
||||
@@ -94,6 +95,19 @@ inline fun <reified T : Parcelable> Bundle?.getParcelableCompat(key: String): T
|
||||
this?.getParcelable(key) as? T
|
||||
} ?: throw ParcelNotFoundException()
|
||||
|
||||
/**
|
||||
* Applies a rainbow colour effect to a progress circle of a given [SwipeRefreshLayout]. The circle
|
||||
* will rotate through 4 different colours during the refresh process.
|
||||
*/
|
||||
fun SwipeRefreshLayout.setRainbowProgressCircle() {
|
||||
setColorSchemeColors(
|
||||
context.getColor(R.color.beef_light_primary),
|
||||
context.getColor(R.color.fair_light_primary),
|
||||
context.getColor(R.color.vital_light_primary),
|
||||
context.getColor(R.color.poultry_dark_primary),
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a conversion method between a timestamp ending in a full hour, and one with an academic
|
||||
* quarter applied.
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.fragment.app.viewModels
|
||||
import com.denizk0461.studip.R
|
||||
import com.denizk0461.studip.adapter.CanteenOfferPageAdapter
|
||||
import com.denizk0461.studip.data.getTextSheet
|
||||
import com.denizk0461.studip.data.setRainbowProgressCircle
|
||||
import com.denizk0461.studip.data.showErrorSnackBar
|
||||
import com.denizk0461.studip.databinding.FragmentCanteenBinding
|
||||
import com.denizk0461.studip.model.*
|
||||
@@ -49,6 +50,9 @@ class CanteenFragment : AppFragment() {
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// Set progress circle colours
|
||||
binding.swipeRefreshLayout.setRainbowProgressCircle()
|
||||
|
||||
// Open the menu for the canteen picker button
|
||||
binding.buttonCanteenPicker.setOnClickListener {
|
||||
PopupMenu(binding.root.context, binding.buttonCanteenPicker).apply {
|
||||
@@ -128,9 +132,9 @@ class CanteenFragment : AppFragment() {
|
||||
* TODO implement a more efficient / better-looking method
|
||||
* TODO order the chips alphabetically?
|
||||
*/
|
||||
val index = binding.chipsPreference.indexOfChild(buttonView)
|
||||
binding.chipsPreference.removeView(buttonView)
|
||||
binding.chipsPreference.addView(buttonView, index)
|
||||
// val index = binding.chipsPreference.indexOfChild(buttonView)
|
||||
// binding.chipsPreference.removeView(buttonView)
|
||||
// binding.chipsPreference.addView(buttonView, index)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,10 +230,14 @@ class CanteenFragment : AppFragment() {
|
||||
binding.swipeRefreshLayout.isRefreshing = false
|
||||
|
||||
}, onError = {
|
||||
// Tell the user that an error occurred
|
||||
context.theme?.showErrorSnackBar(
|
||||
binding.snackbarContainer,
|
||||
getString(R.string.canteen_fetch_error)
|
||||
)
|
||||
/*
|
||||
* Tell the swipe refresh layout to stop refreshing.
|
||||
*/
|
||||
binding.swipeRefreshLayout.isRefreshing = false
|
||||
})
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="@dimen/fab_margin"
|
||||
android:layout_marginBottom="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/check" />
|
||||
app:srcCompat="@drawable/save"/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -1,224 +1,224 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/snackbar_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_canteen_picker"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:fontFamily="@font/lato_bolditalic"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_title_bar"
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:text="@string/title_food"
|
||||
android:textSize="32sp"
|
||||
android:fontFamily="@font/lato_bolditalic"
|
||||
android:layout_marginHorizontal="16dp"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_canteen_picker"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:layout_gravity="start"
|
||||
android:fontFamily="@font/lato_bolditalic"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:id="@+id/button_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
app:icon="@drawable/info"
|
||||
app:iconPadding="0dp"
|
||||
android:layout_gravity="end"
|
||||
app:iconTint="?attr/colorOnSurfaceVariant"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/scroll_view_chip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/chips_preference"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="8dp">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_fair"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/handshake"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_fair_text"
|
||||
app:chipIconTint="@color/list_chip_fair_text"
|
||||
app:chipBackgroundColor="@color/list_chip_fair_bg"
|
||||
android:text="@string/pref_fair"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_fish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/fish"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_fish_text"
|
||||
app:chipIconTint="@color/list_chip_fish_text"
|
||||
app:chipBackgroundColor="@color/list_chip_fish_bg"
|
||||
android:text="@string/pref_fish"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_poultry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/chicken"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_poultry_text"
|
||||
app:chipIconTint="@color/list_chip_poultry_text"
|
||||
app:chipBackgroundColor="@color/list_chip_poultry_bg"
|
||||
android:text="@string/pref_poultry"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_lamb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/sheep"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_lamb_text"
|
||||
app:chipIconTint="@color/list_chip_lamb_text"
|
||||
app:chipBackgroundColor="@color/list_chip_lamb_bg"
|
||||
android:text="@string/pref_lamb"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vital"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/yoga"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_vital_text"
|
||||
app:chipIconTint="@color/list_chip_vital_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vital_bg"
|
||||
android:text="@string/pref_vital"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_beef"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/cow"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_beef_text"
|
||||
app:chipIconTint="@color/list_chip_beef_text"
|
||||
app:chipBackgroundColor="@color/list_chip_beef_bg"
|
||||
android:text="@string/pref_beef"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_pork"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/pig"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_pork_text"
|
||||
app:chipIconTint="@color/list_chip_pork_text"
|
||||
app:chipBackgroundColor="@color/list_chip_pork_bg"
|
||||
android:text="@string/pref_pork"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vegetarian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/carrot"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_vegetarian_text"
|
||||
app:chipIconTint="@color/list_chip_vegetarian_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vegetarian_bg"
|
||||
android:text="@string/pref_vegetarian"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vegan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/leaf"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_vegan_text"
|
||||
app:chipIconTint="@color/list_chip_vegan_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vegan_bg"
|
||||
android:text="@string/pref_vegan"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_game"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/deer"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_game_text"
|
||||
app:chipIconTint="@color/list_chip_game_text"
|
||||
app:chipBackgroundColor="@color/list_chip_game_bg"
|
||||
android:text="@string/pref_game"/>
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:text="@string/title_food"
|
||||
android:textSize="32sp"
|
||||
android:fontFamily="@font/lato_bolditalic"
|
||||
android:layout_marginHorizontal="16dp"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/day_tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll|snap"
|
||||
app:tabMode="scrollable"/>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:id="@+id/button_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
app:icon="@drawable/info"
|
||||
app:iconPadding="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:iconTint="?attr/colorOnSurfaceVariant"/>
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scroll_view_chip">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="fill_vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/snackbar_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scroll_view_chip"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
<!-- <androidx.coordinatorlayout.widget.CoordinatorLayout-->
|
||||
<!-- android:id="@+id/snackbar_container"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="bottom"/>-->
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/scroll_view_chip"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/chips_preference"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true"
|
||||
android:paddingHorizontal="8dp">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_fair"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/handshake"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_fair_text"
|
||||
app:chipIconTint="@color/list_chip_fair_text"
|
||||
app:chipBackgroundColor="@color/list_chip_fair_bg"
|
||||
android:text="@string/pref_fair"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_fish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/fish"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_fish_text"
|
||||
app:chipIconTint="@color/list_chip_fish_text"
|
||||
app:chipBackgroundColor="@color/list_chip_fish_bg"
|
||||
android:text="@string/pref_fish"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_poultry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/chicken"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_poultry_text"
|
||||
app:chipIconTint="@color/list_chip_poultry_text"
|
||||
app:chipBackgroundColor="@color/list_chip_poultry_bg"
|
||||
android:text="@string/pref_poultry"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_lamb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/sheep"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_lamb_text"
|
||||
app:chipIconTint="@color/list_chip_lamb_text"
|
||||
app:chipBackgroundColor="@color/list_chip_lamb_bg"
|
||||
android:text="@string/pref_lamb"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vital"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/yoga"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_vital_text"
|
||||
app:chipIconTint="@color/list_chip_vital_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vital_bg"
|
||||
android:text="@string/pref_vital"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_beef"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/cow"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_beef_text"
|
||||
app:chipIconTint="@color/list_chip_beef_text"
|
||||
app:chipBackgroundColor="@color/list_chip_beef_bg"
|
||||
android:text="@string/pref_beef"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_pork"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/pig"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_pork_text"
|
||||
app:chipIconTint="@color/list_chip_pork_text"
|
||||
app:chipBackgroundColor="@color/list_chip_pork_bg"
|
||||
android:text="@string/pref_pork"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vegetarian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/carrot"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_vegetarian_text"
|
||||
app:chipIconTint="@color/list_chip_vegetarian_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vegetarian_bg"
|
||||
android:text="@string/pref_vegetarian"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vegan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/leaf"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_vegan_text"
|
||||
app:chipIconTint="@color/list_chip_vegan_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vegan_bg"
|
||||
android:text="@string/pref_vegan"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_game"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/deer"
|
||||
app:chipIconEnabled="true"
|
||||
android:textColor="@color/list_chip_game_text"
|
||||
app:chipIconTint="@color/list_chip_game_text"
|
||||
app:chipBackgroundColor="@color/list_chip_game_bg"
|
||||
android:text="@string/pref_game"/>
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
|
||||
@@ -8,12 +8,9 @@
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_title_bar"
|
||||
@@ -21,6 +18,7 @@
|
||||
android:layout_height="48dp"
|
||||
android:text="@string/title_schedule"
|
||||
android:textSize="32sp"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
||||
android:fontFamily="@font/lato_bolditalic"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"/>
|
||||
@@ -30,20 +28,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabMode="scrollable"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
app:layout_scrollFlags="scroll|snap"/>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
<!-- app:layout_behavior="@string/appbar_scrolling_view_behavior"-->
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
|
||||
tools:context=".fragment.SettingsFragment"
|
||||
@@ -21,14 +21,16 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/lato_bolditalic"
|
||||
android:text="@string/title_settings"
|
||||
android:textSize="32sp" />
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
||||
android:textSize="32sp"/>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical">
|
||||
android:scrollbars="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
@@ -503,5 +505,5 @@
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- I am unsure whether these attrs are necessary to define -->
|
||||
<!-- <attr name="colorPrimary" type="color" />-->
|
||||
<attr name="scheduleColorDefault" type="color" />
|
||||
<attr name="colorOutlineVariant" type="color" />
|
||||
<attr name="colorOnSurfaceVariant" type="color" />
|
||||
|
||||
Reference in New Issue
Block a user