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
0f7caa66
Commit
0f7caa66
authored
Jul 04, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove usage of grid layouts
parent
bd14994e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
7 additions
and
31 deletions
+7
-31
Config.kt
app/src/main/java/com/topjohnwu/magisk/core/Config.kt
+2
-10
DarkThemeDialog.kt
...m/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt
+1
-1
BaseUIActivity.kt
.../main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt
+1
-1
SettingsItems.kt
...in/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt
+0
-13
SettingsViewModel.kt
...ava/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt
+1
-1
fragment_module_md2.xml
app/src/main/res/layout/fragment_module_md2.xml
+0
-1
fragment_settings_md2.xml
app/src/main/res/layout/fragment_settings_md2.xml
+1
-2
include_module_filter.xml
app/src/main/res/layout/include_module_filter.xml
+1
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/core/Config.kt
View file @
0f7caa66
...
@@ -47,16 +47,13 @@ object Config : PreferenceModel, DBConfig {
...
@@ -47,16 +47,13 @@ object Config : PreferenceModel, DBConfig {
const
val
UPDATE_CHANNEL
=
"update_channel"
const
val
UPDATE_CHANNEL
=
"update_channel"
const
val
CUSTOM_CHANNEL
=
"custom_channel"
const
val
CUSTOM_CHANNEL
=
"custom_channel"
const
val
LOCALE
=
"locale"
const
val
LOCALE
=
"locale"
const
val
DARK_THEME
=
"dark_theme"
const
val
DARK_THEME
=
"dark_theme_extended"
const
val
DARK_THEME_EXTENDED
=
"dark_theme_extended"
const
val
REPO_ORDER
=
"repo_order"
const
val
REPO_ORDER
=
"repo_order"
const
val
SHOW_SYSTEM_APP
=
"show_system"
const
val
SHOW_SYSTEM_APP
=
"show_system"
const
val
DOWNLOAD_PATH
=
"download_path"
const
val
DOWNLOAD_PATH
=
"download_path"
const
val
REDESIGN
=
"redesign"
const
val
SAFETY
=
"safety_notice"
const
val
SAFETY
=
"safety_notice"
const
val
THEME_ORDINAL
=
"theme_ordinal"
const
val
THEME_ORDINAL
=
"theme_ordinal"
const
val
BOOT_ID
=
"boot_id"
const
val
BOOT_ID
=
"boot_id"
const
val
LIST_SPAN_COUNT
=
"column_count"
// system state
// system state
const
val
MAGISKHIDE
=
"magiskhide"
const
val
MAGISKHIDE
=
"magiskhide"
...
@@ -120,17 +117,12 @@ object Config : PreferenceModel, DBConfig {
...
@@ -120,17 +117,12 @@ object Config : PreferenceModel, DBConfig {
var
updateChannel
by
preferenceStrInt
(
Key
.
UPDATE_CHANNEL
,
defaultChannel
)
var
updateChannel
by
preferenceStrInt
(
Key
.
UPDATE_CHANNEL
,
defaultChannel
)
var
safetyNotice
by
preference
(
Key
.
SAFETY
,
true
)
var
safetyNotice
by
preference
(
Key
.
SAFETY
,
true
)
var
darkThemeExtended
by
preference
(
var
darkTheme
by
preference
(
Key
.
DARK_THEME
,
AppCompatDelegate
.
MODE_NIGHT_FOLLOW_SYSTEM
)
Key
.
DARK_THEME_EXTENDED
,
AppCompatDelegate
.
MODE_NIGHT_FOLLOW_SYSTEM
)
var
themeOrdinal
by
preference
(
Key
.
THEME_ORDINAL
,
Theme
.
Piplup
.
ordinal
)
var
themeOrdinal
by
preference
(
Key
.
THEME_ORDINAL
,
Theme
.
Piplup
.
ordinal
)
var
suReAuth
by
preference
(
Key
.
SU_REAUTH
,
false
)
var
suReAuth
by
preference
(
Key
.
SU_REAUTH
,
false
)
var
checkUpdate
by
preference
(
Key
.
CHECK_UPDATES
,
true
)
var
checkUpdate
by
preference
(
Key
.
CHECK_UPDATES
,
true
)
var
magiskHide
by
preference
(
Key
.
MAGISKHIDE
,
true
)
var
magiskHide
by
preference
(
Key
.
MAGISKHIDE
,
true
)
var
showSystemApp
by
preference
(
Key
.
SHOW_SYSTEM_APP
,
false
)
var
showSystemApp
by
preference
(
Key
.
SHOW_SYSTEM_APP
,
false
)
@JvmStatic
var
listSpanCount
by
preference
(
Key
.
LIST_SPAN_COUNT
,
1
)
var
customChannelUrl
by
preference
(
Key
.
CUSTOM_CHANNEL
,
""
)
var
customChannelUrl
by
preference
(
Key
.
CUSTOM_CHANNEL
,
""
)
var
locale
by
preference
(
Key
.
LOCALE
,
""
)
var
locale
by
preference
(
Key
.
LOCALE
,
""
)
...
...
app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt
View file @
0f7caa66
...
@@ -42,7 +42,7 @@ class DarkThemeDialog : DialogEvent(), ActivityExecutor {
...
@@ -42,7 +42,7 @@ class DarkThemeDialog : DialogEvent(), ActivityExecutor {
}
}
private
fun
selectTheme
(
mode
:
Int
)
{
private
fun
selectTheme
(
mode
:
Int
)
{
Config
.
darkTheme
Extended
=
mode
Config
.
darkTheme
=
mode
activity
?.
get
()
?.
recreate
()
activity
?.
get
()
?.
recreate
()
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt
View file @
0f7caa66
...
@@ -47,7 +47,7 @@ abstract class BaseUIActivity<ViewModel : BaseViewModel, Binding : ViewDataBindi
...
@@ -47,7 +47,7 @@ abstract class BaseUIActivity<ViewModel : BaseViewModel, Binding : ViewDataBindi
open
val
snackbarView
get
()
=
binding
.
root
open
val
snackbarView
get
()
=
binding
.
root
init
{
init
{
val
theme
=
Config
.
darkTheme
Extended
val
theme
=
Config
.
darkTheme
AppCompatDelegate
.
setDefaultNightMode
(
theme
)
AppCompatDelegate
.
setDefaultNightMode
(
theme
)
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt
View file @
0f7caa66
...
@@ -21,8 +21,6 @@ import com.topjohnwu.magisk.model.entity.recycler.SettingsItem
...
@@ -21,8 +21,6 @@ import com.topjohnwu.magisk.model.entity.recycler.SettingsItem
import
com.topjohnwu.magisk.utils.asTransitive
import
com.topjohnwu.magisk.utils.asTransitive
import
com.topjohnwu.superuser.Shell
import
com.topjohnwu.superuser.Shell
import
java.io.File
import
java.io.File
import
kotlin.math.max
import
kotlin.math.min
// --- Customization
// --- Customization
...
@@ -123,17 +121,6 @@ object DownloadPath : SettingsItem.Input() {
...
@@ -123,17 +121,6 @@ object DownloadPath : SettingsItem.Input() {
.
inflate
(
LayoutInflater
.
from
(
context
)).
also
{
it
.
data
=
this
}.
root
.
inflate
(
LayoutInflater
.
from
(
context
)).
also
{
it
.
data
=
this
}.
root
}
}
object
GridSize
:
SettingsItem
.
Selector
()
{
override
var
value
by
bindableValue
(
Config
.
listSpanCount
-
1
)
{
Config
.
listSpanCount
=
max
(
1
,
min
(
2
,
it
+
1
))
}
override
val
title
=
R
.
string
.
settings_grid_column_count_title
.
asTransitive
()
override
val
description
=
R
.
string
.
settings_grid_column_count_summary
.
asTransitive
()
override
val
entryRes
=
R
.
array
.
span_count
override
val
entryValRes
=
R
.
array
.
value_array
}
object
UpdateChannel
:
SettingsItem
.
Selector
()
{
object
UpdateChannel
:
SettingsItem
.
Selector
()
{
override
var
value
by
bindableValue
(
Config
.
updateChannel
)
{
Config
.
updateChannel
=
it
}
override
var
value
by
bindableValue
(
Config
.
updateChannel
)
{
Config
.
updateChannel
=
it
}
...
...
app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt
View file @
0f7caa66
...
@@ -40,7 +40,7 @@ class SettingsViewModel(
...
@@ -40,7 +40,7 @@ class SettingsViewModel(
// Customization
// Customization
val
list
=
mutableListOf
(
val
list
=
mutableListOf
(
Customization
,
Customization
,
Theme
,
Language
,
GridSize
Theme
,
Language
)
)
if
(
Build
.
VERSION
.
SDK_INT
<
21
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
21
)
{
// Pre 5.0 does not support getting colors from attributes,
// Pre 5.0 does not support getting colors from attributes,
...
...
app/src/main/res/layout/fragment_module_md2.xml
View file @
0f7caa66
...
@@ -36,7 +36,6 @@
...
@@ -36,7 +36,6 @@
gone=
"@{viewModel.loading && viewModel.items.empty}"
gone=
"@{viewModel.loading && viewModel.items.empty}"
itemBinding=
"@{viewModel.itemBinding}"
itemBinding=
"@{viewModel.itemBinding}"
items=
"@{viewModel.items}"
items=
"@{viewModel.items}"
spanCount=
"@{Config.listSpanCount}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:clipToPadding=
"false"
android:clipToPadding=
"false"
...
...
app/src/main/res/layout/fragment_settings_md2.xml
View file @
0f7caa66
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
dividerVertical=
"@{@drawable/divider_l_50}"
dividerVertical=
"@{@drawable/divider_l_50}"
itemBinding=
"@{viewModel.itemBinding}"
itemBinding=
"@{viewModel.itemBinding}"
items=
"@{viewModel.items}"
items=
"@{viewModel.items}"
spanCount=
"@{Config.listSpanCount}"
android:id=
"@+id/settings_list"
android:id=
"@+id/settings_list"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
...
@@ -30,7 +29,7 @@
...
@@ -30,7 +29,7 @@
android:paddingTop=
"@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
android:paddingTop=
"@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
android:paddingEnd=
"@dimen/l_50"
android:paddingEnd=
"@dimen/l_50"
android:paddingBottom=
"@{viewModel.insets.bottom + (int) @dimen/l1}"
android:paddingBottom=
"@{viewModel.insets.bottom + (int) @dimen/l1}"
app:layoutManager=
"androidx.recyclerview.widget.
StaggeredGrid
LayoutManager"
app:layoutManager=
"androidx.recyclerview.widget.
Linear
LayoutManager"
app:spanCount=
"1"
app:spanCount=
"1"
tools:layout_marginTop=
"24dp"
tools:layout_marginTop=
"24dp"
tools:listitem=
"@layout/item_settings_toggle"
tools:listitem=
"@layout/item_settings_toggle"
...
...
app/src/main/res/layout/include_module_filter.xml
View file @
0f7caa66
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
dividerVertical=
"@{@drawable/divider_l1}"
dividerVertical=
"@{@drawable/divider_l1}"
itemBinding=
"@{viewModel.itemSearchBinding}"
itemBinding=
"@{viewModel.itemSearchBinding}"
items=
"@{viewModel.itemsSearch}"
items=
"@{viewModel.itemsSearch}"
spanCount=
"@{Config.listSpanCount}"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_marginBottom=
"@dimen/l1"
android:layout_marginBottom=
"@dimen/l1"
...
@@ -41,7 +40,7 @@
...
@@ -41,7 +40,7 @@
app:fastScrollHorizontalTrackDrawable=
"@drawable/fast_scroll_track"
app:fastScrollHorizontalTrackDrawable=
"@drawable/fast_scroll_track"
app:fastScrollVerticalThumbDrawable=
"@drawable/fast_scroll_thumb"
app:fastScrollVerticalThumbDrawable=
"@drawable/fast_scroll_thumb"
app:fastScrollVerticalTrackDrawable=
"@drawable/fast_scroll_track"
app:fastScrollVerticalTrackDrawable=
"@drawable/fast_scroll_track"
app:layoutManager=
"androidx.recyclerview.widget.
StaggeredGrid
LayoutManager"
app:layoutManager=
"androidx.recyclerview.widget.
Linear
LayoutManager"
app:layout_constrainedHeight=
"true"
app:layout_constrainedHeight=
"true"
app:layout_constraintBottom_toTopOf=
"@+id/module_filter_title_search"
app:layout_constraintBottom_toTopOf=
"@+id/module_filter_title_search"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
...
...
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