From fb525d62ed630c9731a4704ad3b9848b0fc10752 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Wed, 27 Feb 2019 13:15:32 +0800 Subject: [PATCH] Don't draw under display cutouts in landscape mode (API >= 28). --- .../SubredditListingRecyclerViewAdapter.java | 4 +--- .../UserListingRecyclerViewAdapter.java | 14 +++++++------- app/src/main/res/layout/activity_main.xml | 3 +-- app/src/main/res/values-land-v28/styles.xml | 13 +++++++++++++ 4 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 app/src/main/res/values-land-v28/styles.xml 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 { 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 { 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"> + + + + \ No newline at end of file