Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkaW committed Jul 30, 2019
1 parent 1bc0981 commit 726cd9a
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ task clean(type: Delete) {

def gitCommitId = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def gitCommitCount = Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim())
def baseVersionName = '3.4.4'
def baseVersionName = '3.4.5'

ext {
androidXLibraryVersion = '1.0.0'
Expand Down
5 changes: 5 additions & 0 deletions manager/src/main/java/moe/shizuku/manager/Helps.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class Helps {

public static final MultiLocaleEntity ADB = new MultiLocaleEntity();
public static final MultiLocaleEntity APPS = new MultiLocaleEntity();
public static final MultiLocaleEntity HOME = new MultiLocaleEntity();

static {
ADB.put("zh-CN", "https://shizuku.rikka.app/zh-hans/guide/setup.html#%E8%AE%BE%E5%A4%87%E6%9C%AA-root");
Expand All @@ -15,5 +16,9 @@ public class Helps {
APPS.put("zh-CN", "https://shizuku.rikka.app/zh-hans/apps.html");
APPS.put("zh-TW", "https://shizuku.rikka.app/zh-hant/apps.html");
APPS.put("en", "https://shizuku.rikka.app/apps.html");

HOME.put("zh-CN", "https://shizuku.rikka.app/zh-hans/");
HOME.put("zh-TW", "https://shizuku.rikka.app/zh-hant/");
HOME.put("en", "https://shizuku.rikka.app/");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import moe.shizuku.api.ShizukuService;
import moe.shizuku.manager.ShizukuManagerSettings;
import moe.shizuku.manager.ShizukuManagerSettings.LaunchMethod;
import moe.shizuku.manager.viewholder.GetAppsViewHolder;
import moe.shizuku.manager.viewholder.LearnMoreViewHolder;
import moe.shizuku.manager.viewholder.ManageAppsViewHolder;
import moe.shizuku.manager.viewholder.ServerStatusViewHolder;
import moe.shizuku.manager.viewholder.StartAdbViewHolder;
Expand Down Expand Up @@ -71,7 +71,8 @@ public void updateData(Context context) {

}

addItem(GetAppsViewHolder.CREATOR, null, 4);
//addItem(GetAppsViewHolder.CREATOR, null, 4);
addItem(LearnMoreViewHolder.CREATOR, null, 5);

notifyDataSetChanged();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package moe.shizuku.manager.viewholder;

import android.view.View;

import moe.shizuku.manager.Helps;
import moe.shizuku.manager.R;
import moe.shizuku.manager.utils.CustomTabsHelper;
import moe.shizuku.support.recyclerview.BaseViewHolder;

public class LearnMoreViewHolder extends BaseViewHolder<Object> {

public static final Creator<Object> CREATOR = (inflater, parent) -> new LearnMoreViewHolder(inflater.inflate(R.layout.item_home_learn_more, parent, false));

public LearnMoreViewHolder(View itemView) {
super(itemView);

itemView.setOnClickListener(v -> CustomTabsHelper.launchUrlOrCopy(v.getContext(), Helps.HOME.get()));
}
}
9 changes: 9 additions & 0 deletions manager/src/main/res/drawable/ic_learn_more_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"/>
</vector>
45 changes: 45 additions & 0 deletions manager/src/main/res/layout/item_home_learn_more.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
style="?homeCardStyle"
android:gravity="center_vertical"
android:orientation="horizontal">

<moe.shizuku.manager.widget.MaterialCircleIconView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:duplicateParentState="true"
android:importantForAccessibility="no"
android:src="@drawable/ic_learn_more_24dp"
app:iconColorName="blue_grey" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:duplicateParentState="true"
android:orientation="vertical">

<moe.shizuku.support.widget.HtmlCompatTextView
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:duplicateParentState="true"
android:textAppearance="@android:style/TextAppearance.Material.Body2"
android:textSize="16sp"
app:htmlText="@string/learn_more" />

<moe.shizuku.support.widget.HtmlCompatTextView
android:id="@android:id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:duplicateParentState="true"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
app:htmlText="@string/learn_more_summary" />

</LinearLayout>

</LinearLayout>
3 changes: 2 additions & 1 deletion manager/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@
<string name="dialog_cannot_open_browser_title">无法启动浏览器</string>
<string name="toast_copied_to_clipboard_with_text"><![CDATA[<b>%s</b> 已被复制到剪贴板。]]></string>
<string name="get_more_summary">查看使用 Shizuku 的应用</string>

<string name="learn_more">了解 Shizuku</string>
<string name="learn_more_summary">了解如何使用 Shizuku 开发或查看使用 Shizuku 的应用</string>
</resources>
2 changes: 2 additions & 0 deletions manager/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
<string name="dialog_cannot_open_browser_title">無法啟動瀏覽器</string>
<string name="toast_copied_to_clipboard_with_text"><![CDATA[<b>%s</b> 已被複制到剪貼簿。]]></string>
<string name="get_more_summary">檢視使用 Shizuku 的應用程式</string>
<string name="learn_more">瞭解 Shizuku</string>
<string name="learn_more_summary">瞭解如何使用 Shizuku 開發或檢視使用 Shizuku 的程式</string>

</resources>
2 changes: 2 additions & 0 deletions manager/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
<string name="dialog_cannot_open_browser_title">無法啟動瀏覽器</string>
<string name="toast_copied_to_clipboard_with_text"><![CDATA[<b>%s</b> 已被複制到剪貼簿。]]></string>
<string name="get_more_summary">檢視使用 Shizuku 的應用程式</string>
<string name="learn_more">瞭解 Shizuku</string>
<string name="learn_more_summary">瞭解如何使用 Shizuku 開發或檢視使用 Shizuku 的程式</string>

</resources>
2 changes: 2 additions & 0 deletions manager/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,6 @@
<string name="dialog_cannot_open_browser_title">Can\'t start browser</string>
<string name="toast_copied_to_clipboard_with_text"><![CDATA[<b>%s</b> has been copied to clipboard.]]></string>
<string name="get_more_summary">View apps using Shizuku</string>
<string name="learn_more">Learn Shizuku</string>
<string name="learn_more_summary">Learn how to develop with Shizuku or get apps using Shizuku</string>
</resources>

0 comments on commit 726cd9a

Please sign in to comment.