Remove ProCheckUtils and dependent code

This commit is contained in:
Adrian Malacoda 2016-09-25 05:15:16 -05:00
parent c1d658ffb1
commit 79d6cb6172
3 changed files with 2 additions and 66 deletions

View File

@ -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;
}

View File

@ -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) {

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}