Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/src/main/java/eu/faircode/netguard/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
private Runnable searchRunnable;
private static final long SEARCH_DEBOUNCE_MS = 300;

public void createInsets(View view) {
if (view == null) return;

ViewCompat.setOnApplyWindowInsetsListener(view, (v, windowInsets) -> {
int types = WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.ime();
Insets insets = windowInsets.getInsets(types);
v.setPadding(insets.left, insets.top, insets.right, insets.bottom);

return WindowInsetsCompat.CONSUMED;
});
}

private static final int REQUEST_VPN = 1;
private static final int REQUEST_INVITE = 2;
public static final int REQUEST_ROAMING = 3;
Expand Down Expand Up @@ -205,6 +217,8 @@ protected void onCreate(Bundle savedInstanceState) {
return insets;
});

createInsets(findViewById(android.R.id.content).getRootView());

// Check for filtering
if (!Util.canFilter(this)) {
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this)
Expand Down