Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
833269fd
Commit
833269fd
authored
Nov 18, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated install from storage button to be more expressive
parent
332c1a6c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
7 deletions
+33
-7
ModuleRvItem.kt
...om/topjohnwu/magisk/model/entity/recycler/ModuleRvItem.kt
+8
-2
item_module_download.xml
app/src/main/res/layout/item_module_download.xml
+4
-5
attrs.xml
app/src/main/res/values/attrs.xml
+2
-0
styles_md2.xml
app/src/main/res/values/styles_md2.xml
+4
-0
styles_md2_impl.xml
app/src/main/res/values/styles_md2_impl.xml
+15
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ModuleRvItem.kt
View file @
833269fd
...
@@ -84,6 +84,12 @@ class RepoRvItem(val item: Repo) : ComparableRvItem<RepoRvItem>() {
...
@@ -84,6 +84,12 @@ class RepoRvItem(val item: Repo) : ComparableRvItem<RepoRvItem>() {
object
InstallModule
:
ComparableRvItem
<
InstallModule
>()
{
object
InstallModule
:
ComparableRvItem
<
InstallModule
>()
{
override
val
layoutRes
=
R
.
layout
.
item_module_download
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
contentSameAs
(
other
:
InstallModule
)
=
this
==
other
override
fun
itemSameAs
(
other
:
InstallModule
)
=
this
===
other
override
fun
itemSameAs
(
other
:
InstallModule
)
=
this
===
other
}
}
...
@@ -116,8 +122,8 @@ class SectionTitle(
...
@@ -116,8 +122,8 @@ class SectionTitle(
override
fun
onBindingBound
(
binding
:
ViewDataBinding
)
{
override
fun
onBindingBound
(
binding
:
ViewDataBinding
)
{
super
.
onBindingBound
(
binding
)
super
.
onBindingBound
(
binding
)
val
params
=
binding
.
root
.
layoutParams
as
StaggeredGridLayoutManager
.
LayoutParams
val
params
=
binding
.
root
.
layoutParams
as
?
StaggeredGridLayoutManager
.
LayoutParams
params
.
isFullSpan
=
true
params
?
.
isFullSpan
=
true
}
}
override
fun
itemSameAs
(
other
:
SectionTitle
):
Boolean
=
this
===
other
override
fun
itemSameAs
(
other
:
SectionTitle
):
Boolean
=
this
===
other
...
...
app/src/main/res/layout/item_module_download.xml
View file @
833269fd
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
xmlns:tools=
"http://schemas.android.com/tools"
>
<data>
<data>
...
@@ -16,15 +15,15 @@
...
@@ -16,15 +15,15 @@
</data>
</data>
<com.google.android.material.button.MaterialButton
<com.google.android.material.button.MaterialButton
style=
"?styleButton
TextSecondary
"
style=
"?styleButton
Outlined
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:onClick=
"@{() -> viewModel.installPressed()}"
android:onClick=
"@{() -> viewModel.installPressed()}"
android:text=
"@string/module_action_install_external"
android:text=
"@string/module_action_install_external"
android:textAllCaps=
"false"
android:textAllCaps=
"false"
android:textSize=
"12sp"
android:textSize=
"12sp"
app:cornerRadius=
"@dimen/r1"
app:icon=
"@drawable/ic_module_storage_md2"
app:icon=
"@drawable/ic_module_storage_md2"
app:iconPadding=
"@dimen/l_50"
app:iconPadding=
"@dimen/l_50"
/>
tools:layout_width=
"150dp"
/>
</layout>
</layout>
app/src/main/res/values/attrs.xml
View file @
833269fd
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
<!--Button-->
<!--Button-->
<attr
name=
"styleButtonDefault"
format=
"reference"
/>
<attr
name=
"styleButtonDefault"
format=
"reference"
/>
<attr
name=
"styleButtonDefaultOnPrimary"
format=
"reference"
/>
<attr
name=
"styleButtonDefaultOnPrimary"
format=
"reference"
/>
<attr
name=
"styleButtonOutlined"
format=
"reference"
/>
<attr
name=
"styleButtonOutlinedOnPrimary"
format=
"reference"
/>
<attr
name=
"styleButtonFlat"
format=
"reference"
/>
<attr
name=
"styleButtonFlat"
format=
"reference"
/>
<attr
name=
"styleButtonFlatOnPrimary"
format=
"reference"
/>
<attr
name=
"styleButtonFlatOnPrimary"
format=
"reference"
/>
<attr
name=
"styleButtonText"
format=
"reference"
/>
<attr
name=
"styleButtonText"
format=
"reference"
/>
...
...
app/src/main/res/values/styles_md2.xml
View file @
833269fd
...
@@ -36,6 +36,10 @@
...
@@ -36,6 +36,10 @@
<item
name=
"styleButtonDefault"
>
@style/WidgetFoundation.Button
</item>
<item
name=
"styleButtonDefault"
>
@style/WidgetFoundation.Button
</item>
<item
name=
"styleButtonDefaultOnPrimary"
>
@style/WidgetFoundation.Button.OnPrimary
</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=
"styleButtonFlat"
>
@style/WidgetFoundation.Button.Flat
</item>
<item
name=
"styleButtonFlatOnPrimary"
>
@style/WidgetFoundation.Button.Flat.OnPrimary
</item>
<item
name=
"styleButtonFlatOnPrimary"
>
@style/WidgetFoundation.Button.Flat.OnPrimary
</item>
<item
name=
"styleButtonText"
>
@style/WidgetFoundation.Button.Text
</item>
<item
name=
"styleButtonText"
>
@style/WidgetFoundation.Button.Text
</item>
...
...
app/src/main/res/values/styles_md2_impl.xml
View file @
833269fd
...
@@ -66,6 +66,21 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
...
@@ -66,6 +66,21 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
<item
name=
"iconTint"
>
?colorPrimary
</item>
<item
name=
"iconTint"
>
?colorPrimary
</item>
</style>
</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"
>
<style
name=
"WidgetFoundation.Button.Flat"
parent=
"Widget.MaterialComponents.Button.UnelevatedButton"
>
<item
name=
"android:textStyle"
>
bold
</item>
<item
name=
"android:textStyle"
>
bold
</item>
<item
name=
"iconGravity"
>
textStart
</item>
<item
name=
"iconGravity"
>
textStart
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment