Skip to content

Commit

Permalink
clean up donate related code
Browse files Browse the repository at this point in the history
  • Loading branch information
guanlisheng committed Dec 27, 2023
1 parent 429a782 commit e7eb556
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 39 deletions.
13 changes: 2 additions & 11 deletions app/src/main/java/com/money/manager/ex/about/AboutFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/com/money/manager/ex/home/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e7eb556

Please sign in to comment.