Corrects number localization and adjusts the padding of the reblog avatars in right-to-left layout direction.
This commit is contained in:
parent
68e3ec67c5
commit
8559a6d75c
5 changed files with 14 additions and 5 deletions
|
@ -17,6 +17,7 @@ package com.keylesspalace.tusky.adapter;
|
|||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
|
@ -129,7 +130,12 @@ public class StatusViewHolder extends RecyclerView.ViewHolder {
|
|||
Context context = avatar.getContext();
|
||||
boolean hasReblog = rebloggedUrl != null && !rebloggedUrl.isEmpty();
|
||||
int padding = hasReblog ? Utils.dpToPx(context, 12) : 0;
|
||||
avatar.setPadding(0, 0, padding, padding);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
|
||||
avatar.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
|
||||
avatar.setPadding(padding, 0, 0, padding);
|
||||
} else {
|
||||
avatar.setPadding(0, 0, padding, padding);
|
||||
}
|
||||
|
||||
if (url.isEmpty()) {
|
||||
avatar.setImageResource(R.drawable.avatar_default);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue