mirror of https://github.com/M66B/NetGuard.git
Added option to reset application rule
This commit is contained in:
parent
da73ccdc26
commit
086a6ffc52
|
@ -102,6 +102,7 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
||||||
public CheckBox cbScreenOther;
|
public CheckBox cbScreenOther;
|
||||||
public CheckBox cbRoaming;
|
public CheckBox cbRoaming;
|
||||||
|
|
||||||
|
public ImageButton btnClear;
|
||||||
public ImageButton btnSettings;
|
public ImageButton btnSettings;
|
||||||
public Button btnLaunch;
|
public Button btnLaunch;
|
||||||
|
|
||||||
|
@ -139,6 +140,7 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
||||||
cbScreenOther = (CheckBox) itemView.findViewById(R.id.cbScreenOther);
|
cbScreenOther = (CheckBox) itemView.findViewById(R.id.cbScreenOther);
|
||||||
cbRoaming = (CheckBox) itemView.findViewById(R.id.cbRoaming);
|
cbRoaming = (CheckBox) itemView.findViewById(R.id.cbRoaming);
|
||||||
|
|
||||||
|
btnClear = (ImageButton) itemView.findViewById(R.id.btnClear);
|
||||||
btnSettings = (ImageButton) itemView.findViewById(R.id.btnSettings);
|
btnSettings = (ImageButton) itemView.findViewById(R.id.btnSettings);
|
||||||
btnLaunch = (Button) itemView.findViewById(R.id.btnLaunch);
|
btnLaunch = (Button) itemView.findViewById(R.id.btnLaunch);
|
||||||
|
|
||||||
|
@ -409,6 +411,18 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Reset rule
|
||||||
|
holder.btnClear.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
holder.cbWifi.setChecked(rule.wifi_default);
|
||||||
|
holder.cbOther.setChecked(rule.other_default);
|
||||||
|
holder.cbScreenWifi.setChecked(rule.screen_wifi_default);
|
||||||
|
holder.cbScreenOther.setChecked(rule.screen_other_default);
|
||||||
|
holder.cbRoaming.setChecked(rule.roaming_default);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Launch application settings
|
// Launch application settings
|
||||||
final Intent settings = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
final Intent settings = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
settings.setData(Uri.parse("package:" + rule.info.packageName));
|
settings.setData(Uri.parse("package:" + rule.info.packageName));
|
||||||
|
|
|
@ -259,10 +259,17 @@
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/btnClear"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@android:drawable/ic_menu_delete" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btnSettings"
|
android:id="@+id/btnSettings"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
android:src="@drawable/ic_settings_white_24dp" />
|
android:src="@drawable/ic_settings_white_24dp" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|
Loading…
Reference in New Issue