mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Merge branch '2152-rss-icon' into 'master'
Resolve "RSS icon doesn't appear on older devices" Closes #2152 See merge request briar/briar!1523
This commit is contained in:
@@ -110,7 +110,7 @@ dependencies {
|
||||
|
||||
implementation 'info.guardianproject.panic:panic:1.0'
|
||||
implementation 'info.guardianproject.trustedintents:trustedintents:0.2'
|
||||
implementation 'de.hdodenhof:circleimageview:3.0.1'
|
||||
implementation 'de.hdodenhof:circleimageview:3.1.0'
|
||||
implementation 'com.google.zxing:core:3.3.3' // newer version need minSdk 24
|
||||
implementation 'uk.co.samuelwall:material-tap-target-prompt:3.3.0'
|
||||
implementation 'com.vanniktech:emoji-google:0.6.0' // newer versions need minSdk 21
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package org.briarproject.briar.android.blog;
|
||||
|
||||
import org.briarproject.bramble.api.identity.Author;
|
||||
import org.briarproject.briar.api.identity.AuthorInfo;
|
||||
import org.briarproject.bramble.api.sync.GroupId;
|
||||
import org.briarproject.bramble.api.sync.MessageId;
|
||||
import org.briarproject.briar.api.blog.BlogPostHeader;
|
||||
import org.briarproject.briar.api.identity.AuthorInfo;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.concurrent.NotThreadSafe;
|
||||
@@ -50,7 +50,7 @@ public class BlogPostItem implements Comparable<BlogPostItem> {
|
||||
return text;
|
||||
}
|
||||
|
||||
public boolean isRssFeed() {
|
||||
boolean isRssFeed() {
|
||||
return header.isRssFeed();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import androidx.annotation.UiThread;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import static android.os.Build.VERSION.SDK_INT;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
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 ViewGroup commentContainer;
|
||||
private final boolean fullText, authorClickable;
|
||||
private final int padding;
|
||||
|
||||
private final OnBlogPostClickListener listener;
|
||||
|
||||
@@ -61,6 +63,8 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
|
||||
reblogButton = v.findViewById(R.id.commentView);
|
||||
text = v.findViewById(R.id.textView);
|
||||
commentContainer = v.findViewById(R.id.commentContainer);
|
||||
padding = ctx.getResources()
|
||||
.getDimensionPixelSize(R.dimen.listitem_vertical_margin);
|
||||
}
|
||||
|
||||
void hideReblogButton() {
|
||||
@@ -129,6 +133,12 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
|
||||
} else {
|
||||
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) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.briarproject.briar.android.view;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.ImageView;
|
||||
@@ -29,6 +30,7 @@ import im.delight.android.identicons.IdenticonDrawable;
|
||||
import static android.content.Context.LAYOUT_INFLATER_SERVICE;
|
||||
import static android.graphics.Typeface.BOLD;
|
||||
import static android.util.TypedValue.COMPLEX_UNIT_PX;
|
||||
import static androidx.appcompat.content.res.AppCompatResources.getDrawable;
|
||||
import static org.briarproject.briar.android.util.UiUtils.getContactDisplayName;
|
||||
import static org.briarproject.briar.android.util.UiUtils.resolveAttribute;
|
||||
import static org.briarproject.briar.api.identity.AuthorInfo.Status.NONE;
|
||||
@@ -177,14 +179,14 @@ public class AuthorView extends ConstraintLayout {
|
||||
case RSS_FEED:
|
||||
avatarIcon.setVisibility(INVISIBLE);
|
||||
date.setVisibility(VISIBLE);
|
||||
avatar.setImageResource(R.drawable.ic_rss_feed);
|
||||
setRssVectorAvatar();
|
||||
setAvatarSize(R.dimen.blogs_avatar_normal_size);
|
||||
setTextSize(authorName, R.dimen.text_size_small);
|
||||
break;
|
||||
case RSS_FEED_REBLOGGED:
|
||||
avatarIcon.setVisibility(INVISIBLE);
|
||||
date.setVisibility(VISIBLE);
|
||||
avatar.setImageResource(R.drawable.ic_rss_feed);
|
||||
setRssVectorAvatar();
|
||||
setAvatarSize(R.dimen.blogs_avatar_comment_size);
|
||||
setTextSize(authorName, R.dimen.text_size_tiny);
|
||||
break;
|
||||
@@ -204,4 +206,16 @@ public class AuthorView extends ConstraintLayout {
|
||||
v.setTextSize(COMPLEX_UNIT_PX, textSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies special hack to use AppCompat vector drawable support
|
||||
* when setting the RSS vector drawable to the avatar view.
|
||||
* {@link ImageView#setImageResource(int)} is not working as
|
||||
* {@link CircleImageView} is not using
|
||||
* {@link androidx.appcompat.widget.AppCompatImageView}.
|
||||
*/
|
||||
private void setRssVectorAvatar() {
|
||||
Drawable d = getDrawable(getContext(), R.drawable.ic_rss_feed);
|
||||
avatar.setImageDrawable(d);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/listitem_vertical_margin"
|
||||
android:paddingLeft="@dimen/listitem_vertical_margin"
|
||||
android:paddingEnd="@dimen/listitem_vertical_margin"
|
||||
android:paddingRight="@dimen/listitem_vertical_margin"
|
||||
android:paddingBottom="@dimen/listitem_vertical_margin"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="@dimen/text_size_small"
|
||||
|
||||
@@ -147,7 +147,7 @@ dependencyVerification {
|
||||
'com.vanniktech:emoji:0.6.0:emoji-0.6.0.aar:a5fcde58902305c004f03c6dc2241e718400ac4162226079791d87fac83ef639',
|
||||
'commons-codec:commons-codec:1.10:commons-codec-1.10.jar:4241dfa94e711d435f29a4604a3e2de5c4aa3c165e23bd066be6fc1fc4309569',
|
||||
'commons-logging:commons-logging:1.2:commons-logging-1.2.jar:daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636',
|
||||
'de.hdodenhof:circleimageview:3.0.1:circleimageview-3.0.1.aar:7b0f088436ad4dcbb36d779fd09bf2192d9cc1e1a734bb6337904a7648f97617',
|
||||
'de.hdodenhof:circleimageview:3.1.0:circleimageview-3.1.0.aar:8e9965b54072ee159074a55df216e17d5a622c94ce915ef311b1a1f32660c7fb',
|
||||
'info.guardianproject.panic:panic:1.0:panic-1.0.jar:35116ab95212e67f94577faf67b88c11a6b21cbf9178b3f5b51d3dff45203ffd',
|
||||
'info.guardianproject.trustedintents:trustedintents:0.2:trustedintents-0.2.jar:6221456d8821a8d974c2acf86306900237cf6afaaa94a4c9c44e161350f80f3e',
|
||||
'it.unimi.dsi:fastutil:7.2.0:fastutil-7.2.0.jar:74fa208043740642f7e6eb09faba15965218ad2f50ce3020efb100136e4b591c',
|
||||
|
||||
Reference in New Issue
Block a user