mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-07 03:07:26 +01:00
Don't draw under display cutouts in landscape mode (API >= 28).
This commit is contained in:
parent
acc08489fa
commit
fb525d62ed
@ -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)
|
||||
|
@ -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() {
|
||||
|
@ -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"
|
||||
|
13
app/src/main/res/values-land-v28/styles.xml
Normal file
13
app/src/main/res/values-land-v28/styles.xml
Normal file
@ -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>
|
Loading…
Reference in New Issue
Block a user