Skip to content

Commit

Permalink
[Exposed-UI] Add alert for icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
维术 committed Jan 26, 2018
1 parent 517d38f commit 47e9648
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions VirtualApp/app/src/main/java/io/virtualapp/home/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Color;
import android.os.Bundle;
Expand All @@ -13,6 +14,7 @@
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.OrientationHelper;
Expand Down Expand Up @@ -126,6 +128,24 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
new HomePresenterImpl(this).start();
VirtualCore.get().registerObserver(mPackageObserver);
alertForMeizu();
mUiHandler.postDelayed(() -> {
final String alertForIcon = "showIconAlert";
SharedPreferences defaultSp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
boolean show = defaultSp.getBoolean(alertForIcon, true);
defaultSp.edit().putBoolean(alertForIcon, false).apply();
if (show) {
AlertDialog alertDialog = new AlertDialog.Builder(this, R.style.Theme_AppCompat_DayNight_Dialog_Alert)
.setTitle(R.string.about_icon_title)
.setMessage(R.string.about_icon_content)
.setPositiveButton(R.string.about_icon_yes, null)
.create();
try {
alertDialog.show();
} catch (Throwable ignored) {
// BadTokenException.
}
}
}, 5000);
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions VirtualApp/app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@
<string name="donate_dialog_yes">去支付宝捐赠</string>
<string name="donate_dialog_no">先不了哈,加油~</string>
<string name="large_app_install_tips">安装大型APP可能需要花费较长的时间,请耐心等待~</string>
<string name="about_icon_title">关于图标</string>
<string name="about_icon_content">如果你不喜欢这个图标,赶紧为VAExposed设计一个吧!哈哈哈哈哈,我知道你们这些设计师肯定会看不下去的,啊哈哈哈</string>
<string name="about_icon_yes">。。。。</string>
</resources>
3 changes: 3 additions & 0 deletions VirtualApp/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,8 @@
<string name="donate_dialog_yes">Donate</string>
<string name="donate_dialog_no">Cancel</string>
<string name="large_app_install_tips">Installation time may take a while, please be patient :)</string>
<string name="about_icon_title">About Icon</string>
<string name="about_icon_content">If you do not like my new icon, welcome to design a new icon for VAExposed</string>
<string name="about_icon_yes">OK</string>

</resources>

0 comments on commit 47e9648

Please sign in to comment.