aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.idea/caches/build_file_checksums.serbin533 -> 533 bytes
-rw-r--r--.idea/caches/gradle_models.serbin254866 -> 257686 bytes
-rw-r--r--app/build.gradle1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java66
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PostTypeBottomSheetFragment.java74
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java8
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SortTypeBottomSheetFragment.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java75
-rw-r--r--app/src/main/res/layout/fragment_post_type_bottom_sheet.xml (renamed from app/src/main/res/layout/post_type_bottom_sheet.xml)52
-rw-r--r--app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml60
-rw-r--r--app/src/main/res/layout/sort_type_bottom_sheet.xml97
-rw-r--r--app/src/main/res/values/colors.xml2
-rw-r--r--app/src/main/res/values/dimens.xml3
13 files changed, 207 insertions, 235 deletions
diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
index 4b5c0b5d..94e2cf6f 100644
--- a/.idea/caches/build_file_checksums.ser
+++ b/.idea/caches/build_file_checksums.ser
Binary files differ
diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser
index 80643aa1..058c966f 100644
--- a/.idea/caches/gradle_models.ser
+++ b/.idea/caches/gradle_models.ser
Binary files differ
diff --git a/app/build.gradle b/app/build.gradle
index 92fb64ab..83263b79 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -75,4 +75,5 @@ dependencies {
implementation 'com.github.Ferfalk:SimpleSearchView:0.1.3'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.libRG:customtextview:2.2'
+ implementation 'com.github.Deishelon:RoundedBottomSheet:1.0.1'
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
index efb651a4..08dba87e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java
@@ -25,7 +25,6 @@ import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
-import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import javax.inject.Inject;
@@ -37,7 +36,8 @@ import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;
-public class MainActivity extends AppCompatActivity implements SortTypeBottomSheetFragment.SortTypeSelectionCallback {
+public class MainActivity extends AppCompatActivity implements SortTypeBottomSheetFragment.SortTypeSelectionCallback,
+ PostTypeBottomSheetFragment.PostTypeSelectionCallback {
private static final String FRAGMENT_OUT_STATE = "FOS";
private static final String FETCH_USER_INFO_STATE = "FUIS";
@@ -60,7 +60,7 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
private Fragment mFragment;
private RequestManager glide;
private AppBarLayout.LayoutParams params;
- private BottomSheetDialog postTypedialog;
+ private PostTypeBottomSheetFragment postTypeBottomSheetFragment;
private SortTypeBottomSheetFragment sortTypeBottomSheetFragment;
private String mName;
@@ -94,15 +94,7 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
((Infinity) getApplication()).getmAppComponent().inject(this);
- View postTypeDialogView = View.inflate(this, R.layout.post_type_bottom_sheet, null);
- LinearLayout textTypeLinearLayout = postTypeDialogView.findViewById(R.id.text_type_linear_layout_post_type_bottom_sheet);
- LinearLayout linkTypeLinearLayout = postTypeDialogView.findViewById(R.id.link_type_linear_layout_post_type_bottom_sheet);
- LinearLayout imageTypeLinearLayout = postTypeDialogView.findViewById(R.id.image_type_linear_layout_post_type_bottom_sheet);
- LinearLayout videoTypeLinearLayout = postTypeDialogView.findViewById(R.id.video_type_linear_layout_post_type_bottom_sheet);
-
- postTypedialog = new BottomSheetDialog(this);
- postTypedialog.setContentView(postTypeDialogView);
-
+ postTypeBottomSheetFragment = new PostTypeBottomSheetFragment();
sortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
Toolbar toolbar = findViewById(R.id.toolbar);
@@ -181,31 +173,7 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
});
}
- textTypeLinearLayout.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, PostTextActivity.class);
- startActivity(intent);
- postTypedialog.dismiss();
- });
-
- linkTypeLinearLayout.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, PostLinkActivity.class);
- startActivity(intent);
- postTypedialog.dismiss();
- });
-
- imageTypeLinearLayout.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, PostImageActivity.class);
- startActivity(intent);
- postTypedialog.dismiss();
- });
-
- videoTypeLinearLayout.setOnClickListener(view -> {
- Intent intent = new Intent(MainActivity.this, PostVideoActivity.class);
- startActivity(intent);
- postTypedialog.dismiss();
- });
-
- fab.setOnClickListener(view -> postTypedialog.show());
+ fab.setOnClickListener(view -> postTypeBottomSheetFragment.show(getSupportFragmentManager(), postTypeBottomSheetFragment.getTag()));
}
private void replaceFragment(String sortType) {
@@ -303,7 +271,7 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
}
@Override
- public boolean onOptionsItemSelected(MenuItem item) {
+ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (mFragment instanceof FragmentCommunicator) {
switch (item.getItemId()) {
case R.id.action_sort_main_activity:
@@ -364,4 +332,26 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
public void sortTypeSelected(String sortType) {
replaceFragment(sortType);
}
+
+ @Override
+ public void postTypeSelected(int postType) {
+ Intent intent;
+ switch (postType) {
+ case PostTypeBottomSheetFragment.TYPE_TEXT:
+ intent = new Intent(MainActivity.this, PostTextActivity.class);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_LINK:
+ intent = new Intent(MainActivity.this, PostLinkActivity.class);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_IMAGE:
+ intent = new Intent(MainActivity.this, PostImageActivity.class);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_VIDEO:
+ intent = new Intent(MainActivity.this, PostVideoActivity.class);
+ startActivity(intent);
+ }
+ }
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostTypeBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostTypeBottomSheetFragment.java
new file mode 100644
index 00000000..c8dd0d28
--- /dev/null
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostTypeBottomSheetFragment.java
@@ -0,0 +1,74 @@
+package ml.docilealligator.infinityforreddit;
+
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+
+import androidx.fragment.app.Fragment;
+
+import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class PostTypeBottomSheetFragment extends RoundedBottomSheetDialogFragment {
+
+ interface PostTypeSelectionCallback {
+ void postTypeSelected(int postType);
+ }
+
+ static final int TYPE_TEXT = 0;
+ static final int TYPE_LINK = 1;
+ static final int TYPE_IMAGE = 2;
+ static final int TYPE_VIDEO = 3;
+
+ @BindView(R.id.text_type_linear_layout_post_type_bottom_sheet_fragment) LinearLayout textTypeLinearLayout;
+ @BindView(R.id.link_type_linear_layout_post_type_bottom_sheet_fragment) LinearLayout linkTypeLinearLayout;
+ @BindView(R.id.image_type_linear_layout_post_type_bottom_sheet_fragment) LinearLayout imageTypeLinearLayout;
+ @BindView(R.id.video_type_linear_layout_post_type_bottom_sheet_fragment) LinearLayout videoTypeLinearLayout;
+
+ public PostTypeBottomSheetFragment() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.fragment_post_type_bottom_sheet, container, false);
+ ButterKnife.bind(this, rootView);
+
+ Activity activity = getActivity();
+
+ textTypeLinearLayout.setOnClickListener(view -> {
+ ((PostTypeSelectionCallback) activity).postTypeSelected(TYPE_TEXT);
+ dismiss();
+ });
+
+ linkTypeLinearLayout.setOnClickListener(view -> {
+ ((PostTypeSelectionCallback) activity).postTypeSelected(TYPE_LINK);
+ dismiss();
+ });
+
+ imageTypeLinearLayout.setOnClickListener(view -> {
+ ((PostTypeSelectionCallback) activity).postTypeSelected(TYPE_IMAGE);
+ dismiss();
+ });
+
+ videoTypeLinearLayout.setOnClickListener(view -> {
+ ((PostTypeSelectionCallback) activity).postTypeSelected(TYPE_VIDEO);
+ dismiss();
+ });
+
+ return rootView;
+ }
+
+}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java
index 725b50a0..cd828c80 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SearchActivity.java
@@ -147,14 +147,6 @@ public class SearchActivity extends AppCompatActivity {
}
@Override
- public void onBackPressed() {
- if (simpleSearchView.onBackPressed()) {
- return;
- }
- super.onBackPressed();
- }
-
- @Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(SUBREDDIT_NAME_STATE, subredditName);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SortTypeBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SortTypeBottomSheetFragment.java
index 1af128a0..8e25c271 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/SortTypeBottomSheetFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SortTypeBottomSheetFragment.java
@@ -11,7 +11,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
-import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
+import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -20,7 +20,7 @@ import butterknife.ButterKnife;
/**
* A simple {@link Fragment} subclass.
*/
-public class SortTypeBottomSheetFragment extends BottomSheetDialogFragment {
+public class SortTypeBottomSheetFragment extends RoundedBottomSheetDialogFragment {
interface SortTypeSelectionCallback {
void sortTypeSelected(String sortType);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
index e6ff9bfe..9996a4af 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
@@ -8,7 +8,6 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
@@ -23,7 +22,6 @@ import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
-import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.chip.Chip;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
@@ -43,7 +41,8 @@ import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;
-public class ViewSubredditDetailActivity extends AppCompatActivity implements SortTypeBottomSheetFragment.SortTypeSelectionCallback {
+public class ViewSubredditDetailActivity extends AppCompatActivity implements SortTypeBottomSheetFragment.SortTypeSelectionCallback,
+ PostTypeBottomSheetFragment.PostTypeSelectionCallback {
public static final String EXTRA_SUBREDDIT_NAME_KEY = "ESN";
@@ -71,7 +70,7 @@ public class ViewSubredditDetailActivity extends AppCompatActivity implements So
private Fragment mFragment;
private Menu mMenu;
private AppBarLayout.LayoutParams params;
- private BottomSheetDialog dialog;
+ private PostTypeBottomSheetFragment postTypeBottomSheetFragment;
private SortTypeBottomSheetFragment sortTypeBottomSheetFragment;
private SubscribedSubredditDao subscribedSubredditDao;
@@ -98,15 +97,7 @@ public class ViewSubredditDetailActivity extends AppCompatActivity implements So
((Infinity) getApplication()).getmAppComponent().inject(this);
- View dialogView = View.inflate(this, R.layout.post_type_bottom_sheet, null);
- LinearLayout textTypeLinearLayout = dialogView.findViewById(R.id.text_type_linear_layout_post_type_bottom_sheet);
- LinearLayout linkTypeLinearLayout = dialogView.findViewById(R.id.link_type_linear_layout_post_type_bottom_sheet);
- LinearLayout imageTypeLinearLayout = dialogView.findViewById(R.id.image_type_linear_layout_post_type_bottom_sheet);
- LinearLayout videoTypeLinearLayout = dialogView.findViewById(R.id.video_type_linear_layout_post_type_bottom_sheet);
-
- dialog = new BottomSheetDialog(this);
- dialog.setContentView(dialogView);
-
+ postTypeBottomSheetFragment = new PostTypeBottomSheetFragment();
sortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
params = (AppBarLayout.LayoutParams) collapsingToolbarLayout.getLayoutParams();
@@ -277,37 +268,7 @@ public class ViewSubredditDetailActivity extends AppCompatActivity implements So
getSupportFragmentManager().beginTransaction().replace(R.id.frame_layout_view_subreddit_detail_activity, mFragment).commit();
}
- textTypeLinearLayout.setOnClickListener(view -> {
- Intent intent = new Intent(this, PostTextActivity.class);
- intent.putExtra(PostTextActivity.EXTRA_SUBREDDIT_NAME, subredditName);
- startActivity(intent);
- dialog.dismiss();
- });
-
- linkTypeLinearLayout.setOnClickListener(view -> {
- Intent intent = new Intent(this, PostLinkActivity.class);
- intent.putExtra(PostLinkActivity.EXTRA_SUBREDDIT_NAME, subredditName);
- startActivity(intent);
- dialog.dismiss();
- });
-
- imageTypeLinearLayout.setOnClickListener(view -> {
- Intent intent = new Intent(this, PostImageActivity.class);
- intent.putExtra(PostImageActivity.EXTRA_SUBREDDIT_NAME, subredditName);
- startActivity(intent);
- dialog.dismiss();
- });
-
- videoTypeLinearLayout.setOnClickListener(view -> {
- Intent intent = new Intent(this, PostVideoActivity.class);
- intent.putExtra(PostVideoActivity.EXTRA_SUBREDDIT_NAME, subredditName);
- startActivity(intent);
- dialog.dismiss();
- });
-
- fab.setOnClickListener(view -> {
- dialog.show();
- });
+ fab.setOnClickListener(view -> postTypeBottomSheetFragment.show(getSupportFragmentManager(), postTypeBottomSheetFragment.getTag()));
}
@Override
@@ -395,6 +356,32 @@ public class ViewSubredditDetailActivity extends AppCompatActivity implements So
replaceFragment(sortType);
}
+ @Override
+ public void postTypeSelected(int postType) {
+ Intent intent;
+ switch (postType) {
+ case PostTypeBottomSheetFragment.TYPE_TEXT:
+ intent = new Intent(this, PostTextActivity.class);
+ intent.putExtra(PostTextActivity.EXTRA_SUBREDDIT_NAME, subredditName);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_LINK:
+ intent = new Intent(this, PostLinkActivity.class);
+ intent.putExtra(PostTextActivity.EXTRA_SUBREDDIT_NAME, subredditName);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_IMAGE:
+ intent = new Intent(this, PostImageActivity.class);
+ intent.putExtra(PostTextActivity.EXTRA_SUBREDDIT_NAME, subredditName);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_VIDEO:
+ intent = new Intent(this, PostVideoActivity.class);
+ intent.putExtra(PostTextActivity.EXTRA_SUBREDDIT_NAME, subredditName);
+ startActivity(intent);
+ }
+ }
+
private static class InsertSubredditDataAsyncTask extends AsyncTask<Void, Void, Void> {
private SubredditDao mSubredditDao;
diff --git a/app/src/main/res/layout/post_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml
index 092495c4..1e3659d1 100644
--- a/app/src/main/res/layout/post_type_bottom_sheet.xml
+++ b/app/src/main/res/layout/fragment_post_type_bottom_sheet.xml
@@ -1,20 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:paddingBottom="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="16dp"
+ android:paddingTop="24dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:text="@string/bottom_sheet_post_type"
android:textSize="18sp" />
<LinearLayout
- android:id="@+id/text_type_linear_layout_post_type_bottom_sheet"
+ android:id="@+id/text_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" >
@@ -31,17 +38,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:text="@string/bottom_sheet_post_text"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp" />
+ android:text="@string/bottom_sheet_post_text" />
</LinearLayout>
<LinearLayout
- android:id="@+id/link_type_linear_layout_post_type_bottom_sheet"
+ android:id="@+id/link_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" >
@@ -58,17 +66,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:text="@string/bottom_sheet_post_link"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp" />
+ android:text="@string/bottom_sheet_post_link" />
</LinearLayout>
<LinearLayout
- android:id="@+id/image_type_linear_layout_post_type_bottom_sheet"
+ android:id="@+id/image_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" >
@@ -85,18 +94,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:text="@string/bottom_sheet_post_image"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp" />
+ android:text="@string/bottom_sheet_post_image" />
</LinearLayout>
<LinearLayout
- android:id="@+id/video_type_linear_layout_post_type_bottom_sheet"
+ android:id="@+id/video_type_linear_layout_post_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" >
@@ -113,9 +123,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:text="@string/bottom_sheet_post_video"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp" />
+ android:text="@string/bottom_sheet_post_video" />
</LinearLayout>
diff --git a/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml b/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml
index bdf38858..d3977d81 100644
--- a/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml
+++ b/app/src/main/res/layout/fragment_sort_type_bottom_sheet.xml
@@ -1,13 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:paddingBottom="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="16dp"
+ android:paddingTop="24dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:text="@string/sort"
+ android:textColor="@color/primaryTextColor"
android:textSize="18sp" />
<TextView
@@ -15,9 +20,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_best"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -27,9 +33,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_hot"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -39,9 +46,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_new"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -51,9 +59,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_random"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -63,9 +72,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_rising"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -75,9 +85,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/sort_top"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
@@ -86,10 +97,11 @@
android:id="@+id/controversial_type_text_view_sort_type_bottom_sheet_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/sort_rising"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
+ android:text="@string/sort_controversial"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="32dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground" />
diff --git a/app/src/main/res/layout/sort_type_bottom_sheet.xml b/app/src/main/res/layout/sort_type_bottom_sheet.xml
deleted file mode 100644
index 5951b431..00000000
--- a/app/src/main/res/layout/sort_type_bottom_sheet.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="16dp"
- android:text="@string/sort"
- android:textSize="18sp" />
-
- <TextView
- android:id="@+id/best_type_text_view_sort_type_bottom_sheet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/sort_best"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
- android:clickable="true"
- android:focusable="true"
- android:background="?attr/selectableItemBackground" />
-
- <TextView
- android:id="@+id/hot_type_text_view_sort_type_bottom_sheet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/sort_hot"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
- android:clickable="true"
- android:focusable="true"
- android:background="?attr/selectableItemBackground" />
-
- <TextView
- android:id="@+id/new_type_text_view_sort_type_bottom_sheet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/sort_new"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
- android:clickable="true"
- android:focusable="true"
- android:background="?attr/selectableItemBackground" />
-
- <TextView
- android:id="@+id/random_type_text_view_sort_type_bottom_sheet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/sort_random"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
- android:clickable="true"
- android:focusable="true"
- android:background="?attr/selectableItemBackground" />
-
- <TextView
- android:id="@+id/rising_type_text_view_sort_type_bottom_sheet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/sort_rising"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
- android:clickable="true"
- android:focusable="true"
- android:background="?attr/selectableItemBackground" />
-
- <TextView
- android:id="@+id/top_type_text_view_sort_type_bottom_sheet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/sort_top"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
- android:clickable="true"
- android:focusable="true"
- android:background="?attr/selectableItemBackground" />
-
- <TextView
- android:id="@+id/controversial_type_text_view_sort_type_bottom_sheet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/sort_rising"
- android:textColor="@color/primaryTextColor"
- android:textSize="18sp"
- android:padding="16dp"
- android:clickable="true"
- android:focusable="true"
- android:background="?attr/selectableItemBackground" />
-
-</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 1112f7b3..a4f27cd2 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -23,4 +23,6 @@
<color name="backgroundColor">#FFFFFF</color>
<color name="backgroundColorPrimaryDark">@color/colorPrimaryDark</color>
+
+ <color name="roundedBottomSheetPrimaryNavigationBarColor">#000000</color>
</resources>
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 5a6277cf..ddc21110 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -7,4 +7,7 @@
<dimen name="fab_margin">16dp</dimen>
<dimen name="app_bar_height">180dp</dimen>
<dimen name="text_margin">16dp</dimen>
+ <dimen name="roundedBottomSheetCornerRadiusTopPadding">0dp</dimen>
+ <dimen name="roundedBottomSheetCornerRadiusLeftPadding">0dp</dimen>
+ <dimen name="roundedBottomSheetCornerRadiusRightPadding">0dp</dimen>
</resources> \ No newline at end of file