mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-25 15:42:53 +00:00
Layout improvement
This commit is contained in:
parent
5ab87cdca8
commit
2834f1e555
2 changed files with 46 additions and 47 deletions
|
@ -380,6 +380,27 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
||||||
holder.tvDisabled.setVisibility(rule.enabled ? View.GONE : View.VISIBLE);
|
holder.tvDisabled.setVisibility(rule.enabled ? View.GONE : View.VISIBLE);
|
||||||
holder.tvInternet.setVisibility(rule.internet ? View.GONE : View.VISIBLE);
|
holder.tvInternet.setVisibility(rule.internet ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
|
// Launch application settings
|
||||||
|
final Intent settings = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
settings.setData(Uri.parse("package:" + rule.info.packageName));
|
||||||
|
holder.btnSettings.setVisibility(
|
||||||
|
!debuggable || settings.resolveActivity(context.getPackageManager()) == null ? View.GONE : View.VISIBLE);
|
||||||
|
holder.btnSettings.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
context.startActivity(settings);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Launch application
|
||||||
|
holder.btnLaunch.setVisibility(!debuggable || rule.intent == null ? View.GONE : View.VISIBLE);
|
||||||
|
holder.btnLaunch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
context.startActivity(rule.intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Show Wi-Fi screen on condition
|
// Show Wi-Fi screen on condition
|
||||||
holder.cbScreenWifi.setOnCheckedChangeListener(null);
|
holder.cbScreenWifi.setOnCheckedChangeListener(null);
|
||||||
holder.cbScreenWifi.setChecked(rule.screen_wifi);
|
holder.cbScreenWifi.setChecked(rule.screen_wifi);
|
||||||
|
@ -503,27 +524,6 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Launch application settings
|
|
||||||
final Intent settings = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
||||||
settings.setData(Uri.parse("package:" + rule.info.packageName));
|
|
||||||
holder.btnSettings.setVisibility(
|
|
||||||
!debuggable || settings.resolveActivity(context.getPackageManager()) == null ? View.GONE : View.VISIBLE);
|
|
||||||
holder.btnSettings.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
context.startActivity(settings);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Launch application
|
|
||||||
holder.btnLaunch.setVisibility(!debuggable || rule.intent == null ? View.GONE : View.VISIBLE);
|
|
||||||
holder.btnLaunch.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
context.startActivity(rule.intent);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Show access rules
|
// Show access rules
|
||||||
if (rule.expanded) {
|
if (rule.expanded) {
|
||||||
// Access the database when expanded only
|
// Access the database when expanded only
|
||||||
|
|
|
@ -190,6 +190,27 @@
|
||||||
android:textStyle="italic"
|
android:textStyle="italic"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/btnSettings"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@drawable/ic_settings_white_24dp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnLaunch"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:text="@string/title_launch" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -269,35 +290,13 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btnClear"
|
android:id="@+id/btnClear"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
android:src="@drawable/ic_delete_white_24dp" />
|
android:src="@drawable/ic_delete_white_24dp" />
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/btnSettings"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:src="@drawable/ic_settings_white_24dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btnLaunch"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="@string/title_launch" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
Loading…
Reference in a new issue