Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show "what's new" dialog. #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ android {
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
resValue "string", "app_version_name", "${versionName}"
resValue "string", "app_minor_version", "${versionMinor}"
resValue "string", "app_playstore_url", "market://details?id=${applicationId}"
buildConfigField "boolean", "CAN_REQUEST_RATING", "false"
buildConfigField "boolean", "GOOGLE_GCM", "false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,13 @@ public void setUp() throws Exception {
*/
public static void preventFirstRunDialogs(Context context) {
AccountsActivity.rateAppConfig = new RateThisApp.Config(10000, 10000);
Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();

//do not show first run dialog
editor.putBoolean(context.getString(R.string.key_first_run), false);
editor.putInt(AccountsActivity.LAST_OPEN_TAB_INDEX, AccountsActivity.INDEX_TOP_LEVEL_ACCOUNTS_FRAGMENT);

//do not show "What's new" dialog
String minorVersion = context.getString(R.string.app_minor_version);
int currentMinor = Integer.parseInt(minorVersion);
editor.putInt(context.getString(R.string.key_previous_minor_version), currentMinor);
editor.commit();
PreferenceManager.getDefaultSharedPreferences(context).edit()
//do not show first run dialog
.putBoolean(context.getString(R.string.key_first_run), false)
.putInt(AccountsActivity.LAST_OPEN_TAB_INDEX, AccountsActivity.INDEX_TOP_LEVEL_ACCOUNTS_FRAGMENT)
.apply();
}


