diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java index af5833b12..30dbd3cf1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusViewHolder.java @@ -130,9 +130,8 @@ public class StatusViewHolder extends RecyclerView.ViewHolder { Context context = avatar.getContext(); boolean hasReblog = rebloggedUrl != null && !rebloggedUrl.isEmpty(); int padding = hasReblog ? Utils.dpToPx(context, 12) : 0; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && - avatar.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) { - avatar.setPadding(padding, 0, 0, padding); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + avatar.setPaddingRelative(0, 0, padding, padding); } else { avatar.setPadding(0, 0, padding, padding); } @@ -369,7 +368,8 @@ public class StatusViewHolder extends RecyclerView.ViewHolder { sensitiveMediaWarning.setVisibility(View.GONE); } - private void setSpoilerText(String spoilerText, final boolean expanded, final StatusActionListener listener) { + private void setSpoilerText(String spoilerText, final boolean expanded, + final StatusActionListener listener) { contentWarningDescription.setText(spoilerText); contentWarningBar.setVisibility(View.VISIBLE); contentWarningButton.setChecked(expanded); diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index f98b34c69..3df0db63d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -43,6 +43,7 @@ import com.keylesspalace.tusky.entity.Status; import com.keylesspalace.tusky.interfaces.StatusActionListener; import com.keylesspalace.tusky.receiver.TimelineReceiver; import com.keylesspalace.tusky.util.HttpHeaderLink; +import com.keylesspalace.tusky.util.ListUtils; import com.keylesspalace.tusky.util.PairedList; import com.keylesspalace.tusky.util.ThemeUtils; import com.keylesspalace.tusky.util.ViewDataUtils; @@ -436,7 +437,7 @@ public class NotificationsFragment extends SFragment implements public void update(@Nullable List newNotifications, @Nullable String fromId, @Nullable String uptoId) { - if (newNotifications == null || newNotifications.isEmpty()) { + if (ListUtils.isEmpty(newNotifications)) { return; } if (fromId != null) { @@ -465,12 +466,15 @@ public class NotificationsFragment extends SFragment implements } public void addItems(List newNotifications, @Nullable String fromId) { + if (ListUtils.isEmpty(newNotifications)) { + return; + } if (fromId != null) { bottomId = fromId; } int end = notifications.size(); Notification last = notifications.get(end - 1); - if (last != null && !findNotification(newNotifications, last.id) && newNotifications.size() > 0) { + if (last != null && !findNotification(newNotifications, last.id)) { notifications.addAll(newNotifications); List newViewDatas = notifications.getPairedCopy() .subList(notifications.size() - newNotifications.size(), diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java index 87579446f..0a6b7d2cc 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -642,7 +642,9 @@ public class TimelineFragment extends SFragment implements newStatuses.size(), newViewDatas.size(), statuses.size()); throw new AssertionError(error); } - if (fromId != null) bottomId = fromId; + if (fromId != null) { + bottomId = fromId; + } adapter.addItems(newViewDatas); } } diff --git a/app/src/main/res/drawable/ic_check_in_box_24dp.xml b/app/src/main/res/drawable/ic_check_in_box_24dp.xml deleted file mode 100644 index f73e39df6..000000000 --- a/app/src/main/res/drawable/ic_check_in_box_24dp.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_exit_to_app_24dp.xml b/app/src/main/res/drawable/ic_exit_to_app_24dp.xml deleted file mode 100644 index 93378231f..000000000 --- a/app/src/main/res/drawable/ic_exit_to_app_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - -