mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-03 03:44:52 +00:00
Merge pull request #1354 from InfiniteCoder06/bug-scrolling
Fix Scrolling in BottomSheet
This commit is contained in:
commit
c17f30b89e
2 changed files with 48 additions and 21 deletions
|
@ -20,6 +20,8 @@ import androidx.annotation.AttrRes;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StyleRes;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
|
@ -49,6 +51,7 @@ import com.bumptech.glide.ListPreloader;
|
|||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.integration.recyclerview.RecyclerViewPreloader;
|
||||
import com.bumptech.glide.util.ViewPreloadSizeProvider;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
import com.google.android.material.chip.Chip;
|
||||
|
@ -529,6 +532,12 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
|
|||
private void initializeGroupChip() {
|
||||
View view = getLayoutInflater().inflate(R.layout.dialog_select_groups, null);
|
||||
BottomSheetDialog dialog = new BottomSheetDialog(requireContext());
|
||||
NestedScrollView scrollView = view.findViewById(R.id.scrollView);
|
||||
ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) scrollView.getLayoutParams();
|
||||
layoutParams.matchConstraintMaxHeight = getResources().getConfiguration().screenHeightDp;
|
||||
|
||||
dialog.getBehavior().setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
dialog.getBehavior().setSkipCollapsed(false);
|
||||
dialog.setContentView(view);
|
||||
|
||||
ChipGroup chipGroup = view.findViewById(R.id.groupChipGroup);
|
||||
|
|
|
@ -1,50 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:id="@+id/drag_handle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/groups"
|
||||
android:textSize="20sp" />
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/drag_handle"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="150dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="15dp">
|
||||
android:layout_height="0dp"
|
||||
android:minWidth="150dp"
|
||||
app:layout_constraintHeight_default="wrap"
|
||||
app:layout_constraintTop_toBottomOf="@+id/text_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/groupChipGroup"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="150dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/groupChipGroup"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_gravity="end"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/scrollView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:orientation="horizontal">
|
||||
<Button
|
||||
android:id="@+id/btnSave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save"
|
||||
app:rippleColor="@color/dialog_button_ripple_color"
|
||||
style="@style/Widget.Material3.Button.TextButton" />
|
||||
|
||||
<Button
|
||||
|
@ -52,8 +71,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/clear"
|
||||
app:rippleColor="@color/dialog_button_ripple_color"
|
||||
style="@style/Widget.Material3.Button.TextButton" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
Loading…
Add table
Reference in a new issue