Show whether an apk is from source or a binary on the apk list

This commit is contained in:
Ciaran Gultnieks 2011-02-21 22:12:00 +00:00
parent 79ab3fe030
commit efcc7c6d8c
5 changed files with 26 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
local.properties local.properties
bin/* bin/*
proguard.cfg

View File

@ -6,6 +6,10 @@
<RelativeLayout android:layout_width="fill_parent" <RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="vertical"> android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:id="@+id/buildtype" android:textSize="12sp"
android:layout_alignParentRight="true" android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<TextView android:id="@+id/version" android:textStyle="bold" <TextView android:id="@+id/version" android:textStyle="bold"
android:singleLine="true" android:ellipsize="marquee" android:singleLine="true" android:ellipsize="marquee"
android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_height="wrap_content"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2010 Ciaran Gultnieks, ciaran@ciarang.com * Copyright (C) 2010-11 Ciaran Gultnieks, ciaran@ciarang.com
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -116,6 +116,12 @@ public class AppDetails extends ListActivity {
} else { } else {
size.setText(getFriendlySize(apk.size)); size.setText(getFriendlySize(apk.size));
} }
TextView buildtype = (TextView) v.findViewById(R.id.buildtype);
if(apk.srcname!=null) {
buildtype.setText("source");
} else {
buildtype.setText("bin");
}
return v; return v;
} }
} }

View File

@ -166,10 +166,14 @@ public class DB {
public String apkName; public String apkName;
// If null, the apk comes from the same server as the repo index. // If null, the apk comes from the same server as the repo index.
// Otherwise // Otherwise this is the complete URL to download the apk from.
// this is the complete URL to download the apk from.
public String apkSource; public String apkSource;
// If not null, this is the name of the source tarball for the
// application. Null indicates that it's a developer's binary
// build - otherwise it's built from source.
public String srcname;
// Used internally for tracking during repo updates. // Used internally for tracking during repo updates.
public boolean updated; public boolean updated;
@ -229,7 +233,10 @@ public class DB {
{ "alter table " + TABLE_REPO + " add pubkey string" }, { "alter table " + TABLE_REPO + " add pubkey string" },
// Version 8... // Version 8...
{ "alter table " + TABLE_APP + " add donateURL string" } }; { "alter table " + TABLE_APP + " add donateURL string" },
// Version 9...
{ "alter table " + TABLE_APK + " add srcname string" } };
private class DBHelper extends SQLiteOpenHelper { private class DBHelper extends SQLiteOpenHelper {
@ -421,6 +428,7 @@ public class DB {
apk.server = c2.getString(c2.getColumnIndex("server")); apk.server = c2.getString(c2.getColumnIndex("server"));
apk.hash = c2.getString(c2.getColumnIndex("hash")); apk.hash = c2.getString(c2.getColumnIndex("hash"));
apk.sig = c2.getString(c2.getColumnIndex("sig")); apk.sig = c2.getString(c2.getColumnIndex("sig"));
apk.srcname = c2.getString(c2.getColumnIndex("srcname"));
apk.size = c2.getInt(c2.getColumnIndex("size")); apk.size = c2.getInt(c2.getColumnIndex("size"));
apk.apkName = c2 apk.apkName = c2
.getString(c2.getColumnIndex("apkName")); .getString(c2.getColumnIndex("apkName"));
@ -665,6 +673,7 @@ public class DB {
values.put("server", upapk.server); values.put("server", upapk.server);
values.put("hash", upapk.hash); values.put("hash", upapk.hash);
values.put("sig", upapk.sig); values.put("sig", upapk.sig);
values.put("srcname", upapk.srcname);
values.put("size", upapk.size); values.put("size", upapk.size);
values.put("apkName", upapk.apkName); values.put("apkName", upapk.apkName);
values.put("apkSource", upapk.apkSource); values.put("apkSource", upapk.apkSource);

View File

@ -113,6 +113,8 @@ public class RepoXMLHandler extends DefaultHandler {
curapk.hash = str; curapk.hash = str;
} else if (curel == "sig") { } else if (curel == "sig") {
curapk.sig = str; curapk.sig = str;
} else if (curel == "srcname") {
curapk.srcname = str;
} else if (curel == "apkname") { } else if (curel == "apkname") {
curapk.apkName = str; curapk.apkName = str;
} else if (curel == "apksource") { } else if (curel == "apksource") {