Changed FABs into Extended FABs that collapse on scroll; updated FABs and scrolling behaviour of app bars; removed dimens.xml files for landscape and larger widths that had been generated by Android Studio

This commit is contained in:
denizk0461
2023-05-13 10:00:40 +02:00
parent 92f7361488
commit 7ed230b4b9
14 changed files with 280 additions and 192 deletions
+9 -2
View File
@@ -18,8 +18,15 @@ Currently, nothing is outright broken, but a few things may be bodged together.
## Why Android-only?
Because:
a) I know Android development and it's a lot easier for me to work on an app using a framework I already know than to learn a new one while still trying to keep up with my responsibilities at university, and
b) because Apple is a greedy company that charges thousands for laptops, phones, as well as $99 a year for a developer account, which are all requirements (sans the phone, if I was to use their simulator, which isn't ideal) and I, as a student, simply do not have the money for that.
- I know Android development and it's a lot easier for me to work on an app using a framework I already know than to learn a new one while still trying to keep up with my responsibilities at university, and
- because Apple is a greedy company that charges thousands for laptops, phones, as well as $99 a year for a developer account, which are all requirements (sans the phone, if I was to use their simulator, which isn't ideal) and I, as a student, simply do not have the money for that.
I may reconsider once Apple finally opens up iOS for third-party apps.
## Why this logo? Why this evil red colour scheme?
The colour scheme is inspired by the University of Bremen's colour scheme, as well as the city of Bremen's colour scheme. The logo represents both the University of Bremen as well as (kind of) the Weserstadion, our local sports stadium.
I admit the Weserstadion idea came to me after I had created the logo.
![WeserPlaner app icon](https://denizk0461.github.io/weserplaner_app_icon.png)
@@ -8,6 +8,7 @@ import android.view.ViewGroup
import androidx.appcompat.content.res.AppCompatResources
import androidx.appcompat.widget.PopupMenu
import androidx.fragment.app.viewModels
import androidx.viewpager2.widget.ViewPager2
import com.denizk0461.weserplaner.R
import com.denizk0461.weserplaner.adapter.CanteenOfferPageAdapter
import com.denizk0461.weserplaner.data.getTextSheet
@@ -86,7 +87,6 @@ class CanteenFragment : AppFragment() {
// Set up click listener to tell the user that no news are available
binding.buttonNotifications.setOnClickListener {
// showToast(context, getString(R.string.text_sheet_news_empty))
context.theme.showSnackBar(binding.snackbarContainer, getString(R.string.text_sheet_news_empty))
}
@@ -171,7 +171,6 @@ class CanteenFragment : AppFragment() {
else -> 0
}
// Set newly selected canteen to the button
// binding.buttonCanteenPicker.text = getCurrentlySelectedCanteenName()
binding.appTitleBar.text = getString(
R.string.title_canteen_template,
getCurrentlySelectedCanteenName(),
@@ -212,12 +211,6 @@ class CanteenFragment : AppFragment() {
// Let the adapter know of the new amount of dates (pages) to display
viewPagerAdapter.itemCount = dates.size
// Retrieve further information about this canteen from the database
// viewModel.getCanteen().also { canteen ->
// Set visibility of the notifications icon depending on whether news are available
// badge.isVisible = info.news.isNotBlank()
// }
}
// Assign the adapter to the view pager
@@ -228,6 +221,18 @@ class CanteenFragment : AppFragment() {
tab.text = dates[position]
}.attach()
// Set extended FAB to extend when the page is changed
binding.viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageScrolled(
position: Int,
positionOffset: Float,
positionOffsetPixels: Int
) {
super.onPageScrolled(position, positionOffset, positionOffsetPixels)
binding.fabRefreshOffers.extend()
}
})
// Set up functions for when the user swipes to refresh the view
binding.swipeRefreshLayout.setOnRefreshListener {
refresh()
@@ -252,6 +257,20 @@ class CanteenFragment : AppFragment() {
_binding = null
}
/**
* Shrinks the FAB.
*/
fun shrinkFab() {
binding.fabRefreshOffers.shrink()
}
/**
* Extends the FAB.
*/
fun extendFab() {
binding.fabRefreshOffers.extend()
}
/**
* Updates a given preference and refreshes the view.
*
@@ -5,6 +5,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.NavHostFragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.denizk0461.weserplaner.adapter.CanteenOfferItemAdapter
import com.denizk0461.weserplaner.adapter.StudIPEventPageAdapter
@@ -89,6 +90,23 @@ class CanteenPageFragment : AppFragment(), CanteenOfferItemAdapter.OnClickListen
}
}
// Retrieve parent fragment to access its functions
val navHostFragment = activity?.supportFragmentManager?.fragments?.get(0) as? NavHostFragment
val parent = navHostFragment?.childFragmentManager?.primaryNavigationFragment as? CanteenFragment
// Set up scroll change listener to shrink and extend FAB accordingly
binding.recyclerView.setOnScrollChangeListener { _, _, scrollY, _, oldScrollY ->
// Calculate the vertical scroll difference
val dy = scrollY - oldScrollY
if (dy > 0) {
// If scrolling down, shrink the FAB
parent?.shrinkFab()
} else if (dy < 0) {
// If scrolling up, extend the FAB
parent?.extendFab()
}
}
// Observe dietary preference updates and re-set the items if a change is detected
viewModel.dietaryPreferencesUpdate.observe(viewLifecycleOwner) {
// Re-set the list of items to the recycler view, forcing an update
@@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.viewModels
import androidx.viewpager2.widget.ViewPager2
import com.denizk0461.weserplaner.R
import com.denizk0461.weserplaner.activity.FetcherActivity
import com.denizk0461.weserplaner.adapter.StudIPEventPageAdapter
@@ -64,6 +65,18 @@ class EventFragment : AppFragment() {
tab.text = weekdays[position]
}.attach()
// Set extended FAB to extend when the page is changed
binding.viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageScrolled(
position: Int,
positionOffset: Float,
positionOffsetPixels: Int
) {
super.onPageScrolled(position, positionOffset, positionOffsetPixels)
binding.fabAddEvent.extend()
}
})
// Set the view pager's current page to the current day, if the user chose this option
if (viewModel.preferenceCurrentDay) {
@@ -117,6 +130,20 @@ class EventFragment : AppFragment() {
}
}
/**
* Shrinks the FAB.
*/
fun shrinkFab() {
binding.fabAddEvent.shrink()
}
/**
* Extends the FAB.
*/
fun extendFab() {
binding.fabAddEvent.extend()
}
// Invalidate the view binding
override fun onDestroyView() {
super.onDestroyView()
@@ -5,6 +5,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.NavHostFragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.denizk0461.weserplaner.adapter.StudIPEventPageAdapter
import com.denizk0461.weserplaner.adapter.StudIPEventItemAdapter
@@ -76,6 +77,23 @@ class EventPageFragment : AppFragment(), StudIPEventItemAdapter.OnClickListener
scheduleLayoutAnimation()
}
// Retrieve parent fragment to access its functions
val navHostFragment = activity?.supportFragmentManager?.fragments?.get(0) as? NavHostFragment
val parent = navHostFragment?.childFragmentManager?.primaryNavigationFragment as? EventFragment
// Set up scroll change listener to shrink and extend FAB accordingly
binding.recyclerView.setOnScrollChangeListener { _, _, scrollY, _, oldScrollY ->
// Calculate the vertical scroll difference
val dy = scrollY - oldScrollY
if (dy > 0) {
// If scrolling down, shrink the FAB
parent?.shrinkFab()
} else if (dy < 0) {
// If scrolling up, extend the FAB
parent?.extendFab()
}
}
// Set up LiveData observer to refresh the view on update
viewModel.getEventsForDay(currentDay).observe(viewLifecycleOwner) { events ->
eventAdapter.setNewData(events)
+162 -161
View File
@@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
app:layout_scrollFlags="scroll">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@@ -44,13 +44,14 @@
app:layout_constraintEnd_toStartOf="@id/button_notifications"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.TextButton"
style="@style/Widget.Material3.Button.IconButton.Outlined"
android:id="@+id/button_notifications"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="0dp"
app:icon="@drawable/notifications_none"
app:iconPadding="0dp"
app:strokeColor="?attr/colorOutlineVariant"
app:layout_constraintTop_toTopOf="@id/app_title_bar"
app:layout_constraintBottom_toBottomOf="@id/app_title_bar"
app:layout_constraintEnd_toEndOf="parent"
@@ -58,161 +59,162 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
android:text="@string/pref_game"/>
</com.google.android.material.chip.ChipGroup>
</HorizontalScrollView>
</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"/>
app:layout_scrollFlags="scroll"
app:tabMode="scrollable"
android:background="@android:color/transparent"/>
<HorizontalScrollView
android:id="@+id/scroll_view_chip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
app:layout_scrollFlags="scroll">
<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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
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"
app:chipStrokeColor="@color/list_chip_stroke"
android:text="@string/pref_game"/>
</com.google.android.material.chip.ChipGroup>
</HorizontalScrollView>
</com.google.android.material.appbar.AppBarLayout>
@@ -247,8 +249,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="bottom|end"
app:layout_dodgeInsetEdges="bottom"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior">
app:layout_dodgeInsetEdges="bottom">
<com.google.android.material.floatingactionbutton.FloatingActionButton
style="?attr/floatingActionButtonSmallStyle"
@@ -258,7 +259,8 @@
app:srcCompat="@drawable/clock"
android:contentDescription="@string/canteen_fab_opening_hours_content_desc"
android:tooltipText="@string/canteen_fab_opening_hours_content_desc"
android:layout_gravity="center_horizontal"
android:layout_gravity="end"
android:layout_marginHorizontal="24dp"
tools:ignore="UnusedAttribute"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
@@ -269,20 +271,19 @@
app:srcCompat="@drawable/switch_arrows"
android:contentDescription="@string/canteen_fab_switch_canteen_content_desc"
android:tooltipText="@string/canteen_fab_switch_canteen_content_desc"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="4dp"
android:layout_gravity="end"
android:layout_marginHorizontal="24dp"
tools:ignore="UnusedAttribute"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/fab_refresh_offers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/refresh"
android:contentDescription="@string/canteen_fab_refresh_content_desc"
android:tooltipText="@string/canteen_fab_refresh_content_desc"
app:icon="@drawable/refresh"
android:text="@string/canteen_fab_refresh_text"
android:layout_marginHorizontal="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"
tools:ignore="UnusedAttribute"/>
android:layout_marginBottom="@dimen/fab_margin"/>
</androidx.appcompat.widget.LinearLayoutCompat>
+7 -9
View File
@@ -22,14 +22,15 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed"/>
app:layout_scrollFlags="scroll"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/day_tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="scrollable"
app:layout_scrollFlags="scroll|snap"/>
app:layout_scrollFlags="scroll"
android:background="@android:color/transparent"/>
</com.google.android.material.appbar.AppBarLayout>
@@ -49,17 +50,14 @@
android:text="@string/event_empty_fetch_button"
android:visibility="gone"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/fab_add_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/plus"
android:contentDescription="@string/sheet_schedule_update_header_add"
android:tooltipText="@string/sheet_schedule_update_header_add"
app:icon="@drawable/plus"
android:text="@string/schedule_fab_add_text"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"
tools:ignore="UnusedAttribute"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"/>
android:layout_marginBottom="@dimen/fab_margin"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -22,7 +22,7 @@
android:layout_marginBottom="8dp"
android:fontFamily="@font/lato_blackitalic"
android:text="@string/title_settings"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:layout_scrollFlags="scroll"
android:textSize="28sp"/>
</com.google.android.material.appbar.AppBarLayout>
@@ -4,4 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:paddingBottom="72dp"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:layoutAnimation="@anim/layout_animation_fall_down"/>
+3
View File
@@ -42,6 +42,8 @@
<string name="fetch_bar_help_sheet_content"> • Logge dich mit deinem Stud.IP-Login ein\n • Öffne deinen Stundenplan (falls er sich nicht automatisch öffnet)\n • Klicke auf den \'Speichern\'-Knopf, der unten in der rechten Ecke auftauchen sollte\n • Fertig!</string>
<string name="fetch_bar_save_desc">Speichere den Stundenplan in der App ab</string>
<string name="schedule_fab_add_text">Neue Veranstaltung</string>
<string name="save">Speichern</string>
<string name="delete">Löschen</string>
<string name="sheet_schedule_update_delete_confirm">Sicher?</string>
@@ -68,6 +70,7 @@
<string name="canteen_fab_opening_hours_content_desc">Zeige Öffnungszeiten</string>
<string name="canteen_fab_switch_canteen_content_desc">Wechsle Mensa</string>
<string name="canteen_fab_refresh_content_desc">Aktualisiere Angebote</string>
<string name="canteen_fab_refresh_text">Aktualisieren</string>
<!-- TODO replace 'this canteen' with %s -->
<string name="text_sheet_opening_hours_title">%s Öffnungszeiten</string>
-3
View File
@@ -1,3 +0,0 @@
<resources>
<dimen name="fab_margin">48dp</dimen>
</resources>
@@ -1,3 +0,0 @@
<resources>
<dimen name="fab_margin">200dp</dimen>
</resources>
@@ -1,3 +0,0 @@
<resources>
<dimen name="fab_margin">48dp</dimen>
</resources>
+3
View File
@@ -43,6 +43,8 @@
<string name="fetch_bar_help_sheet_content"> • Log in with your Stud.IP login\n • Open your timetable view (in case it doesn\'t open automatically)\n • Click the \'save\' button that should appear in the bottom right corner\n • Done!</string>
<string name="fetch_bar_save_desc">Save the timetable in the app</string>
<string name="schedule_fab_add_text">New event</string>
<string name="save">Save</string>
<string name="delete">Delete</string>
<string name="sheet_schedule_update_delete_confirm">Sure?</string>
@@ -70,6 +72,7 @@
<string name="canteen_fab_opening_hours_content_desc">Show opening hours</string>
<string name="canteen_fab_switch_canteen_content_desc">Switch canteen</string>
<string name="canteen_fab_refresh_content_desc">Refresh offers</string>
<string name="canteen_fab_refresh_text">Refresh</string>
<string name="text_sheet_opening_hours_title">%s opening hours</string>
<string name="text_sheet_opening_hours_empty">The opening hours could not be downloaded.</string>