Skip to content

Commit

Permalink
add updateReminder
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleydu committed Jul 29, 2020
1 parent 8bce789 commit c71118b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,15 @@ public boolean onNavigationItemSelected(@NonNull MenuItem item) {
mDrawerLayout.closeDrawer(GravityCompat.START);
break;
case R.id.drawer_comiclist:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.home_page_comiclist_url)));
Intent intentBaidu = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.home_page_comiclist_url)));
try {
startActivity(intentBaidu);
} catch (Exception e) {
showSnackbar(R.string.about_resource_fail);
}
break;
case R.id.drawer_comicUpdate:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.about_update_url)));
try {
startActivity(intent);
} catch (Exception e) {
Expand Down Expand Up @@ -443,6 +451,8 @@ public void onNightSwitch() {
@Override
public void onUpdateReady() {
HintUtils.showToast(this, R.string.main_ready_update);

mNavigationView.getMenu().findItem(R.id.drawer_comicUpdate).setVisible(true);
// Update.update(this);
}

Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@
android:id="@+id/drawer_comiclist"
android:icon="@drawable/ic_class_black_24dp"
android:title="@string/drawer_list"/>
<item
android:visible="false"
android:id="@+id/drawer_comicUpdate"
android:title="@string/drawer_update"/>
</group>
</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<string name="drawer_light">日間模式</string>
<string name="drawer_night">夜間模式</string>
<string name="drawer_backup">備份</string>
<string name="drawer_update">非最新版本請點擊更新</string>

<string name="main_double_click">再按一次退出</string>
<string name="main_last_read_fail">讀取最後閱讀失敗</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
<string name="drawer_light">日间模式</string>
<string name="drawer_night">夜间模式</string>
<string name="drawer_backup">备份</string>
<string name="drawer_update">非最新版本请点击更新</string>

<string name="main_double_click">再按一次退出</string>
<string name="main_last_read_fail">读取最后阅读失败</string>
<string name="main_notice">欢迎使用</string>
<string name="main_notice_content">有问题上github或gitter留言</string>
<string name="main_notice_content">有问题上github或gitter留言 \n 本软件为免费软件</string>
<string name="main_permission">权限请求</string>
<string name="main_permission_content">下载、备份还原与保存图片功能需要访问SD卡的权限!\n如果没有存储权限,将会出现设置功能将闪退,备份功能无法使用等问题。请在之后的弹出框中确定授予权限!</string>
<string name="main_permission_success">授权成功</string>
Expand Down

0 comments on commit c71118b

Please sign in to comment.