public void testDisplayAccountsList() {
AccountsActivity.createDefaultAccounts("EUR", mAccountsActivity);
mAccountsActivity.recreate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@
package org.gnucash.android.ui.account;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.SearchManager;
import android.content.ActivityNotFoundException;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
Expand Down Expand Up @@ -207,7 +201,6 @@ public void onCreate(Bundle savedInstanceState) {

//show the simple accounts list
mPagerAdapter = new AccountViewPagerAdapter(this);

mBinding.pager.setAdapter(mPagerAdapter);

TabLayoutMediator tabLayoutMediator = new TabLayoutMediator(tabLayout, mBinding.pager, new TabLayoutMediator.TabConfigurationStrategy() {
Expand Down Expand Up @@ -311,9 +304,6 @@ private void init() {
return;
}

if (hasNewFeatures()) {
showWhatsNewDialog(context);
}
ScheduledActionService.schedulePeriodic(context);
}

Expand All @@ -324,53 +314,6 @@ protected void onDestroy() {
preferences.edit().putInt(LAST_OPEN_TAB_INDEX, mBinding.pager.getCurrentItem()).apply();
}

/**
* Checks if the minor version has been increased and displays the What's New dialog box.
* This is the minor version as per semantic versioning.
*
* @return <code>true</code> if the minor version has been increased, <code>false</code> otherwise.
*/
private boolean hasNewFeatures() {
String minorVersion = getString(R.string.app_minor_version);
int currentMinor = Integer.parseInt(minorVersion);

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
int previousMinor = prefs.getInt(getString(R.string.key_previous_minor_version), 0);
if (currentMinor > previousMinor) {
Editor editor = prefs.edit();
editor.putInt(getString(R.string.key_previous_minor_version), currentMinor);
editor.apply();
return true;
}
return false;
}

/**
* Show dialog with new features for this version
*/
public static AlertDialog showWhatsNewDialog(Context context) {
Resources resources = context.getResources();
StringBuilder releaseTitle = new StringBuilder(resources.getString(R.string.title_whats_new));
PackageInfo packageInfo;
try {
packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
releaseTitle.append(" - v").append(packageInfo.versionName);
} catch (NameNotFoundException e) {
Timber.e(e, "Error displaying 'Whats new' dialog");
}

return new AlertDialog.Builder(context)
.setTitle(releaseTitle.toString())
.setMessage(R.string.whats_new)
.setPositiveButton(R.string.label_dismiss, new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).show();
}

/**
* Displays the dialog for exporting transactions
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;

import org.gnucash.android.BuildConfig;
import org.gnucash.android.R;
import org.gnucash.android.ui.account.AccountsActivity;


/**
* Fragment for displaying information about the application
Expand All @@ -52,17 +48,4 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.title_about_gnucash);
}

@Override
public void onResume() {
super.onResume();
Preference pref = findPreference(getString(R.string.key_about_gnucash));
pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(@NonNull Preference preference) {
AccountsActivity.showWhatsNewDialog(preference.getContext());
return true;
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public void onClick(DialogInterface dialog, int which) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
.setTitle(R.string.title_no_backups_found)
.setMessage(R.string.msg_no_backups_to_restore_from)
.setNegativeButton(R.string.label_dismiss, new DialogInterface.OnClickListener() {
.setNegativeButton(R.string.btn_cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values-af/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@
<string name="label_parent_account">Parent account</string>
<string name="title_xml_ofx_header">Use XML OFX header</string>
<string name="summary_xml_ofx_header">Enable this option when exporting to third-party application other than GnuCash for desktop</string>
<string name="title_whats_new">What\'s New</string>
<string name="whats_new">
- Added ability to export to any service which supports the Storage Access Framework \n
- Added option to set the location for regular automatic backups (See backup settings)\n
- Added Bitcoin currency support\n
- Added support for renaming books\n
- Multiple bug fixes and improvements\n
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash Accounts successfully imported</string>
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@
<string name="label_parent_account">Parent account</string>
<string name="title_xml_ofx_header">Use XML OFX header</string>
<string name="summary_xml_ofx_header">Enable this option when exporting to third-party application other than GnuCash for desktop</string>
<string name="title_whats_new">What\'s New</string>
<string name="whats_new">
- Added ability to export to any service which supports the Storage Access Framework \n
- Added option to set the location for regular automatic backups (See backup settings)\n
- Added Bitcoin currency support\n
- Added support for renaming books\n
- Multiple bug fixes and improvements\n
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">أدخل مبلغ لحفظ الحركة</string>
<string name="toast_error_importing_accounts">حدث خطأ أثناء استيراد حسابات GnuCash</string>
<string name="toast_success_importing_accounts">تم إستيراد حسابات GnuCash بنجاح</string>
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@
<string name="label_parent_account">Compte pare</string>
<string name="title_xml_ofx_header">Utilitzar capçalera XML d\'OFX</string>
<string name="summary_xml_ofx_header">Habiliteu aquesta opció quan exporteu a aplicacions de tercers diferents de GnuCash per escriptori</string>
<string name="title_whats_new">Novetats</string>
<string name="whats_new">
- Added ability to export to any service which supports the Storage Access Framework \n
- Added option to set the location for regular automatic backups (See backup settings)\n
- Added Bitcoin currency support\n
- Added support for renaming books\n
- Multiple bug fixes and improvements\n
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Introduïu una quantitat per desar l\'assentament</string>
<string name="toast_error_importing_accounts">S\'ha produït un error en importar els comptes de GnuCash</string>
<string name="toast_success_importing_accounts">S\'han importat els comptes de GnuCash correctament</string>
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@
<string name="label_parent_account">Parent account</string>
<string name="title_xml_ofx_header">Použit XML OFX hlavičku</string>
<string name="summary_xml_ofx_header">Použijte tuto možnost při exportu do aplikace jiného výrobce než GnuCash pro stolní počítače</string>
<string name="title_whats_new">Co je nového</string>
<string name="whats_new">
- Added ability to export to any service which supports the Storage Access Framework \n
- Added option to set the location for regular automatic backups (See backup settings)\n
- Added Bitcoin currency support\n
- Added support for renaming books\n
- Multiple bug fixes and improvements\n
</string>
<string name="label_dismiss">Zrušit</string>
<string name="toast_transanction_amount_required">Zadejte částku k uložení transakce</string>
<string name="toast_error_importing_accounts">Při importu GnuCash účtů došlo k chybě</string>
<string name="toast_success_importing_accounts">GnuCash účty úspěšně importovány</string>
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@
<string name="label_parent_account">Hauptkonto</string>
<string name="title_xml_ofx_header">XML-OFX-Header verwenden</string>
<string name="summary_xml_ofx_header">Diese Option aktivieren, wenn Sie die OFX-Dateien für ein anderes Programm als GnuCash auf dem Desktop exportieren</string>
<string name="title_whats_new">Neuigkeiten in dieser Version</string>
<string name="whats_new">
- Export zu einem beliebigen Dienst mit Storage Access Framework Unterstützung möglich \n
- Option, um Ort für regelmäßige automatische Backups, hinzugefügt (Siehe Backup Einstellungen)\n
- Bitcoin-Unterstützung hinzugefügt\n
- Bücher umbenennen ermöglicht\n
- Mehrere Bugfixes and Verbesserungen\n</string>
<string name="label_dismiss">Schließen</string>
<string name="toast_transanction_amount_required">Geben Sie einen Betrag ein, um die Buchung speichern zu können</string>
<string name="toast_error_importing_accounts">Beim Importieren der GnuCash-Konten ist ein Fehler aufgetreten!</string>
<string name="toast_success_importing_accounts">GnuCash-Konten wurden erfolgreich importiert</string>
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,6 @@
<string name="label_parent_account">Γονικός λογαριασμός</string>
<string name="title_xml_ofx_header">Χρήση κεφαλίδας XML OFX</string>
<string name="summary_xml_ofx_header">Ενεργοποίηση αυτής της επιλογής για εξαγωγή σε εφαρμογές τρίτων, εκτός του GnuCash για επιτραπέζιο υπολογιστή.</string>
<string name="title_whats_new">Τι νέο υπάρχει</string>
<string name="whats_new">
- Added ability to export to any service which supports the Storage Access Framework \n
- Added option to set the location for regular automatic backups (See backup settings)\n
- Added Bitcoin currency support\n
- Added support for renaming books\n
- Multiple bug fixes and improvements\n
</string>
<string name="label_dismiss">Απόρριψη</string>
<string name="toast_transanction_amount_required">Εισαγωγή ποσού για
αποθήκευση κίνησης</string>
<string name="toast_error_importing_accounts">Προέκυψε σφάλμα κατά την
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values-en-rAU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,6 @@
<string name="label_parent_account">Parent account</string>
<string name="title_xml_ofx_header">Use XML OFX header</string>
<string name="summary_xml_ofx_header">Enable this option when exporting to third-party application other than GnuCash for desktop</string>
<string name="title_whats_new">What\'s New</string>
<string name="whats_new">
- Added ability to export to any service which supports the Storage Access Framework \n
- Added option to set the location for regular automatic backups (See backup settings)\n
- Added Bitcoin currency support\n
- Added support for renaming books\n
- Multiple bug fixes and improvements\n
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash Accounts successfully imported</string>
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values-en-rGB/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@
<string name="label_parent_account">Parent account</string>
<string name="title_xml_ofx_header">Use XML OFX header</string>
<string name="summary_xml_ofx_header">Enable this option when exporting to third-party application other than GnuCash for desktop</string>
<string name="title_whats_new">What\'s New</string>
<string name="whats_new">
- Added ability to export to any service which supports the Storage Access Framework \n
- Added option to set the location for regular automatic backups (See backup settings)\n
- Added Bitcoin currency support\n
- Added support for renaming books\n
- Multiple bug fixes and improvements\n
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash Accounts successfully imported</string>
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/values-en-rZA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,6 @@
<string name="label_parent_account">Parent account</string>
<string name="title_xml_ofx_header">Use XML OFX header</string>
<string name="summary_xml_ofx_header">Enable this option when exporting to third-party application other than GnuCash for desktop</string>
<string name="title_whats_new">What\'s New</string>
<string name="whats_new">
- Added ability to export to any service which supports the Storage Access Framework \n
- Added option to set the location for regular automatic backups (See backup settings)\n
- Added Bitcoin currency support\n
- Added support for renaming books\n
- Multiple bug fixes and improvements\n
</string>
<string name="label_dismiss">Dismiss</string>
<string name="toast_transanction_amount_required">Enter an amount to save the transaction</string>
<string name="toast_error_importing_accounts">An error occurred while importing the GnuCash accounts</string>
<string name="toast_success_importing_accounts">GnuCash Accounts successfully imported</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-es-rMX/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@
<string name="label_parent_account">Cuenta padre</string>
<string name="title_xml_ofx_header">Usar cabecera XML OFX</string>
<string name="summary_xml_ofx_header">Active esta opción para exportar a otras aplicaciones distintas a GnuCash para escritorio</string>
<string name="title_whats_new">Novedades</string>
<string name="whats_new">
-Se ha añadido capacidad para exportar a cualquier servicio que soporta el marco de acceso de almacenamiento \n - Añadida la opción para establecer la ubicación de copias de seguridad automáticas (ver configuración de copia de seguridad) \n - añadido el soporte para moneda Bitcoin\n - agregado de soporte para renombrar libros\n - múltiples correcciones y mejoras\n</string>
<string name="label_dismiss">Cerrar</string>
<string name="toast_transanction_amount_required">Introduzca un importe para guardar la transacción</string>
<string name="toast_error_importing_accounts">Ocurrió un error al importar las cuentas de GnuCash</string>
<string name="toast_success_importing_accounts">Cuentas de GnuCash importadas con éxito</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@
<string name="label_parent_account">Cuenta padre</string>
<string name="title_xml_ofx_header">Usar cabecera XML OFX</string>
<string name="summary_xml_ofx_header">Active esta opción para exportar a otras aplicaciones distintas a GnuCash para escritorio</string>
<string name="title_whats_new">Novedades</string>
<string name="whats_new">
-Se ha añadido capacidad para exportar a cualquier servicio que soporta el marco de acceso de almacenamiento \n - Añadida la opción para establecer la ubicación de copias de seguridad automáticas (ver configuración de copia de seguridad) \n - añadido el soporte para moneda Bitcoin\n - agregado de soporte para renombrar libros\n - múltiples correcciones y mejoras\n</string>
<string name="label_dismiss">Cerrar</string>
<string name="toast_transanction_amount_required">Introduzca un importe para guardar la transacción</string>
<string name="toast_error_importing_accounts">Ocurrió un error al importar las cuentas de GnuCash</string>
<string name="toast_success_importing_accounts">Cuentas de GnuCash importadas con éxito</string>
Expand Down
Loading