Skip to content

Commit

Permalink
Fixed bottom sheet fragments cannot swipe down to show items when the…
Browse files Browse the repository at this point in the history
…y are expanded. Version 1.3.1.
  • Loading branch information
Docile-Alligator committed Oct 20, 2019
1 parent 096f122 commit 6662f9a
Show file tree
Hide file tree
Showing 8 changed files with 578 additions and 531 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "ml.docilealligator.infinityforreddit"
minSdkVersion 21
targetSdkVersion 29
versionCode 17
versionName "1.3.0"
versionCode 18
versionName "1.3.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
}

int postType = getArguments().getInt(EXTRA_POST_TYPE);
//String sortType = getArguments().getString(EXTRA_SORT_TYPE);

int filter = getArguments().getInt(EXTRA_FILTER);
String accessToken = getArguments().getString(EXTRA_ACCESS_TOKEN);
Expand Down Expand Up @@ -491,6 +490,10 @@ public void typeChipClicked(int filter) {
}

public void changeSortType(SortType sortType) {
if (mFetchPostInfoLinearLayout.getVisibility() != View.GONE) {
mFetchPostInfoLinearLayout.setVisibility(View.GONE);
mGlide.clear(mFetchPostInfoImageView);
}
mPostViewModel.changeSortType(sortType);
}

Expand Down
263 changes: 135 additions & 128 deletions app/src/main/res/layout/fragment_post_comment_sort_type_bottom_sheet.xml
Original file line number Diff line number Diff line change
@@ -1,144 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:overScrollMode="never"
tools:context=".Fragment.PostCommentSortTypeBottomSheetFragment">

<TextView
android:id="@+id/best_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_best"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
android:orientation="vertical">

<TextView
android:id="@+id/confidence_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_confidence"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/best_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_best"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

<TextView
android:id="@+id/top_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_top"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/confidence_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_confidence"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

<TextView
android:id="@+id/new_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_new"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/top_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_top"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

<TextView
android:id="@+id/controversial_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_controversial"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/new_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_new"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

<TextView
android:id="@+id/old_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_old"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/controversial_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_controversial"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

<TextView
android:id="@+id/random_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_random"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/old_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_old"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

<TextView
android:id="@+id/qa_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_qa"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/random_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_random"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

<TextView
android:id="@+id/live_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_live"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
<TextView
android:id="@+id/qa_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_qa"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

<TextView
android:id="@+id/live_type_text_view_post_comment_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="@string/sort_live"
android:textColor="@color/primaryTextColor"
android:textSize="?attr/font_default" />

</LinearLayout>

</LinearLayout>
</androidx.core.widget.NestedScrollView>
Loading

0 comments on commit 6662f9a

Please sign in to comment.