aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
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 /app/src/main/java/ml
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).
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java14
2 files changed, 8 insertions, 10 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() {