From 79d6cb6172dd3095370741f66a169ee6af0990e4 Mon Sep 17 00:00:00 2001 From: Adrian Malacoda Date: Sun, 25 Sep 2016 05:15:16 -0500 Subject: [PATCH] Remove ProCheckUtils and dependent code --- .../fileeditorpro/activity/MainActivity.java | 6 --- .../preferences/SettingsFragment.java | 19 +------- .../fileeditorpro/util/ProCheckUtils.java | 43 ------------------- 3 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 app/src/main/java/com/maskyn/fileeditorpro/util/ProCheckUtils.java diff --git a/app/src/main/java/com/maskyn/fileeditorpro/activity/MainActivity.java b/app/src/main/java/com/maskyn/fileeditorpro/activity/MainActivity.java index 031bff8..636b7dc 100644 --- a/app/src/main/java/com/maskyn/fileeditorpro/activity/MainActivity.java +++ b/app/src/main/java/com/maskyn/fileeditorpro/activity/MainActivity.java @@ -115,7 +115,6 @@ import com.maskyn.fileeditorpro.util.Device; import com.maskyn.fileeditorpro.util.GreatUri; import com.maskyn.fileeditorpro.util.IHomeActivity; import com.maskyn.fileeditorpro.util.MimeTypes; -import com.maskyn.fileeditorpro.util.ProCheckUtils; import com.maskyn.fileeditorpro.util.ThemeUtils; import com.maskyn.fileeditorpro.util.ViewUtils; import com.maskyn.fileeditorpro.views.CustomDrawerLayout; @@ -469,11 +468,6 @@ public abstract class MainActivity extends ActionBarActivity implements IHomeAct } } - MenuItem imDonate = menu.findItem(R.id.im_donate); - if (imDonate != null) - if (ProCheckUtils.isPro(this, false)) - imDonate.setVisible(false); - return true; } diff --git a/app/src/main/java/com/maskyn/fileeditorpro/preferences/SettingsFragment.java b/app/src/main/java/com/maskyn/fileeditorpro/preferences/SettingsFragment.java index ca83181..eacdcd9 100644 --- a/app/src/main/java/com/maskyn/fileeditorpro/preferences/SettingsFragment.java +++ b/app/src/main/java/com/maskyn/fileeditorpro/preferences/SettingsFragment.java @@ -37,7 +37,6 @@ import com.maskyn.fileeditorpro.dialogfragment.EncodingDialog; import com.maskyn.fileeditorpro.dialogfragment.NumberPickerDialog; import com.maskyn.fileeditorpro.dialogfragment.ThemeDialog; import com.maskyn.fileeditorpro.util.Device; -import com.maskyn.fileeditorpro.util.ProCheckUtils; import com.maskyn.fileeditorpro.util.ViewUtils; public class SettingsFragment extends Fragment implements NumberPickerDialog.INumberPickerDialog, EncodingDialog.DialogListener, ThemeDialog.DialogListener { @@ -115,28 +114,14 @@ public class SettingsFragment extends Fragment implements NumberPickerDialog.INu swSplitByLine.setChecked(sSplitByLine); swErrorReports.setChecked(sErrorReports); - TextView fontSizeView, encodingView, extraOptionsView, themeView, goPro; - goPro = (TextView) rootView.findViewById(R.id.drawer_button_go_pro); + TextView fontSizeView, encodingView, extraOptionsView, themeView; fontSizeView = (TextView) rootView.findViewById(R.id.drawer_button_font_size); encodingView = (TextView) rootView.findViewById(R.id.drawer_button_encoding); extraOptionsView = (TextView) rootView.findViewById(R.id.drawer_button_extra_options); themeView = (TextView) rootView.findViewById(R.id.drawer_button_theme); - ViewUtils.setVisible(goPro, !ProCheckUtils.isPro(getActivity())); ViewUtils.setVisible(swStorageAccessFramework, Device.hasKitKatApi()); - - goPro.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - final String appPackageName = "com.maskyn.fileeditorpro"; - try { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName))); - } catch (android.content.ActivityNotFoundException anfe) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName))); - } - } - }); - + swLineNumbers.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { diff --git a/app/src/main/java/com/maskyn/fileeditorpro/util/ProCheckUtils.java b/app/src/main/java/com/maskyn/fileeditorpro/util/ProCheckUtils.java deleted file mode 100644 index 3410f1a..0000000 --- a/app/src/main/java/com/maskyn/fileeditorpro/util/ProCheckUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2014 Vlad Mihalachi - * - * This file is part of Robut Editor. - * - * Robut Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Robut Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.maskyn.fileeditorpro.util; - -import android.content.Context; - -public class ProCheckUtils { - public static boolean isPro(Context context, boolean includeDonations) { - - // happy new year - return context.getPackageName().equals("com.maskyn.fileeditorpro"); - /* - if (Build.FOR_AMAZON) - return true; - else if () - return true; - else if (includeDonations && PreferenceHelper.hasDonated(context)) - return true; - else - return false;*/ - } - - public static boolean isPro(Context context) { - return isPro(context, true); - } -}