show report when the user enables the Send to F-Droid Metrics pref

This commit is contained in:
Hans-Christoph Steiner 2021-02-25 09:38:30 +01:00
parent a207798f5c
commit d558d396ed
2 changed files with 11 additions and 1 deletions

View File

@ -47,6 +47,8 @@ import java.nio.charset.Charset;
public class InstallHistoryActivity extends AppCompatActivity {
public static final String TAG = "InstallHistoryActivity";
public static final String EXTRA_SHOW_FDROID_METRICS = "showFDroidMetrics";
private boolean showingInstallHistory;
private Toolbar toolbar;
private MenuItem showMenuItem;
@ -65,8 +67,13 @@ public class InstallHistoryActivity extends AppCompatActivity {
textView = findViewById(R.id.text);
appName = getString(R.string.app_name);
Intent intent = getIntent();
if (intent != null && intent.getBooleanExtra(EXTRA_SHOW_FDROID_METRICS, false)) {
showFDroidMetricsReport();
} else {
showInstallHistory();
}
}
private void showInstallHistory() {
String text = "";

View File

@ -555,6 +555,9 @@ public class PreferencesFragment extends PreferenceFragmentCompat
getContext().getString(R.string.app_name));
Toast.makeText(getContext(), msg, Toast.LENGTH_LONG).show();
installHistoryPref.setTitle(R.string.install_history_and_metrics);
Intent intent = new Intent(getActivity(), InstallHistoryActivity.class);
intent.putExtra(InstallHistoryActivity.EXTRA_SHOW_FDROID_METRICS, true);
startActivity(intent);
} else {
installHistoryPref.setTitle(R.string.install_history);
}