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
1fcf35eb
Commit
1fcf35eb
authored
Aug 19, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not hardcode appcompat widget classes
They should be handled by the theme
parent
6d749a58
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
55 additions
and
49 deletions
+55
-49
BaseUIActivity.kt
...src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt
+6
-5
DataBindingAdapters.kt
...a/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt
+5
-0
activity_main_md2.xml
app/src/main/res/layout/activity_main_md2.xml
+2
-2
activity_request.xml
app/src/main/res/layout/activity_request.xml
+2
-2
fragment_flash_md2.xml
app/src/main/res/layout/fragment_flash_md2.xml
+1
-1
fragment_home_md2.xml
app/src/main/res/layout/fragment_home_md2.xml
+4
-4
fragment_install_md2.xml
app/src/main/res/layout/fragment_install_md2.xml
+3
-3
fragment_module_md2.xml
app/src/main/res/layout/fragment_module_md2.xml
+1
-1
fragment_safetynet_md2.xml
app/src/main/res/layout/fragment_safetynet_md2.xml
+1
-1
include_hide_filter.xml
app/src/main/res/layout/include_hide_filter.xml
+4
-4
include_home_magisk.xml
app/src/main/res/layout/include_home_magisk.xml
+2
-2
include_home_manager.xml
app/src/main/res/layout/include_home_manager.xml
+2
-2
include_module_filter.xml
app/src/main/res/layout/include_module_filter.xml
+3
-3
item_log_access_md2.xml
app/src/main/res/layout/item_log_access_md2.xml
+4
-4
item_log_track_md2.xml
app/src/main/res/layout/item_log_track_md2.xml
+2
-2
item_module_download.xml
app/src/main/res/layout/item_module_download.xml
+1
-1
item_module_md2.xml
app/src/main/res/layout/item_module_md2.xml
+1
-1
item_policy_md2.xml
app/src/main/res/layout/item_policy_md2.xml
+3
-3
item_section_md2.xml
app/src/main/res/layout/item_section_md2.xml
+1
-1
item_spinner.xml
app/src/main/res/layout/item_spinner.xml
+1
-1
item_tappable_headline.xml
app/src/main/res/layout/item_tappable_headline.xml
+3
-3
item_text.xml
app/src/main/res/layout/item_text.xml
+1
-1
item_theme.xml
app/src/main/res/layout/item_theme.xml
+2
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt
View file @
1fcf35eb
...
...
@@ -11,8 +11,9 @@ import androidx.databinding.DataBindingUtil
import
androidx.databinding.OnRebindCallback
import
androidx.databinding.ViewDataBinding
import
androidx.lifecycle.MutableLiveData
import
androidx.navigation.NavController
import
androidx.navigation.NavDirections
import
androidx.navigation.f
indNavController
import
androidx.navigation.f
ragment.NavHostFragment
import
com.topjohnwu.magisk.BR
import
com.topjohnwu.magisk.core.Config
import
com.topjohnwu.magisk.core.base.BaseActivity
...
...
@@ -26,14 +27,14 @@ abstract class BaseUIActivity<VM : BaseViewModel, Binding : ViewDataBinding> :
protected
abstract
val
layoutRes
:
Int
protected
open
val
themeRes
:
Int
=
Theme
.
selected
.
themeRes
private
val
navHostFragment
get
()
=
supportFragmentManager
.
findFragmentById
(
navHost
)
private
val
navHostFragment
by
lazy
{
supportFragmentManager
.
findFragmentById
(
navHost
)
as
?
NavHostFragment
}
private
val
topFragment
get
()
=
navHostFragment
?.
childFragmentManager
?.
fragments
?.
getOrNull
(
0
)
protected
val
currentFragment
get
()
=
topFragment
as
?
BaseUIFragment
<*,
*>
override
val
viewRoot
:
View
get
()
=
binding
.
root
open
val
navigation
by
lazy
{
runCatching
{
findNavController
(
navHost
)
}.
getOrNull
()
}
open
val
navigation
:
NavController
?
get
()
=
navHostFragment
?.
navController
open
val
navHost
:
Int
=
0
open
val
snackbarView
get
()
=
binding
.
root
...
...
app/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt
View file @
1fcf35eb
...
...
@@ -199,6 +199,11 @@ fun Button.setIconRes(res: Int) {
(
this
as
MaterialButton
).
setIconResource
(
res
)
}
@BindingAdapter
(
"app:icon"
)
fun
Button
.
setIcon
(
drawable
:
Drawable
)
{
(
this
as
MaterialButton
).
icon
=
drawable
}
@BindingAdapter
(
"strokeWidth"
)
fun
MaterialCardView
.
setCardStrokeWidthBound
(
stroke
:
Float
)
{
strokeWidth
=
stroke
.
roundToInt
()
...
...
app/src/main/res/layout/activity_main_md2.xml
View file @
1fcf35eb
...
...
@@ -19,7 +19,7 @@
android:paddingRight=
"@{viewModel.insets.right}"
tools:ignore=
"RtlHardcoded"
>
<
fragment
<
androidx.fragment.app.FragmentContainerView
android:id=
"@+id/main_nav_host"
android:name=
"androidx.navigation.fragment.NavHostFragment"
android:layout_width=
"match_parent"
...
...
@@ -89,7 +89,7 @@
app:labelVisibilityMode=
"unlabeled"
app:menu=
"@menu/menu_bottom_nav"
/>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
gone=
"@{viewModel.isConnected}"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/layout/activity_request.xml
View file @
1fcf35eb
...
...
@@ -124,7 +124,7 @@
android:paddingStart=
"@dimen/l2"
android:paddingEnd=
"@dimen/l2"
>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/deny_btn"
style=
"@style/WidgetFoundation.Button.Text"
android:layout_width=
"0dp"
...
...
@@ -135,7 +135,7 @@
android:textColor=
"?colorOnSurfaceVariant"
tools:text=
"@string/deny"
/>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/grant_btn"
style=
"@style/WidgetFoundation.Button.Text"
android:layout_width=
"0dp"
...
...
app/src/main/res/layout/fragment_flash_md2.xml
View file @
1fcf35eb
...
...
@@ -64,7 +64,7 @@
android:layout_gravity=
"center"
app:contentPadding=
"@dimen/l1"
>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
movieBehavior=
"@{viewModel.loading}"
movieBehaviorText=
"@{viewModel.behaviorText}"
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/fragment_home_md2.xml
View file @
1fcf35eb
...
...
@@ -33,7 +33,7 @@
android:orientation=
"vertical"
android:paddingTop=
"@dimen/l1"
>
<
com.google.android.material.button.Material
Button
<Button
android:layout_gravity=
"center"
style=
"@style/WidgetFoundation.Button"
gone=
"@{!viewModel.showTest}"
...
...
@@ -68,7 +68,7 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/home_notice_hide"
style=
"@style/WidgetFoundation.Button.Text.OnPrimary"
android:layout_width=
"wrap_content"
...
...
@@ -110,7 +110,7 @@
android:layout_height=
"@dimen/l1"
gone=
"@{!Info.hasGMS && !viewModel.showUninstall}"
/>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button.Outlined"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l1"
...
...
@@ -124,7 +124,7 @@
app:cornerRadius=
"@dimen/r1"
app:icon=
"@drawable/ic_safetynet_md2"
/>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button.Outlined.Error"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l1"
...
...
app/src/main/res/layout/fragment_install_md2.xml
View file @
1fcf35eb
...
...
@@ -74,7 +74,7 @@
app:layout_constraintStart_toEndOf=
"@+id/install_step_options_icon"
app:layout_constraintTop_toTopOf=
"parent"
/>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/install_step_options_button"
style=
"@style/WidgetFoundation.Button.Text"
gone=
"@{viewModel.step != 0}"
...
...
@@ -153,7 +153,7 @@
app:layout_constraintStart_toEndOf=
"@+id/install_step_method_icon"
app:layout_constraintTop_toTopOf=
"parent"
/>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/install_step_method_button"
style=
"@style/WidgetFoundation.Button.Text"
gone=
"@{viewModel.step != 1}"
...
...
@@ -238,7 +238,7 @@
</com.google.android.material.card.MaterialCardView>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button.Text"
gone=
"@{viewModel.step != 2}"
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/fragment_module_md2.xml
View file @
1fcf35eb
...
...
@@ -86,7 +86,7 @@
android:gravity=
"center"
android:orientation=
"vertical"
>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/safetynet_attest_loading"
...
...
app/src/main/res/layout/fragment_safetynet_md2.xml
View file @
1fcf35eb
...
...
@@ -214,7 +214,7 @@
</com.google.android.material.card.MaterialCardView>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button.Text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/layout/include_hide_filter.xml
View file @
1fcf35eb
...
...
@@ -25,7 +25,7 @@
tools:layout_gravity=
"bottom"
tools:paddingBottom=
"64dp"
>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@+id/hide_filter_title_filter"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -70,7 +70,7 @@
</com.google.android.material.chip.ChipGroup>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@+id/hide_filter_title_search"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -96,7 +96,7 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/hide_filter_title_search"
>
<
androidx.appcompat.widget.AppCompat
ImageView
<ImageView
style=
"@style/WidgetFoundation.Icon"
android:layout_width=
"48dp"
android:layout_height=
"36dp"
...
...
@@ -105,7 +105,7 @@
app:srcCompat=
"@drawable/ic_search_md2"
app:tint=
"?colorDisabled"
/>
<
androidx.appcompat.widget.AppCompat
EditText
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"48dp"
...
...
app/src/main/res/layout/include_home_magisk.xml
View file @
1fcf35eb
...
...
@@ -59,7 +59,7 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/home_magisk_title"
>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button"
gone=
"@{viewModel.stateMagisk != MagiskState.OBSOLETE}"
android:layout_width=
"wrap_content"
...
...
@@ -69,7 +69,7 @@
android:textAllCaps=
"false"
app:icon=
"@drawable/ic_update_md2"
/>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button.Text"
gone=
"@{viewModel.stateMagisk == MagiskState.OBSOLETE}"
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/include_home_manager.xml
View file @
1fcf35eb
...
...
@@ -62,7 +62,7 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/home_manager_title"
>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button"
gone=
"@{viewModel.stateManager != MagiskState.OBSOLETE}"
android:layout_width=
"wrap_content"
...
...
@@ -72,7 +72,7 @@
android:textAllCaps=
"false"
app:icon=
"@drawable/ic_update_md2"
/>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button.Text"
gone=
"@{viewModel.stateManager == MagiskState.OBSOLETE}"
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/include_module_filter.xml
View file @
1fcf35eb
...
...
@@ -54,7 +54,7 @@
android:background=
"@drawable/bg_shadow"
app:layout_constraintBottom_toBottomOf=
"@+id/module_filter_list"
/>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@+id/module_filter_title_search"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -81,7 +81,7 @@
app:layout_constraintEnd_toStartOf=
"@+id/module_filter_done"
app:layout_constraintStart_toStartOf=
"parent"
>
<
androidx.appcompat.widget.AppCompat
ImageView
<ImageView
style=
"@style/WidgetFoundation.Icon"
android:layout_width=
"48dp"
android:layout_height=
"36dp"
...
...
@@ -90,7 +90,7 @@
app:srcCompat=
"@drawable/ic_search_md2"
app:tint=
"?colorDisabled"
/>
<
androidx.appcompat.widget.AppCompat
EditText
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"48dp"
...
...
app/src/main/res/layout/item_log_access_md2.xml
View file @
1fcf35eb
...
...
@@ -47,7 +47,7 @@
app:layout_constraintStart_toEndOf=
"@+id/log_track_container"
app:layout_constraintTop_toTopOf=
"parent"
>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@+id/log_app_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -60,7 +60,7 @@
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"@string/app_name"
/>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@+id/log_date"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -71,7 +71,7 @@
app:layout_constraintTop_toBottomOf=
"@+id/log_app_name"
tools:text=
"06:00 PM, 10 Oct 2019"
/>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@+id/log_app_details"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
...
...
@@ -84,7 +84,7 @@
app:layout_constraintTop_toBottomOf=
"@+id/log_date"
tools:text=
"PID: 7196 Target UID: 0"
/>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@+id/log_command"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/layout/item_log_track_md2.xml
View file @
1fcf35eb
...
...
@@ -42,7 +42,7 @@
app:layout_constraintStart_toStartOf=
"@+id/track_bullet"
app:layout_constraintTop_toTopOf=
"parent"
/>
<
androidx.appcompat.widget.AppCompat
ImageView
<ImageView
android:id=
"@+id/track_bullet"
style=
"@style/WidgetFoundation.Image.Small"
isSelected=
"@{isSelected}"
...
...
app/src/main/res/layout/item_module_download.xml
View file @
1fcf35eb
...
...
@@ -14,7 +14,7 @@
</data>
<
com.google.android.material.button.Material
Button
<Button
style=
"@style/WidgetFoundation.Button.Outlined"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/layout/item_module_md2.xml
View file @
1fcf35eb
...
...
@@ -129,7 +129,7 @@
app:layout_constraintTop_toTopOf=
"@+id/module_remove"
app:srcCompat=
"@drawable/ic_info"
/>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/module_remove"
style=
"@style/WidgetFoundation.Button.Text"
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/item_policy_md2.xml
View file @
1fcf35eb
...
...
@@ -103,7 +103,7 @@
android:background=
"?colorSurfaceVariant"
tools:visibility=
"visible"
>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/policy_notify"
style=
"@style/WidgetFoundation.Button.Text"
isSelected=
"@{item.shouldNotify}"
...
...
@@ -127,7 +127,7 @@
android:layout_marginBottom=
"@dimen/l_50"
android:background=
"?colorSurfaceSurfaceVariant"
/>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/policy_log"
style=
"@style/WidgetFoundation.Button.Text"
isSelected=
"@{item.shouldLog}"
...
...
@@ -151,7 +151,7 @@
android:layout_marginBottom=
"@dimen/l_50"
android:background=
"?colorSurfaceSurfaceVariant"
/>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/policy_delete"
style=
"@style/WidgetFoundation.Button.Text"
android:layout_weight=
"1"
...
...
app/src/main/res/layout/item_section_md2.xml
View file @
1fcf35eb
...
...
@@ -32,7 +32,7 @@
android:textStyle=
"bold"
tools:text=
"Installed"
/>
<
com.google.android.material.button.Material
Button
<Button
android:id=
"@+id/module_button"
style=
"@style/WidgetFoundation.Button.Text.Secondary"
invisible=
"@{!item.hasButton}"
...
...
app/src/main/res/layout/item_spinner.xml
View file @
1fcf35eb
...
...
@@ -10,7 +10,7 @@
</data>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@android:id/text1"
style=
"?android:attr/spinnerItemStyle"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/item_tappable_headline.xml
View file @
1fcf35eb
...
...
@@ -26,7 +26,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<
androidx.appcompat.widget.AppCompat
ImageView
<ImageView
android:id=
"@+id/tappable_icon"
style=
"@style/WidgetFoundation.Icon"
android:background=
"@null"
...
...
@@ -36,7 +36,7 @@
app:srcCompat=
"@{item.icon}"
tools:srcCompat=
"@drawable/ic_hide_md2"
/>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:requiresFadingEdge=
"horizontal"
...
...
@@ -50,7 +50,7 @@
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"@string/magiskhide"
/>
<
androidx.appcompat.widget.AppCompat
ImageView
<ImageView
android:id=
"@+id/headline_icon_pointer"
style=
"@style/WidgetFoundation.Icon"
android:background=
"@null"
...
...
app/src/main/res/layout/item_text.xml
View file @
1fcf35eb
...
...
@@ -10,7 +10,7 @@
</data>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
...
...
app/src/main/res/layout/item_theme.xml
View file @
1fcf35eb
...
...
@@ -114,7 +114,7 @@
android:padding=
"@dimen/l1"
app:layout_constraintTop_toBottomOf=
"@+id/theme_card_bottom"
>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:layout_width=
"125dp"
android:layout_height=
"wrap_content"
android:text=
"@{theme.themeName}"
...
...
@@ -168,7 +168,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<
androidx.appcompat.widget.AppCompat
ImageView
<ImageView
style=
"@style/WidgetFoundation.Icon.OnPrimary"
gone=
"@{!theme.isSelected}"
android:layout_gravity=
"end|top"
...
...
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