mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-09 18:43:23 +02:00
Added in-app changelog
This commit is contained in:
@@ -87,6 +87,7 @@ import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
|
||||
@@ -1105,6 +1106,19 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
if (prefs.getBoolean("first", true))
|
||||
new FragmentDialogFirst().show(getSupportFragmentManager(), "first");
|
||||
else if (!BuildConfig.PLAY_STORE_RELEASE) {
|
||||
String current = BuildConfig.VERSION_NAME + "-" + BuildConfig.REVISION;
|
||||
String last = prefs.getString("changelog", current);
|
||||
if (!Objects.equals(current, last)) {
|
||||
prefs.edit().putString("changelog", current).apply();
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString("name", "CHANGELOG.md");
|
||||
FragmentDialogMarkdown fragment = new FragmentDialogMarkdown();
|
||||
fragment.setArguments(args);
|
||||
fragment.show(getSupportFragmentManager(), "changelog");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkBanner() {
|
||||
|
||||
@@ -120,12 +120,6 @@ public class FragmentAbout extends FragmentBase {
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(Menu menu) {
|
||||
menu.findItem(R.id.menu_changelog).setVisible(!TextUtils.isEmpty(BuildConfig.CHANGELOG));
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int itemId = item.getItemId();
|
||||
@@ -140,7 +134,11 @@ public class FragmentAbout extends FragmentBase {
|
||||
}
|
||||
|
||||
private void onMenuChangelog() {
|
||||
Helper.view(getContext(), Uri.parse(BuildConfig.CHANGELOG), false);
|
||||
Bundle args = new Bundle();
|
||||
args.putString("name", "CHANGELOG.md");
|
||||
FragmentDialogMarkdown fragment = new FragmentDialogMarkdown();
|
||||
fragment.setArguments(args);
|
||||
fragment.show(getParentFragmentManager(), "changelog");
|
||||
}
|
||||
|
||||
private void onMenuAttribution() {
|
||||
@@ -148,6 +146,6 @@ public class FragmentAbout extends FragmentBase {
|
||||
args.putString("name", "ATTRIBUTION.md");
|
||||
FragmentDialogMarkdown fragment = new FragmentDialogMarkdown();
|
||||
fragment.setArguments(args);
|
||||
fragment.show(getParentFragmentManager(), "privacy");
|
||||
fragment.show(getParentFragmentManager(), "attribution");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user