fixed actions displayed in retweet dialog

This commit is contained in:
Mariotaku Lee 2018-08-07 18:40:39 +08:00
parent 1812d8b86e
commit 8d1955995b
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
4 changed files with 15 additions and 6 deletions

View File

@ -7,5 +7,6 @@ data class ItemDisplayOption(
@ImageShapeStyle @ImageShapeStyle
var profileImageStyle: Int, var profileImageStyle: Int,
var textSize: Float, var textSize: Float,
var showAbsoluteTime: Boolean var showAbsoluteTime: Boolean,
var showActions: Boolean
) )

View File

@ -187,19 +187,17 @@ class StatusViewHolder(var adapter: IStatusesAdapter, val binding: ItemStatusBin
val context = itemView.context val context = itemView.context
val formatter = BidiFormatterSingleton.get() val formatter = BidiFormatterSingleton.get()
val colorNameManager = UserColorNameManager.get(context) val colorNameManager = UserColorNameManager.get(context)
val showCardActions = isCardActionsShown
val display = status.displayInfo(context) val display = status.displayInfo(context)
binding.status = status binding.status = status
binding.showActions = isCardActionsShown
replyButton.alpha = 1f replyButton.alpha = 1f
retweetButton.alpha = 1f retweetButton.alpha = 1f
favoriteButton.alpha = 1f favoriteButton.alpha = 1f
itemMenu.alpha = 1f itemMenu.alpha = 1f
itemActionsGroup.setVisible(showCardActions)
if (displayPinned && status.is_pinned_status) { if (displayPinned && status.is_pinned_status) {
statusInfoLabel.setText(R.string.pinned_status) statusInfoLabel.setText(R.string.pinned_status)
statusInfoIcon.setImageResource(R.drawable.ic_activity_action_pinned) statusInfoIcon.setImageResource(R.drawable.ic_activity_action_pinned)

View File

@ -23,6 +23,8 @@
<data> <data>
<import type="android.view.View" />
<import type="org.mariotaku.twidere.R" /> <import type="org.mariotaku.twidere.R" />
<import type="org.mariotaku.twidere.model.ParcelableStatus" /> <import type="org.mariotaku.twidere.model.ParcelableStatus" />
@ -31,9 +33,17 @@
name="status" name="status"
type="org.mariotaku.twidere.model.ParcelableStatus" /> type="org.mariotaku.twidere.model.ParcelableStatus" />
<variable
name="displayOption"
type="org.mariotaku.twidere.model.adapter.ItemDisplayOption" />
<variable <variable
name="useFavorite" name="useFavorite"
type="boolean" /> type="boolean" />
<variable
name="showActions"
type="boolean" />
</data> </data>
<org.mariotaku.twidere.view.ColorLabelConstraintLayout <org.mariotaku.twidere.view.ColorLabelConstraintLayout
@ -261,7 +271,7 @@
android:id="@+id/itemActionsGroup" android:id="@+id/itemActionsGroup"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:visibility="visible" android:visibility="@{showActions ? View.VISIBLE : View.GONE}"
app:constraint_referenced_ids="reply,retweet,favorite,itemMenu" /> app:constraint_referenced_ids="reply,retweet,favorite,itemMenu" />

View File

@ -4,6 +4,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<include layout="@layout/list_item_status"/> <include layout="@layout/item_status"/>
</FrameLayout> </FrameLayout>