mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 04:33:54 -04:00
Remove duplicate help/welcome page methods
This commit is contained in:
parent
b6c2c4a725
commit
ca1edaf950
@ -706,7 +706,7 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.menu_help:
|
case R.id.menu_help:
|
||||||
showHelp();
|
showHelpPage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.menu_openfile:
|
case R.id.menu_openfile:
|
||||||
@ -789,7 +789,7 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
isFullscreenOpened = false;
|
isFullscreenOpened = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void showWelcomePage() {
|
public void showHelpPage() {
|
||||||
getCurrentWebView().loadUrl("file:///android_res/raw/welcome.html");
|
getCurrentWebView().loadUrl("file:///android_res/raw/welcome.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,11 +803,6 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void showHelp() {
|
|
||||||
newTab();
|
|
||||||
getCurrentWebView().loadUrl("file:///android_res/raw/welcome.html");
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean openZimFile(File file, boolean clearHistory) {
|
public boolean openZimFile(File file, boolean clearHistory) {
|
||||||
if (file.canRead() || Build.VERSION.SDK_INT < 19 || (Constants.IS_CUSTOM_APP
|
if (file.canRead() || Build.VERSION.SDK_INT < 19 || (Constants.IS_CUSTOM_APP
|
||||||
&& Build.VERSION.SDK_INT != 23)) {
|
&& Build.VERSION.SDK_INT != 23)) {
|
||||||
@ -836,14 +831,14 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, getResources().getString(R.string.error_fileinvalid),
|
Toast.makeText(this, getResources().getString(R.string.error_fileinvalid),
|
||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
showWelcomePage();
|
showHelpPage();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG_KIWIX, "ZIM file doesn't exist at " + file.getAbsolutePath());
|
Log.e(TAG_KIWIX, "ZIM file doesn't exist at " + file.getAbsolutePath());
|
||||||
|
|
||||||
Toast.makeText(this, getResources().getString(R.string.error_filenotfound), Toast.LENGTH_LONG)
|
Toast.makeText(this, getResources().getString(R.string.error_filenotfound), Toast.LENGTH_LONG)
|
||||||
.show();
|
.show();
|
||||||
showWelcomePage();
|
showHelpPage();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -1574,7 +1569,7 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
} else {
|
} else {
|
||||||
Log.d(TAG_KIWIX,
|
Log.d(TAG_KIWIX,
|
||||||
" Kiwix normal start, no zimFile loaded last time -> display welcome page");
|
" Kiwix normal start, no zimFile loaded last time -> display welcome page");
|
||||||
showWelcomePage();
|
showHelpPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public class KiwixWebViewClient extends WebViewClient {
|
|||||||
@Override
|
@Override
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
if ((url.equals("content://org.kiwix.zim.base/null")) && !Constants.IS_CUSTOM_APP) {
|
if ((url.equals("content://org.kiwix.zim.base/null")) && !Constants.IS_CUSTOM_APP) {
|
||||||
callback.showWelcomePage();
|
callback.showHelpPage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!url.equals("file:///android_res/raw/welcome.html")) {
|
if (!url.equals("file:///android_res/raw/welcome.html")) {
|
||||||
|
@ -9,7 +9,7 @@ public interface WebViewCallback {
|
|||||||
|
|
||||||
void webViewFailedLoading(String failingUrl);
|
void webViewFailedLoading(String failingUrl);
|
||||||
|
|
||||||
void showWelcomePage();
|
void showHelpPage();
|
||||||
|
|
||||||
void openExternalUrl(Intent intent);
|
void openExternalUrl(Intent intent);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user