adapter: replace simple viewholders by SingleViewHolder(extended from RecyclerView.ViewHolder but allowed to instantiate)
parent
78cf552a32
commit
8d89f83bae
@ -1,39 +0,0 @@ |
|||||||
package com.keylesspalace.tusky.adapter; |
|
||||||
|
|
||||||
import android.content.ClipData; |
|
||||||
import android.content.ClipboardManager; |
|
||||||
import android.content.Context; |
|
||||||
import android.graphics.drawable.Drawable; |
|
||||||
import android.text.method.LinkMovementMethod; |
|
||||||
import android.view.LayoutInflater; |
|
||||||
import android.view.View; |
|
||||||
import android.widget.TextView; |
|
||||||
import android.widget.Toast; |
|
||||||
import android.util.Log; |
|
||||||
|
|
||||||
import androidx.annotation.Nullable; |
|
||||||
import androidx.emoji.widget.EmojiAppCompatButton; |
|
||||||
import androidx.recyclerview.widget.RecyclerView; |
|
||||||
import com.google.android.flexbox.FlexboxLayoutManager; |
|
||||||
|
|
||||||
import com.keylesspalace.tusky.R; |
|
||||||
import com.keylesspalace.tusky.entity.Status; |
|
||||||
import com.keylesspalace.tusky.entity.EmojiReaction; |
|
||||||
import com.keylesspalace.tusky.interfaces.StatusActionListener; |
|
||||||
import com.keylesspalace.tusky.util.CardViewMode; |
|
||||||
import com.keylesspalace.tusky.util.LinkHelper; |
|
||||||
import com.keylesspalace.tusky.util.StatusDisplayOptions; |
|
||||||
import com.keylesspalace.tusky.viewdata.StatusViewData; |
|
||||||
|
|
||||||
import java.text.DateFormat; |
|
||||||
import java.util.List; |
|
||||||
import java.util.Date; |
|
||||||
|
|
||||||
public class EmojiReactionViewHolder extends RecyclerView.ViewHolder { |
|
||||||
public EmojiAppCompatButton emojiReaction; |
|
||||||
EmojiReactionViewHolder(View view) { |
|
||||||
super(view); |
|
||||||
emojiReaction = view.findViewById(R.id.status_emoji_reaction); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
@ -0,0 +1,11 @@ |
|||||||
|
package com.keylesspalace.tusky.adapter; |
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView; |
||||||
|
import android.view.View; |
||||||
|
|
||||||
|
// empty class to be able to instantiate ViewHolder which is abstract for dumbass reason
|
||||||
|
public class SingleViewHolder extends RecyclerView.ViewHolder { |
||||||
|
public SingleViewHolder(View view) { |
||||||
|
super(view); |
||||||
|
} |
||||||
|
} |
@ -1,24 +1,17 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
<androidx.emoji.widget.EmojiAppCompatButton |
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
xmlns:tools="http://schemas.android.com/tools" |
xmlns:tools="http://schemas.android.com/tools" |
||||||
android:layout_width="wrap_content" |
android:layout_width="wrap_content" |
||||||
android:layout_height="wrap_content"> |
android:layout_height="wrap_content" |
||||||
|
android:layout_marginRight="2dp" |
||||||
<!-- not a best way but I'm lazy to do proper button --> |
android:layout_marginBottom="1dp" |
||||||
<androidx.emoji.widget.EmojiAppCompatButton |
android:minWidth="0dp" |
||||||
android:id="@+id/status_emoji_reaction" |
android:lines="1" |
||||||
android:layout_width="wrap_content" |
android:textAlignment="viewStart" |
||||||
android:layout_height="wrap_content" |
android:textColor="?android:attr/textColorPrimary" |
||||||
android:layout_marginRight="2dp" |
android:textSize="?attr/status_text_medium" |
||||||
android:layout_marginBottom="1dp" |
app:backgroundTint="@color/emoji_reaction_button" |
||||||
android:minWidth="0dp" |
tools:text="A 0" /> |
||||||
android:lines="1" |
|
||||||
android:textAlignment="viewStart" |
|
||||||
android:textColor="?android:attr/textColorPrimary" |
|
||||||
android:textSize="?attr/status_text_medium" |
|
||||||
app:backgroundTint="@color/emoji_reaction_button" |
|
||||||
tools:text="A 0" /> |
|
||||||
|
|
||||||
</FrameLayout> |
|
||||||
|
|
||||||
|
Loading…
Reference in new issue