Fix RedditAPIInfoBottomSheetFragment not scrollable.

This commit is contained in:
Docile-Alligator 2023-06-22 09:02:08 -04:00
parent d386514725
commit 1686e2d9c3
2 changed files with 58 additions and 50 deletions

View File

@ -38,6 +38,8 @@ public class RedditAPIInfoBottomSheetFragment extends LandscapeExpandedRoundedBo
Utils.setFontToAllTextViews(binding.getRoot(), mainActivity.typeface); Utils.setFontToAllTextViews(binding.getRoot(), mainActivity.typeface);
} }
binding.getRoot().setNestedScrollingEnabled(true);
SpannableString message = new SpannableString(getString(R.string.reddit_api_info, "https://www.reddit.com/r/reddit/comments/145bram/addressing_the_community_about_changes_to_our_api", "https://www.reddit.com/r/Infinity_For_Reddit/comments/147bhsg/the_future_of_infinity")); SpannableString message = new SpannableString(getString(R.string.reddit_api_info, "https://www.reddit.com/r/reddit/comments/145bram/addressing_the_community_about_changes_to_our_api", "https://www.reddit.com/r/Infinity_For_Reddit/comments/147bhsg/the_future_of_infinity"));
Linkify.addLinks(message, Linkify.WEB_URLS); Linkify.addLinks(message, Linkify.WEB_URLS);
binding.messageTextViewRedditApiInfoBottomSheetFragment.setText(message); binding.messageTextViewRedditApiInfoBottomSheetFragment.setText(message);

View File

@ -1,68 +1,74 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".bottomsheetfragments.RedditAPIInfoBottomSheetFragment"> tools:context=".bottomsheetfragments.RedditAPIInfoBottomSheetFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="@string/reddit_api_info_title"
android:fontFamily="?attr/font_family"
android:textSize="?attr/font_20"
android:textColor="?attr/primaryTextColor"
android:textStyle="bold" />
<TextView
android:id="@+id/message_text_view_reddit_api_info_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/reddit_api_info"
android:fontFamily="?attr/font_family"
android:textSize="?attr/font_16"
android:textColor="?attr/primaryTextColor" />
<LinearLayout <LinearLayout
android:id="@+id/linear_layout_check_box_wrapper_reddit_api_info_bottom_sheet_fragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:orientation="vertical">
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp">
<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/do_not_show_this_again_check_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<TextView <TextView
android:id="@+id/do_not_show_this_again_text_view" android:layout_width="match_parent"
android:layout_width="0dp" android:layout_height="wrap_content"
android:layout_height="match_parent" android:paddingTop="16dp"
android:layout_weight="1" android:paddingStart="16dp"
android:text="@string/do_not_show_this_again" android:paddingEnd="16dp"
android:gravity="center_vertical" android:text="@string/reddit_api_info_title"
android:fontFamily="?attr/font_family" android:fontFamily="?attr/font_family"
android:textSize="?attr/font_default" android:textSize="?attr/font_20"
android:textColor="?attr/primaryTextColor"
android:textStyle="bold" />
<TextView
android:id="@+id/message_text_view_reddit_api_info_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="@string/reddit_api_info"
android:fontFamily="?attr/font_family"
android:textSize="?attr/font_16"
android:textColor="?attr/primaryTextColor" /> android:textColor="?attr/primaryTextColor" />
<com.google.android.material.button.MaterialButton <LinearLayout
android:id="@+id/continue_button_reddit_api_info_bottom_sheet_fragment" android:id="@+id/linear_layout_check_box_wrapper_reddit_api_info_bottom_sheet_fragment"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end" android:layout_marginStart="10dp"
android:layout_marginStart="8dp" android:layout_marginEnd="16dp"
android:layout_marginEnd="8dp" android:layout_marginBottom="16dp">
android:backgroundTint="@color/colorPrimary"
android:text="@string/i_understand" /> <com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/do_not_show_this_again_check_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<TextView
android:id="@+id/do_not_show_this_again_text_view"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/do_not_show_this_again"
android:gravity="center_vertical"
android:fontFamily="?attr/font_family"
android:textSize="?attr/font_default"
android:textColor="?attr/primaryTextColor" />
<com.google.android.material.button.MaterialButton
android:id="@+id/continue_button_reddit_api_info_bottom_sheet_fragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:backgroundTint="@color/colorPrimary"
android:text="@string/i_understand" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </ScrollView>