1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-29 07:42:08 +01:00
Feature #38
This commit is contained in:
Gregor Santner 2016-07-30 17:02:57 +02:00 committed by GitHub
commit 1d2a428df6
2 changed files with 195 additions and 29 deletions

View file

@ -34,13 +34,7 @@
android:theme="@style/AppTheme.NoActionBar" android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateHidden" > android:windowSoftInputMode="stateHidden" >
</activity> </activity>
<activity
android:name=".activity.MainActivity"
android:launchMode="singleInstance"
android:windowSoftInputMode="adjustPan"
android:theme="@style/AppTheme.NoActionBar"
android:label="@string/diaspora">
</activity>
<activity <activity
android:name=".activity.SettingsActivity" android:name=".activity.SettingsActivity"
android:launchMode="singleInstance" android:launchMode="singleInstance"
@ -67,7 +61,6 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" /> <data android:mimeType="image/*" />
</intent-filter>--> </intent-filter>-->
</activity> </activity>
<service <service
@ -76,8 +69,165 @@
android:exported="false" > android:exported="false" >
</service> </service>
<activity
android:name=".activity.MainActivity"
android:launchMode="singleInstance"
android:windowSoftInputMode="adjustPan"
android:theme="@style/AppTheme.NoActionBar"
android:label="@string/diaspora">
<!-- Intent from Web Browser / Mail / IM / Clickable Link -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!--@@@ PODLIST START-->
<data android:host="austriapod.at" android:scheme="https" />
<data android:host="berdaguermontes.eu" android:scheme="https" />
<data android:host="berlinspora.de" android:scheme="https" />
<data android:host="canfly.org" android:scheme="https" />
<data android:host="community.kanalinseln.de" android:scheme="https" />
<data android:host="cryptospora.net" android:scheme="https" />
<data android:host="d.consumium.org" android:scheme="https" />
<data android:host="despora.de" android:scheme="https" />
<data android:host="dia.manuelbichler.at" android:scheme="https" />
<data android:host="dia.myocastor.de" android:scheme="https" />
<data android:host="diapod.net" android:scheme="https" />
<data android:host="diapod.org" android:scheme="https" />
<data android:host="diasp.ca" android:scheme="https" />
<data android:host="diasp.cz" android:scheme="https" />
<data android:host="diasp.de" android:scheme="https" />
<data android:host="diasp.eu" android:scheme="https" />
<data android:host="diasp.eu.com" android:scheme="https" />
<data android:host="diasp.nl" android:scheme="https" />
<data android:host="diaspod.de" android:scheme="https" />
<data android:host="diaspora.alfter.us" android:scheme="https" />
<data android:host="diaspora.bohramt.de" android:scheme="https" />
<data android:host="diasporabr.com.br" android:scheme="https" />
<data android:host="diaspora.com.ar" android:scheme="https" />
<data android:host="diaspora.deadhexagon.com" android:scheme="https" />
<data android:host="diaspora.digitalismus.org" android:scheme="https" />
<data android:host="diaspora.dorf-post.de" android:scheme="https" />
<data android:host="diaspora.espiritolivre.org" android:scheme="https" />
<data android:host="diaspora-fr.org" android:scheme="https" />
<data android:host="diaspora.hzsogood.net" android:scheme="https" />
<data android:host="diaspora.kapper.net" android:scheme="https" />
<data android:host="diaspora.koehn.com" android:scheme="https" />
<data android:host="diaspora.kosebamse.com" android:scheme="https" />
<data android:host="diaspora.lebarjack.com" android:scheme="https" />
<data android:host="diaspora.mazi.tk" android:scheme="https" />
<data android:host="diaspora.moosje.nl" android:scheme="https" />
<data android:host="diaspora.net.gr" android:scheme="https" />
<data android:host="diaspora.permutationsofchaos.com" android:scheme="https" />
<data android:host="diaspora.pimpmypony.eu" android:scheme="https" />
<data android:host="diaspora.pingupod.de" android:scheme="https" />
<data android:host="diaspora.podzimek.org" android:scheme="https" />
<data android:host="diaspora.poleni.com" android:scheme="https" />
<data android:host="diasporapr.tk" android:scheme="https" />
<data android:host="diaspora.psyco.fr" android:scheme="https" />
<data android:host="diaspora.punkbeer.me" android:scheme="https" />
<data android:host="diaspora.raven-ip.com" android:scheme="https" />
<data android:host="diaspora.retrodigital.net" android:scheme="https" />
<data android:host="diaspora.sceal.ie" android:scheme="https" />
<data android:host="diaspora.schrauger.com" android:scheme="https" />
<data android:host="diaspora.slowb.ro" android:scheme="https" />
<data android:host="diaspora.soh.re" android:scheme="https" />
<data android:host="diaspora.subsignal.org" android:scheme="https" />
<data android:host="diaspora.trash-talk.de" android:scheme="https" />
<data android:host="diaspora.undernet.uy" android:scheme="https" />
<data android:host="diasporausa.com" android:scheme="https" />
<data android:host="diasp.org" android:scheme="https" />
<data android:host="espora.social" android:scheme="https" />
<data android:host="failure.net" android:scheme="https" />
<data android:host="flokk.no" android:scheme="https" />
<data android:host="framasphere.org" android:scheme="https" />
<data android:host="freehuman.fr" android:scheme="https" />
<data android:host="idoru.pl" android:scheme="https" />
<data android:host="iliketoast.net" android:scheme="https" />
<data android:host="joindiaspora.com" android:scheme="https" />
<data android:host="jons.gr" android:scheme="https" />
<data android:host="kapok.se" android:scheme="https" />
<data android:host="karmasphe.re" android:scheme="https" />
<data android:host="kosmospora.net" android:scheme="https" />
<data android:host="laba.mba" android:scheme="https" />
<data android:host="legends.im" android:scheme="https" />
<data android:host="liberdade.digital" android:scheme="https" />
<data android:host="libertypod.org" android:scheme="https" />
<data android:host="LibertyPod.org" android:scheme="https" />
<data android:host="librenet.co.za" android:scheme="https" />
<data android:host="librenet.gr" android:scheme="https" />
<data android:host="misamigos.online" android:scheme="https" />
<data android:host="mondiaspora.net" android:scheme="https" />
<data android:host="nerdpol.ch" android:scheme="https" />
<data android:host="networkwizard.de" android:scheme="https" />
<data android:host="nx-pod.de" android:scheme="https" />
<data android:host="parteidervernunft.com" android:scheme="https" />
<data android:host="pod.4ray.co" android:scheme="https" />
<data android:host="pod.alterworld.info" android:scheme="https" />
<data android:host="pod.asap-soft.com" android:scheme="https" />
<data android:host="podbay.net" android:scheme="https" />
<data android:host="pod.cannyfoxx.me" android:scheme="https" />
<data android:host="pod.cyberdungeon.de" android:scheme="https" />
<data android:host="pod.dapor.net" android:scheme="https" />
<data android:host="pod.datenknoten.me" android:scheme="https" />
<data android:host="poddery.com" android:scheme="https" />
<data android:host="pod.diaspora.software" android:scheme="https" />
<data android:host="pod.dirkomatik.de" android:scheme="https" />
<data android:host="pod.disroot.org" android:scheme="https" />
<data android:host="pod.gedankenausbruch.com" android:scheme="https" />
<data android:host="pod.geraspora.de" android:scheme="https" />
<data android:host="pod.gleisnetze.de" android:scheme="https" />
<data android:host="pod.goodsharing.at" android:scheme="https" />
<data android:host="pod.hashtagueule.fr" android:scheme="https" />
<data android:host="pod.hfrc.de" android:scheme="https" />
<data android:host="pod.hoizi.net" android:scheme="https" />
<data android:host="pod.itabs.nl" android:scheme="https" />
<data android:host="pod.jpope.org" android:scheme="https" />
<data android:host="pod.kepow.org" android:scheme="https" />
<data android:host="pod.liebeleu.de" android:scheme="https" />
<data android:host="pod.neikos.me" android:scheme="https" />
<data android:host="pod.nomorestars.com" android:scheme="https" />
<data android:host="pod.orkz.net" android:scheme="https" />
<data android:host="pod.ponk.pink" android:scheme="https" />
<data android:host="pod.promedol.com" android:scheme="https" />
<data android:host="pod.psynet.su" android:scheme="https" />
<data android:host="pod.ros-it.ch" android:scheme="https" />
<data android:host="pod.sccn.club" android:scheme="https" />
<data android:host="pod.sertelon.fr" android:scheme="https" />
<data android:host="pod.storel.li" android:scheme="https" />
<data android:host="pod.tchncs.de" android:scheme="https" />
<data android:host="pod.thomasdalichow.de" android:scheme="https" />
<data android:host="pod.undreaming.org" android:scheme="https" />
<data android:host="pubpod.alqualonde.org" android:scheme="https" />
<data android:host="realms.the-wizard.co.za" android:scheme="https" />
<data android:host="ruhrspora.de" android:scheme="https" />
<data android:host="russiandiaspora.org" android:scheme="https" />
<data android:host="sechat.org" android:scheme="https" />
<data android:host="shrekislove.us" android:scheme="https" />
<data android:host="social.acclaro.digital" android:scheme="https" />
<data android:host="social.baldr.io" android:scheme="https" />
<data android:host="social.daxbau.net" android:scheme="https" />
<data android:host="social.elaon.de" android:scheme="https" />
<data android:host="socializer.cc" android:scheme="https" />
<data android:host="social.mbuto.me" android:scheme="https" />
<data android:host="spora.zone" android:scheme="https" />
<data android:host="subvillage.de" android:scheme="https" />
<data android:host="sysad.org" android:scheme="https" />
<data android:host="teki.be" android:scheme="https" />
<data android:host="therealtalk.org" android:scheme="https" />
<data android:host="thinkopen.net" android:scheme="https" />
<data android:host="tippentappen.de" android:scheme="https" />
<data android:host="united.zkp.fr" android:scheme="https" />
<data android:host="whatsnewz.com" android:scheme="https" />
<data android:host="wk3.org" android:scheme="https" />
<data android:host="www.datataffel.dk" android:scheme="https" />
<data android:host="www.diasporaix.de" android:scheme="https" />
<!--@@@ PODLIST END-->
</intent-filter>
</activity>
</application> </application>
</manifest> </manifest>

View file

@ -279,7 +279,8 @@ public class MainActivity extends AppCompatActivity
//Set proxy //Set proxy
if (appSettings.isProxyEnabled()) { if (appSettings.isProxyEnabled()) {
if(!setProxy()) Toast.makeText(this, R.string.toast_set_proxy_failed, Toast.LENGTH_LONG).show(); if (!setProxy())
Toast.makeText(this, R.string.toast_set_proxy_failed, Toast.LENGTH_LONG).show();
} }
/* /*
@ -431,16 +432,30 @@ public class MainActivity extends AppCompatActivity
} }
private void handleIntent(Intent intent) { private void handleIntent(Intent intent) {
if (intent == null) {
return;
}
String action = intent.getAction(); String action = intent.getAction();
String loadUrl = null;
if (ACTION_OPEN_URL.equals(action)) { if (ACTION_OPEN_URL.equals(action)) {
String url = intent.getStringExtra(URL_MESSAGE); loadUrl = intent.getStringExtra(URL_MESSAGE);
webView.loadUrl(url); } else if (Intent.ACTION_VIEW.equals(action) && intent.getDataString() != null) {
loadUrl = intent.getDataString();
} else if (ACTION_CHANGE_ACCOUNT.equals(action)) { } else if (ACTION_CHANGE_ACCOUNT.equals(action)) {
app.resetPodData(webView); app.resetPodData(webView);
Helpers.animateToActivity(MainActivity.this, PodSelectionActivity.class, true); Helpers.animateToActivity(MainActivity.this, PodSelectionActivity.class, true);
} else if (ACTION_CLEAR_CACHE.equals(action)) { } else if (ACTION_CLEAR_CACHE.equals(action)) {
webView.clearCache(true); webView.clearCache(true);
} }
if (loadUrl != null) {
webView.stopLoading();
navDrawer.closeDrawers();
webView.loadUrl(loadUrl);
}
} }
@Override @Override
@ -1001,6 +1016,7 @@ public class MainActivity extends AppCompatActivity
/** /**
* Set proxy according to arguments. host must not be "" or null, port must be positive. * Set proxy according to arguments. host must not be "" or null, port must be positive.
* Return true on success and update appSettings' proxy related values. * Return true on success and update appSettings' proxy related values.
*
* @param host proxy host (eg. localhost or 127.0.0.1) * @param host proxy host (eg. localhost or 127.0.0.1)
* @param port proxy port (eg. 8118) * @param port proxy port (eg. 8118)
* @return success * @return success