Add basic dogecoin donation support
This commit is contained in:
parent
a189ff6e4e
commit
1e4fe9fa2c
@ -9,6 +9,7 @@
|
||||
|
||||
<string name="menu_bitcoin">Bitcoin</string>
|
||||
<string name="menu_litecoin">Litecoin</string>
|
||||
<string name="menu_dogecoin">Dogecoin</string>
|
||||
<string name="menu_flattr">Flattr</string>
|
||||
|
||||
<string-array name="updateIntervalValues">
|
||||
|
@ -193,8 +193,9 @@ public class AppDetails extends ListActivity {
|
||||
private static final int DONATE = Menu.FIRST + 9;
|
||||
private static final int BITCOIN = Menu.FIRST + 10;
|
||||
private static final int LITECOIN = Menu.FIRST + 11;
|
||||
private static final int FLATTR = Menu.FIRST + 12;
|
||||
private static final int DONATE_URL = Menu.FIRST + 13;
|
||||
private static final int DOGECOIN = Menu.FIRST + 12;
|
||||
private static final int FLATTR = Menu.FIRST + 13;
|
||||
private static final int DONATE_URL = Menu.FIRST + 14;
|
||||
|
||||
private DB.App app;
|
||||
private String appid;
|
||||
@ -705,6 +706,7 @@ public class AppDetails extends ListActivity {
|
||||
}
|
||||
|
||||
if (app.detail_bitcoinAddr != null || app.detail_litecoinAddr != null ||
|
||||
app.detail_dogecoinAddr != null ||
|
||||
app.detail_flattrID != null || app.detail_donateURL != null) {
|
||||
SubMenu donate = menu.addSubMenu(Menu.NONE, DONATE, 7,
|
||||
R.string.menu_donate).setIcon(
|
||||
@ -713,6 +715,8 @@ public class AppDetails extends ListActivity {
|
||||
donate.add(Menu.NONE, BITCOIN, 8, R.string.menu_bitcoin);
|
||||
if (app.detail_litecoinAddr != null)
|
||||
donate.add(Menu.NONE, LITECOIN, 8, R.string.menu_litecoin);
|
||||
if (app.detail_dogecoinAddr != null)
|
||||
donate.add(Menu.NONE, DOGECOIN, 8, R.string.menu_dogecoin);
|
||||
if (app.detail_flattrID != null)
|
||||
donate.add(Menu.NONE, FLATTR, 9, R.string.menu_flattr);
|
||||
if (app.detail_donateURL != null)
|
||||
@ -794,6 +798,10 @@ public class AppDetails extends ListActivity {
|
||||
tryOpenUri("litecoin:" + app.detail_litecoinAddr);
|
||||
return true;
|
||||
|
||||
case DOGECOIN:
|
||||
tryOpenUri("dogecoin:" + app.detail_dogecoinAddr);
|
||||
return true;
|
||||
|
||||
case FLATTR:
|
||||
tryOpenUri("https://flattr.com/thing/" + app.detail_flattrID);
|
||||
return true;
|
||||
|
@ -99,6 +99,7 @@ public class DB {
|
||||
+ "curVersion text," + "curVercode integer,"
|
||||
+ "antiFeatures string," + "donateURL string,"
|
||||
+ "bitcoinAddr string," + "litecoinAddr string,"
|
||||
+ "dogecoinAddr string,"
|
||||
+ "flattrID string," + "requirements string,"
|
||||
+ "categories string," + "added string,"
|
||||
+ "lastUpdated string," + "compatible int not null,"
|
||||
@ -119,6 +120,7 @@ public class DB {
|
||||
detail_donateURL = null;
|
||||
detail_bitcoinAddr = null;
|
||||
detail_litecoinAddr = null;
|
||||
detail_dogecoinAddr = null;
|
||||
detail_webURL = null;
|
||||
categories = null;
|
||||
provides = null;
|
||||
@ -175,6 +177,10 @@ public class DB {
|
||||
// Null when !detail_Populated
|
||||
public String detail_litecoinAddr;
|
||||
|
||||
// Dogecoin donate address, or null
|
||||
// Null when !detail_Populated
|
||||
public String detail_dogecoinAddr;
|
||||
|
||||
// Flattr donate ID, or null
|
||||
// Null when !detail_Populated
|
||||
public String detail_flattrID;
|
||||
@ -461,7 +467,7 @@ public class DB {
|
||||
public String lastetag; // last etag we updated from, null forces update
|
||||
}
|
||||
|
||||
private final int DBVersion = 31;
|
||||
private final int DBVersion = 32;
|
||||
|
||||
private static void createAppApk(SQLiteDatabase db) {
|
||||
db.execSQL(CREATE_TABLE_APP);
|
||||
@ -730,7 +736,7 @@ public class DB {
|
||||
|
||||
private static final String[] POPULATE_APP_COLS = new String[] {
|
||||
"description", "webURL", "trackerURL", "sourceURL",
|
||||
"donateURL", "bitcoinAddr", "flattrID", "litecoinAddr" };
|
||||
"donateURL", "bitcoinAddr", "flattrID", "litecoinAddr", "dogecoinAddr" };
|
||||
|
||||
private void populateAppDetails(App app) {
|
||||
Cursor cursor = null;
|
||||
@ -746,6 +752,7 @@ public class DB {
|
||||
app.detail_bitcoinAddr = cursor.getString(5);
|
||||
app.detail_flattrID = cursor.getString(6);
|
||||
app.detail_litecoinAddr = cursor.getString(7);
|
||||
app.detail_dogecoinAddr = cursor.getString(8);
|
||||
app.detail_Populated = true;
|
||||
} catch (Exception e) {
|
||||
Log.d("FDroid", "Error populating app details " + app.id );
|
||||
@ -1247,6 +1254,7 @@ public class DB {
|
||||
values.put("donateURL", upapp.detail_donateURL);
|
||||
values.put("bitcoinAddr", upapp.detail_bitcoinAddr);
|
||||
values.put("litecoinAddr", upapp.detail_litecoinAddr);
|
||||
values.put("dogecoinAddr", upapp.detail_dogecoinAddr);
|
||||
values.put("flattrID", upapp.detail_flattrID);
|
||||
values.put("added",
|
||||
upapp.added == null ? "" : mDateFormat.format(upapp.added));
|
||||
|
Loading…
x
Reference in New Issue
Block a user