mirror of
https://github.com/gsantner/dandelion
synced 2024-11-22 04:12:08 +01:00
Load README when ow pod URL gets called and no pod selected , fixes #193
This commit is contained in:
parent
51093e0c3d
commit
68be2f3a4a
2 changed files with 17 additions and 8 deletions
|
@ -333,19 +333,26 @@ public class MainActivity extends ThemedActivity
|
|||
*/
|
||||
public void openDiasporaUrl(final String url) {
|
||||
AppLog.v(this, "openDiasporaUrl()");
|
||||
if (url.startsWith(_appSettings.getPod().getPodUrl().getBaseUrl()) && !url.startsWith("https://dia.so/")) {
|
||||
if (url != null && url.startsWith("http://127.0.0.1")) {
|
||||
// This URL seems to be called somehow, but it doesn't make sense ;)
|
||||
toolbarTop.postDelayed(() -> {
|
||||
Intent i = new Intent(ACTION_OPEN_EXTERNAL_URL);
|
||||
i.putExtra(EXTRA_URL, "https://github.com/Diaspora-for-Android/dandelion/blob/master/README.md");
|
||||
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(i);
|
||||
}, 1000);
|
||||
return;
|
||||
}
|
||||
if (_appSettings.getPod() != null && _appSettings.getPod().getPodUrl() != null && _appSettings.getPod().getPodUrl().getBaseUrl() != null
|
||||
&& url.startsWith(_appSettings.getPod().getPodUrl().getBaseUrl()) && !url.startsWith("https://dia.so/")) {
|
||||
DiasporaStreamFragment streamFragment = (DiasporaStreamFragment) getFragment(DiasporaStreamFragment.TAG);
|
||||
showFragment(streamFragment);
|
||||
showLastVisitedTimestampMessageIfNeeded(url);
|
||||
streamFragment.loadUrl(url);
|
||||
} else {
|
||||
toolbarTop.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
toolbarTop.postDelayed(() -> {
|
||||
Intent i = new Intent(ACTION_OPEN_EXTERNAL_URL);
|
||||
i.putExtra(EXTRA_URL, url);
|
||||
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(i);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,6 +108,8 @@ public class CustomTabsHelper {
|
|||
sPackageNameToUse = CHROMIUM;
|
||||
} else if (packagesSupportingCustomTabs.contains(FENNEC)) {
|
||||
sPackageNameToUse = FENNEC;
|
||||
}else if (packagesSupportingCustomTabs.contains(KLAR)) {
|
||||
sPackageNameToUse = KLAR;
|
||||
}
|
||||
return sPackageNameToUse;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue