Updated install from storage button to be more expressive
This commit is contained in:
parent
332c1a6c59
commit
833269fd0a
@ -84,6 +84,12 @@ class RepoRvItem(val item: Repo) : ComparableRvItem<RepoRvItem>() {
|
||||
object InstallModule : ComparableRvItem<InstallModule>() {
|
||||
override val layoutRes = R.layout.item_module_download
|
||||
|
||||
override fun onBindingBound(binding: ViewDataBinding) {
|
||||
super.onBindingBound(binding)
|
||||
val params = binding.root.layoutParams as? StaggeredGridLayoutManager.LayoutParams
|
||||
params?.isFullSpan = true
|
||||
}
|
||||
|
||||
override fun contentSameAs(other: InstallModule) = this == other
|
||||
override fun itemSameAs(other: InstallModule) = this === other
|
||||
}
|
||||
@ -116,8 +122,8 @@ class SectionTitle(
|
||||
|
||||
override fun onBindingBound(binding: ViewDataBinding) {
|
||||
super.onBindingBound(binding)
|
||||
val params = binding.root.layoutParams as StaggeredGridLayoutManager.LayoutParams
|
||||
params.isFullSpan = true
|
||||
val params = binding.root.layoutParams as? StaggeredGridLayoutManager.LayoutParams
|
||||
params?.isFullSpan = true
|
||||
}
|
||||
|
||||
override fun itemSameAs(other: SectionTitle): Boolean = this === other
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
@ -16,15 +15,15 @@
|
||||
</data>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="?styleButtonTextSecondary"
|
||||
style="?styleButtonOutlined"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="@{() -> viewModel.installPressed()}"
|
||||
android:text="@string/module_action_install_external"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="12sp"
|
||||
app:cornerRadius="@dimen/r1"
|
||||
app:icon="@drawable/ic_module_storage_md2"
|
||||
app:iconPadding="@dimen/l_50"
|
||||
tools:layout_width="150dp" />
|
||||
app:iconPadding="@dimen/l_50" />
|
||||
|
||||
</layout>
|
||||
|
@ -24,6 +24,8 @@
|
||||
<!--Button-->
|
||||
<attr name="styleButtonDefault" format="reference" />
|
||||
<attr name="styleButtonDefaultOnPrimary" format="reference" />
|
||||
<attr name="styleButtonOutlined" format="reference" />
|
||||
<attr name="styleButtonOutlinedOnPrimary" format="reference" />
|
||||
<attr name="styleButtonFlat" format="reference" />
|
||||
<attr name="styleButtonFlatOnPrimary" format="reference" />
|
||||
<attr name="styleButtonText" format="reference" />
|
||||
|
@ -36,6 +36,10 @@
|
||||
|
||||
<item name="styleButtonDefault">@style/WidgetFoundation.Button</item>
|
||||
<item name="styleButtonDefaultOnPrimary">@style/WidgetFoundation.Button.OnPrimary</item>
|
||||
<item name="styleButtonOutlined">@style/WidgetFoundation.Button.Outlined</item>
|
||||
<item name="styleButtonOutlinedOnPrimary">
|
||||
@style/WidgetFoundation.Button.Outlined.OnPrimary
|
||||
</item>
|
||||
<item name="styleButtonFlat">@style/WidgetFoundation.Button.Flat</item>
|
||||
<item name="styleButtonFlatOnPrimary">@style/WidgetFoundation.Button.Flat.OnPrimary</item>
|
||||
<item name="styleButtonText">@style/WidgetFoundation.Button.Text</item>
|
||||
|
@ -66,6 +66,21 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
|
||||
<item name="iconTint">?colorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetFoundation.Button.Outlined" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="iconGravity">textStart</item>
|
||||
<item name="iconPadding">@dimen/l1</item>
|
||||
<item name="strokeColor">?colorPrimary</item>
|
||||
<item name="android:textColor">?colorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetFoundation.Button.Outlined.OnPrimary">
|
||||
<item name="strokeColor">?colorOnPrimary</item>
|
||||
<item name="rippleColor">?colorOnPrimary</item>
|
||||
<item name="android:textColor">?colorOnPrimary</item>
|
||||
<item name="iconTint">?colorOnPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetFoundation.Button.Flat" parent="Widget.MaterialComponents.Button.UnelevatedButton">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="iconGravity">textStart</item>
|
||||
|
Loading…
Reference in New Issue
Block a user