Also open web repo links right away

No fdid opens the app normally, listing all the apps. If fdid is present, that
app is opened.
This commit is contained in:
Daniel Martí 2013-07-28 09:23:53 +02:00
parent eead91385e
commit aa164dd090
2 changed files with 23 additions and 1 deletions

View File

@ -39,6 +39,18 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="f-droid.org"
android:path="/repository/browse" />
<data android:scheme="https" android:host="f-droid.org"
android:path="/repository/browse" />
</intent-filter>
<meta-data
android:name="android.app.default_searchable"
android:value=".SearchResults" />

View File

@ -83,7 +83,17 @@ public class FDroid extends FragmentActivity {
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
Intent i = getIntent();
if (i.hasExtra("uri")) {
Uri data = getIntent().getData();
if (data != null) {
String appid = data.getQueryParameter("fdid");
// If appid == null, we just browse all the apps.
// If appid != null, we browse the app specified.
if (appid != null) {
Intent call = new Intent(this, AppDetails.class);
call.putExtra("appid", appid);
startActivityForResult(call, REQUEST_APPDETAILS);
}
} else if (i.hasExtra("uri")) {
Intent call = new Intent(this, ManageRepo.class);
call.putExtra("uri", i.getStringExtra("uri"));
startActivityForResult(call, REQUEST_MANAGEREPOS);