From 96c074e87be051a44e128f737aaac8c11b9bd23d Mon Sep 17 00:00:00 2001 From: LagradOst <11805592+LagradOst@users.noreply.github.com> Date: Mon, 18 Apr 2022 20:24:29 +0200 Subject: [PATCH] bit of material3 --- .../java/com/lagradost/cloudstream3/MainActivity.kt | 10 ++++++---- .../com/lagradost/cloudstream3/widget/FlowLayout.kt | 3 ++- .../res/drawable/ic_baseline_delete_outline_24.xml | 13 +++++++++---- .../main/res/drawable/ic_baseline_storage_24.xml | 13 +++++++++---- app/src/main/res/layout/activity_main.xml | 1 + app/src/main/res/values/styles.xml | 5 +++-- 6 files changed, 30 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt index 015a5004..80b207a4 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt @@ -533,10 +533,10 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { .setPopUpTo(navController.graph.startDestination, false) .build()*/ nav_view?.setupWithNavController(navController) - val navRail = findViewById(R.id.nav_rail_view) - navRail?.setupWithNavController(navController) + val nav_rail = findViewById(R.id.nav_rail_view) + nav_rail?.setupWithNavController(navController) - navRail?.setOnItemSelectedListener { item -> + nav_rail?.setOnItemSelectedListener { item -> onNavDestinationSelected( item, navController @@ -574,7 +574,9 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { val rippleColor = ColorStateList.valueOf(getResourceColor(R.attr.colorPrimary, 0.1f)) nav_view?.itemRippleColor = rippleColor - navRail?.itemRippleColor = rippleColor + nav_rail?.itemRippleColor = rippleColor + nav_rail?.itemActiveIndicatorColor = rippleColor + nav_view?.itemActiveIndicatorColor = rippleColor if (!checkWrite()) { requestRW() diff --git a/app/src/main/java/com/lagradost/cloudstream3/widget/FlowLayout.kt b/app/src/main/java/com/lagradost/cloudstream3/widget/FlowLayout.kt index e05f5b7a..5002573d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/widget/FlowLayout.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/widget/FlowLayout.kt @@ -4,6 +4,7 @@ import android.annotation.SuppressLint import android.content.Context import android.util.AttributeSet import android.view.ViewGroup +import androidx.core.view.marginEnd import com.lagradost.cloudstream3.R import kotlin.math.max @@ -36,7 +37,7 @@ class FlowLayout : ViewGroup { val childHeight = child.measuredHeight //check if child can be placed in the current row, else go to next line - if (currentChildHookPointx + childWidth > realWidth && i + 1 < childCount) { + if (currentChildHookPointx + childWidth - child.marginEnd - child.paddingEnd - itemSpacing > realWidth) { //new line currentWidth = max(currentWidth, currentChildHookPointx) diff --git a/app/src/main/res/drawable/ic_baseline_delete_outline_24.xml b/app/src/main/res/drawable/ic_baseline_delete_outline_24.xml index 8f98cc53..a93d8ab0 100644 --- a/app/src/main/res/drawable/ic_baseline_delete_outline_24.xml +++ b/app/src/main/res/drawable/ic_baseline_delete_outline_24.xml @@ -1,5 +1,10 @@ - - + + diff --git a/app/src/main/res/drawable/ic_baseline_storage_24.xml b/app/src/main/res/drawable/ic_baseline_storage_24.xml index 24caa07d..5909dcc7 100644 --- a/app/src/main/res/drawable/ic_baseline_storage_24.xml +++ b/app/src/main/res/drawable/ic_baseline_storage_24.xml @@ -1,5 +1,10 @@ - - + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 358ef281..a5ec2921 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -18,6 +18,7 @@ android:id="@+id/nav_rail_view" android:background="?attr/primaryGrayBackground" app:itemTextColor="@color/item_select_color" + app:itemIconTint="@color/item_select_color" app:menuGravity="center" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c043126b..c1e99107 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,6 +1,6 @@ - -