アプリ設定に「返信の数の表示」を追加
This commit is contained in:
parent
03b37204ce
commit
b58552c990
|
@ -9,6 +9,7 @@ import android.os.AsyncTask
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.annotation.ColorInt
|
import android.support.annotation.ColorInt
|
||||||
|
import android.support.annotation.IdRes
|
||||||
import android.support.v4.content.FileProvider
|
import android.support.v4.content.FileProvider
|
||||||
import android.support.v4.view.ViewCompat
|
import android.support.v4.view.ViewCompat
|
||||||
import android.support.v7.app.AlertDialog
|
import android.support.v7.app.AlertDialog
|
||||||
|
@ -103,6 +104,7 @@ class ActAppSetting : AppCompatActivity()
|
||||||
private lateinit var spResizeImage : Spinner
|
private lateinit var spResizeImage : Spinner
|
||||||
private lateinit var spRefreshAfterToot : Spinner
|
private lateinit var spRefreshAfterToot : Spinner
|
||||||
private lateinit var spDefaultAccount : Spinner
|
private lateinit var spDefaultAccount : Spinner
|
||||||
|
private lateinit var spRepliesCount : Spinner
|
||||||
|
|
||||||
private var footer_button_bg_color : Int = 0
|
private var footer_button_bg_color : Int = 0
|
||||||
private var footer_button_fg_color : Int = 0
|
private var footer_button_fg_color : Int = 0
|
||||||
|
@ -193,66 +195,49 @@ class ActAppSetting : AppCompatActivity()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
run {
|
spBackButtonAction = initSpinner(
|
||||||
val caption_list = arrayOf(
|
R.id.spBackButtonAction
|
||||||
getString(R.string.ask_always),
|
, getString(R.string.ask_always)
|
||||||
getString(R.string.close_column),
|
, getString(R.string.close_column)
|
||||||
getString(R.string.open_column_list),
|
, getString(R.string.open_column_list)
|
||||||
getString(R.string.app_exit)
|
, getString(R.string.app_exit)
|
||||||
)
|
)
|
||||||
val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, caption_list)
|
|
||||||
adapter.setDropDownViewResource(R.layout.lv_spinner_dropdown)
|
spRepliesCount = initSpinner(
|
||||||
spBackButtonAction = findViewById(R.id.spBackButtonAction)
|
R.id.spRepliesCount
|
||||||
spBackButtonAction.adapter = adapter
|
, getString(R.string.replies_count_simple)
|
||||||
spBackButtonAction.onItemSelectedListener = this
|
, getString(R.string.replies_count_actual)
|
||||||
|
, getString(R.string.replies_count_none)
|
||||||
|
)
|
||||||
|
|
||||||
|
spUITheme = initSpinner(
|
||||||
|
R.id.spUITheme
|
||||||
|
, getString(R.string.theme_light)
|
||||||
|
, getString(R.string.theme_dark)
|
||||||
|
)
|
||||||
|
|
||||||
|
spResizeImage = initSpinner(
|
||||||
|
R.id.spResizeImage
|
||||||
|
, getString(R.string.dont_resize)
|
||||||
|
, getString(R.string.long_side_pixel, 640)
|
||||||
|
, getString(R.string.long_side_pixel, 800)
|
||||||
|
, getString(R.string.long_side_pixel, 1024)
|
||||||
|
, getString(R.string.long_side_pixel, 1280)
|
||||||
|
// サーバ側でさらに縮小されるようなので、1280より上は用意しない
|
||||||
|
)
|
||||||
|
|
||||||
|
spRefreshAfterToot = initSpinner(
|
||||||
|
R.id.spRefreshAfterToot
|
||||||
|
, getString(R.string.refresh_scroll_to_toot)
|
||||||
|
, getString(R.string.refresh_no_scroll)
|
||||||
|
, getString(R.string.dont_refresh)
|
||||||
|
)
|
||||||
|
|
||||||
|
spDefaultAccount = findViewById<Spinner>(R.id.spDefaultAccount).also {
|
||||||
|
it.adapter = AccountAdapter()
|
||||||
|
it.onItemSelectedListener = this@ActAppSetting
|
||||||
}
|
}
|
||||||
|
|
||||||
run {
|
|
||||||
val caption_list =
|
|
||||||
arrayOf(getString(R.string.theme_light), getString(R.string.theme_dark))
|
|
||||||
val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, caption_list)
|
|
||||||
adapter.setDropDownViewResource(R.layout.lv_spinner_dropdown)
|
|
||||||
spUITheme = findViewById(R.id.spUITheme)
|
|
||||||
spUITheme.adapter = adapter
|
|
||||||
spUITheme.onItemSelectedListener = this
|
|
||||||
}
|
|
||||||
run {
|
|
||||||
val caption_list = arrayOf(
|
|
||||||
getString(R.string.dont_resize),
|
|
||||||
getString(R.string.long_side_pixel, 640),
|
|
||||||
getString(R.string.long_side_pixel, 800),
|
|
||||||
getString(R.string.long_side_pixel, 1024),
|
|
||||||
getString(R.string.long_side_pixel, 1280)
|
|
||||||
) //// サーバ側でさらに縮小されるようなので、1280より上は用意しない
|
|
||||||
// Integer.toString( 1600 ),
|
|
||||||
// Integer.toString( 2048 ),
|
|
||||||
val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, caption_list)
|
|
||||||
adapter.setDropDownViewResource(R.layout.lv_spinner_dropdown)
|
|
||||||
spResizeImage = findViewById(R.id.spResizeImage)
|
|
||||||
spResizeImage.adapter = adapter
|
|
||||||
spResizeImage.onItemSelectedListener = this
|
|
||||||
}
|
|
||||||
|
|
||||||
run {
|
|
||||||
val caption_list = arrayOf(
|
|
||||||
getString(R.string.refresh_scroll_to_toot),
|
|
||||||
getString(R.string.refresh_no_scroll),
|
|
||||||
getString(R.string.dont_refresh)
|
|
||||||
)
|
|
||||||
val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, caption_list)
|
|
||||||
adapter.setDropDownViewResource(R.layout.lv_spinner_dropdown)
|
|
||||||
spRefreshAfterToot = findViewById(R.id.spRefreshAfterToot)
|
|
||||||
spRefreshAfterToot.adapter = adapter
|
|
||||||
spRefreshAfterToot.onItemSelectedListener = this
|
|
||||||
}
|
|
||||||
|
|
||||||
run {
|
|
||||||
|
|
||||||
val adapter = AccountAdapter()
|
|
||||||
spDefaultAccount = findViewById(R.id.spDefaultAccount)
|
|
||||||
spDefaultAccount.adapter = adapter
|
|
||||||
spDefaultAccount.onItemSelectedListener = this
|
|
||||||
}
|
|
||||||
|
|
||||||
findViewById<View>(R.id.btnFooterBackgroundEdit).setOnClickListener(this)
|
findViewById<View>(R.id.btnFooterBackgroundEdit).setOnClickListener(this)
|
||||||
findViewById<View>(R.id.btnFooterBackgroundReset).setOnClickListener(this)
|
findViewById<View>(R.id.btnFooterBackgroundReset).setOnClickListener(this)
|
||||||
|
@ -349,6 +334,16 @@ class ActAppSetting : AppCompatActivity()
|
||||||
tvUserAgentError = findViewById(R.id.tvUserAgentError)
|
tvUserAgentError = findViewById(R.id.tvUserAgentError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun initSpinner(@IdRes viewId : Int, vararg captions : String) : Spinner {
|
||||||
|
val caption_list : Array<String> = arrayOf(*captions)
|
||||||
|
val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, caption_list)
|
||||||
|
adapter.setDropDownViewResource(R.layout.lv_spinner_dropdown)
|
||||||
|
val sp : Spinner = findViewById(viewId)
|
||||||
|
sp.adapter = adapter
|
||||||
|
sp.onItemSelectedListener = this
|
||||||
|
return sp
|
||||||
|
}
|
||||||
|
|
||||||
private fun loadUIFromData() {
|
private fun loadUIFromData() {
|
||||||
load_busy = true
|
load_busy = true
|
||||||
|
|
||||||
|
@ -357,6 +352,7 @@ class ActAppSetting : AppCompatActivity()
|
||||||
}
|
}
|
||||||
|
|
||||||
spBackButtonAction.setSelection(Pref.ipBackButtonAction(pref))
|
spBackButtonAction.setSelection(Pref.ipBackButtonAction(pref))
|
||||||
|
spRepliesCount.setSelection(Pref.ipRepliesCount(pref))
|
||||||
spUITheme.setSelection(Pref.ipUiTheme(pref))
|
spUITheme.setSelection(Pref.ipUiTheme(pref))
|
||||||
spResizeImage.setSelection(Pref.ipResizeImage(pref))
|
spResizeImage.setSelection(Pref.ipResizeImage(pref))
|
||||||
spRefreshAfterToot.setSelection(Pref.ipRefreshAfterToot(pref))
|
spRefreshAfterToot.setSelection(Pref.ipRefreshAfterToot(pref))
|
||||||
|
@ -395,7 +391,7 @@ class ActAppSetting : AppCompatActivity()
|
||||||
etTimelineFontSize.setText(formatFontSize(Pref.fpTimelineFontSize(pref)))
|
etTimelineFontSize.setText(formatFontSize(Pref.fpTimelineFontSize(pref)))
|
||||||
etAcctFontSize.setText(formatFontSize(Pref.fpAcctFontSize(pref)))
|
etAcctFontSize.setText(formatFontSize(Pref.fpAcctFontSize(pref)))
|
||||||
etNotificationTlFontSize.setText(formatFontSize(Pref.fpNotificationTlFontSize(pref)))
|
etNotificationTlFontSize.setText(formatFontSize(Pref.fpNotificationTlFontSize(pref)))
|
||||||
|
|
||||||
etUserAgent.hint = App1.userAgentDefault
|
etUserAgent.hint = App1.userAgentDefault
|
||||||
|
|
||||||
load_busy = false
|
load_busy = false
|
||||||
|
@ -406,7 +402,11 @@ class ActAppSetting : AppCompatActivity()
|
||||||
|
|
||||||
showFontSize(tvTimelineFontSize, etTimelineFontSize, default_timeline_font_size)
|
showFontSize(tvTimelineFontSize, etTimelineFontSize, default_timeline_font_size)
|
||||||
showFontSize(tvAcctFontSize, etAcctFontSize, default_acct_font_size)
|
showFontSize(tvAcctFontSize, etAcctFontSize, default_acct_font_size)
|
||||||
showFontSize(tvNotificationTlFontSize, etNotificationTlFontSize, default_notification_tl_font_size)
|
showFontSize(
|
||||||
|
tvNotificationTlFontSize,
|
||||||
|
etNotificationTlFontSize,
|
||||||
|
default_notification_tl_font_size
|
||||||
|
)
|
||||||
|
|
||||||
showUserAgentError()
|
showUserAgentError()
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,9 @@ class ActAppSetting : AppCompatActivity()
|
||||||
.put(Pref.spQuoteNameFormat, etQuoteNameFormat.text.toString()) // not trimmed
|
.put(Pref.spQuoteNameFormat, etQuoteNameFormat.text.toString()) // not trimmed
|
||||||
.put(Pref.spAutoCWLines, etAutoCWLines.text.toString().trim { it <= ' ' })
|
.put(Pref.spAutoCWLines, etAutoCWLines.text.toString().trim { it <= ' ' })
|
||||||
.put(Pref.spAvatarIconSize, etAvatarIconSize.text.toString().trim { it <= ' ' })
|
.put(Pref.spAvatarIconSize, etAvatarIconSize.text.toString().trim { it <= ' ' })
|
||||||
.put(Pref.spNotificationTlIconSize, etNotificationTlIconSize.text.toString().trim { it <= ' ' })
|
.put(
|
||||||
|
Pref.spNotificationTlIconSize,
|
||||||
|
etNotificationTlIconSize.text.toString().trim { it <= ' ' })
|
||||||
.put(
|
.put(
|
||||||
Pref.spPullNotificationCheckInterval,
|
Pref.spPullNotificationCheckInterval,
|
||||||
etPullNotificationCheckInterval.text.toString().trim { it <= ' ' })
|
etPullNotificationCheckInterval.text.toString().trim { it <= ' ' })
|
||||||
|
@ -460,6 +462,7 @@ class ActAppSetting : AppCompatActivity()
|
||||||
.put(Pref.spTimelineFontBold, timeline_font_bold ?: "")
|
.put(Pref.spTimelineFontBold, timeline_font_bold ?: "")
|
||||||
|
|
||||||
.put(Pref.ipBackButtonAction, spBackButtonAction.selectedItemPosition)
|
.put(Pref.ipBackButtonAction, spBackButtonAction.selectedItemPosition)
|
||||||
|
.put(Pref.ipRepliesCount, spRepliesCount.selectedItemPosition)
|
||||||
.put(Pref.ipUiTheme, spUITheme.selectedItemPosition)
|
.put(Pref.ipUiTheme, spUITheme.selectedItemPosition)
|
||||||
.put(Pref.ipResizeImage, spResizeImage.selectedItemPosition)
|
.put(Pref.ipResizeImage, spResizeImage.selectedItemPosition)
|
||||||
.put(Pref.ipRefreshAfterToot, spRefreshAfterToot.selectedItemPosition)
|
.put(Pref.ipRefreshAfterToot, spRefreshAfterToot.selectedItemPosition)
|
||||||
|
@ -473,7 +476,6 @@ class ActAppSetting : AppCompatActivity()
|
||||||
.apply()
|
.apply()
|
||||||
|
|
||||||
showUserAgentError()
|
showUserAgentError()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showUserAgentError() {
|
private fun showUserAgentError() {
|
||||||
|
@ -557,7 +559,7 @@ class ActAppSetting : AppCompatActivity()
|
||||||
saveUIToData()
|
saveUIToData()
|
||||||
showFooterColor()
|
showFooterColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.btnListDividerColorEdit -> openColorPicker(
|
R.id.btnListDividerColorEdit -> openColorPicker(
|
||||||
COLOR_DIALOG_ID_LIST_DIVIDER,
|
COLOR_DIALOG_ID_LIST_DIVIDER,
|
||||||
list_divider_color,
|
list_divider_color,
|
||||||
|
@ -568,7 +570,7 @@ class ActAppSetting : AppCompatActivity()
|
||||||
list_divider_color = 0
|
list_divider_color = 0
|
||||||
saveUIToData()
|
saveUIToData()
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.btnTimelineFontReset -> {
|
R.id.btnTimelineFontReset -> {
|
||||||
timeline_font = ""
|
timeline_font = ""
|
||||||
saveUIToData()
|
saveUIToData()
|
||||||
|
@ -691,7 +693,7 @@ class ActAppSetting : AppCompatActivity()
|
||||||
showFooterColor()
|
showFooterColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
COLOR_DIALOG_ID_LIST_DIVIDER ->{
|
COLOR_DIALOG_ID_LIST_DIVIDER -> {
|
||||||
list_divider_color = if(colorSelected == 0) 0x01000000 else colorSelected
|
list_divider_color = if(colorSelected == 0) 0x01000000 else colorSelected
|
||||||
saveUIToData()
|
saveUIToData()
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ internal class ItemViewHolder(
|
||||||
|
|
||||||
private lateinit var llButtonBar : View
|
private lateinit var llButtonBar : View
|
||||||
private lateinit var btnConversation : ImageButton
|
private lateinit var btnConversation : ImageButton
|
||||||
private lateinit var btnReply : ImageButton
|
private lateinit var btnReply : Button
|
||||||
private lateinit var btnBoost : Button
|
private lateinit var btnBoost : Button
|
||||||
private lateinit var btnFavourite : Button
|
private lateinit var btnFavourite : Button
|
||||||
private lateinit var llFollow2 : View
|
private lateinit var llFollow2 : View
|
||||||
|
@ -1891,6 +1891,9 @@ internal class ItemViewHolder(
|
||||||
topMargin = dip(3)
|
topMargin = dip(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val marginBetween = dip(2)
|
||||||
|
val compoundPadding= dip(0.5f)
|
||||||
|
|
||||||
btnConversation = imageButton {
|
btnConversation = imageButton {
|
||||||
|
|
||||||
background = ContextCompat.getDrawable(
|
background = ContextCompat.getDrawable(
|
||||||
|
@ -1903,19 +1906,18 @@ internal class ItemViewHolder(
|
||||||
Styler.getAttributeResourceId(context, R.attr.ic_conversation)
|
Styler.getAttributeResourceId(context, R.attr.ic_conversation)
|
||||||
}.lparams(wrapContent, matchParent)
|
}.lparams(wrapContent, matchParent)
|
||||||
|
|
||||||
btnReply = imageButton {
|
btnReply = button {
|
||||||
|
|
||||||
background = ContextCompat.getDrawable(
|
background = ContextCompat.getDrawable(
|
||||||
context,
|
context,
|
||||||
R.drawable.btn_bg_transparent
|
R.drawable.btn_bg_transparent
|
||||||
)
|
)
|
||||||
contentDescription = context.getString(R.string.reply)
|
compoundDrawablePadding = compoundPadding
|
||||||
minimumWidth = dip(40)
|
minWidthCompat = dip(48)
|
||||||
imageResource =
|
setPaddingStartEnd(dip(4), dip(4))
|
||||||
Styler.getAttributeResourceId(context, R.attr.btn_reply)
|
// imageResource = Styler.getAttributeResourceId(context, R.attr.btn_reply)
|
||||||
|
|
||||||
}.lparams(wrapContent, matchParent) {
|
}.lparams(wrapContent, matchParent) {
|
||||||
startMargin = dip(2)
|
startMargin = marginBetween
|
||||||
}
|
}
|
||||||
|
|
||||||
btnBoost = button {
|
btnBoost = button {
|
||||||
|
@ -1924,12 +1926,12 @@ internal class ItemViewHolder(
|
||||||
context,
|
context,
|
||||||
R.drawable.btn_bg_transparent
|
R.drawable.btn_bg_transparent
|
||||||
)
|
)
|
||||||
compoundDrawablePadding = dip(4)
|
compoundDrawablePadding = compoundPadding
|
||||||
|
|
||||||
minWidthCompat = dip(48)
|
minWidthCompat = dip(48)
|
||||||
setPaddingStartEnd(dip(4), dip(4))
|
setPaddingStartEnd(dip(4), dip(4))
|
||||||
}.lparams(wrapContent, matchParent) {
|
}.lparams(wrapContent, matchParent) {
|
||||||
startMargin = dip(2)
|
startMargin = marginBetween
|
||||||
}
|
}
|
||||||
|
|
||||||
btnFavourite = button {
|
btnFavourite = button {
|
||||||
|
@ -1937,17 +1939,17 @@ internal class ItemViewHolder(
|
||||||
context,
|
context,
|
||||||
R.drawable.btn_bg_transparent
|
R.drawable.btn_bg_transparent
|
||||||
)
|
)
|
||||||
compoundDrawablePadding = dip(4)
|
compoundDrawablePadding = compoundPadding
|
||||||
minWidthCompat = dip(48)
|
minWidthCompat = dip(48)
|
||||||
setPaddingStartEnd(dip(4), dip(4))
|
setPaddingStartEnd(dip(4), dip(4))
|
||||||
|
|
||||||
}.lparams(wrapContent, matchParent) {
|
}.lparams(wrapContent, matchParent) {
|
||||||
startMargin = dip(2)
|
startMargin = marginBetween
|
||||||
}
|
}
|
||||||
|
|
||||||
llFollow2 = frameLayout {
|
llFollow2 = frameLayout {
|
||||||
lparams(dip(40), dip(40)) {
|
lparams(dip(40), dip(40)) {
|
||||||
startMargin = dip(2)
|
startMargin = marginBetween
|
||||||
}
|
}
|
||||||
|
|
||||||
btnFollow2 = imageButton {
|
btnFollow2 = imageButton {
|
||||||
|
@ -1984,9 +1986,8 @@ internal class ItemViewHolder(
|
||||||
Styler.getAttributeResourceId(context, R.attr.btn_more)
|
Styler.getAttributeResourceId(context, R.attr.btn_more)
|
||||||
minimumWidth = dip(40)
|
minimumWidth = dip(40)
|
||||||
}.lparams(wrapContent, matchParent) {
|
}.lparams(wrapContent, matchParent) {
|
||||||
startMargin = dip(2)
|
startMargin = marginBetween
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tvApplication = textView {
|
tvApplication = textView {
|
||||||
|
|
|
@ -312,11 +312,16 @@ object Pref {
|
||||||
R.id.swScrollTopFromColumnStrip
|
R.id.swScrollTopFromColumnStrip
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
// int
|
// int
|
||||||
|
|
||||||
val ipBackButtonAction = IntPref("back_button_action", 0)
|
val ipBackButtonAction = IntPref("back_button_action", 0)
|
||||||
val ipUiTheme = IntPref("ui_theme", 0)
|
val ipUiTheme = IntPref("ui_theme", 0)
|
||||||
val ipResizeImage = IntPref("resize_image", 4)
|
val ipResizeImage = IntPref("resize_image", 4)
|
||||||
|
val ipRepliesCount = IntPref("RepliesCount",0)
|
||||||
|
const val RC_SIMPLE = 0
|
||||||
|
const val RC_ACTUAL = 1
|
||||||
|
const val RC_NONE = 2
|
||||||
|
|
||||||
val ipRefreshAfterToot = IntPref("refresh_after_toot", 0)
|
val ipRefreshAfterToot = IntPref("refresh_after_toot", 0)
|
||||||
const val RAT_REFRESH_SCROLL = 0
|
const val RAT_REFRESH_SCROLL = 0
|
||||||
|
|
|
@ -22,7 +22,7 @@ internal class StatusButtons(
|
||||||
private val bSimpleList : Boolean,
|
private val bSimpleList : Boolean,
|
||||||
|
|
||||||
private val btnConversation : ImageButton,
|
private val btnConversation : ImageButton,
|
||||||
private val btnReply : ImageButton,
|
private val btnReply : Button,
|
||||||
private val btnBoost : Button,
|
private val btnBoost : Button,
|
||||||
private val btnFavourite : Button,
|
private val btnFavourite : Button,
|
||||||
private val llFollow2 : View,
|
private val llFollow2 : View,
|
||||||
|
@ -69,6 +69,25 @@ internal class StatusButtons(
|
||||||
val fav_icon_attr =
|
val fav_icon_attr =
|
||||||
if(access_info.isNicoru(status.account)) R.attr.ic_nicoru else R.attr.btn_favourite
|
if(access_info.isNicoru(status.account)) R.attr.ic_nicoru else R.attr.btn_favourite
|
||||||
|
|
||||||
|
val replies_count = status.replies_count
|
||||||
|
setButton(
|
||||||
|
btnReply,
|
||||||
|
true,
|
||||||
|
color_normal,
|
||||||
|
R.attr.btn_reply,
|
||||||
|
when{
|
||||||
|
replies_count == null || status.visibility == TootStatus.VISIBILITY_DIRECT -> ""
|
||||||
|
else->when(Pref.ipRepliesCount(activity.pref)){
|
||||||
|
Pref.RC_SIMPLE -> when{
|
||||||
|
replies_count >= 1 -> "1+"
|
||||||
|
else -> replies_count.toString()
|
||||||
|
}
|
||||||
|
Pref.RC_ACTUAL -> replies_count.toString()
|
||||||
|
else->""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// ブーストボタン
|
// ブーストボタン
|
||||||
when {
|
when {
|
||||||
TootStatus.VISIBILITY_DIRECT == status.visibility -> setButton(
|
TootStatus.VISIBILITY_DIRECT == status.visibility -> setButton(
|
||||||
|
@ -78,14 +97,14 @@ internal class StatusButtons(
|
||||||
R.attr.ic_mail,
|
R.attr.ic_mail,
|
||||||
""
|
""
|
||||||
)
|
)
|
||||||
// マストドン2.4.0から非公開トゥートもブーストできるようになった
|
// マストドン2.4.0から非公開トゥートもブーストできるようになった
|
||||||
// TootStatus.VISIBILITY_PRIVATE == status.visibility -> setButton(
|
// TootStatus.VISIBILITY_PRIVATE == status.visibility -> setButton(
|
||||||
// btnBoost,
|
// btnBoost,
|
||||||
// false,
|
// false,
|
||||||
// color_accent,
|
// color_accent,
|
||||||
// R.attr.ic_lock,
|
// R.attr.ic_lock,
|
||||||
// ""
|
// ""
|
||||||
// )
|
// )
|
||||||
activity.app_state.isBusyBoost(access_info, status) -> setButton(
|
activity.app_state.isBusyBoost(access_info, status) -> setButton(
|
||||||
btnBoost,
|
btnBoost,
|
||||||
false,
|
false,
|
||||||
|
@ -192,7 +211,7 @@ internal class StatusButtons(
|
||||||
NOT_CROSS_ACCOUNT,
|
NOT_CROSS_ACCOUNT,
|
||||||
when {
|
when {
|
||||||
! bSimpleList -> null
|
! bSimpleList -> null
|
||||||
// 簡略表示なら結果をトースト表示
|
// 簡略表示なら結果をトースト表示
|
||||||
bSet -> activity.boost_complete_callback
|
bSet -> activity.boost_complete_callback
|
||||||
else -> activity.unboost_complete_callback
|
else -> activity.unboost_complete_callback
|
||||||
},
|
},
|
||||||
|
@ -216,7 +235,7 @@ internal class StatusButtons(
|
||||||
NOT_CROSS_ACCOUNT,
|
NOT_CROSS_ACCOUNT,
|
||||||
when {
|
when {
|
||||||
! bSimpleList -> null
|
! bSimpleList -> null
|
||||||
// 簡略表示なら結果をトースト表示
|
// 簡略表示なら結果をトースト表示
|
||||||
bSet -> activity.favourite_complete_callback
|
bSet -> activity.favourite_complete_callback
|
||||||
else -> activity.unfavourite_complete_callback
|
else -> activity.unfavourite_complete_callback
|
||||||
},
|
},
|
||||||
|
@ -271,7 +290,13 @@ internal class StatusButtons(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
btnMore -> DlgContextMenu(activity, column, status.accountRef, status, notification).show()
|
btnMore -> DlgContextMenu(
|
||||||
|
activity,
|
||||||
|
column,
|
||||||
|
status.accountRef,
|
||||||
|
status,
|
||||||
|
notification
|
||||||
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,9 @@ class TootStatus(parser : TootParser, src : JSONObject) :
|
||||||
|
|
||||||
var enquete : NicoEnquete? = null
|
var enquete : NicoEnquete? = null
|
||||||
|
|
||||||
|
//
|
||||||
|
var replies_count :Long? = null
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////
|
||||||
// 以下はentityから取得したデータではなく、アプリ内部で使う
|
// 以下はentityから取得したデータではなく、アプリ内部で使う
|
||||||
|
|
||||||
|
@ -166,14 +169,16 @@ class TootStatus(parser : TootParser, src : JSONObject) :
|
||||||
|
|
||||||
this.accountRef = TootAccountRef(parser, who)
|
this.accountRef = TootAccountRef(parser, who)
|
||||||
|
|
||||||
|
this.reblogs_count = src.parseLong("reblogs_count")
|
||||||
|
this.favourites_count = src.parseLong("favourites_count")
|
||||||
|
this.replies_count = src.parseLong("replies_count")
|
||||||
|
|
||||||
when(parser.serviceType) {
|
when(parser.serviceType) {
|
||||||
ServiceType.MASTODON -> {
|
ServiceType.MASTODON -> {
|
||||||
this.host_access = parser.linkHelper.host
|
this.host_access = parser.linkHelper.host
|
||||||
|
|
||||||
this.id = src.parseLong("id") ?: INVALID_ID
|
this.id = src.parseLong("id") ?: INVALID_ID
|
||||||
|
|
||||||
this.reblogs_count = src.parseLong("reblogs_count")
|
|
||||||
this.favourites_count = src.parseLong("favourites_count")
|
|
||||||
this.reblogged = src.optBoolean("reblogged")
|
this.reblogged = src.optBoolean("reblogged")
|
||||||
this.favourited = src.optBoolean("favourited")
|
this.favourited = src.optBoolean("favourited")
|
||||||
|
|
||||||
|
@ -191,10 +196,6 @@ class TootStatus(parser : TootParser, src : JSONObject) :
|
||||||
// 投稿元タンスでのIDを調べる。失敗するかもしれない
|
// 投稿元タンスでのIDを調べる。失敗するかもしれない
|
||||||
this.id = findStatusIdFromUri(uri, url)
|
this.id = findStatusIdFromUri(uri, url)
|
||||||
|
|
||||||
|
|
||||||
this.reblogs_count = src.parseLong("reblogs_count")
|
|
||||||
this.favourites_count = src.parseLong("favourites_count")
|
|
||||||
|
|
||||||
this.time_created_at = TootStatus.parseTime(this.created_at)
|
this.time_created_at = TootStatus.parseTime(this.created_at)
|
||||||
this.media_attachments =
|
this.media_attachments =
|
||||||
parseListOrNull(::TootAttachment, src.optJSONArray("media_attachments"), log)
|
parseListOrNull(::TootAttachment, src.optJSONArray("media_attachments"), log)
|
||||||
|
|
|
@ -651,7 +651,6 @@ fun JSONObject.parseInt(key : String) : Int? {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Bundle
|
// Bundle
|
||||||
|
|
||||||
|
|
|
@ -872,6 +872,22 @@
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View style="@style/setting_divider"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/setting_row_label"
|
||||||
|
android:text="@string/display_replies_count"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout style="@style/setting_row_form">
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spRepliesCount"
|
||||||
|
style="@style/setting_horizontal_stretch"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<!--<LinearLayout style="@style/setting_row_form">-->
|
<!--<LinearLayout style="@style/setting_row_form">-->
|
||||||
|
|
||||||
<!--<TextView-->
|
<!--<TextView-->
|
||||||
|
|
|
@ -33,15 +33,16 @@
|
||||||
android:src="?attr/ic_conversation"
|
android:src="?attr/ic_conversation"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ImageButton
|
<Button
|
||||||
android:id="@+id/btnReply"
|
android:id="@+id/btnReply"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:background="@drawable/btn_bg_transparent"
|
android:background="@drawable/btn_bg_transparent"
|
||||||
android:contentDescription="@string/reply"
|
android:drawablePadding="1dp"
|
||||||
android:minWidth="40dp"
|
android:minWidth="48dp"
|
||||||
android:src="?attr/btn_reply"
|
android:paddingEnd="4dp"
|
||||||
|
android:paddingStart="4dp"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
@ -50,7 +51,7 @@
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:background="@drawable/btn_bg_transparent"
|
android:background="@drawable/btn_bg_transparent"
|
||||||
android:drawablePadding="4dp"
|
android:drawablePadding="1dp"
|
||||||
android:minWidth="48dp"
|
android:minWidth="48dp"
|
||||||
android:paddingEnd="4dp"
|
android:paddingEnd="4dp"
|
||||||
android:paddingStart="4dp"
|
android:paddingStart="4dp"
|
||||||
|
@ -62,7 +63,7 @@
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:background="@drawable/btn_bg_transparent"
|
android:background="@drawable/btn_bg_transparent"
|
||||||
android:drawablePadding="4dp"
|
android:drawablePadding="1dp"
|
||||||
android:minWidth="48dp"
|
android:minWidth="48dp"
|
||||||
android:paddingEnd="4dp"
|
android:paddingEnd="4dp"
|
||||||
android:paddingStart="4dp"
|
android:paddingStart="4dp"
|
||||||
|
|
|
@ -731,8 +731,12 @@
|
||||||
<string name="toot_context_parse_failed">conversation parse failed.</string>
|
<string name="toot_context_parse_failed">conversation parse failed.</string>
|
||||||
<string name="toot_default_text">Default text when composing toot. (not affected to quick toot bar and switching account in toot composing screen)</string>
|
<string name="toot_default_text">Default text when composing toot. (not affected to quick toot bar and switching account in toot composing screen)</string>
|
||||||
<string name="list_divider_color">List divider color</string>
|
<string name="list_divider_color">List divider color</string>
|
||||||
|
<string name="display_replies_count">Show replies count</string>
|
||||||
|
<string name="replies_count_simple">0/1/1+</string>
|
||||||
|
<string name="replies_count_actual">Actual</string>
|
||||||
|
<string name="replies_count_none">None</string>
|
||||||
|
|
||||||
<!--<string name="abc_action_bar_home_description">Revenir à l\'accueil</string>-->
|
<!--<string name="abc_action_bar_home_description">Revenir à l\'accueil</string>-->
|
||||||
<!--<string name="abc_action_bar_home_description_format">%1$s, %2$s</string>-->
|
<!--<string name="abc_action_bar_home_description_format">%1$s, %2$s</string>-->
|
||||||
<!--<string name="abc_action_bar_home_subtitle_description_format">%1$s, %2$s, %3$s</string>-->
|
<!--<string name="abc_action_bar_home_subtitle_description_format">%1$s, %2$s, %3$s</string>-->
|
||||||
<!--<string name="abc_action_bar_up_description">Revenir en haut de la page</string>-->
|
<!--<string name="abc_action_bar_up_description">Revenir en haut de la page</string>-->
|
||||||
|
|
|
@ -1010,5 +1010,9 @@
|
||||||
<string name="toot_context_parse_failed">会話データのデコードに失敗</string>
|
<string name="toot_context_parse_failed">会話データのデコードに失敗</string>
|
||||||
<string name="toot_default_text">トゥート作成時のデフォルトテキスト (簡易投稿や投稿画面でのアカウント切り替えには影響しません)</string>
|
<string name="toot_default_text">トゥート作成時のデフォルトテキスト (簡易投稿や投稿画面でのアカウント切り替えには影響しません)</string>
|
||||||
<string name="list_divider_color">区切り線の色</string>
|
<string name="list_divider_color">区切り線の色</string>
|
||||||
|
<string name="display_replies_count">返信の数の表示</string>
|
||||||
|
<string name="replies_count_simple">0/1/1+</string>
|
||||||
|
<string name="replies_count_actual">詳細</string>
|
||||||
|
<string name="replies_count_none">なし</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -717,4 +717,8 @@
|
||||||
<string name="toot_context_parse_failed">conversation parse failed.</string>
|
<string name="toot_context_parse_failed">conversation parse failed.</string>
|
||||||
<string name="toot_default_text">Default text when composing toot. (not affected to quick toot bar and switching account in toot composing screen)</string>
|
<string name="toot_default_text">Default text when composing toot. (not affected to quick toot bar and switching account in toot composing screen)</string>
|
||||||
<string name="list_divider_color">List divider color</string>
|
<string name="list_divider_color">List divider color</string>
|
||||||
|
<string name="display_replies_count">Show replies count</string>
|
||||||
|
<string name="replies_count_simple">0/1/1+</string>
|
||||||
|
<string name="replies_count_actual">Actual</string>
|
||||||
|
<string name="replies_count_none">None</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue