Made search index a pro feature

This commit is contained in:
M66B
2020-01-16 18:21:03 +01:00
parent e8a7920dca
commit 6b67e3cf63
7 changed files with 23 additions and 6 deletions

View File

@@ -187,7 +187,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean fts = prefs.getBoolean("fts", false);
if (fts && seen == null && flagged == null && snoozed == null && encrypted == null) {
boolean pro = ActivityBilling.isPro(context);
if (fts && pro && seen == null && flagged == null && snoozed == null && encrypted == null) {
if (state.ids == null) {
SQLiteDatabase sdb = FtsDbHelper.getInstance(context);
state.ids = FtsDbHelper.match(sdb, folder, query);

View File

@@ -52,6 +52,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swExternalSearch;
private SwitchCompat swFts;
private TextView tvFtsIndexed;
private TextView tvFtsPro;
private SwitchCompat swEnglish;
private SwitchCompat swWatchdog;
private SwitchCompat swUpdates;
@@ -95,6 +96,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swExternalSearch = view.findViewById(R.id.swExternalSearch);
swFts = view.findViewById(R.id.swFts);
tvFtsIndexed = view.findViewById(R.id.tvFtsIndexed);
tvFtsPro = view.findViewById(R.id.tvFtsPro);
swEnglish = view.findViewById(R.id.swEnglish);
swWatchdog = view.findViewById(R.id.swWatchdog);
swUpdates = view.findViewById(R.id.swUpdates);
@@ -165,6 +167,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
Helper.linkPro(tvFtsPro);
swEnglish.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {

View File

@@ -110,7 +110,8 @@ public class WorkerFts extends Worker {
try {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean fts = prefs.getBoolean("fts", true);
if (fts) {
boolean pro = ActivityBilling.isPro(context);
if (fts && pro) {
Log.i("Queuing " + getName());
OneTimeWorkRequest.Builder builder = new OneTimeWorkRequest.Builder(WorkerFts.class);