From 6d4639325d0e873c16bc7153be24a97d7c506d4c Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 13 Feb 2016 15:55:22 +0100 Subject: [PATCH] Inflate without attaching to root --- app/src/main/java/eu/faircode/netguard/ActivityLog.java | 2 +- app/src/main/java/eu/faircode/netguard/ActivityMain.java | 8 ++++---- .../main/java/eu/faircode/netguard/ActivitySettings.java | 2 +- app/src/main/java/eu/faircode/netguard/Util.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/ActivityLog.java b/app/src/main/java/eu/faircode/netguard/ActivityLog.java index a39290d3..d179d413 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivityLog.java +++ b/app/src/main/java/eu/faircode/netguard/ActivityLog.java @@ -91,7 +91,7 @@ public class ActivityLog extends AppCompatActivity implements SharedPreferences. running = true; // Action bar - View actionView = getLayoutInflater().inflate(R.layout.action, null); + View actionView = getLayoutInflater().inflate(R.layout.action, null, false); SwitchCompat swEnabled = (SwitchCompat) actionView.findViewById(R.id.swEnabled); getSupportActionBar().setDisplayShowCustomEnabled(true); diff --git a/app/src/main/java/eu/faircode/netguard/ActivityMain.java b/app/src/main/java/eu/faircode/netguard/ActivityMain.java index 0102acf2..bd765a8e 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivityMain.java +++ b/app/src/main/java/eu/faircode/netguard/ActivityMain.java @@ -113,7 +113,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences } // Action bar - View actionView = getLayoutInflater().inflate(R.layout.action, null); + View actionView = getLayoutInflater().inflate(R.layout.action, null, false); SwitchCompat swEnabled = (SwitchCompat) actionView.findViewById(R.id.swEnabled); getSupportActionBar().setDisplayShowCustomEnabled(true); @@ -135,7 +135,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences } else { // Show dialog LayoutInflater inflater = LayoutInflater.from(ActivityMain.this); - View view = inflater.inflate(R.layout.vpn, null); + View view = inflater.inflate(R.layout.vpn, null, false); dialogVpn = new AlertDialog.Builder(ActivityMain.this) .setView(view) .setCancelable(false) @@ -219,7 +219,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences if (!initialized) { // Create view LayoutInflater inflater = LayoutInflater.from(this); - View view = inflater.inflate(R.layout.first, null); + View view = inflater.inflate(R.layout.first, null, false); TextView tvFirst = (TextView) view.findViewById(R.id.tvFirst); tvFirst.setMovementMethod(LinkMovementMethod.getInstance()); @@ -655,7 +655,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences private void menu_about() { // Create view LayoutInflater inflater = LayoutInflater.from(this); - View view = inflater.inflate(R.layout.about, null); + View view = inflater.inflate(R.layout.about, null, false); TextView tvVersion = (TextView) view.findViewById(R.id.tvVersion); Button btnRate = (Button) view.findViewById(R.id.btnRate); TextView tvLicense = (TextView) view.findViewById(R.id.tvLicense); diff --git a/app/src/main/java/eu/faircode/netguard/ActivitySettings.java b/app/src/main/java/eu/faircode/netguard/ActivitySettings.java index 7a5b3151..08383345 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivitySettings.java +++ b/app/src/main/java/eu/faircode/netguard/ActivitySettings.java @@ -515,7 +515,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere // Show dialog if (prefs.getBoolean(name, false)) { LayoutInflater inflater = LayoutInflater.from(ActivitySettings.this); - View view = inflater.inflate(R.layout.filter, null); + View view = inflater.inflate(R.layout.filter, null, false); dialogFilter = new AlertDialog.Builder(ActivitySettings.this) .setView(view) .setCancelable(false) diff --git a/app/src/main/java/eu/faircode/netguard/Util.java b/app/src/main/java/eu/faircode/netguard/Util.java index 9dd8d7ed..6a9bfddd 100644 --- a/app/src/main/java/eu/faircode/netguard/Util.java +++ b/app/src/main/java/eu/faircode/netguard/Util.java @@ -442,7 +442,7 @@ public class Util { public static void areYouSure(Context context, int explanation, final DoubtListener listener) { LayoutInflater inflater = LayoutInflater.from(context); - View view = inflater.inflate(R.layout.sure, null); + View view = inflater.inflate(R.layout.sure, null, false); TextView tvExplanation = (TextView) view.findViewById(R.id.tvExplanation); tvExplanation.setText(explanation); new AlertDialog.Builder(context)