From e7eb5569b5bd029f0cfef5dd6525dc846003fc46 Mon Sep 17 00:00:00 2001 From: Lisheng Guan Date: Wed, 27 Dec 2023 15:11:33 +0800 Subject: [PATCH] clean up donate related code --- .../money/manager/ex/about/AboutFragment.java | 13 ++--------- .../money/manager/ex/home/MainActivity.java | 4 ---- .../ex/settings/DatabaseSettingsFragment.java | 6 ----- .../manager/ex/settings/SettingsFragment.java | 22 ++++--------------- 4 files changed, 6 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/com/money/manager/ex/about/AboutFragment.java b/app/src/main/java/com/money/manager/ex/about/AboutFragment.java index 6a94307004..87b015bec6 100644 --- a/app/src/main/java/com/money/manager/ex/about/AboutFragment.java +++ b/app/src/main/java/com/money/manager/ex/about/AboutFragment.java @@ -32,10 +32,11 @@ import android.widget.TextView; import android.widget.Toast; +import androidx.fragment.app.Fragment; + import com.github.pedrovgs.lynx.LynxActivity; import com.github.pedrovgs.lynx.LynxConfig; import com.money.manager.ex.Constants; -import com.money.manager.ex.DonateActivity; import com.money.manager.ex.R; import com.money.manager.ex.common.MmxBaseFragmentActivity; import com.money.manager.ex.core.Core; @@ -45,7 +46,6 @@ import java.io.InputStreamReader; import java.util.Calendar; -import androidx.fragment.app.Fragment; import timber.log.Timber; public class AboutFragment extends Fragment { @@ -189,15 +189,6 @@ public void onClick(View v) { } }); - // Donate, button - Button buttonDonate = view.findViewById(R.id.buttonDonateInApp); - buttonDonate.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - startActivity(new Intent(getActivity(), DonateActivity.class)); - } - }); - // Send logcat button Button sendLogcatButton = view.findViewById(R.id.sendLogcatButton); sendLogcatButton.setOnClickListener(new OnClickListener() { diff --git a/app/src/main/java/com/money/manager/ex/home/MainActivity.java b/app/src/main/java/com/money/manager/ex/home/MainActivity.java index 2590cf397a..e1c9af7c87 100644 --- a/app/src/main/java/com/money/manager/ex/home/MainActivity.java +++ b/app/src/main/java/com/money/manager/ex/home/MainActivity.java @@ -54,7 +54,6 @@ import com.mikepenz.google_material_typeface_library.GoogleMaterial; import com.mikepenz.mmex_icon_font_typeface_library.MMXIconFont; import com.money.manager.ex.Constants; -import com.money.manager.ex.DonateActivity; import com.money.manager.ex.HelpActivity; import com.money.manager.ex.MmexApplication; import com.money.manager.ex.PasscodeActivity; @@ -670,9 +669,6 @@ public boolean onDrawerMenuAndOptionMenuSelected(DrawerMenuItem item) { case R.id.menu_about: startActivity(new Intent(MainActivity.this, AboutActivity.class)); break; - case R.id.menu_donate: - startActivity(new Intent(this, DonateActivity.class)); - break; default: // if no match, return false result = false; diff --git a/app/src/main/java/com/money/manager/ex/settings/DatabaseSettingsFragment.java b/app/src/main/java/com/money/manager/ex/settings/DatabaseSettingsFragment.java index 35a5b87a28..ca73d022fa 100644 --- a/app/src/main/java/com/money/manager/ex/settings/DatabaseSettingsFragment.java +++ b/app/src/main/java/com/money/manager/ex/settings/DatabaseSettingsFragment.java @@ -22,7 +22,6 @@ import android.database.sqlite.SQLiteDatabase; import android.net.Uri; import android.os.Bundle; -import android.text.Html; import android.util.Log; import android.widget.Toast; @@ -32,18 +31,13 @@ import com.money.manager.ex.BuildConfig; import com.money.manager.ex.MmexApplication; import com.money.manager.ex.R; -import com.money.manager.ex.core.Core; import com.money.manager.ex.core.RequestCodes; import com.money.manager.ex.core.UIHelper; -import com.money.manager.ex.core.database.DatabaseManager; import com.money.manager.ex.database.MmxOpenHelper; import com.money.manager.ex.home.DatabaseMetadata; -import com.money.manager.ex.home.MainActivity; import com.money.manager.ex.home.RecentDatabasesProvider; -import com.money.manager.ex.utils.DonateDialogUtils; import com.money.manager.ex.utils.MmxDatabaseUtils; -import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/app/src/main/java/com/money/manager/ex/settings/SettingsFragment.java b/app/src/main/java/com/money/manager/ex/settings/SettingsFragment.java index d2a766a8f4..a0c72bbc17 100644 --- a/app/src/main/java/com/money/manager/ex/settings/SettingsFragment.java +++ b/app/src/main/java/com/money/manager/ex/settings/SettingsFragment.java @@ -20,17 +20,17 @@ import android.os.Bundle; import android.text.TextUtils; +import androidx.preference.Preference; +import androidx.preference.PreferenceFragmentCompat; +import androidx.preference.PreferenceScreen; + import com.mikepenz.google_material_typeface_library.GoogleMaterial; import com.mikepenz.mmex_icon_font_typeface_library.MMXIconFont; import com.money.manager.ex.Constants; -import com.money.manager.ex.DonateActivity; import com.money.manager.ex.R; import com.money.manager.ex.about.AboutActivity; import com.money.manager.ex.core.UIHelper; -import androidx.preference.Preference; -import androidx.preference.PreferenceFragmentCompat; -import androidx.preference.PreferenceScreen; import timber.log.Timber; /** @@ -159,20 +159,6 @@ public boolean onPreferenceClick(Preference preference) { }); } - //donate - final Preference pDonate = findPreference(getString(PreferenceConstants.PREF_DONATE)); - if (pDonate != null) { - pDonate.setIcon(uiHelper.getIcon(GoogleMaterial.Icon.gmd_card_giftcard) - .color(uiHelper.getSecondaryTextColor())); - pDonate.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - startActivity(new Intent(getActivity(), DonateActivity.class)); - return false; - } - }); - } - final Preference infoPreference = findPreference(getString(PreferenceConstants.PREF_VERSION_NAME)); if (infoPreference != null) { infoPreference.setIcon(uiHelper.getIcon(GoogleMaterial.Icon.gmd_info_outline)