Remove custom shapes and elevations
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package gq.kirmanak.mealient.ui.recipes.info
|
||||
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -8,10 +7,8 @@ import android.view.ViewGroup
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.viewModels
|
||||
import by.kirich1409.viewbindingdelegate.viewBinding
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import gq.kirmanak.mealient.R
|
||||
import gq.kirmanak.mealient.databinding.FragmentRecipeInfoBinding
|
||||
import gq.kirmanak.mealient.logging.Logger
|
||||
import gq.kirmanak.mealient.ui.recipes.images.RecipeImageLoader
|
||||
@@ -71,9 +68,6 @@ class RecipeInfoFragment : BottomSheetDialogFragment() {
|
||||
instructionsAdapter.submitList(uiState.recipeInstructions)
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog =
|
||||
BottomSheetDialog(requireContext(), R.style.NoShapeBottomSheetDialog)
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
logger.v { "onDestroyView() called" }
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="?attr/colorOnPrimary" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/rounded_corner_size_default"
|
||||
android:topRightRadius="@dimen/rounded_corner_size_default" />
|
||||
</shape>
|
||||
@@ -2,6 +2,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
style="?materialCardViewElevatedStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="ui.disclaimer.DisclaimerFragment">
|
||||
@@ -12,12 +13,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="40dp"
|
||||
app:cardElevation="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/okay"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:shapeAppearance="@style/ShapeAppearance.AllCornersRounded">
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/main_text"
|
||||
@@ -32,10 +31,10 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/okay"
|
||||
android:clickable="false"
|
||||
tools:text="Okay (3 seconds)"
|
||||
style="@style/SmallMarginButton"
|
||||
android:clickable="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/main_text_holder" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/main_text_holder"
|
||||
tools:text="Okay (3 seconds)" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -33,15 +33,14 @@
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/image"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_width="0dp"
|
||||
app:shapeAppearance="@style/ShapeAppearance.AllCornersRounded"
|
||||
android:layout_height="@dimen/fragment_recipe_info_image_height"
|
||||
android:contentDescription="@string/content_description_fragment_recipe_info_image"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toTopOf="@+id/title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/title"
|
||||
tools:srcCompat="@drawable/placeholder_recipe" />
|
||||
|
||||
<TextView
|
||||
@@ -60,8 +59,8 @@
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textAppearance="?textAppearanceBody2"
|
||||
app:layout_constraintBottom_toTopOf="@+id/ingredients_holder"
|
||||
@@ -72,13 +71,12 @@
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/ingredients_holder"
|
||||
style="?materialCardViewOutlinedStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
app:shapeAppearance="@style/ShapeAppearance.AllCornersRounded"
|
||||
app:cardElevation="10dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/instructions_header"
|
||||
app:layout_constraintEnd_toStartOf="@+id/end_guide"
|
||||
app:layout_constraintStart_toEndOf="@+id/start_guide"
|
||||
@@ -133,11 +131,11 @@
|
||||
android:id="@+id/instructions_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/end_guide"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintTop_toBottomOf="@+id/instructions_header"
|
||||
app:layout_constraintStart_toEndOf="@+id/start_guide"
|
||||
app:layout_constraintTop_toBottomOf="@+id/instructions_header"
|
||||
tools:itemCount="2"
|
||||
tools:listitem="@layout/view_holder_instruction" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
<com.google.android.material.card.MaterialCardView 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"
|
||||
style="?materialCardViewOutlinedStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="8dp"
|
||||
app:shapeAppearance="@style/ShapeAppearance.AllCornersRounded"
|
||||
app:cardElevation="10dp"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -2,13 +2,12 @@
|
||||
<com.google.android.material.card.MaterialCardView 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"
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
style="?materialCardViewElevatedStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="7dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="19dp"
|
||||
app:shapeAppearance="@style/ShapeAppearance.AllCornersRounded">
|
||||
android:layout_marginEnd="19dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -43,7 +42,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:shapeAppearance="@style/ShapeAppearance.AllCornersRounded"
|
||||
tools:srcCompat="@drawable/placeholder_recipe" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -3,6 +3,4 @@
|
||||
<dimen name="margin_small">8dp</dimen>
|
||||
<dimen name="height_view_holder_recipe_image">182dp</dimen>
|
||||
<dimen name="fragment_recipe_info_image_height">@dimen/height_view_holder_recipe_image</dimen>
|
||||
<dimen name="main_activity_toolbar_corner_radius">32dp</dimen>
|
||||
<dimen name="rounded_corner_size_default">15dp</dimen>
|
||||
</resources>
|
||||
@@ -5,7 +5,6 @@
|
||||
<string name="fragment_authentication_input_hint_url">Server URL</string>
|
||||
<string name="fragment_authentication_button_login">Login</string>
|
||||
<string name="content_description_view_holder_recipe_image">Picture of the cooked meal</string>
|
||||
<string name="menu_main_toolbar_content_description_logout" translatable="false">@string/menu_navigation_drawer_logout</string>
|
||||
<string name="menu_navigation_drawer_logout">Logout</string>
|
||||
<string name="view_holder_recipe_text_placeholder">Loading…</string>
|
||||
<string name="content_description_fragment_recipe_info_image" translatable="false">@string/content_description_view_holder_recipe_image</string>
|
||||
@@ -18,7 +17,6 @@
|
||||
<string name="fragment_base_url_malformed_url">Check URL format: %s</string>
|
||||
<string name="fragment_base_url_save">Proceed</string>
|
||||
<string name="fragment_base_url_unknown_error" translatable="false">@string/fragment_authentication_unknown_error</string>
|
||||
<string name="menu_main_toolbar_content_description_login" translatable="false">@string/menu_navigation_drawer_login</string>
|
||||
<string name="menu_navigation_drawer_login">Login</string>
|
||||
<string name="fragment_disclaimer_button_okay">Okay</string>
|
||||
<string name="view_holder_recipe_instructions_step">Step: %d</string>
|
||||
|
||||
@@ -13,22 +13,6 @@
|
||||
<item name="android:layout_margin">@dimen/margin_small</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearance.AllCornersRounded" parent="ShapeAppearance.Material3.LargeComponent">
|
||||
<item name="cornerSize">@dimen/rounded_corner_size_default</item>
|
||||
</style>
|
||||
|
||||
<!-- This is a workaround to support always round corners of the bottom sheet
|
||||
See more at https://github.com/material-components/material-components-android/pull/437#issuecomment-852461685 -->
|
||||
<style name="NoShapeBottomSheetDialog" parent="ThemeOverlay.Material3.BottomSheetDialog">
|
||||
<item name="bottomSheetStyle">@style/NoShapeBottomSheet</item>
|
||||
</style>
|
||||
|
||||
<style name="NoShapeBottomSheet" parent="Widget.Material3.BottomSheet.Modal">
|
||||
<item name="shapeAppearance">@null</item>
|
||||
<item name="shapeAppearanceOverlay">@null</item>
|
||||
<item name="android:background">@drawable/recipe_info_background</item>
|
||||
</style>
|
||||
|
||||
<style name="IndeterminateProgress">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
|
||||
Reference in New Issue
Block a user