mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
android Set subtitle to zimfile title.
null apparently just clear subtitle which is fine
This commit is contained in:
parent
5f79e60402
commit
ab3dd2048c
@ -378,6 +378,9 @@ public class KiwixMobileActivity extends Activity {
|
||||
private boolean openZimFile(File file, boolean clearHistory) {
|
||||
if (file.exists()) {
|
||||
if (ZimContentProvider.setZimFile(file.getAbsolutePath())!=null) {
|
||||
|
||||
|
||||
getActionBar().setSubtitle(ZimContentProvider.getZimFileTitle());
|
||||
//Apparently with webView.clearHistory() only
|
||||
// history before currently (fully) loaded page is cleared
|
||||
// -> request clear, actual clear done after load.
|
||||
|
@ -58,7 +58,20 @@ public class ZimContentProvider extends ContentProvider {
|
||||
public static String getZimFile() {
|
||||
return zimFileName;
|
||||
}
|
||||
public static String getZimFileTitle() {
|
||||
if (jniKiwix==null)
|
||||
return null;
|
||||
else {
|
||||
JNIKiwixString title = new JNIKiwixString();
|
||||
if (jniKiwix.getTitle(title)) {
|
||||
return title.value;
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
|
||||
public native boolean getTitle(JNIKiwixString title);
|
||||
|
||||
public static String getMainPage() {
|
||||
if (jniKiwix==null)
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user