Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
6e4dd864
Commit
6e4dd864
authored
Feb 04, 2020
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly respect dynamic resources
parent
4499d088
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
core/src/main/java/com/github/shadowsocks/plugin/ResolvedPlugin.kt
...main/java/com/github/shadowsocks/plugin/ResolvedPlugin.kt
+2
-2
mobile/src/main/java/com/github/shadowsocks/preference/PluginPreferenceDialogFragment.kt
.../shadowsocks/preference/PluginPreferenceDialogFragment.kt
+3
-2
plugin/CHANGES.md
plugin/CHANGES.md
+1
-1
No files found.
core/src/main/java/com/github/shadowsocks/plugin/ResolvedPlugin.kt
View file @
6e4dd864
...
...
@@ -44,8 +44,8 @@ abstract class ResolvedPlugin(protected val resolveInfo: ResolveInfo) : Plugin()
else
->
error
(
"unknown type for plugin meta-data idAliases"
)
}
}
override
val
label
:
CharSequence
by
lazy
{
resolveInfo
.
loadLabel
(
app
.
packageManager
)
}
override
val
icon
:
Drawable
by
lazy
{
resolveInfo
.
loadIcon
(
app
.
packageManager
)
}
override
val
label
:
CharSequence
get
()
=
resolveInfo
.
loadLabel
(
app
.
packageManager
)
override
val
icon
:
Drawable
get
()
=
resolveInfo
.
loadIcon
(
app
.
packageManager
)
override
val
defaultConfig
by
lazy
{
componentInfo
.
metaData
.
loadString
(
PluginContract
.
METADATA_KEY_DEFAULT_CONFIG
)
{
resources
}
}
...
...
mobile/src/main/java/com/github/shadowsocks/preference/PluginPreferenceDialogFragment.kt
View file @
6e4dd864
...
...
@@ -62,12 +62,13 @@ class PluginPreferenceDialogFragment : PreferenceDialogFragmentCompat() {
fun
bind
(
plugin
:
Plugin
,
selected
:
Boolean
=
false
)
{
this
.
plugin
=
plugin
text1
.
text
=
plugin
.
label
val
label
=
plugin
.
label
text1
.
text
=
label
text2
.
text
=
plugin
.
id
val
typeface
=
if
(
selected
)
Typeface
.
BOLD
else
Typeface
.
NORMAL
text1
.
setTypeface
(
null
,
typeface
)
text2
.
setTypeface
(
null
,
typeface
)
text2
.
isVisible
=
plugin
.
id
.
isNotEmpty
()
&&
plugin
.
label
!=
plugin
.
id
text2
.
isVisible
=
plugin
.
id
.
isNotEmpty
()
&&
label
!=
plugin
.
id
icon
.
setImageDrawable
(
plugin
.
icon
)
}
...
...
plugin/CHANGES.md
View file @
6e4dd864
...
...
@@ -2,7 +2,7 @@
*
Optional new metadata
`com.github.shadowsocks.plugin.id.aliases`
for plugin ID aliases;
(see doc for
`PluginContract.METADATA_KEY_ID_ALIASES`
and main documentation "Plugin ID Aliasing" for more information)
*
Please use
`android:path`
instead of
`android:pathPrefix`
, sample code in documentations have been updated to reflect this recommendation.
*
You can now use
`android:resources`
on
`meta-data`
tags. (main/host app update required)
*
You can now use
`android:resources`
on
`meta-data`
tags. (main/host app update required
, however, you should never use dynamic resources
)
*
Fix occasional crash in
`AlertDialogFragment`
.
*
Translation updates.
*
Dependency updates:
...
...
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