アプリ設定に「ブーストボタンのアルファ値」を追加。明るいテーマのカラムヘッダ背景色のデフォルト値を白くした
This commit is contained in:
parent
2b5d66ee95
commit
5432d10331
|
@ -134,6 +134,7 @@ class ActAppSetting : AppCompatActivity()
|
|||
private lateinit var etMediaSizeMax : EditText
|
||||
private lateinit var etMovieSizeMax : EditText
|
||||
private lateinit var etRoundRatio : EditText
|
||||
private lateinit var etBoostAlpha : EditText
|
||||
private lateinit var etMediaReadTimeout : EditText
|
||||
|
||||
|
||||
|
@ -147,6 +148,7 @@ class ActAppSetting : AppCompatActivity()
|
|||
private lateinit var tvTimelineFontSize : TextView
|
||||
private lateinit var tvAcctFontSize : TextView
|
||||
private lateinit var etAvatarIconSize : EditText
|
||||
|
||||
private lateinit var etPullNotificationCheckInterval : EditText
|
||||
|
||||
private lateinit var etNotificationTlFontSize : EditText
|
||||
|
@ -332,6 +334,9 @@ class ActAppSetting : AppCompatActivity()
|
|||
etRoundRatio = findViewById(R.id.etRoundRatio)
|
||||
etRoundRatio.addTextChangedListener(this)
|
||||
|
||||
etBoostAlpha = findViewById(R.id.etBoostAlpha)
|
||||
etBoostAlpha.addTextChangedListener(this)
|
||||
|
||||
etMediaReadTimeout= findViewById(R.id.etMediaReadTimeout)
|
||||
etMediaReadTimeout.addTextChangedListener(this)
|
||||
|
||||
|
@ -440,6 +445,7 @@ class ActAppSetting : AppCompatActivity()
|
|||
etMediaSizeMax.setText(Pref.spMediaSizeMax(pref))
|
||||
etMovieSizeMax.setText(Pref.spMovieSizeMax(pref))
|
||||
etRoundRatio.setText(Pref.spRoundRatio(pref))
|
||||
etBoostAlpha.setText(Pref.spBoostAlpha(pref))
|
||||
|
||||
etMediaReadTimeout.setText(Pref.spMediaReadTimeout(pref))
|
||||
|
||||
|
@ -521,6 +527,8 @@ class ActAppSetting : AppCompatActivity()
|
|||
.put(Pref.spMovieSizeMax, etMovieSizeMax.text.toString().trim { it <= ' ' })
|
||||
|
||||
.put(Pref.spRoundRatio, etRoundRatio.text.toString().trim { it <= ' ' })
|
||||
.put(Pref.spBoostAlpha, etBoostAlpha.text.toString().trim { it <= ' ' })
|
||||
|
||||
.put(Pref.spMediaReadTimeout, etMediaReadTimeout.text.toString().trim { it <= ' ' })
|
||||
|
||||
|
||||
|
@ -849,8 +857,8 @@ class ActAppSetting : AppCompatActivity()
|
|||
|
||||
var c = footer_button_bg_color
|
||||
if(c == 0) {
|
||||
ivFooterToot.setBackgroundResource(R.drawable.btn_bg_ddd)
|
||||
ivFooterMenu.setBackgroundResource(R.drawable.btn_bg_ddd)
|
||||
ivFooterToot.setBackgroundResource(R.drawable.bg_button_cw)
|
||||
ivFooterMenu.setBackgroundResource(R.drawable.bg_button_cw)
|
||||
} else {
|
||||
val fg = if(footer_button_fg_color != 0)
|
||||
footer_button_fg_color
|
||||
|
|
|
@ -23,6 +23,7 @@ import jp.juggler.subwaytooter.api.TootTask
|
|||
import jp.juggler.subwaytooter.api.TootTaskRunner
|
||||
import jp.juggler.subwaytooter.util.*
|
||||
import org.apache.commons.io.IOUtils
|
||||
import org.jetbrains.anko.textColor
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
|
||||
|
@ -126,13 +127,13 @@ class ActColumnCustomize : AppCompatActivity(), View.OnClickListener, ColorPicke
|
|||
}
|
||||
|
||||
R.id.btnHeaderTextEdit -> {
|
||||
builder = ColorPickerDialog.newBuilder()
|
||||
ColorPickerDialog.newBuilder()
|
||||
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
|
||||
.setAllowPresets(true)
|
||||
.setShowAlphaSlider(false)
|
||||
.setDialogId(COLOR_DIALOG_ID_HEADER_FOREGROUND)
|
||||
if(column.header_fg_color != 0) builder.setColor(column.header_fg_color)
|
||||
builder.show(this)
|
||||
.setColor(column.getHeaderNameColor(this))
|
||||
.show(this)
|
||||
}
|
||||
|
||||
R.id.btnHeaderTextReset -> {
|
||||
|
@ -387,43 +388,19 @@ class ActColumnCustomize : AppCompatActivity(), View.OnClickListener, ColorPicke
|
|||
private fun show() {
|
||||
try {
|
||||
loading_busy = true
|
||||
var c = column.header_bg_color
|
||||
if(c == 0) {
|
||||
llColumnHeader.setBackgroundResource(R.drawable.btn_bg_ddd)
|
||||
} else {
|
||||
ViewCompat.setBackground(
|
||||
llColumnHeader, Styler.getAdaptiveRippleDrawable(
|
||||
c,
|
||||
if(column.header_fg_color != 0)
|
||||
column.header_fg_color
|
||||
else
|
||||
Styler.getAttributeColor(this, R.attr.colorRippleEffect)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
c = column.header_fg_color
|
||||
if(c == 0) {
|
||||
tvColumnName.setTextColor(
|
||||
Styler.getAttributeColor(
|
||||
this,
|
||||
android.R.attr.textColorPrimary
|
||||
)
|
||||
)
|
||||
Styler.setIconAttr(
|
||||
this,
|
||||
ivColumnHeader,
|
||||
column.getIconAttrId(column.column_type)
|
||||
)
|
||||
} else {
|
||||
tvColumnName.setTextColor(c)
|
||||
column.setHeaderBackground(this,llColumnHeader)
|
||||
|
||||
|
||||
|
||||
var c = column.getHeaderNameColor(this)
|
||||
tvColumnName.textColor = c
|
||||
Styler.setIconAttr(
|
||||
this,
|
||||
ivColumnHeader,
|
||||
column.getIconAttrId(column.column_type),
|
||||
color = c
|
||||
)
|
||||
}
|
||||
|
||||
tvColumnName.text = column.getColumnName(false)
|
||||
|
||||
|
|
|
@ -1222,6 +1222,20 @@ class ActMain : AppCompatActivity()
|
|||
Styler.round_ratio = clipRange(0f, 1f, round_ratio / 100f) * 0.5f
|
||||
}
|
||||
|
||||
run {
|
||||
var boost_alpha :Float? = 0.8f
|
||||
try{
|
||||
val f = ( Pref.spBoostAlpha.toInt(pref).toFloat() +0.5f )/100f
|
||||
boost_alpha = when{
|
||||
f >= 1f -> null
|
||||
f < 0f -> 0.66f
|
||||
else-> f
|
||||
}
|
||||
} catch(ex : Throwable) {
|
||||
log.trace(ex)
|
||||
}
|
||||
Styler.boost_alpha = boost_alpha
|
||||
}
|
||||
|
||||
llEmpty = findViewById(R.id.llEmpty)
|
||||
|
||||
|
@ -1415,28 +1429,11 @@ class ActMain : AppCompatActivity()
|
|||
viewRoot.contentDescription = column.getColumnName(true)
|
||||
//
|
||||
|
||||
var c = column.header_bg_color
|
||||
if(c == 0) {
|
||||
viewRoot.setBackgroundResource(R.drawable.btn_bg_ddd)
|
||||
} else {
|
||||
ViewCompat.setBackground(
|
||||
viewRoot, Styler.getAdaptiveRippleDrawable(
|
||||
c,
|
||||
if(column.header_fg_color != 0)
|
||||
column.header_fg_color
|
||||
else
|
||||
Styler.getAttributeColor(this, R.attr.colorRippleEffect)
|
||||
column.setHeaderBackground(this,viewRoot)
|
||||
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
c = column.header_fg_color
|
||||
if(c == 0) {
|
||||
Styler.setIconAttr(this, ivIcon, column.getIconAttrId(column.column_type))
|
||||
} else {
|
||||
var c = column.getHeaderNameColor(this)
|
||||
Styler.setIconAttr(this, ivIcon, column.getIconAttrId(column.column_type), c)
|
||||
}
|
||||
|
||||
//
|
||||
val ac = AcctColor.load(column.access_info.acct)
|
||||
|
@ -2265,9 +2262,9 @@ class ActMain : AppCompatActivity()
|
|||
val footer_tab_indicator_color = Pref.ipFooterTabIndicatorColor(pref)
|
||||
var c = footer_button_bg_color
|
||||
if(c == 0) {
|
||||
btnMenu.setBackgroundResource(R.drawable.btn_bg_ddd)
|
||||
btnToot.setBackgroundResource(R.drawable.btn_bg_ddd)
|
||||
btnQuickToot.setBackgroundResource(R.drawable.btn_bg_ddd)
|
||||
btnMenu.setBackgroundResource(R.drawable.bg_button_cw)
|
||||
btnToot.setBackgroundResource(R.drawable.bg_button_cw)
|
||||
btnQuickToot.setBackgroundResource(R.drawable.bg_button_cw)
|
||||
} else {
|
||||
val fg = if(footer_button_fg_color != 0)
|
||||
footer_button_fg_color
|
||||
|
|
|
@ -6,8 +6,10 @@ import android.net.Uri
|
|||
import android.os.AsyncTask
|
||||
import android.os.Environment
|
||||
import android.os.SystemClock
|
||||
import android.support.v4.view.ViewCompat
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import jp.juggler.subwaytooter.api.*
|
||||
import jp.juggler.subwaytooter.api.entity.*
|
||||
import jp.juggler.subwaytooter.table.*
|
||||
|
@ -1931,6 +1933,7 @@ class Column(
|
|||
}
|
||||
client.request(path_base, params.toPostRequestBuilder())
|
||||
}
|
||||
|
||||
aroundMin -> client.request("$path_base&min_id=$status_id")
|
||||
aroundMax -> client.request("$path_base&max_id=$status_id")
|
||||
else -> client.request(path_base)
|
||||
|
@ -6831,6 +6834,39 @@ class Column(
|
|||
Styler.getAttributeColor(activity, R.attr.colorTimeSmall)
|
||||
}
|
||||
|
||||
fun getHeaderPageNumberColor(activity : AppCompatActivity) : Int {
|
||||
val c = header_fg_color
|
||||
return when {
|
||||
c != 0 -> c
|
||||
else -> Styler.getAttributeColor(
|
||||
activity,
|
||||
R.attr.colorColumnHeaderPageNumber
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun getHeaderNameColor(activity : AppCompatActivity) : Int {
|
||||
val c = header_fg_color
|
||||
return when {
|
||||
c != 0 -> c
|
||||
else -> Styler.getAttributeColor(
|
||||
activity,
|
||||
R.attr.colorColumnHeaderName
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun setHeaderBackground(activity : AppCompatActivity, view : View) {
|
||||
val c = header_bg_color
|
||||
if(c == 0) {
|
||||
view.setBackgroundResource(R.drawable.bg_column_header)
|
||||
} else {
|
||||
ViewCompat.setBackground(
|
||||
view, Styler.getAdaptiveRippleDrawable(c, getHeaderNameColor(activity))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// fun findListIndexByTimelineId(orderId : EntityId) : Int? {
|
||||
// list_data.forEachIndexed { i, v ->
|
||||
// if(v.getOrderId() == orderId) return i
|
||||
|
|
|
@ -658,54 +658,12 @@ class ColumnViewHolder(
|
|||
val column = this.column
|
||||
if(column == null || column.is_dispose.get()) return
|
||||
|
||||
var c = column.header_bg_color
|
||||
if(c == 0) {
|
||||
llColumnHeader.setBackgroundResource(R.drawable.btn_bg_ddd)
|
||||
} else {
|
||||
ViewCompat.setBackground(
|
||||
llColumnHeader,
|
||||
Styler.getAdaptiveRippleDrawable(
|
||||
c,
|
||||
if(column.header_fg_color != 0)
|
||||
column.header_fg_color
|
||||
else
|
||||
Styler.getAttributeColor(activity, R.attr.colorRippleEffect)
|
||||
)
|
||||
)
|
||||
}
|
||||
// カラムヘッダ背景
|
||||
column.setHeaderBackground(activity,llColumnHeader)
|
||||
|
||||
c = column.header_fg_color
|
||||
if(c == 0) {
|
||||
tvColumnIndex.setTextColor(
|
||||
Styler.getAttributeColor(
|
||||
activity,
|
||||
R.attr.colorColumnHeaderPageNumber
|
||||
)
|
||||
)
|
||||
tvColumnStatus.setTextColor(
|
||||
Styler.getAttributeColor(
|
||||
activity,
|
||||
R.attr.colorColumnHeaderPageNumber
|
||||
)
|
||||
)
|
||||
tvColumnName.setTextColor(
|
||||
Styler.getAttributeColor(
|
||||
activity,
|
||||
android.R.attr.textColorPrimary
|
||||
)
|
||||
)
|
||||
Styler.setIconAttr(
|
||||
activity,
|
||||
ivColumnIcon,
|
||||
column.getIconAttrId(column.column_type)
|
||||
)
|
||||
Styler.setIconAttr(activity, btnColumnSetting, R.attr.ic_tune)
|
||||
Styler.setIconAttr(activity, btnColumnReload, R.attr.btn_refresh)
|
||||
Styler.setIconAttr(activity, btnColumnClose, R.attr.btn_close)
|
||||
} else {
|
||||
tvColumnIndex.setTextColor(c)
|
||||
tvColumnStatus.setTextColor(c)
|
||||
tvColumnName.setTextColor(c)
|
||||
// カラムヘッダ文字色(A)
|
||||
var c = column.getHeaderNameColor(activity)
|
||||
tvColumnName.textColor =c
|
||||
Styler.setIconAttr(
|
||||
activity,
|
||||
ivColumnIcon,
|
||||
|
@ -715,8 +673,13 @@ class ColumnViewHolder(
|
|||
Styler.setIconAttr(activity, btnColumnSetting, R.attr.ic_tune, c)
|
||||
Styler.setIconAttr(activity, btnColumnReload, R.attr.btn_refresh, c)
|
||||
Styler.setIconAttr(activity, btnColumnClose, R.attr.btn_close, c)
|
||||
}
|
||||
|
||||
// カラムヘッダ文字色(B)
|
||||
c = column.getHeaderPageNumberColor(activity)
|
||||
tvColumnIndex.textColor =c
|
||||
tvColumnStatus.textColor =c
|
||||
|
||||
// カラム内部の背景色
|
||||
c = column.column_bg_color
|
||||
if(c == 0) {
|
||||
ViewCompat.setBackground(flColumnBackground, null)
|
||||
|
@ -724,15 +687,17 @@ class ColumnViewHolder(
|
|||
flColumnBackground.setBackgroundColor(c)
|
||||
}
|
||||
|
||||
// カラム内部の背景画像
|
||||
ivColumnBackgroundImage.alpha = column.column_bg_image_alpha
|
||||
|
||||
loadBackgroundImage(ivColumnBackgroundImage, column.column_bg_image)
|
||||
|
||||
// エラー表示
|
||||
tvLoading.textColor = column.getContentColor(activity)
|
||||
|
||||
status_adapter?.findHeaderViewHolder(listView)?.showColor()
|
||||
}
|
||||
|
||||
|
||||
private fun closeBitmaps() {
|
||||
try {
|
||||
ivColumnBackgroundImage.visibility = View.GONE
|
||||
|
|
|
@ -865,7 +865,8 @@ internal class ItemViewHolder(
|
|||
activity,
|
||||
ivReply,
|
||||
iconAttrId,
|
||||
color = content_color
|
||||
color = content_color,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
|
||||
tvReply.text = text
|
||||
|
@ -939,7 +940,8 @@ internal class ItemViewHolder(
|
|||
activity,
|
||||
ivBoosted,
|
||||
icon_attr_id,
|
||||
color = content_color
|
||||
color = content_color,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -968,7 +970,15 @@ internal class ItemViewHolder(
|
|||
setAcct(tvFollowerAcct, access_info.getFullAcct(who), who.acct)
|
||||
|
||||
val relation = UserRelation.load(access_info.db_id, who.id)
|
||||
Styler.setFollowIcon(activity, btnFollow, ivFollowedBy, relation, who,content_color)
|
||||
Styler.setFollowIcon(
|
||||
activity,
|
||||
btnFollow,
|
||||
ivFollowedBy,
|
||||
relation,
|
||||
who,
|
||||
content_color,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
|
||||
if(column.column_type == Column.TYPE_FOLLOW_REQUESTS) {
|
||||
llFollowRequest.visibility = View.VISIBLE
|
||||
|
@ -1147,7 +1157,8 @@ internal class ItemViewHolder(
|
|||
activity,
|
||||
btnHideMedia,
|
||||
R.attr.btn_close,
|
||||
color = content_color
|
||||
color = content_color,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1903,8 +1914,6 @@ internal class ItemViewHolder(
|
|||
// c != null && c > 0
|
||||
// } ?: return
|
||||
|
||||
|
||||
|
||||
val density = activity.resources.displayMetrics.density
|
||||
|
||||
val buttonHeight = ActMain.boostButtonSize
|
||||
|
@ -1947,7 +1956,8 @@ internal class ItemViewHolder(
|
|||
activity,
|
||||
b,
|
||||
R.drawable.ic_add,
|
||||
color = content_color
|
||||
color = content_color,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
|
||||
box.addView(b)
|
||||
|
@ -2404,7 +2414,7 @@ internal class ItemViewHolder(
|
|||
btnContentWarning = button {
|
||||
|
||||
background =
|
||||
ContextCompat.getDrawable(context, R.drawable.btn_bg_ddd)
|
||||
ContextCompat.getDrawable(context, R.drawable.bg_button_cw)
|
||||
minWidthCompat = dip(40)
|
||||
padding = dip(4)
|
||||
//tools:text="見る"
|
||||
|
|
|
@ -411,6 +411,8 @@ object Pref {
|
|||
val spMspUserToken = StringPref("mastodon_search_portal_user_token", "")
|
||||
val spEmojiPickerRecent = StringPref("emoji_picker_recent", "")
|
||||
val spRoundRatio = StringPref("round_ratio", "33")
|
||||
val spBoostAlpha = StringPref("BoostAlpha", "60")
|
||||
|
||||
val spPullNotificationCheckInterval = StringPref("PullNotificationCheckInterval", "15")
|
||||
val spUserAgent = StringPref("UserAgent", "")
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import jp.juggler.subwaytooter.api.entity.TootVisibility
|
|||
import jp.juggler.subwaytooter.table.SavedAccount
|
||||
import jp.juggler.subwaytooter.table.UserRelation
|
||||
import jp.juggler.subwaytooter.util.LogCategory
|
||||
import jp.juggler.subwaytooter.util.applyAlphaMultiplier
|
||||
import jp.juggler.subwaytooter.util.startMargin
|
||||
import jp.juggler.subwaytooter.view.CountImageButton
|
||||
import org.jetbrains.anko.*
|
||||
|
@ -92,13 +93,15 @@ internal class StatusButtons(
|
|||
activity,
|
||||
btnConversation,
|
||||
R.drawable.ic_conversation_dark,
|
||||
color = color_normal
|
||||
color = color_normal,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
Styler.setIconDrawableId(
|
||||
activity,
|
||||
btnMore,
|
||||
R.drawable.btn_more_dark,
|
||||
color = color_normal
|
||||
color = color_normal,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
|
||||
// val a = (((color_normal ushr 24)/255f) * 0.7f)
|
||||
|
@ -198,7 +201,8 @@ internal class StatusButtons(
|
|||
ivFollowedBy2,
|
||||
relation,
|
||||
account,
|
||||
color_normal
|
||||
color_normal,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
relation
|
||||
}
|
||||
|
@ -213,10 +217,10 @@ internal class StatusButtons(
|
|||
count : String,
|
||||
contentDescription : String
|
||||
) {
|
||||
val d = Styler.createColoredDrawable(activity,drawableId,color)
|
||||
val d = Styler.createColoredDrawable(activity,drawableId,color,alphaMultiplier = Styler.boost_alpha)
|
||||
b.setImageDrawable(d)
|
||||
b.setPaddingAndText(holder.paddingH, holder.paddingV, count, 14f, holder.compoundPaddingDp)
|
||||
b.setTextColor(color)
|
||||
b.setTextColor(color.applyAlphaMultiplier(Styler.boost_alpha))
|
||||
b.contentDescription = contentDescription + count
|
||||
b.isEnabled = enabled
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import jp.juggler.subwaytooter.api.entity.TootAccount
|
|||
import jp.juggler.subwaytooter.api.entity.TootVisibility
|
||||
import jp.juggler.subwaytooter.span.EmojiImageSpan
|
||||
import jp.juggler.subwaytooter.table.UserRelation
|
||||
import jp.juggler.subwaytooter.util.clipRange
|
||||
import java.util.*
|
||||
|
||||
object Styler {
|
||||
|
@ -58,13 +59,20 @@ object Styler {
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun createColoredDrawable(
|
||||
context : Context,
|
||||
drawableId : Int,
|
||||
color : Int
|
||||
color : Int,
|
||||
alphaMultiplier: Float? = null
|
||||
) : Drawable {
|
||||
val rgb = (color and 0xffffff) or Color.BLACK
|
||||
val alpha = (color ushr 24)
|
||||
val alpha = if( alphaMultiplier ==null ){
|
||||
(color ushr 24)
|
||||
}else{
|
||||
clipRange(0,255,((color ushr 24).toFloat() * alphaMultiplier +0.5f ).toInt())
|
||||
}
|
||||
|
||||
// 色指定が他のアイコンに影響しないようにする
|
||||
// カラーフィルターとアルファ値を設定する
|
||||
|
@ -79,13 +87,14 @@ object Styler {
|
|||
context : Context,
|
||||
imageView : ImageView,
|
||||
drawableId : Int,
|
||||
color : Int? = null
|
||||
color : Int? = null,
|
||||
alphaMultiplier: Float? = null
|
||||
) {
|
||||
if(color == null) {
|
||||
// ImageViewにアイコンを設定する。デフォルトの色
|
||||
imageView.setImageDrawable(ContextCompat.getDrawable(context, drawableId))
|
||||
} else {
|
||||
imageView.setImageDrawable(createColoredDrawable(context, drawableId, color))
|
||||
imageView.setImageDrawable(createColoredDrawable(context, drawableId, color,alphaMultiplier))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,9 +102,10 @@ object Styler {
|
|||
context : Context,
|
||||
imageView : ImageView,
|
||||
iconAttrId : Int,
|
||||
color : Int? = null
|
||||
color : Int? = null,
|
||||
alphaMultiplier: Float? = null
|
||||
) {
|
||||
setIconDrawableId(context, imageView, getAttributeResourceId(context, iconAttrId), color)
|
||||
setIconDrawableId(context, imageView, getAttributeResourceId(context, iconAttrId), color,alphaMultiplier)
|
||||
}
|
||||
|
||||
fun getVisibilityIconAttr(isMisskeyData : Boolean, visibility : TootVisibility) : Int {
|
||||
|
@ -214,6 +224,7 @@ object Styler {
|
|||
, relation : UserRelation
|
||||
, who : TootAccount
|
||||
, defaultColor : Int
|
||||
,alphaMultiplier : Float? = null
|
||||
) {
|
||||
|
||||
fun colorError() = Styler.getAttributeColor(context, R.attr.colorRegexFilterError)
|
||||
|
@ -224,17 +235,17 @@ object Styler {
|
|||
|
||||
relation.blocked_by -> {
|
||||
ivDot.visibility = View.VISIBLE
|
||||
setIconDrawableId(context, ivDot, R.drawable.ic_blocked_by, color = colorError())
|
||||
setIconDrawableId(context, ivDot, R.drawable.ic_blocked_by, color = colorError(),alphaMultiplier = alphaMultiplier)
|
||||
}
|
||||
|
||||
relation.requested_by -> {
|
||||
ivDot.visibility = View.VISIBLE
|
||||
setIconDrawableId(context, ivDot, R.drawable.ic_requested_by, color = colorError())
|
||||
setIconDrawableId(context, ivDot, R.drawable.ic_requested_by, color = colorError(),alphaMultiplier = alphaMultiplier)
|
||||
}
|
||||
|
||||
relation.followed_by -> {
|
||||
ivDot.visibility = View.VISIBLE
|
||||
setIconAttr(context, ivDot, R.attr.ic_followed_by, color = colorAccent())
|
||||
setIconAttr(context, ivDot, R.attr.ic_followed_by, color = colorAccent(),alphaMultiplier = alphaMultiplier)
|
||||
// 被フォローリクエスト状態の時に followed_by が 真と偽の両方がありえるようなので
|
||||
// Relationshipだけを見ても被フォローリクエスト状態は分からないっぽい
|
||||
// 仕方ないので馬鹿正直に「 followed_byが真ならバッジをつける」しかできない
|
||||
|
@ -283,7 +294,7 @@ object Styler {
|
|||
}
|
||||
}
|
||||
|
||||
setIconAttr(context, ibFollow, icon_attr, color = color)
|
||||
setIconAttr(context, ibFollow, icon_attr, color = color,alphaMultiplier = alphaMultiplier)
|
||||
ibFollow.contentDescription = contentDescription
|
||||
}
|
||||
|
||||
|
@ -350,6 +361,7 @@ object Styler {
|
|||
|
||||
// ActMainの初期化時に更新される
|
||||
var round_ratio : Float = 0.33f * 0.5f
|
||||
var boost_alpha : Float? = null
|
||||
|
||||
fun calcIconRound(wh : Int) = wh.toFloat() * round_ratio
|
||||
|
||||
|
|
|
@ -155,7 +155,14 @@ internal class ViewHolderHeaderProfile(
|
|||
btnStatusCount.textColor = contentColor
|
||||
btnFollowing.textColor = contentColor
|
||||
btnFollowers.textColor = contentColor
|
||||
Styler.setIconDrawableId(activity, btnMore, R.drawable.btn_more, color = contentColor)
|
||||
|
||||
Styler.setIconDrawableId(
|
||||
activity,
|
||||
btnMore,
|
||||
R.drawable.btn_more,
|
||||
color = contentColor,
|
||||
alphaMultiplier = Styler.boost_alpha
|
||||
)
|
||||
|
||||
val acctColor = column.getAcctColor(activity)
|
||||
tvCreated.textColor = acctColor
|
||||
|
@ -293,8 +300,6 @@ internal class ViewHolderHeaderProfile(
|
|||
emojiMapProfile = who.profile_emojis
|
||||
)
|
||||
|
||||
|
||||
|
||||
val nameTypeface = ActMain.timeline_font_bold
|
||||
val valueTypeface = ActMain.timeline_font
|
||||
|
||||
|
|
|
@ -1068,3 +1068,13 @@ fun Matcher.groupOrNull( g:Int):String? =
|
|||
null
|
||||
}
|
||||
|
||||
// colorARGB.applyAlphaMultiplier(0.5f) でalpha値が半分になったARGB値を得る
|
||||
fun Int.applyAlphaMultiplier(alphaMultiplier: Float? = null):Int{
|
||||
return if( alphaMultiplier ==null ){
|
||||
this
|
||||
}else{
|
||||
val rgb = (this and 0xffffff)
|
||||
val alpha = clipRange(0,255,((this ushr 24).toFloat() * alphaMultiplier +0.5f ).toInt())
|
||||
return rgb or (alpha shl 24)
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/colorRippleEffect" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/colorButtonSelected" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_focused="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/colorButtonSelected" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="?attr/color_column_header" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -1181,7 +1181,7 @@
|
|||
android:id="@+id/ivFooterMenu"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/btn_bg_ddd"
|
||||
android:background="@drawable/bg_button_cw"
|
||||
android:importantForAccessibility="no"
|
||||
app:srcCompat="?attr/ic_hamburger"
|
||||
/>
|
||||
|
@ -1239,7 +1239,7 @@
|
|||
android:id="@+id/ivFooterToot"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/btn_bg_ddd"
|
||||
android:background="@drawable/bg_button_cw"
|
||||
android:contentDescription="@string/toot"
|
||||
app:srcCompat="?attr/ic_edit"
|
||||
/>
|
||||
|
@ -1583,6 +1583,23 @@
|
|||
|
||||
<View style="@style/setting_divider"/>
|
||||
|
||||
<TextView
|
||||
style="@style/setting_row_label"
|
||||
android:labelFor="@+id/etBoostAlpha"
|
||||
android:text="@string/boost_button_alpha"
|
||||
/>
|
||||
|
||||
<LinearLayout style="@style/setting_row_form">
|
||||
<EditText
|
||||
android:id="@+id/etBoostAlpha"
|
||||
style="@style/setting_horizontal_stretch"
|
||||
android:gravity="center"
|
||||
android:inputType="numberDecimal"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<View style="@style/setting_divider"/>
|
||||
|
||||
<TextView
|
||||
style="@style/setting_row_label"
|
||||
android:labelFor="@+id/etAvatarIconSize"
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
android:id="@+id/btnMenu"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/btn_bg_ddd"
|
||||
android:background="@drawable/bg_button_cw"
|
||||
android:contentDescription="@string/menu"
|
||||
app:srcCompat="?attr/ic_hamburger"
|
||||
/>
|
||||
|
@ -109,7 +109,7 @@
|
|||
android:id="@+id/btnToot"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/btn_bg_ddd"
|
||||
android:background="@drawable/bg_button_cw"
|
||||
android:contentDescription="@string/toot"
|
||||
app:srcCompat="?attr/ic_edit"
|
||||
/>
|
||||
|
@ -140,7 +140,7 @@
|
|||
android:id="@+id/btnQuickToot"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/btn_bg_ddd"
|
||||
android:background="@drawable/bg_button_cw"
|
||||
android:contentDescription="@string/post"
|
||||
app:srcCompat="?attr/btn_post"
|
||||
/>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/btn_bg_ddd"
|
||||
android:background="@drawable/bg_column_header"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
android:id="@+id/llColumnHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/btn_bg_ddd"
|
||||
android:background="@drawable/bg_column_header"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="3dp"
|
||||
android:paddingEnd="12dp"
|
||||
|
|
|
@ -793,5 +793,6 @@
|
|||
<string name="conversation_to">送り先:</string>
|
||||
<string name="make_quote_renote">引用Renoteにする</string>
|
||||
<string name="mute_application_confirm">アプリ \"%1$s\" はミュートされます。よろしいですか?</string>
|
||||
<string name="boost_button_alpha">ブーストボタンのアルファ不透明度(単位:%。アプリの再起動が必要。本文テキスト色のアルファ値の影響も受けます)</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
<!-- カラムヘッダ背景色、および一部ボタンの背景色 -->
|
||||
<attr name="color_column_header" format="color"/>
|
||||
|
||||
<!-- CWボタンなどの背景色 -->
|
||||
<attr name="colorButtonBg" format="color"/>
|
||||
|
||||
|
||||
<!-- イメージボタンの図柄の色 0xff000000 -->
|
||||
<attr name="colorImageButton" format="color"/>
|
||||
|
||||
|
@ -56,6 +60,9 @@
|
|||
<!-- カラムヘッダページ番号の文字色 #888 -->
|
||||
<attr name="colorColumnHeaderPageNumber" format="color"/>
|
||||
|
||||
<!-- カラムヘッダのカラム名の文字色 -->
|
||||
<attr name="colorColumnHeaderName" format="color"/>
|
||||
|
||||
<!-- カラム設定の背景色 #ccc -->
|
||||
<attr name="colorColumnSettingBackground" format="color"/>
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<color name="Light_colorColumnListItemText">#80000000</color>
|
||||
<color name="Light_colorTimeSmall">#ff666666</color>
|
||||
<color name="Light_colorContentText">#ff333333</color>
|
||||
<color name="Light_colorColumnHeaderName">#616161</color>
|
||||
|
||||
<color name="Light_colorColumnHeaderAcct">#80000000</color>
|
||||
<color name="Light_colorColumnHeaderPageNumber">#80000000</color>
|
||||
|
@ -23,10 +24,12 @@
|
|||
<color name="Light_colorSearchFormBackground">#bee6ff</color>
|
||||
|
||||
<color name="Light_colorPrimary">#cccccc</color>
|
||||
<color name="Light_color_column_header">#cccccc</color>
|
||||
<color name="Light_color_column_header">#fff</color>
|
||||
<color name="Light_colorButtonBg">#cccccc</color>
|
||||
<color name="Light_colorReplyBackground">#cccccc</color>
|
||||
|
||||
|
||||
|
||||
<color name="Light_colorPostFormBackground">#eee</color>
|
||||
|
||||
<color name="Light_colorProfileBackgroundMask">#C0FFFFFF</color>
|
||||
|
@ -55,7 +58,7 @@
|
|||
<color name="Dark_colorColumnHeaderAcct">#66FFFFFF</color>
|
||||
<color name="Dark_colorColumnHeaderPageNumber">#66FFFFFF</color>
|
||||
<color name="Dark_colorSettingDivider">#66FFFFFF</color><!-- ダイアログ背景が#424242なので、それより明るくないといけない -->
|
||||
|
||||
<color name="Dark_colorColumnHeaderName">#e4e4e4</color>
|
||||
|
||||
<color name="Dark_colorImageButton">#ccFFFFFF</color>
|
||||
|
||||
|
@ -72,6 +75,7 @@
|
|||
|
||||
<color name="Dark_colorPrimary">#333</color>
|
||||
<color name="Dark_color_column_header">#333</color>
|
||||
<color name="Dark_colorButtonBg">#333</color>
|
||||
<color name="Dark_colorReplyBackground">#333</color>
|
||||
|
||||
<color name="Dark_colorPostFormBackground">#222</color>
|
||||
|
|
|
@ -812,5 +812,6 @@
|
|||
<string name="conversation_to">To:</string>
|
||||
<string name="make_quote_renote">Use \"Quoted Renote\"</string>
|
||||
<string name="mute_application_confirm">Application \"%1$s\" will be muted. Are you sure ?</string>
|
||||
<string name="boost_button_alpha">Boost button alpha opacity (Unit:%. app restart required. also affected of content text alpha.)</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
<item name="colorRegexFilterError">@color/Light_colorRegexFilterError</item>
|
||||
<item name="colorPostFormBackground">@color/Light_colorPostFormBackground</item>
|
||||
<item name="colorColumnStripBackground">@color/Light_colorColumnStripBackground</item>
|
||||
<item name="colorColumnHeaderName">@color/Light_colorColumnHeaderName</item>
|
||||
<item name="colorButtonBg">@color/Light_colorButtonBg</item>
|
||||
|
||||
<item name="btn_attachment">@drawable/btn_attachment</item>
|
||||
<item name="btn_boost">@drawable/btn_boost</item>
|
||||
|
@ -167,6 +169,8 @@
|
|||
<item name="colorRegexFilterError">@color/Dark_colorRegexFilterError</item>
|
||||
<item name="colorPostFormBackground">@color/Dark_colorPostFormBackground</item>
|
||||
<item name="colorColumnStripBackground">@color/Dark_colorColumnStripBackground</item>
|
||||
<item name="colorColumnHeaderName">@color/Dark_colorColumnHeaderName</item>
|
||||
<item name="colorButtonBg">@color/Dark_colorButtonBg</item>
|
||||
|
||||
<item name="btn_attachment">@drawable/btn_attachment_dark</item>
|
||||
<item name="btn_boost">@drawable/btn_boost_dark</item>
|
||||
|
|
Loading…
Reference in New Issue