Add share (via fdroid://details?id=app.id) button
This commit is contained in:
parent
234b39acb7
commit
89f8630f12
@ -108,6 +108,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<string name="menu_launch">Run</string>
|
<string name="menu_launch">Run</string>
|
||||||
|
<string name="menu_share">Share</string>
|
||||||
<string name="menu_install">Install</string>
|
<string name="menu_install">Install</string>
|
||||||
<string name="menu_uninstall">Uninstall</string>
|
<string name="menu_uninstall">Uninstall</string>
|
||||||
<string name="menu_website">Website</string>
|
<string name="menu_website">Website</string>
|
||||||
|
@ -163,6 +163,7 @@ public class AppDetails extends ListActivity {
|
|||||||
private static final int MARKET = Menu.FIRST + 5;
|
private static final int MARKET = Menu.FIRST + 5;
|
||||||
private static final int DONATE = Menu.FIRST + 6;
|
private static final int DONATE = Menu.FIRST + 6;
|
||||||
private static final int LAUNCH = Menu.FIRST + 7;
|
private static final int LAUNCH = Menu.FIRST + 7;
|
||||||
|
private static final int SHARE = Menu.FIRST + 8;
|
||||||
|
|
||||||
private DB.App app;
|
private DB.App app;
|
||||||
private int app_currentvercode;
|
private int app_currentvercode;
|
||||||
@ -562,6 +563,9 @@ public class AppDetails extends ListActivity {
|
|||||||
android.R.drawable.ic_media_play));
|
android.R.drawable.ic_media_play));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
toShow.add(menu.add( Menu.NONE, SHARE, 1, R.string.menu_share).setIcon(
|
||||||
|
android.R.drawable.ic_menu_share));
|
||||||
|
|
||||||
if (app.detail_webURL.length() > 0) {
|
if (app.detail_webURL.length() > 0) {
|
||||||
menu.add(Menu.NONE, WEBSITE, 2, R.string.menu_website).setIcon(
|
menu.add(Menu.NONE, WEBSITE, 2, R.string.menu_website).setIcon(
|
||||||
android.R.drawable.ic_menu_view);
|
android.R.drawable.ic_menu_view);
|
||||||
@ -608,6 +612,10 @@ public class AppDetails extends ListActivity {
|
|||||||
launchApk(app.id);
|
launchApk(app.id);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case SHARE:
|
||||||
|
shareApp(app);
|
||||||
|
return true;
|
||||||
|
|
||||||
case INSTALL:
|
case INSTALL:
|
||||||
// Note that this handles updating as well as installing.
|
// Note that this handles updating as well as installing.
|
||||||
curapk = app.getCurrentVersion();
|
curapk = app.getCurrentVersion();
|
||||||
@ -734,6 +742,16 @@ public class AppDetails extends ListActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void shareApp(DB.App app) {
|
||||||
|
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
||||||
|
shareIntent.setType("text/plain");
|
||||||
|
|
||||||
|
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, app.name);
|
||||||
|
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "fdroid://details?id="+app.id);
|
||||||
|
|
||||||
|
startActivity(Intent.createChooser(shareIntent, getString(R.string.menu_share)));
|
||||||
|
}
|
||||||
|
|
||||||
private ProgressDialog createProgressDialog(String file, int p, int max) {
|
private ProgressDialog createProgressDialog(String file, int p, int max) {
|
||||||
final ProgressDialog pd = new ProgressDialog(this);
|
final ProgressDialog pd = new ProgressDialog(this);
|
||||||
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user