mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-04 03:06:41 -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) {
|
private boolean openZimFile(File file, boolean clearHistory) {
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
if (ZimContentProvider.setZimFile(file.getAbsolutePath())!=null) {
|
if (ZimContentProvider.setZimFile(file.getAbsolutePath())!=null) {
|
||||||
|
|
||||||
|
|
||||||
|
getActionBar().setSubtitle(ZimContentProvider.getZimFileTitle());
|
||||||
//Apparently with webView.clearHistory() only
|
//Apparently with webView.clearHistory() only
|
||||||
// history before currently (fully) loaded page is cleared
|
// history before currently (fully) loaded page is cleared
|
||||||
// -> request clear, actual clear done after load.
|
// -> request clear, actual clear done after load.
|
||||||
|
@ -58,6 +58,19 @@ public class ZimContentProvider extends ContentProvider {
|
|||||||
public static String getZimFile() {
|
public static String getZimFile() {
|
||||||
return zimFileName;
|
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() {
|
public static String getMainPage() {
|
||||||
if (jniKiwix==null)
|
if (jniKiwix==null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user