Merge commit 'refs/merge-requests/45' of gitorious.org:f-droid/fdroidclient
Conflicts: src/org/fdroid/fdroid/AppDetails.java
This commit is contained in:
commit
e04a9f9682
@ -120,6 +120,8 @@
|
||||
<string name="menu_source">Source Code</string>
|
||||
<string name="menu_market">Market</string>
|
||||
<string name="menu_update">Update</string>
|
||||
<string name="menu_bitcoin">Bitcoin</string>
|
||||
<string name="menu_flattr">Flattr</string>
|
||||
<string name="menu_donate">Donate</string>
|
||||
|
||||
<string name="details_installed">Version %s installed</string>
|
||||
|
@ -162,9 +162,11 @@ public class AppDetails extends ListActivity {
|
||||
private static final int ISSUES = Menu.FIRST + 3;
|
||||
private static final int SOURCE = Menu.FIRST + 4;
|
||||
private static final int MARKET = Menu.FIRST + 5;
|
||||
private static final int DONATE = Menu.FIRST + 6;
|
||||
private static final int LAUNCH = Menu.FIRST + 7;
|
||||
private static final int SHARE = Menu.FIRST + 8;
|
||||
private static final int BITCOIN = Menu.FIRST + 6;
|
||||
private static final int FLATTR = Menu.FIRST + 7;
|
||||
private static final int DONATE = Menu.FIRST + 8;
|
||||
private static final int LAUNCH = Menu.FIRST + 9;
|
||||
private static final int SHARE = Menu.FIRST + 10;
|
||||
|
||||
private DB.App app;
|
||||
private int app_currentvercode;
|
||||
@ -613,8 +615,16 @@ public class AppDetails extends ListActivity {
|
||||
}
|
||||
menu.add(Menu.NONE, MARKET, 5, R.string.menu_market).setIcon(
|
||||
android.R.drawable.ic_menu_view);
|
||||
if (app.detail_bitcoinAddr != null) {
|
||||
menu.add(Menu.NONE, BITCOIN, 6, R.string.menu_bitcoin).setIcon(
|
||||
android.R.drawable.ic_menu_view);
|
||||
}
|
||||
if (app.detail_flattrID != null) {
|
||||
menu.add(Menu.NONE, FLATTR, 7, R.string.menu_flattr).setIcon(
|
||||
android.R.drawable.ic_menu_view);
|
||||
}
|
||||
if (app.detail_donateURL != null) {
|
||||
menu.add(Menu.NONE, DONATE, 6, R.string.menu_donate).setIcon(
|
||||
menu.add(Menu.NONE, DONATE, 8, R.string.menu_donate).setIcon(
|
||||
android.R.drawable.ic_menu_view);
|
||||
}
|
||||
|
||||
@ -671,9 +681,14 @@ public class AppDetails extends ListActivity {
|
||||
tryOpenUri("https://play.google.com/store/apps/details?id=" + app.id);
|
||||
return true;
|
||||
|
||||
// TODO: Separate donate links if there are many (e.g. paypal and
|
||||
// bitcoin) and use their link schemas if possible.
|
||||
// http://f-droid.org/repository/issues/?do=view_issue&issue=212
|
||||
case BITCOIN:
|
||||
tryOpenUri("bitcoin:" + app.detail_bitcoinAddr);
|
||||
return true;
|
||||
|
||||
case FLATTR:
|
||||
tryOpenUri("https://flattr.com/thing/" + app.detail_flattrID);
|
||||
return true;
|
||||
|
||||
case DONATE:
|
||||
tryOpenUri(app.detail_donateURL);
|
||||
return true;
|
||||
|
@ -95,6 +95,7 @@ public class DB {
|
||||
+ "webURL text, " + "trackerURL text, " + "sourceURL text, "
|
||||
+ "curVersion text," + "curVercode integer,"
|
||||
+ "antiFeatures string," + "donateURL string,"
|
||||
+ "bitcoinAddr string," + "flattrID string,"
|
||||
+ "requirements string," + "category string," + "added string,"
|
||||
+ "lastUpdated string," + "compatible int not null,"
|
||||
+ "primary key(id));";
|
||||
@ -111,6 +112,7 @@ public class DB {
|
||||
detail_trackerURL = null;
|
||||
detail_sourceURL = null;
|
||||
detail_donateURL = null;
|
||||
detail_bitcoinAddr = null;
|
||||
detail_webURL = null;
|
||||
antiFeatures = null;
|
||||
requirements = null;
|
||||
@ -153,6 +155,14 @@ public class DB {
|
||||
// Null when !detail_Populated
|
||||
public String detail_donateURL;
|
||||
|
||||
// Bitcoin donate address, or null
|
||||
// Null when !detail_Populated
|
||||
public String detail_bitcoinAddr;
|
||||
|
||||
// Flattr donate ID, or null
|
||||
// Null when !detail_Populated
|
||||
public String detail_flattrID;
|
||||
|
||||
public String curVersion;
|
||||
public int curVercode;
|
||||
public Date added;
|
||||
@ -605,7 +615,7 @@ public class DB {
|
||||
}
|
||||
|
||||
private static final String[] POPULATE_APP_COLS = new String[] {"description", "webURL",
|
||||
"trackerURL", "sourceURL", "donateURL" };
|
||||
"trackerURL", "sourceURL", "donateURL", "bitcoinAddr", "flattrID" };
|
||||
|
||||
private void populateAppDetails(App app) {
|
||||
Cursor cursor = null;
|
||||
@ -618,6 +628,8 @@ public class DB {
|
||||
app.detail_trackerURL = cursor.getString(2);
|
||||
app.detail_sourceURL = cursor.getString(3);
|
||||
app.detail_donateURL = cursor.getString(4);
|
||||
app.detail_bitcoinAddr = cursor.getString(5);
|
||||
app.detail_flattrID = cursor.getString(6);
|
||||
app.detail_Populated = true;
|
||||
} catch (Exception e) {
|
||||
Log.d("FDroid", "Error populating app details " + app.id );
|
||||
@ -1193,6 +1205,8 @@ public class DB {
|
||||
values.put("trackerURL", upapp.detail_trackerURL);
|
||||
values.put("sourceURL", upapp.detail_sourceURL);
|
||||
values.put("donateURL", upapp.detail_donateURL);
|
||||
values.put("bitcoinAddr", upapp.detail_bitcoinAddr);
|
||||
values.put("flattrID", upapp.detail_flattrID);
|
||||
values.put("added",
|
||||
upapp.added == null ? "" : mDateFormat.format(upapp.added));
|
||||
values.put(
|
||||
|
@ -204,6 +204,10 @@ public class RepoXMLHandler extends DefaultHandler {
|
||||
curapp.detail_sourceURL = str;
|
||||
} else if (curel.equals("donate")) {
|
||||
curapp.detail_donateURL = str;
|
||||
} else if (curel.equals("bitcoin")) {
|
||||
curapp.detail_bitcoinAddr = str;
|
||||
} else if (curel.equals("flattr")) {
|
||||
curapp.detail_flattrID = str;
|
||||
} else if (curel.equals("web")) {
|
||||
curapp.detail_webURL = str;
|
||||
} else if (curel.equals("tracker")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user