mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-11 16:37:18 -04:00
Android bookmark icon correctly updates when switching tabs #10
This commit is contained in:
parent
e4a044c6c8
commit
f47f9406f4
@ -1,4 +1,5 @@
|
|||||||
1.98
|
1.98
|
||||||
|
FIXED: Bookmark icon correctly updates when switching tabs
|
||||||
NEW: Tabs reopen as you left them after app restart
|
NEW: Tabs reopen as you left them after app restart
|
||||||
|
|
||||||
1.97
|
1.97
|
||||||
|
@ -409,6 +409,9 @@ public class KiwixMobileActivity extends AppCompatActivity
|
|||||||
}, 150);
|
}, 150);
|
||||||
}
|
}
|
||||||
loadPrefs();
|
loadPrefs();
|
||||||
|
if (menu != null) {
|
||||||
|
refreshBookmarkSymbol(menu);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private KiwixWebView getCurrentWebView() {
|
private KiwixWebView getCurrentWebView() {
|
||||||
@ -972,7 +975,11 @@ public class KiwixMobileActivity extends AppCompatActivity
|
|||||||
@Override
|
@Override
|
||||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||||
super.onPrepareOptionsMenu(menu);
|
super.onPrepareOptionsMenu(menu);
|
||||||
|
refreshBookmarkSymbol(menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refreshBookmarkSymbol(Menu menu){
|
||||||
if (menu.findItem(R.id.menu_bookmarks) != null &&
|
if (menu.findItem(R.id.menu_bookmarks) != null &&
|
||||||
getCurrentWebView().getUrl() != null &&
|
getCurrentWebView().getUrl() != null &&
|
||||||
!getCurrentWebView().getUrl().equals("file:///android_res/raw/help.html") &&
|
!getCurrentWebView().getUrl().equals("file:///android_res/raw/help.html") &&
|
||||||
@ -984,7 +991,6 @@ public class KiwixMobileActivity extends AppCompatActivity
|
|||||||
menu.findItem(R.id.menu_bookmarks).setIcon(R.drawable.action_bookmark);
|
menu.findItem(R.id.menu_bookmarks).setIcon(R.drawable.action_bookmark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadPrefs() {
|
public void loadPrefs() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user