Skip to content

Commit

Permalink
Generify App Details
Browse files Browse the repository at this point in the history
*Get app details from Gradle instead of specifying manually in Strings.
  • Loading branch information
rayliverified committed Mar 12, 2018
1 parent db006bf commit 740124b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/stream/rocketnotes/SettingsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ public boolean onPreferenceClick(Preference arg0) {

//About
Preference pref = findPreference("settings_version");
pref.setTitle(getString(R.string.app_name) + " " + getString(R.string.app_version));
pref.setTitle(getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME);
itemVersion.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {

public boolean onPreferenceClick(Preference arg0) {
CustomAlertDialogue.Builder alert = new CustomAlertDialogue.Builder(getActivity())
.setStyle(CustomAlertDialogue.Style.DIALOGUE)
.setTitle(mContext.getString(R.string.app_name) + " " + mContext.getString(R.string.app_version))
.setTitle(mContext.getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME)
.setMessage("© Copyright 2017-2018 Stream Inc")
.setNegativeText("OK")
.setNegativeColor(R.color.positive)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void onClick(View view) {
try {
context.startActivity(intent);
} catch (android.content.ActivityNotFoundException ex) {
intent.setData(Uri.parse(String.format("https://play.google.com/store/apps/details?id=%s", context.getString(R.string.app_package))));
intent.setData(Uri.parse(String.format("https://play.google.com/store/apps/details?id=%s", BuildConfig.APPLICATION_ID)));
context.startActivity(intent);
}
} else if (PermissionUtils.isAppInstalled(context, "com.amazon.venezia")) {
Expand All @@ -123,7 +123,7 @@ public void onClick(View view) {
context.startActivity(intent);
}
} else {
intent.setData(Uri.parse(String.format("https://play.google.com/store/apps/details?id=%s", context.getString(R.string.app_package))));
intent.setData(Uri.parse(String.format("https://play.google.com/store/apps/details?id=%s", BuildConfig.APPLICATION_ID)));
context.startActivity(intent);
}
}
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<resources>
<string name="app_name">Rocket Notes</string>
<string name="app_version">v1.4.0</string>
<string name="app_package">stream.rocketnotes</string>

<!-- Settings Page -->
<string name="loading">Loading&#8230;</string>
Expand Down

0 comments on commit 740124b

Please sign in to comment.