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
2ed092c9
Commit
2ed092c9
authored
Jun 02, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update contributors in app
parent
5c6a7ffa
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
153 additions
and
44 deletions
+153
-44
DeveloperItem.kt
...c/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt
+61
-33
ic_favorite.xml
app/src/main/res/drawable/ic_favorite.xml
+5
-0
fragment_home_md2.xml
app/src/main/res/layout/fragment_home_md2.xml
+75
-4
item_developer.xml
app/src/main/res/layout/item_developer.xml
+5
-4
item_icon_link.xml
app/src/main/res/layout/item_icon_link.xml
+2
-2
strings.xml
app/src/main/res/values-zh-rCN/strings.xml
+1
-0
strings.xml
app/src/main/res/values-zh-rTW/strings.xml
+2
-1
resources.xml
app/src/main/res/values/resources.xml
+1
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt
View file @
2ed092c9
...
...
@@ -4,42 +4,63 @@ import com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.core.Const
import
com.topjohnwu.magisk.databinding.RvItem
sealed
class
DeveloperItem
{
interface
Dev
{
val
name
:
String
}
private
interface
JohnImpl
:
Dev
{
override
val
name
get
()
=
"topjohnwu"
}
private
interface
VvbImpl
:
Dev
{
override
val
name
get
()
=
"vvb2060"
}
private
interface
YUImpl
:
Dev
{
override
val
name
get
()
=
"yujincheng08"
}
private
interface
RikkaImpl
:
Dev
{
override
val
name
get
()
=
"RikkaW"
}
sealed
class
DeveloperItem
:
Dev
{
abstract
val
items
:
List
<
IconLink
>
abstract
val
name
:
Int
val
handle
get
()
=
"@${name}"
object
Main
:
DeveloperItem
()
{
object
John
:
DeveloperItem
(),
JohnImpl
{
override
val
items
=
listOf
(
IconLink
.
Twitter
.
Main
,
IconLink
.
Patreon
,
IconLink
.
PayPal
.
Main
,
IconLink
.
Github
object
:
IconLink
.
Twitter
(),
JohnImpl
{},
IconLink
.
Github
.
Project
)
override
val
name
get
()
=
R
.
string
.
topjohnwu
}
object
App
:
DeveloperItem
()
{
object
Vvb
:
DeveloperItem
(),
VvbImpl
{
override
val
items
=
listOf
<
IconLink
>(
IconLink
.
Twitter
.
App
,
IconLink
.
PayPal
.
App
object
:
IconLink
.
Twitter
(),
VvbImpl
{}
,
object
:
IconLink
.
Github
.
User
(),
VvbImpl
{}
)
override
val
name
get
()
=
R
.
string
.
diareuse
}
}
private
interface
Dev
{
val
name
:
String
}
private
interface
MainDev
:
Dev
{
override
val
name
get
()
=
"topjohnwu"
}
object
YU
:
DeveloperItem
(),
YUImpl
{
override
val
items
=
listOf
<
IconLink
>(
object
:
IconLink
.
Twitter
()
{
override
val
name
=
"shanasaimoe"
},
object
:
IconLink
.
Github
.
User
(),
YUImpl
{},
object
:
IconLink
.
Sponsor
(),
YUImpl
{}
)
}
private
interface
AppDev
:
Dev
{
override
val
name
get
()
=
"diareuse"
object
Rikka
:
DeveloperItem
(),
RikkaImpl
{
override
val
items
=
listOf
<
IconLink
>(
object
:
IconLink
.
Twitter
()
{
override
val
name
=
"rikkawww"
},
object
:
IconLink
.
Github
.
User
(),
RikkaImpl
{}
)
}
}
sealed
class
IconLink
:
RvItem
()
{
...
...
@@ -50,14 +71,12 @@ sealed class IconLink : RvItem() {
override
val
layoutRes
get
()
=
R
.
layout
.
item_icon_link
sealed
class
PayPal
:
IconLink
(),
Dev
{
abstract
class
PayPal
:
IconLink
(),
Dev
{
override
val
icon
get
()
=
R
.
drawable
.
ic_paypal
override
val
title
get
()
=
R
.
string
.
paypal
override
val
link
get
()
=
"https://paypal.me/$name"
object
App
:
PayPal
(),
AppDev
object
Main
:
PayPal
()
{
object
Project
:
PayPal
()
{
override
val
name
:
String
get
()
=
"magiskdonate"
}
}
...
...
@@ -68,19 +87,28 @@ sealed class IconLink : RvItem() {
override
val
link
get
()
=
Const
.
Url
.
PATREON_URL
}
sealed
class
Twitter
:
IconLink
(),
Dev
{
abstract
class
Twitter
:
IconLink
(),
Dev
{
override
val
icon
get
()
=
R
.
drawable
.
ic_twitter
override
val
title
get
()
=
R
.
string
.
twitter
override
val
link
get
()
=
"https://twitter.com/$name"
}
object
App
:
Twitter
(),
AppDev
abstract
class
Github
:
IconLink
()
{
override
val
icon
get
()
=
R
.
drawable
.
ic_github
override
val
title
get
()
=
R
.
string
.
github
object
Main
:
Twitter
(),
MainDev
abstract
class
User
:
Github
(),
Dev
{
override
val
link
get
()
=
"https://github.com/$name"
}
object
Github
:
IconLink
()
{
override
val
icon
get
()
=
R
.
drawable
.
ic_github
override
val
title
get
()
=
R
.
string
.
home_item_source
object
Project
:
Github
()
{
override
val
link
get
()
=
Const
.
Url
.
SOURCE_CODE_URL
}
}
abstract
class
Sponsor
:
IconLink
(),
Dev
{
override
val
icon
get
()
=
R
.
drawable
.
ic_favorite
override
val
title
get
()
=
R
.
string
.
github
override
val
link
get
()
=
"https://github.com/sponsors/$name"
}
}
app/src/main/res/drawable/ic_favorite.xml
0 → 100644
View file @
2ed092c9
<vector
android:height=
"24dp"
android:tint=
"#000000"
android:viewportHeight=
"24"
android:viewportWidth=
"24"
android:width=
"24dp"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<path
android:fillColor=
"@android:color/white"
android:pathData=
"M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z"
/>
</vector>
app/src/main/res/layout/fragment_home_md2.xml
View file @
2ed092c9
...
...
@@ -11,6 +11,8 @@
<import
type=
"com.topjohnwu.magisk.ui.home.DeveloperItem"
/>
<import
type=
"com.topjohnwu.magisk.ui.home.IconLink"
/>
<variable
name=
"viewModel"
type=
"com.topjohnwu.magisk.ui.home.HomeViewModel"
/>
...
...
@@ -131,14 +133,17 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_margin=
"@dimen/l1"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l1"
android:layout_marginTop=
"@dimen/l1"
android:focusable=
"false"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:paddingTop=
"@dimen/l1"
>
android:paddingTop=
"@dimen/l1"
android:paddingBottom=
"@dimen/l1"
>
<TextView
android:layout_width=
"match_parent"
...
...
@@ -157,8 +162,74 @@
android:text=
"@string/home_support_content"
android:textAppearance=
"@style/AppearanceFoundation.Caption.Variant"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:paddingTop=
"@dimen/l_50"
>
<include
item=
"@{IconLink.Patreon.INSTANCE}"
layout=
"@layout/item_icon_link"
viewModel=
"@{viewModel}"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
<include
item=
"@{IconLink.PayPal.Project.INSTANCE}"
layout=
"@layout/item_icon_link"
viewModel=
"@{viewModel}"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
style=
"@style/WidgetFoundation.Card"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_margin=
"@dimen/l1"
android:focusable=
"false"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:paddingTop=
"@dimen/l1"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l1"
android:text=
"@string/home_follow_title"
android:textAppearance=
"@style/AppearanceFoundation.Title"
/>
<include
item=
"@{DeveloperItem.John.INSTANCE}"
layout=
"@layout/item_developer"
viewModel=
"@{viewModel}"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/l_50"
/>
<include
item=
"@{DeveloperItem.Vvb.INSTANCE}"
layout=
"@layout/item_developer"
viewModel=
"@{viewModel}"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/l_50"
/>
<include
item=
"@{DeveloperItem.
Main
.INSTANCE}"
item=
"@{DeveloperItem.
YU
.INSTANCE}"
layout=
"@layout/item_developer"
viewModel=
"@{viewModel}"
android:layout_width=
"wrap_content"
...
...
@@ -166,7 +237,7 @@
android:layout_marginTop=
"@dimen/l_50"
/>
<include
item=
"@{DeveloperItem.
App
.INSTANCE}"
item=
"@{DeveloperItem.
Rikka
.INSTANCE}"
layout=
"@layout/item_developer"
viewModel=
"@{viewModel}"
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/item_developer.xml
View file @
2ed092c9
...
...
@@ -18,13 +18,15 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:padding=
"@dimen/l1"
>
android:orientation=
"horizontal"
android:gravity=
"center_vertical"
android:paddingStart=
"@dimen/l1"
android:paddingEnd=
"@dimen/l1"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@{item.
nam
e}"
android:text=
"@{item.
handl
e}"
android:textAppearance=
"@style/AppearanceFoundation.Caption"
android:textStyle=
"bold"
tools:text=
"\@topjohnwu"
/>
...
...
@@ -39,7 +41,6 @@
android:clipToPadding=
"false"
android:fadingEdgeLength=
"@dimen/l1"
android:orientation=
"horizontal"
android:paddingTop=
"@dimen/l_50"
android:requiresFadingEdge=
"horizontal"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount=
"3"
...
...
app/src/main/res/layout/item_icon_link.xml
View file @
2ed092c9
...
...
@@ -18,10 +18,10 @@
<FrameLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"?selectableItemBackground
Borderless
"
android:background=
"?selectableItemBackground"
android:clickable=
"true"
android:focusable=
"true"
android:minWidth=
"
60
dp"
android:minWidth=
"
48
dp"
android:onClick=
"@{() -> viewModel.onLinkPressed(item.link)}"
android:padding=
"@dimen/l_50"
tools:layout_gravity=
"center"
>
...
...
app/src/main/res/values-zh-rCN/strings.xml
View file @
2ed092c9
...
...
@@ -22,6 +22,7 @@
<string
name=
"home_notice_content"
>
仅从官方 GitHub 页面下载 Magisk。未知来源的文件可能具有恶意行为!
</string>
<string
name=
"home_support_title"
>
支持开发
</string>
<string
name=
"home_follow_title"
>
追踪我们
</string>
<string
name=
"home_item_source"
>
源代码
</string>
<string
name=
"home_support_content"
>
Magisk 将一直保持免费且开源,向开发者捐赠以表示支持。
</string>
<string
name=
"home_installed_version"
>
当前
</string>
...
...
app/src/main/res/values-zh-rTW/strings.xml
View file @
2ed092c9
...
...
@@ -21,7 +21,8 @@
<string
name=
"home_app_title"
>
應用程式
</string>
<string
name=
"home_notice_content"
>
請從官方的 Github 網頁下載 Magisk。從未知來源下載的檔案可能懷有惡意!
</string>
<string
name=
"home_support_title"
>
支援我們
</string>
<string
name=
"home_support_title"
>
支持開發
</string>
<string
name=
"home_follow_title"
>
追蹤我們
</string>
<string
name=
"home_item_source"
>
原始碼
</string>
<string
name=
"home_support_content"
>
Magisk 無論現在和未來永遠是免費且開源。但您可以透過發送小額的抖內來彰顯您對我們的支持。
</string>
<string
name=
"home_installed_version"
>
已安裝
</string>
...
...
app/src/main/res/values/resources.xml
View file @
2ed092c9
...
...
@@ -11,6 +11,7 @@
<string
name=
"paypal"
translatable=
"false"
>
PayPal
</string>
<string
name=
"patreon"
translatable=
"false"
>
Patreon
</string>
<string
name=
"twitter"
translatable=
"false"
>
Twitter
</string>
<string
name=
"github"
translatable=
"false"
>
GitHub
</string>
<drawable
name=
"ic_launcher"
>
@drawable/ic_logo
</drawable>
...
...
app/src/main/res/values/strings.xml
View file @
2ed092c9
...
...
@@ -22,6 +22,7 @@
<string
name=
"home_notice_content"
>
Download Magisk ONLY from the official GitHub page. Files from unknown sources can be malicious!
</string>
<string
name=
"home_support_title"
>
Support Us
</string>
<string
name=
"home_follow_title"
>
Follow Us
</string>
<string
name=
"home_item_source"
>
Source
</string>
<string
name=
"home_support_content"
>
Magisk is, and always will be, free, and open source. You can however show us that you care by making a donation.
</string>
<string
name=
"home_installed_version"
>
Installed
</string>
...
...
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