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
feb0f4b7
Commit
feb0f4b7
authored
Aug 12, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MagiskDialog
parent
6c8fe465
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
141 deletions
+115
-141
DataBindingAdapters.kt
...in/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt
+3
-6
MagiskDialog.kt
app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt
+7
-8
dialog_magisk_base.xml
app/src/main/res/layout/dialog_magisk_base.xml
+103
-125
item_list_single_line.xml
app/src/main/res/layout/item_list_single_line.xml
+2
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt
View file @
feb0f4b7
...
@@ -6,10 +6,7 @@ import android.graphics.drawable.Drawable
...
@@ -6,10 +6,7 @@ import android.graphics.drawable.Drawable
import
android.view.ContextThemeWrapper
import
android.view.ContextThemeWrapper
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.*
import
android.widget.PopupMenu
import
android.widget.ProgressBar
import
android.widget.TextView
import
androidx.annotation.DrawableRes
import
androidx.annotation.DrawableRes
import
androidx.appcompat.widget.Toolbar
import
androidx.appcompat.widget.Toolbar
import
androidx.core.view.updateLayoutParams
import
androidx.core.view.updateLayoutParams
...
@@ -166,8 +163,8 @@ fun RecyclerView.setDividers(dividerVertical: Drawable?, dividerHorizontal: Draw
...
@@ -166,8 +163,8 @@ fun RecyclerView.setDividers(dividerVertical: Drawable?, dividerHorizontal: Draw
}
}
@BindingAdapter
(
"app:icon"
)
@BindingAdapter
(
"app:icon"
)
fun
Material
Button
.
setIconRes
(
res
:
Int
)
{
fun
Button
.
setIconRes
(
res
:
Int
)
{
setIconResource
(
res
)
(
this
as
MaterialButton
).
setIconResource
(
res
)
}
}
@BindingAdapter
(
"strokeWidth"
)
@BindingAdapter
(
"strokeWidth"
)
...
...
app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt
View file @
feb0f4b7
...
@@ -13,6 +13,7 @@ import android.view.WindowManager
...
@@ -13,6 +13,7 @@ import android.view.WindowManager
import
androidx.annotation.DrawableRes
import
androidx.annotation.DrawableRes
import
androidx.annotation.StringRes
import
androidx.annotation.StringRes
import
androidx.appcompat.app.AppCompatDialog
import
androidx.appcompat.app.AppCompatDialog
import
androidx.appcompat.content.res.AppCompatResources
import
androidx.core.view.ViewCompat
import
androidx.core.view.ViewCompat
import
androidx.core.view.updatePadding
import
androidx.core.view.updatePadding
import
androidx.databinding.Bindable
import
androidx.databinding.Bindable
...
@@ -77,13 +78,9 @@ class MagiskDialog(
...
@@ -77,13 +78,9 @@ class MagiskDialog(
override
var
callbacks
:
PropertyChangeRegistry
?
=
null
override
var
callbacks
:
PropertyChangeRegistry
?
=
null
@get
:
Bindable
@get
:
Bindable
var
icon
=
0
var
icon
:
Drawable
?
=
null
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
icon
)
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
icon
)
@get
:
Bindable
var
iconRaw
:
Drawable
?
=
null
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
iconRaw
)
@get
:
Bindable
@get
:
Bindable
var
title
:
CharSequence
=
""
var
title
:
CharSequence
=
""
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
title
)
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
title
)
...
@@ -185,10 +182,12 @@ class MagiskDialog(
...
@@ -185,10 +182,12 @@ class MagiskDialog(
apply
{
data
.
message
=
message
}
apply
{
data
.
message
=
message
}
fun
applyIcon
(
@DrawableRes
drawableRes
:
Int
)
=
fun
applyIcon
(
@DrawableRes
drawableRes
:
Int
)
=
apply
{
data
.
icon
=
drawableRes
}
apply
{
data
.
icon
=
AppCompatResources
.
getDrawable
(
context
,
drawableRes
)
}
fun
applyIcon
(
drawable
:
Drawable
)
=
fun
applyIcon
(
drawable
:
Drawable
)
=
apply
{
data
.
icon
Raw
=
drawable
}
apply
{
data
.
icon
=
drawable
}
fun
applyButton
(
buttonType
:
ButtonType
,
builder
:
ButtonBuilder
.()
->
Unit
)
=
apply
{
fun
applyButton
(
buttonType
:
ButtonType
,
builder
:
ButtonBuilder
.()
->
Unit
)
=
apply
{
val
button
=
when
(
buttonType
)
{
val
button
=
when
(
buttonType
)
{
...
@@ -269,7 +268,7 @@ class MagiskDialog(
...
@@ -269,7 +268,7 @@ class MagiskDialog(
fun
resetTitle
()
=
applyTitle
(
""
)
fun
resetTitle
()
=
applyTitle
(
""
)
fun
resetMessage
()
=
applyMessage
(
""
)
fun
resetMessage
()
=
applyMessage
(
""
)
fun
resetIcon
()
=
apply
Icon
(
0
)
fun
resetIcon
()
=
apply
{
data
.
icon
=
null
}
fun
resetButtons
()
=
apply
{
fun
resetButtons
()
=
apply
{
ButtonType
.
values
().
forEach
{
ButtonType
.
values
().
forEach
{
...
...
app/src/main/res/layout/dialog_magisk_base.xml
View file @
feb0f4b7
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/item_list_single_line.xml
View file @
feb0f4b7
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</data>
</data>
<
androidx.appcompat.widget.AppCompat
TextView
<TextView
android:id=
"@android:id/text1"
android:id=
"@android:id/text1"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -28,4 +28,4 @@
...
@@ -28,4 +28,4 @@
android:textAppearance=
"@style/AppearanceFoundation.Body"
android:textAppearance=
"@style/AppearanceFoundation.Body"
tools:text=
"@tools:sample/lorem"
/>
tools:text=
"@tools:sample/lorem"
/>
</layout>
</layout>
\ No newline at end of file
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