aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-02-27 05:15:32 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-02-27 05:15:32 +0000
commitfb525d62ed630c9731a4704ad3b9848b0fc10752 (patch)
tree28e0722e20850218351695854e83d6d65d2cd561
parentacc08489fa9df2519608dbfaa08b18a33b93c9d8 (diff)
downloadinfinity-for-reddit-fb525d62ed630c9731a4704ad3b9848b0fc10752.tar
infinity-for-reddit-fb525d62ed630c9731a4704ad3b9848b0fc10752.tar.gz
infinity-for-reddit-fb525d62ed630c9731a4704ad3b9848b0fc10752.tar.bz2
infinity-for-reddit-fb525d62ed630c9731a4704ad3b9848b0fc10752.tar.lz
infinity-for-reddit-fb525d62ed630c9731a4704ad3b9848b0fc10752.tar.xz
infinity-for-reddit-fb525d62ed630c9731a4704ad3b9848b0fc10752.tar.zst
infinity-for-reddit-fb525d62ed630c9731a4704ad3b9848b0fc10752.zip
Don't draw under display cutouts in landscape mode (API >= 28).
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java14
-rw-r--r--app/src/main/res/layout/activity_main.xml3
-rw-r--r--app/src/main/res/values-land-v28/styles.xml13
4 files changed, 22 insertions, 12 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java
index 1113acd3..ad27c1b9 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java
@@ -3,7 +3,6 @@ package ml.docilealligator.infinityforreddit;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -102,8 +101,7 @@ public class SubredditListingRecyclerViewAdapter extends PagedListAdapter<Subred
context.startActivity(intent);
});
- if(subredditData.getIconUrl() != null) {
- Log.i("url", subredditData.getIconUrl());
+ if(!subredditData.getIconUrl().equals("")) {
glide.load(subredditData.getIconUrl())
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
.error(glide.load(R.drawable.subreddit_default_icon)
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java
index 76cf14b5..5a49f51f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java
@@ -94,15 +94,15 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if(holder instanceof UserListingRecyclerViewAdapter.DataViewHolder) {
- UserData UserData = getItem(position);
+ UserData userData = getItem(position);
((UserListingRecyclerViewAdapter.DataViewHolder) holder).constraintLayout.setOnClickListener(view -> {
Intent intent = new Intent(context, ViewUserDetailActivity.class);
- intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, UserData.getName());
+ intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, userData.getName());
context.startActivity(intent);
});
- if(UserData.getIconUrl() != null) {
- glide.load(UserData.getIconUrl())
+ if(!userData.getIconUrl().equals("")) {
+ glide.load(userData.getIconUrl())
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
.error(glide.load(R.drawable.subreddit_default_icon)
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
@@ -113,9 +113,9 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R
.into(((UserListingRecyclerViewAdapter.DataViewHolder) holder).iconGifImageView);
}
- ((UserListingRecyclerViewAdapter.DataViewHolder) holder).UserNameTextView.setText(UserData.getName());
+ ((UserListingRecyclerViewAdapter.DataViewHolder) holder).UserNameTextView.setText(userData.getName());
- new CheckIsFollowingUserAsyncTask(subscribedUserDao, UserData.getName(),
+ new CheckIsFollowingUserAsyncTask(subscribedUserDao, userData.getName(),
new CheckIsFollowingUserAsyncTask.CheckIsFollowingUserListener() {
@Override
public void isSubscribed() {
@@ -127,7 +127,7 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R
((UserListingRecyclerViewAdapter.DataViewHolder) holder).subscribeButton.setVisibility(View.VISIBLE);
((UserListingRecyclerViewAdapter.DataViewHolder) holder).subscribeButton.setOnClickListener(view -> {
UserFollowing.followUser(oauthRetrofit, retrofit,
- authInfoSharedPreferences, UserData.getName(), subscribedUserDao,
+ authInfoSharedPreferences, userData.getName(), subscribedUserDao,
new UserFollowing.UserFollowingListener() {
@Override
public void onUserFollowingSuccess() {
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 6a5a0aff..13eec540 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -17,8 +17,7 @@
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:layout_gravity="start"
- android:fitsSystemWindows="true">
+ android:layout_gravity="start">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
diff --git a/app/src/main/res/values-land-v28/styles.xml b/app/src/main/res/values-land-v28/styles.xml
new file mode 100644
index 00000000..752c9c87
--- /dev/null
+++ b/app/src/main/res/values-land-v28/styles.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <style name="AppTheme" parent="Theme.MaterialComponents.Light">
+ <!-- Customize your theme here. -->
+ <item name="colorPrimary">@color/colorPrimary</item>
+ <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+ <item name="colorAccent">@color/colorAccent</item>
+ <item name="android:windowLayoutInDisplayCutoutMode">never</item>
+ <item name="android:navigationBarColor">@android:color/black</item>
+ <item name="android:textColorPrimary">@android:color/white</item>
+ </style>
+</resources> \ No newline at end of file