mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Fix blog post padding on Android 4
This commit is contained in:
@@ -20,6 +20,7 @@ import androidx.annotation.UiThread;
|
|||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import static android.os.Build.VERSION.SDK_INT;
|
||||||
import static android.view.View.GONE;
|
import static android.view.View.GONE;
|
||||||
import static android.view.View.VISIBLE;
|
import static android.view.View.VISIBLE;
|
||||||
import static org.briarproject.briar.android.activity.BriarActivity.GROUP_ID;
|
import static org.briarproject.briar.android.activity.BriarActivity.GROUP_ID;
|
||||||
@@ -44,6 +45,7 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
|
|||||||
private final TextView text;
|
private final TextView text;
|
||||||
private final ViewGroup commentContainer;
|
private final ViewGroup commentContainer;
|
||||||
private final boolean fullText, authorClickable;
|
private final boolean fullText, authorClickable;
|
||||||
|
private final int padding;
|
||||||
|
|
||||||
private final OnBlogPostClickListener listener;
|
private final OnBlogPostClickListener listener;
|
||||||
|
|
||||||
@@ -61,6 +63,8 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
|
|||||||
reblogButton = v.findViewById(R.id.commentView);
|
reblogButton = v.findViewById(R.id.commentView);
|
||||||
text = v.findViewById(R.id.textView);
|
text = v.findViewById(R.id.textView);
|
||||||
commentContainer = v.findViewById(R.id.commentContainer);
|
commentContainer = v.findViewById(R.id.commentContainer);
|
||||||
|
padding = ctx.getResources()
|
||||||
|
.getDimensionPixelSize(R.dimen.listitem_vertical_margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hideReblogButton() {
|
void hideReblogButton() {
|
||||||
@@ -129,6 +133,12 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
|
|||||||
} else {
|
} else {
|
||||||
reblogger.setVisibility(GONE);
|
reblogger.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply Android 4 padding fix after setting up author/reblogger views
|
||||||
|
if (SDK_INT < 21) {
|
||||||
|
reblogger.setPadding(padding, padding, padding, padding);
|
||||||
|
author.setPadding(padding, padding, padding, padding);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onBindComment(BlogCommentItem item, boolean authorClickable) {
|
private void onBindComment(BlogCommentItem item, boolean authorClickable) {
|
||||||
|
|||||||
@@ -27,7 +27,9 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="@dimen/listitem_vertical_margin"
|
android:paddingStart="@dimen/listitem_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/listitem_vertical_margin"
|
||||||
android:paddingEnd="@dimen/listitem_vertical_margin"
|
android:paddingEnd="@dimen/listitem_vertical_margin"
|
||||||
|
android:paddingRight="@dimen/listitem_vertical_margin"
|
||||||
android:paddingBottom="@dimen/listitem_vertical_margin"
|
android:paddingBottom="@dimen/listitem_vertical_margin"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:textSize="@dimen/text_size_small"
|
android:textSize="@dimen/text_size_small"
|
||||||
|
|||||||
Reference in New Issue
Block a user