mirror of
https://github.com/tateisu/SubwayTooter
synced 2025-01-30 10:34:53 +01:00
botマークをプロフカラムとトゥート時刻に表示
This commit is contained in:
parent
77bebca288
commit
c5c9179d2b
@ -14,6 +14,7 @@ import android.view.Gravity
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.*
|
import android.widget.*
|
||||||
|
import jp.juggler.emoji.EmojiMap201709
|
||||||
|
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
@ -461,7 +462,12 @@ internal class ItemViewHolder(
|
|||||||
btnSearchTag.text = activity.getString(R.string.read_gap)
|
btnSearchTag.text = activity.getString(R.string.read_gap)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showBoost(whoRef : TootAccountRef, time : Long, icon_attr_id : Int, text : Spannable) {
|
private fun showBoost(
|
||||||
|
whoRef : TootAccountRef,
|
||||||
|
time : Long,
|
||||||
|
icon_attr_id : Int,
|
||||||
|
text : Spannable
|
||||||
|
) {
|
||||||
boost_account = whoRef
|
boost_account = whoRef
|
||||||
val who = whoRef.find()
|
val who = whoRef.find()
|
||||||
boost_time = time
|
boost_time = time
|
||||||
@ -664,6 +670,24 @@ internal class ItemViewHolder(
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
if(status != null) {
|
if(status != null) {
|
||||||
|
|
||||||
|
if(status.account.bot) {
|
||||||
|
if(sb.isNotEmpty()) sb.append(' ')
|
||||||
|
|
||||||
|
val start = sb.length
|
||||||
|
sb.append("bot")
|
||||||
|
val end = sb.length
|
||||||
|
val info = EmojiMap201709.sShortNameToImageId["robot_face"]
|
||||||
|
if(info != null) {
|
||||||
|
sb.setSpan(
|
||||||
|
EmojiImageSpan(activity, info.image_id),
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(status.hasMedia() && status.sensitive) {
|
if(status.hasMedia() && status.sensitive) {
|
||||||
if(sb.isNotEmpty()) sb.append(' ')
|
if(sb.isNotEmpty()) sb.append(' ')
|
||||||
|
|
||||||
@ -968,14 +992,26 @@ internal class ItemViewHolder(
|
|||||||
|
|
||||||
btnFollowRequestAccept -> follow_account?.let { whoRef ->
|
btnFollowRequestAccept -> follow_account?.let { whoRef ->
|
||||||
val who = whoRef.find()
|
val who = whoRef.find()
|
||||||
DlgConfirm.openSimple(activity,activity.getString(R.string.follow_accept_confirm,AcctColor.getNickname(access_info.getFullAcct(who)))){
|
DlgConfirm.openSimple(
|
||||||
|
activity,
|
||||||
|
activity.getString(
|
||||||
|
R.string.follow_accept_confirm,
|
||||||
|
AcctColor.getNickname(access_info.getFullAcct(who))
|
||||||
|
)
|
||||||
|
) {
|
||||||
Action_Follow.authorizeFollowRequest(activity, access_info, whoRef, true)
|
Action_Follow.authorizeFollowRequest(activity, access_info, whoRef, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
btnFollowRequestDeny -> follow_account?.let { whoRef ->
|
btnFollowRequestDeny -> follow_account?.let { whoRef ->
|
||||||
val who = whoRef.find()
|
val who = whoRef.find()
|
||||||
DlgConfirm.openSimple(activity,activity.getString(R.string.follow_deny_confirm,AcctColor.getNickname(access_info.getFullAcct(who)))){
|
DlgConfirm.openSimple(
|
||||||
|
activity,
|
||||||
|
activity.getString(
|
||||||
|
R.string.follow_deny_confirm,
|
||||||
|
AcctColor.getNickname(access_info.getFullAcct(who))
|
||||||
|
)
|
||||||
|
) {
|
||||||
Action_Follow.authorizeFollowRequest(activity, access_info, whoRef, false)
|
Action_Follow.authorizeFollowRequest(activity, access_info, whoRef, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1885,15 +1921,15 @@ internal class ItemViewHolder(
|
|||||||
background = ContextCompat.getDrawable(context, R.drawable.btn_bg_transparent)
|
background = ContextCompat.getDrawable(context, R.drawable.btn_bg_transparent)
|
||||||
contentDescription = context.getString(R.string.follow_accept)
|
contentDescription = context.getString(R.string.follow_accept)
|
||||||
imageResource = Styler.getAttributeResourceId(context, R.attr.ic_check)
|
imageResource = Styler.getAttributeResourceId(context, R.attr.ic_check)
|
||||||
setPadding(0,0,0,0)
|
setPadding(0, 0, 0, 0)
|
||||||
}.lparams(dip(48f),dip(32f))
|
}.lparams(dip(48f), dip(32f))
|
||||||
|
|
||||||
btnFollowRequestDeny = imageButton {
|
btnFollowRequestDeny = imageButton {
|
||||||
background = ContextCompat.getDrawable(context, R.drawable.btn_bg_transparent)
|
background = ContextCompat.getDrawable(context, R.drawable.btn_bg_transparent)
|
||||||
contentDescription = context.getString(R.string.follow_deny)
|
contentDescription = context.getString(R.string.follow_deny)
|
||||||
imageResource = Styler.getAttributeResourceId(context, R.attr.btn_close)
|
imageResource = Styler.getAttributeResourceId(context, R.attr.btn_close)
|
||||||
setPadding(0,0,0,0)
|
setPadding(0, 0, 0, 0)
|
||||||
}.lparams(dip(48f),dip(32f)){
|
}.lparams(dip(48f), dip(32f)) {
|
||||||
startMargin = dip(4)
|
startMargin = dip(4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,6 +210,21 @@ internal class ViewHolderHeaderProfile(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(who.bot){
|
||||||
|
sb.append(" ")
|
||||||
|
val start = sb.length
|
||||||
|
sb.append("bot")
|
||||||
|
val end = sb.length
|
||||||
|
val info = EmojiMap201709.sShortNameToImageId["robot_face"]
|
||||||
|
if(info != null) {
|
||||||
|
sb.setSpan(
|
||||||
|
EmojiImageSpan(activity, info.image_id),
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
tvAcct.text = sb
|
tvAcct.text = sb
|
||||||
|
|
||||||
val note = whoRef.decoded_note
|
val note = whoRef.decoded_note
|
||||||
|
Loading…
x
Reference in New Issue
Block a user