Commit 173fa739 authored by Rohit's avatar Rohit
Browse files

Updater: Adapt displayVersion to show proper versioning

parent 97cb9227
......@@ -269,7 +269,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
String buildDate = StringGenerator.getDateLocalizedUTC(mActivity,
DateFormat.LONG, update.getTimestamp());
String buildVersion = mActivity.getString(R.string.list_build_version,
update.getVersion());
update.getDisplayVersion());
if (!update.getAndroidVersion().equals(Build.VERSION.RELEASE)){
viewHolder.mUpgradeType.setVisibility(TextView.VISIBLE);
......@@ -472,7 +472,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
String buildDate = StringGenerator.getDateLocalizedUTC(mActivity,
DateFormat.MEDIUM, update.getTimestamp());
String buildInfoText = mActivity.getString(R.string.list_build_version_date,
update.getVersion(), buildDate);
update.getDisplayVersion(), buildDate);
if(update.getAndroidVersion().equals(Build.VERSION.RELEASE)){
title = R.string.apply_update_dialog_title;
......
......@@ -97,7 +97,11 @@ public class Utils {
update.setFileSize(object.getLong("size"));
update.setDownloadUrl(object.getString("url"));
update.setVersion(object.getString("version"));
update.setDisplayVersion(object.getString("display_version"));
if(object.has("pre_version") && !object.getString("pre_version").isEmpty()){
update.setDisplayVersion(object.getString("version") + "-" + object.getString("pre_version"));
} else {
update.setDisplayVersion(object.getString("version"));
}
update.setAndroidVersion(object.getString("android_version"));
return update;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment