Skip to content

Commit 47e9648

Browse files
author
维术
committed
[Exposed-UI] Add alert for icon.
1 parent 517d38f commit 47e9648

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

VirtualApp/app/src/main/java/io/virtualapp/home/HomeActivity.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.annotation.SuppressLint;
66
import android.content.Context;
77
import android.content.Intent;
8+
import android.content.SharedPreferences;
89
import android.graphics.Canvas;
910
import android.graphics.Color;
1011
import android.os.Bundle;
@@ -13,6 +14,7 @@
1314
import android.os.Process;
1415
import android.os.RemoteException;
1516
import android.os.SystemClock;
17+
import android.preference.PreferenceManager;
1618
import android.support.annotation.Nullable;
1719
import android.support.v7.app.AlertDialog;
1820
import android.support.v7.widget.OrientationHelper;
@@ -126,6 +128,24 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
126128
new HomePresenterImpl(this).start();
127129
VirtualCore.get().registerObserver(mPackageObserver);
128130
alertForMeizu();
131+
mUiHandler.postDelayed(() -> {
132+
final String alertForIcon = "showIconAlert";
133+
SharedPreferences defaultSp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
134+
boolean show = defaultSp.getBoolean(alertForIcon, true);
135+
defaultSp.edit().putBoolean(alertForIcon, false).apply();
136+
if (show) {
137+
AlertDialog alertDialog = new AlertDialog.Builder(this, R.style.Theme_AppCompat_DayNight_Dialog_Alert)
138+
.setTitle(R.string.about_icon_title)
139+
.setMessage(R.string.about_icon_content)
140+
.setPositiveButton(R.string.about_icon_yes, null)
141+
.create();
142+
try {
143+
alertDialog.show();
144+
} catch (Throwable ignored) {
145+
// BadTokenException.
146+
}
147+
}
148+
}, 5000);
129149
}
130150

131151
@Override

VirtualApp/app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@
4747
<string name="donate_dialog_yes">去支付宝捐赠</string>
4848
<string name="donate_dialog_no">先不了哈,加油~</string>
4949
<string name="large_app_install_tips">安装大型APP可能需要花费较长的时间,请耐心等待~</string>
50+
<string name="about_icon_title">关于图标</string>
51+
<string name="about_icon_content">如果你不喜欢这个图标,赶紧为VAExposed设计一个吧!哈哈哈哈哈,我知道你们这些设计师肯定会看不下去的,啊哈哈哈</string>
52+
<string name="about_icon_yes">。。。。</string>
5053
</resources>

VirtualApp/app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,8 @@
5151
<string name="donate_dialog_yes">Donate</string>
5252
<string name="donate_dialog_no">Cancel</string>
5353
<string name="large_app_install_tips">Installation time may take a while, please be patient :)</string>
54+
<string name="about_icon_title">About Icon</string>
55+
<string name="about_icon_content">If you do not like my new icon, welcome to design a new icon for VAExposed</string>
56+
<string name="about_icon_yes">OK</string>
5457

5558
</resources>

0 commit comments

Comments
 (0)