Removes unused icons and does bits of cleanup.

This commit is contained in:
Vavassor 2017-07-14 23:23:14 -04:00
parent 36fe864c3f
commit c7f3354c40
5 changed files with 13 additions and 23 deletions

View File

@ -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);

View File

@ -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<Notification> 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<Notification> 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<NotificationViewData> newViewDatas = notifications.getPairedCopy()
.subList(notifications.size() - newNotifications.size(),

View File

@ -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);
}
}

View File

@ -1,7 +0,0 @@
<vector android:height="24dp" android:viewportHeight="35.43307"
android:viewportWidth="35.43307" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="M32.16,4.46L31.62,5.01L14.63,21.99L5.78,13.13L2.5,16.41L14.52,28.43L14.55,28.41L14.66,28.52L35.44,7.74L34.89,7.19C34.17,6.46 33.44,5.74 32.71,5.01L32.16,4.46z" />
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="m1.1,6.19c-0.58,0 -1.07,0.49 -1.07,1.07l0,23.06c0,0.58 0.49,1.07 1.07,1.07l23.06,0c0.58,0 1.07,-0.49 1.07,-1.07l0,-18.89 -1.54,1.54 0,16.88 -22.12,0 0,-22.12 22.12,0 0,2.83 1.54,-1.54 0,-1.76c0,-0.58 -0.49,-1.07 -1.07,-1.07l-23.06,0z" />
</vector>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/toolbar_icon_dark"
android:pathData="M10.09,15.59L11.5,17l5,-5 -5,-5 -1.41,1.41L12.67,11H3v2h9.67l-2.58,2.59zM19,3H5c-1.11,0 -2,0.9 -2,2v4h2V5h14v14H5v-4H3v4c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2z"/>
</vector>