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
6977dc08
Commit
6977dc08
authored
Feb 01, 2020
by
Viktor De Pasquale
Committed by
John Wu
Feb 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed texts being incorrect if injected from context
parent
d3dffe81
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
ApplicationModule.kt
...rc/main/java/com/topjohnwu/magisk/di/ApplicationModule.kt
+2
-1
TransitiveText.kt
...rc/main/java/com/topjohnwu/magisk/utils/TransitiveText.kt
+2
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/di/ApplicationModule.kt
View file @
6977dc08
...
...
@@ -8,6 +8,7 @@ import android.os.Build
import
android.os.Bundle
import
androidx.localbroadcastmanager.content.LocalBroadcastManager
import
androidx.preference.PreferenceManager
import
com.topjohnwu.magisk.core.ResourceMgr
import
com.topjohnwu.magisk.utils.RxBus
import
org.koin.core.qualifier.named
import
org.koin.dsl.module
...
...
@@ -17,7 +18,7 @@ val Protected = named("protected")
val
applicationModule
=
module
{
single
{
RxBus
()
}
factory
{
get
<
Context
>().
resources
}
factory
{
ResourceMgr
.
resource
}
factory
{
get
<
Context
>().
packageManager
}
factory
(
Protected
)
{
createDEContext
(
get
())
}
single
(
SUTimeout
)
{
get
<
Context
>(
Protected
).
getSharedPreferences
(
"su_timeout"
,
0
)
}
...
...
app/src/main/java/com/topjohnwu/magisk/utils/TransitiveText.kt
View file @
6977dc08
...
...
@@ -4,6 +4,7 @@ import android.content.res.Resources
import
android.widget.TextView
import
androidx.databinding.BindingAdapter
import
androidx.databinding.InverseBindingAdapter
import
com.topjohnwu.magisk.extensions.get
sealed
class
TransitiveText
{
...
...
@@ -47,7 +48,7 @@ fun CharSequence.asTransitive() = TransitiveText.String(this)
@BindingAdapter
(
"android:text"
)
fun
TextView
.
setText
(
text
:
TransitiveText
)
{
this
.
text
=
text
.
getText
(
resources
)
this
.
text
=
text
.
getText
(
get
()
)
}
@InverseBindingAdapter
(
attribute
=
"android:text"
,
event
=
"android:textAttrChanged"
)
...
...
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