diff --git a/CHANGELOG.md b/CHANGELOG.md
index f88235c3a..bffe3ea6f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,8 @@
* Translation updates
+* Display license and author information in app details where appropriate
+
### 0.97 (2015-11-07)
* Add option to prompt for unstable updates globally
diff --git a/F-Droid/res/drawable-hdpi/ic_email.png b/F-Droid/res/drawable-hdpi/ic_email.png
new file mode 100644
index 000000000..0f27fd0c4
Binary files /dev/null and b/F-Droid/res/drawable-hdpi/ic_email.png differ
diff --git a/F-Droid/res/drawable-mdpi/ic_email.png b/F-Droid/res/drawable-mdpi/ic_email.png
new file mode 100644
index 000000000..af6cc2a9b
Binary files /dev/null and b/F-Droid/res/drawable-mdpi/ic_email.png differ
diff --git a/F-Droid/res/drawable-xhdpi/ic_email.png b/F-Droid/res/drawable-xhdpi/ic_email.png
new file mode 100644
index 000000000..69febc0bf
Binary files /dev/null and b/F-Droid/res/drawable-xhdpi/ic_email.png differ
diff --git a/F-Droid/res/drawable-xxhdpi/ic_email.png b/F-Droid/res/drawable-xxhdpi/ic_email.png
new file mode 100644
index 000000000..428911c95
Binary files /dev/null and b/F-Droid/res/drawable-xxhdpi/ic_email.png differ
diff --git a/F-Droid/res/drawable-xxxhdpi/ic_email.png b/F-Droid/res/drawable-xxxhdpi/ic_email.png
new file mode 100644
index 000000000..68832c96e
Binary files /dev/null and b/F-Droid/res/drawable-xxxhdpi/ic_email.png differ
diff --git a/F-Droid/res/layout/app_details_header.xml b/F-Droid/res/layout/app_details_header.xml
index d3b23cd73..622d895c1 100644
--- a/F-Droid/res/layout/app_details_header.xml
+++ b/F-Droid/res/layout/app_details_header.xml
@@ -73,6 +73,19 @@
android:baselineAligned="false"
android:orientation="vertical">
+
+
android:drawableStart="@drawable/ic_website"
android:text="@string/menu_website" />
+
+
It seems like this package is not compatible with your device. Do you want to try and install it anyway?
You are trying to downgrade this application. Doing so might get it to malfunction and even lose your data. Do you want to try and downgrade it anyway?
Version
+ by
Delete
Enable NFC Send…
Cache packages
@@ -115,6 +116,7 @@
Ignore All Updates
Ignore This Update
Website
+ E-Mail Author
Issues
Changelog
Source Code
diff --git a/F-Droid/src/org/fdroid/fdroid/AppDetails.java b/F-Droid/src/org/fdroid/fdroid/AppDetails.java
index ab9b4dc65..290d30138 100644
--- a/F-Droid/src/org/fdroid/fdroid/AppDetails.java
+++ b/F-Droid/src/org/fdroid/fdroid/AppDetails.java
@@ -1135,6 +1135,9 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
case R.id.website:
url = app.webURL;
break;
+ case R.id.email:
+ url = "mailto:" + app.email;
+ break;
case R.id.source:
url = app.sourceURL;
break;
@@ -1231,6 +1234,13 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
else
tv.setVisibility(View.GONE);
+ // Email button
+ tv = view.findViewById(R.id.email);
+ if (!TextUtils.isEmpty(app.email))
+ tv.setOnClickListener(mOnClickListener);
+ else
+ tv.setVisibility(View.GONE);
+
// Source button
tv = view.findViewById(R.id.source);
if (!TextUtils.isEmpty(app.sourceURL))
@@ -1586,9 +1596,14 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
btMain.setOnClickListener(mOnClickListener);
btMain.setEnabled(true);
}
+ TextView author = (TextView) view.findViewById(R.id.author);
+ if (!TextUtils.isEmpty(app.author)) {
+ author.setText(getString(R.string.by_author) + " " + app.author);
+ author.setVisibility(View.VISIBLE);
+ }
TextView currentVersion = (TextView) view.findViewById(R.id.current_version);
if (!getApks().isEmpty()) {
- currentVersion.setText(getApks().getItem(0).version);
+ currentVersion.setText(getApks().getItem(0).version + " (" + app.license + ")");
} else {
currentVersion.setVisibility(View.GONE);
btMain.setVisibility(View.GONE);
diff --git a/F-Droid/src/org/fdroid/fdroid/RepoXMLHandler.java b/F-Droid/src/org/fdroid/fdroid/RepoXMLHandler.java
index f6d5f6131..ff24611ba 100644
--- a/F-Droid/src/org/fdroid/fdroid/RepoXMLHandler.java
+++ b/F-Droid/src/org/fdroid/fdroid/RepoXMLHandler.java
@@ -167,6 +167,12 @@ public class RepoXMLHandler extends DefaultHandler {
case "license":
curapp.license = str;
break;
+ case "author":
+ curapp.author = str;
+ break;
+ case "email":
+ curapp.email = str;
+ break;
case "source":
curapp.sourceURL = str;
break;
diff --git a/F-Droid/src/org/fdroid/fdroid/data/App.java b/F-Droid/src/org/fdroid/fdroid/data/App.java
index 39b86cda4..db8c0d002 100644
--- a/F-Droid/src/org/fdroid/fdroid/data/App.java
+++ b/F-Droid/src/org/fdroid/fdroid/data/App.java
@@ -40,6 +40,9 @@ public class App extends ValueObject implements Comparable {
public String license = "Unknown";
+ public String author;
+ public String email;
+
public String webURL;
public String trackerURL;
@@ -139,6 +142,12 @@ public class App extends ValueObject implements Comparable {
case AppProvider.DataColumns.LICENSE:
license = cursor.getString(i);
break;
+ case AppProvider.DataColumns.AUTHOR:
+ author = cursor.getString(i);
+ break;
+ case AppProvider.DataColumns.EMAIL:
+ email = cursor.getString(i);
+ break;
case AppProvider.DataColumns.WEB_URL:
webURL = cursor.getString(i);
break;
@@ -374,6 +383,8 @@ public class App extends ValueObject implements Comparable {
values.put(AppProvider.DataColumns.ICON_URL_LARGE, iconUrlLarge);
values.put(AppProvider.DataColumns.DESCRIPTION, description);
values.put(AppProvider.DataColumns.LICENSE, license);
+ values.put(AppProvider.DataColumns.AUTHOR, author);
+ values.put(AppProvider.DataColumns.EMAIL, email);
values.put(AppProvider.DataColumns.WEB_URL, webURL);
values.put(AppProvider.DataColumns.TRACKER_URL, trackerURL);
values.put(AppProvider.DataColumns.SOURCE_URL, sourceURL);
diff --git a/F-Droid/src/org/fdroid/fdroid/data/AppProvider.java b/F-Droid/src/org/fdroid/fdroid/data/AppProvider.java
index 16a3d7c15..7f06c7451 100644
--- a/F-Droid/src/org/fdroid/fdroid/data/AppProvider.java
+++ b/F-Droid/src/org/fdroid/fdroid/data/AppProvider.java
@@ -179,6 +179,8 @@ public class AppProvider extends FDroidProvider {
String ICON = "icon";
String DESCRIPTION = "description";
String LICENSE = "license";
+ String AUTHOR = "author";
+ String EMAIL = "email";
String WEB_URL = "webURL";
String TRACKER_URL = "trackerURL";
String SOURCE_URL = "sourceURL";
@@ -212,8 +214,8 @@ public class AppProvider extends FDroidProvider {
String[] ALL = {
_ID, IS_COMPATIBLE, PACKAGE_NAME, NAME, SUMMARY, ICON, DESCRIPTION,
- LICENSE, WEB_URL, TRACKER_URL, SOURCE_URL, CHANGELOG_URL, DONATE_URL,
- BITCOIN_ADDR, LITECOIN_ADDR, FLATTR_ID,
+ LICENSE, AUTHOR, EMAIL, WEB_URL, TRACKER_URL, SOURCE_URL,
+ CHANGELOG_URL, DONATE_URL, BITCOIN_ADDR, LITECOIN_ADDR, FLATTR_ID,
UPSTREAM_VERSION, UPSTREAM_VERSION_CODE, ADDED, LAST_UPDATED,
CATEGORIES, ANTI_FEATURES, REQUIREMENTS, IGNORE_ALLUPDATES,
IGNORE_THISUPDATE, ICON_URL, ICON_URL_LARGE,
diff --git a/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java b/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java
index 5afead5e0..da0e1dd87 100644
--- a/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java
+++ b/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java
@@ -70,6 +70,8 @@ public class DBHelper extends SQLiteOpenHelper {
+ "icon text, "
+ "description text not null, "
+ "license text not null, "
+ + "author text, "
+ + "email text, "
+ "webURL text, "
+ "trackerURL text, "
+ "sourceURL text, "
@@ -104,7 +106,7 @@ public class DBHelper extends SQLiteOpenHelper {
+ " );";
private static final String DROP_TABLE_INSTALLED_APP = "DROP TABLE " + TABLE_INSTALLED_APP + ";";
- private static final int DB_VERSION = 52;
+ private static final int DB_VERSION = 53;
private final Context context;
@@ -288,6 +290,7 @@ public class DBHelper extends SQLiteOpenHelper {
updateIconUrlLarge(db, oldVersion);
recreateInstalledCache(db, oldVersion);
addCredentialsToRepo(db, oldVersion);
+ addAuthorToApp(db, oldVersion);
}
/**
@@ -458,6 +461,17 @@ public class DBHelper extends SQLiteOpenHelper {
}
}
+ private void addAuthorToApp(SQLiteDatabase db, int oldVersion) {
+ if (oldVersion < 53 && !columnExists(db, TABLE_APP, "author")) {
+ Utils.debugLog(TAG, "Adding author column to " + TABLE_APP);
+ db.execSQL("alter table " + TABLE_APP + " add column author text");
+ }
+ if (oldVersion < 53 && !columnExists(db, TABLE_APP, "email")) {
+ Utils.debugLog(TAG, "Adding email column to " + TABLE_APP);
+ db.execSQL("alter table " + TABLE_APP + " add column email text");
+ }
+ }
+
/**
* By clearing the etags stored in the repo table, it means that next time the user updates
* their repos (either manually or on a scheduled task), they will update regardless of whether