Skip to content

Commit

Permalink
[app] row feature control
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed Feb 5, 2022
1 parent 313112f commit bf163be
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ private static void checkFeatureAccess(ThanosApp thanosApp, @NonNull Activity ac
XLog.i("FA: %s", activity);
if (activity instanceof BaseFeatureActivity) {
BaseFeatureActivity baseFeatureActivity = (BaseFeatureActivity) activity;
boolean isADVF = baseFeatureActivity.isADVF();
if (isADVF) {
if (ThanosApp.isPrc()) {
if (baseFeatureActivity.isADVF()) {
if (Init.isPrc()) {
if (!DonateSettings.isActivated(thanosApp)) {
__sig();
}
}
}

if (baseFeatureActivity.isF()) {
if (!Init.isPrc()) {
// Check LVL
if (!Init.isLVLChecked(thanosApp) && Init.s == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public static void start(Context context) {
ActivityUtils.startActivity(context, SuggestedAppsActivity.class);
}

@Override
public boolean isF() {
return true;
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public static void start(Context context) {
ActivityUtils.startActivity(context, SmartFreezeActivity.class);
}

@Override
public boolean isF() {
return true;
}

@Override
@Verify
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ public static void start(Context context) {
private ProcessManageViewModel startManageViewModel;
private ActivityProcessManageBinding binding;

@Override
public boolean isF() {
return true;
}

@Override
public boolean isADVF() {
return true;
}

@Override
@Verify
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ public class BaseFeatureActivity extends AppCompatActivity {
public boolean isADVF() {
return false;
}

public boolean isF() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public abstract class BaseAppListFilterActivity<VM extends CommonAppListFilterVi
protected VM viewModel;
ActivityCommonListFilterBinding binding;

@Override
public boolean isF() {
return true;
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ import kotlinx.coroutines.flow.collectLatest
class NotificationRecordActivity : ThemeActivity() {
private lateinit var binding: ModuleNotificationRecorderNrdListLayoutBinding

override fun isF(): Boolean {
return true
}

private val model: NotificationRecordViewModel by viewModels {
object : AbstractSavedStateViewModelFactory(this, null) {
override fun <T : ViewModel?> create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public static void start(Context context) {
ActivityUtils.startActivity(context, RuleListActivity.class);
}

@Override
public boolean isF() {
return true;
}

@Override
@Verify
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public boolean isADVF() {
return true;
}

@Override
public boolean isF() {
return true;
}

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down

0 comments on commit bf163be

Please sign in to comment.