mirror of
https://github.com/Docile-Alligator/Infinity-For-Reddit.git
synced 2026-02-07 18:05:28 +00:00
ViewCompat.setOnApplyWindowInsetsListener in CustomizePostFilterActivity.
This commit is contained in:
@ -12,12 +12,17 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.OnApplyWindowInsetsListener;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
@ -85,8 +90,36 @@ public class CustomizePostFilterActivity extends BaseActivity {
|
||||
|
||||
applyCustomTheme();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && isChangeStatusBarIconColor()) {
|
||||
addOnOffsetChangedListener(binding.appbarLayoutCustomizePostFilterActivity);
|
||||
if (isImmersiveInterface()) {
|
||||
if (isChangeStatusBarIconColor()) {
|
||||
addOnOffsetChangedListener(binding.appbarLayoutCustomizePostFilterActivity);
|
||||
}
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(binding.getRoot(), new OnApplyWindowInsetsListener() {
|
||||
@NonNull
|
||||
@Override
|
||||
public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowInsetsCompat insets) {
|
||||
Insets allInsets = insets.getInsets(
|
||||
WindowInsetsCompat.Type.systemBars()
|
||||
| WindowInsetsCompat.Type.displayCutout()
|
||||
);
|
||||
|
||||
setMargins(binding.toolbarCustomizePostFilterActivity,
|
||||
allInsets.left,
|
||||
allInsets.top,
|
||||
allInsets.right,
|
||||
BaseActivity.IGNORE_MARGIN);
|
||||
|
||||
binding.contentWrapperViewCustomizePostFilterActivity.setPadding(
|
||||
allInsets.left,
|
||||
0,
|
||||
allInsets.right,
|
||||
allInsets.bottom
|
||||
);
|
||||
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setSupportActionBar(binding.toolbarCustomizePostFilterActivity);
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/content_wrapper_view_customize_post_filter_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/content_wrapper_view_customize_post_filter_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
@ -34,8 +34,10 @@
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/content_wrapper_view_customize_post_filter_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
|
||||
Reference in New Issue
Block a user