フッタ部ボタンと区切りの色のデフォルト値を変更。画面下部の余白のデフォルト値を8dpに変更。

This commit is contained in:
tateisu 2020-09-07 18:12:25 +09:00
parent e6ee408914
commit 629fc3ff3e
4 changed files with 64 additions and 64 deletions

View File

@ -53,18 +53,17 @@ import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
class ActMain : AsyncActivity()
, Column.Callback
, View.OnClickListener
, ViewPager.OnPageChangeListener
, DrawerLayout.DrawerListener {
class ActMain : AsyncActivity(), Column.Callback, View.OnClickListener,
ViewPager.OnPageChangeListener, DrawerLayout.DrawerListener {
class PhoneEnv {
internal lateinit var pager : MyViewPager
internal lateinit var pager_adapter : ColumnPagerAdapter
}
class TabletEnv {
internal lateinit var tablet_pager : RecyclerView
internal lateinit var tablet_pager_adapter : TabletColumnPagerAdapter
internal lateinit var tablet_layout_manager : LinearLayoutManager
@ -925,8 +924,8 @@ class ActMain : AsyncActivity()
this,
bAllowPseudo = false,
bAuto = true,
message = getString(R.string.account_picker_toot)
, dismiss_callback = { sent_intent2 = null }
message = getString(R.string.account_picker_toot),
dismiss_callback = { sent_intent2 = null }
) { ai ->
sent_intent2 = null
ActPost.open(this@ActMain, REQUEST_CODE_POST, ai.db_id, sent_intent = intent)
@ -1936,8 +1935,8 @@ class ActMain : AsyncActivity()
val result =
client.authentication2Misskey(client_name, token, ti.misskeyVersion)
this.ta = TootParser(
this@ActMain
, LinkHelper.newLinkHelper(instance, misskeyVersion = ti.misskeyVersion)
this@ActMain,
LinkHelper.newLinkHelper(instance, misskeyVersion = ti.misskeyVersion)
).account(result?.jsonObject)
return result
@ -2000,8 +1999,7 @@ class ActMain : AsyncActivity()
val client_name = Pref.spClientName(this@ActMain)
val result = client.authentication2(client_name, code)
this.ta = TootParser(
this@ActMain
, LinkHelper.newLinkHelper(instance)
this@ActMain, LinkHelper.newLinkHelper(instance)
).account(result?.jsonObject)
return result
}
@ -2531,23 +2529,33 @@ class ActMain : AsyncActivity()
}
private fun showFooterColor() {
val footer_button_bg_color = Pref.ipFooterButtonBgColor(pref)
val footer_button_fg_color = Pref.ipFooterButtonFgColor(pref)
val footer_tab_bg_color = Pref.ipFooterTabBgColor(pref)
val footer_tab_divider_color = Pref.ipFooterTabDividerColor(pref)
val footer_tab_indicator_color = Pref.ipFooterTabIndicatorColor(pref)
val colorBg = footer_button_bg_color.notZero() ?: getAttributeColor(
this,
R.attr.colorStatusButtonsPopupBg
)
val colorRipple =
footer_button_fg_color.notZero() ?: getAttributeColor(this, R.attr.colorRippleEffect)
btnMenu.backgroundDrawable = getAdaptiveRippleDrawableRound(this, colorBg, colorRipple)
btnToot.backgroundDrawable = getAdaptiveRippleDrawableRound(this, colorBg, colorRipple)
btnQuickToot.backgroundDrawable = getAdaptiveRippleDrawableRound(this, colorBg, colorRipple)
val colorColumnStripBackground = footer_tab_bg_color.notZero()
?: getAttributeColor(this, R.attr.colorColumnStripBackground)
svColumnStrip.setBackgroundColor(colorColumnStripBackground)
llQuickTootBar.setBackgroundColor(colorColumnStripBackground)
val colorButtonBg = footer_button_bg_color.notZero()
?: colorColumnStripBackground
val colorButtonFg = footer_button_fg_color.notZero()
?: getAttributeColor(this, R.attr.colorRippleEffect)
btnMenu.backgroundDrawable =
getAdaptiveRippleDrawableRound(this, colorButtonBg, colorButtonFg)
btnToot.backgroundDrawable =
getAdaptiveRippleDrawableRound(this, colorButtonBg, colorButtonFg)
btnQuickToot.backgroundDrawable =
getAdaptiveRippleDrawableRound(this, colorButtonBg, colorButtonFg)
btnQuickTootMenu.backgroundDrawable =
getAdaptiveRippleDrawableRound(this, colorBg, colorRipple)
getAdaptiveRippleDrawableRound(this, colorButtonBg, colorButtonFg)
val csl = ColorStateList.valueOf(
footer_button_fg_color.notZero()
@ -2558,17 +2566,13 @@ class ActMain : AsyncActivity()
btnQuickToot.imageTintList = csl
btnQuickTootMenu.imageTintList = csl
var c = footer_tab_bg_color.notZero()
?: getAttributeColor(this, R.attr.colorColumnStripBackground)
svColumnStrip.setBackgroundColor(c)
llQuickTootBar.setBackgroundColor(c)
c = footer_tab_divider_color.notZero()
?: getAttributeColor(this, R.attr.colorImageButton)
val c = footer_tab_divider_color.notZero()
?: colorColumnStripBackground
vFooterDivider1.setBackgroundColor(c)
vFooterDivider2.setBackgroundColor(c)
llColumnStrip.indicatorColor = footer_tab_indicator_color
llColumnStrip.indicatorColor = footer_tab_indicator_color.notZero()
?: getAttributeColor(this, R.attr.colorAccent)
}
/////////////////////////////////////////////////////////////////////////
@ -2951,8 +2955,9 @@ class ActMain : AsyncActivity()
auto_cw.decoded_spoiler_text = null
// テキストをレイアウトして行数を測定
val tv = TextView(this).apply{
layoutParams = LinearLayout.LayoutParams(nAutoCwCellWidth, LinearLayout.LayoutParams.WRAP_CONTENT)
val tv = TextView(this).apply {
layoutParams =
LinearLayout.LayoutParams(nAutoCwCellWidth, LinearLayout.LayoutParams.WRAP_CONTENT)
if(! timeline_font_size_sp.isNaN())
textSize = timeline_font_size_sp

View File

@ -11,6 +11,7 @@ import androidx.annotation.StringRes
import androidx.appcompat.widget.AppCompatImageView
import jp.juggler.subwaytooter.action.CustomShareTarget
import jp.juggler.util.*
import org.jetbrains.anko.backgroundDrawable
enum class SettingType(val id : Int) {
Path(0),
@ -843,12 +844,6 @@ val appSettingRoot = AppSettingItem(null, SettingType.Section, R.string.app_sett
AppSettingItem.SAMPLE_FOOTER =
sample(R.layout.setting_sample_footer) { activity, viewRoot ->
val pref = activity.pref
val footer_button_bg_color = Pref.ipFooterButtonBgColor(pref)
val footer_button_fg_color = Pref.ipFooterButtonFgColor(pref)
val footer_tab_bg_color = Pref.ipFooterTabBgColor(pref)
val footer_tab_divider_color = Pref.ipFooterTabDividerColor(pref)
val footer_tab_indicator_color = Pref.ipFooterTabIndicatorColor(pref)
val ivFooterToot : AppCompatImageView = viewRoot.findViewById(R.id.ivFooterToot)
val ivFooterMenu : AppCompatImageView = viewRoot.findViewById(R.id.ivFooterMenu)
val llFooterBG : View = viewRoot.findViewById(R.id.llFooterBG)
@ -856,19 +851,27 @@ val appSettingRoot = AppSettingItem(null, SettingType.Section, R.string.app_sett
val vFooterDivider2 : View = viewRoot.findViewById(R.id.vFooterDivider2)
val vIndicator : View = viewRoot.findViewById(R.id.vIndicator)
val colorBg = footer_button_bg_color.notZero() ?: getAttributeColor(
activity,
R.attr.colorStatusButtonsPopupBg
)
val colorRipple =
footer_button_fg_color.notZero() ?: getAttributeColor(
activity,
R.attr.colorRippleEffect
)
ivFooterToot.background =
getAdaptiveRippleDrawableRound(activity, colorBg, colorRipple)
ivFooterMenu.background =
getAdaptiveRippleDrawableRound(activity, colorBg, colorRipple)
val footer_button_bg_color = Pref.ipFooterButtonBgColor(pref)
val footer_button_fg_color = Pref.ipFooterButtonFgColor(pref)
val footer_tab_bg_color = Pref.ipFooterTabBgColor(pref)
val footer_tab_divider_color = Pref.ipFooterTabDividerColor(pref)
val footer_tab_indicator_color = Pref.ipFooterTabIndicatorColor(pref)
val colorColumnStripBackground = footer_tab_bg_color.notZero()
?: getAttributeColor(activity, R.attr.colorColumnStripBackground)
llFooterBG.setBackgroundColor(colorColumnStripBackground)
val colorButtonBg = footer_button_bg_color.notZero()
?: colorColumnStripBackground
val colorButtonFg = footer_button_fg_color.notZero()
?: getAttributeColor(activity, R.attr.colorRippleEffect)
ivFooterMenu.backgroundDrawable =
getAdaptiveRippleDrawableRound(activity, colorButtonBg, colorButtonFg)
ivFooterToot.backgroundDrawable =
getAdaptiveRippleDrawableRound(activity, colorButtonBg, colorButtonFg)
val csl = ColorStateList.valueOf(
footer_button_fg_color.notZero()
@ -877,16 +880,8 @@ val appSettingRoot = AppSettingItem(null, SettingType.Section, R.string.app_sett
ivFooterToot.imageTintList = csl
ivFooterMenu.imageTintList = csl
llFooterBG.setBackgroundColor(
footer_tab_bg_color.notZero()
?: getAttributeColor(activity, R.attr.colorColumnStripBackground)
)
val c =
footer_tab_divider_color.notZero() ?: getAttributeColor(
activity,
R.attr.colorImageButton
)
val c = footer_tab_divider_color.notZero()
?: colorColumnStripBackground
vFooterDivider1.setBackgroundColor(c)
vFooterDivider2.setBackgroundColor(c)

View File

@ -563,7 +563,7 @@ object Pref {
val spRoundRatio = StringPref("round_ratio", "33")
val spBoostAlpha = StringPref("BoostAlpha", "60")
val spScreenBottomPadding = StringPref("ScreenBottomPadding", "0")
val spScreenBottomPadding = StringPref("ScreenBottomPadding", "8")
val spPullNotificationCheckInterval = StringPref("PullNotificationCheckInterval", "15")
val spUserAgent = StringPref("UserAgent", "")

View File

@ -8,6 +8,7 @@ import android.util.AttributeSet
import android.widget.LinearLayout
import jp.juggler.subwaytooter.R
import jp.juggler.util.getAttributeColor
import jp.juggler.util.notZero
// 画面下のカラムストリップのLinearLayout
// 可視範囲を示すインジケーターを表示する
@ -24,9 +25,8 @@ class ColumnStripLinearLayout : LinearLayout {
// インジケーターの色
var indicatorColor : Int = 0
set(value) {
val c = if(value != 0) value else getAttributeColor(context, R.attr.colorAccent)
if(field != c) {
field = c
if(field != value) {
field = value
invalidate()
}
}