From 2ed092c9db81004da51110997ea793d2a4f8f1d8 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 2 Jun 2022 06:08:47 -0700 Subject: [PATCH] Update contributors in app --- .../topjohnwu/magisk/ui/home/DeveloperItem.kt | 112 +++++++++++------- app/src/main/res/drawable/ic_favorite.xml | 5 + app/src/main/res/layout/fragment_home_md2.xml | 79 +++++++++++- app/src/main/res/layout/item_developer.xml | 9 +- app/src/main/res/layout/item_icon_link.xml | 4 +- app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 3 +- app/src/main/res/values/resources.xml | 1 + app/src/main/res/values/strings.xml | 1 + 9 files changed, 162 insertions(+), 53 deletions(-) create mode 100644 app/src/main/res/drawable/ic_favorite.xml diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt index f2b528161..4010937d8 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt @@ -4,42 +4,63 @@ import com.topjohnwu.magisk.R import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.databinding.RvItem -sealed class DeveloperItem { - - abstract val items: List - abstract val name: Int - - object Main : DeveloperItem() { - override val items = - listOf( - IconLink.Twitter.Main, - IconLink.Patreon, - IconLink.PayPal.Main, - IconLink.Github - ) - override val name get() = R.string.topjohnwu - } - - object App : DeveloperItem() { - override val items = - listOf( - IconLink.Twitter.App, - IconLink.PayPal.App - ) - override val name get() = R.string.diareuse - } -} - -private interface Dev { +interface Dev { val name: String } -private interface MainDev: Dev { +private interface JohnImpl : Dev { override val name get() = "topjohnwu" } -private interface AppDev: Dev { - override val name get() = "diareuse" +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 + val handle get() = "@${name}" + + object John : DeveloperItem(), JohnImpl { + override val items = + listOf( + object : IconLink.Twitter(), JohnImpl {}, + IconLink.Github.Project + ) + } + + object Vvb : DeveloperItem(), VvbImpl { + override val items = + listOf( + object : IconLink.Twitter(), VvbImpl {}, + object : IconLink.Github.User(), VvbImpl {} + ) + } + + object YU : DeveloperItem(), YUImpl { + override val items = + listOf( + object : IconLink.Twitter() { override val name = "shanasaimoe" }, + object : IconLink.Github.User(), YUImpl {}, + object : IconLink.Sponsor(), YUImpl {} + ) + } + + object Rikka : DeveloperItem(), RikkaImpl { + override val items = + listOf( + 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 - - object Main : Twitter(), MainDev } - object Github : IconLink() { + abstract class Github : IconLink() { override val icon get() = R.drawable.ic_github - override val title get() = R.string.home_item_source - override val link get() = Const.Url.SOURCE_CODE_URL + override val title get() = R.string.github + + abstract class User : Github(), Dev { + override val link get() = "https://github.com/$name" + } + + 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" } } diff --git a/app/src/main/res/drawable/ic_favorite.xml b/app/src/main/res/drawable/ic_favorite.xml new file mode 100644 index 000000000..52d28592a --- /dev/null +++ b/app/src/main/res/drawable/ic_favorite.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/fragment_home_md2.xml b/app/src/main/res/layout/fragment_home_md2.xml index 3ca1994a5..d1479da19 100644 --- a/app/src/main/res/layout/fragment_home_md2.xml +++ b/app/src/main/res/layout/fragment_home_md2.xml @@ -11,6 +11,8 @@ + + @@ -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"> + android:paddingTop="@dimen/l1" + android:paddingBottom="@dimen/l1"> + + + + + + + + + + + + + + + + + + + + + + + android:orientation="horizontal" + android:gravity="center_vertical" + android:paddingStart="@dimen/l1" + android:paddingEnd="@dimen/l1"> @@ -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" diff --git a/app/src/main/res/layout/item_icon_link.xml b/app/src/main/res/layout/item_icon_link.xml index 56d8dc6d5..386c24862 100644 --- a/app/src/main/res/layout/item_icon_link.xml +++ b/app/src/main/res/layout/item_icon_link.xml @@ -18,10 +18,10 @@ diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 074f633c9..730a4c024 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -22,6 +22,7 @@ 仅从官方 GitHub 页面下载 Magisk。未知来源的文件可能具有恶意行为! 支持开发 + 追踪我们 源代码 Magisk 将一直保持免费且开源,向开发者捐赠以表示支持。 当前 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 40dfc0bbe..1fb826062 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -21,7 +21,8 @@ 應用程式 請從官方的 Github 網頁下載 Magisk。從未知來源下載的檔案可能懷有惡意! - 支援我們 + 支持開發 + 追蹤我們 原始碼 Magisk 無論現在和未來永遠是免費且開源。但您可以透過發送小額的抖內來彰顯您對我們的支持。 已安裝 diff --git a/app/src/main/res/values/resources.xml b/app/src/main/res/values/resources.xml index eb98877e7..7b36b4a20 100644 --- a/app/src/main/res/values/resources.xml +++ b/app/src/main/res/values/resources.xml @@ -11,6 +11,7 @@ PayPal Patreon Twitter + GitHub @drawable/ic_logo diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5c177f893..0359f1e5c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -22,6 +22,7 @@ Download Magisk ONLY from the official GitHub page. Files from unknown sources can be malicious! Support Us + Follow Us Source Magisk is, and always will be, free, and open source. You can however show us that you care by making a donation. Installed