アプリ設定に「見た目/通知カラムのクイックフィルタをカラム設定内部に表示する」を追加
This commit is contained in:
parent
b6e2e1b1c5
commit
2e9a5f7d97
@ -5,6 +5,7 @@ import android.content.Context
|
|||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.AsyncTask
|
import android.os.AsyncTask
|
||||||
|
import android.support.v4.content.ContextCompat
|
||||||
import android.support.v4.view.ViewCompat
|
import android.support.v4.view.ViewCompat
|
||||||
import android.support.v7.widget.LinearLayoutManager
|
import android.support.v7.widget.LinearLayoutManager
|
||||||
import android.support.v7.widget.RecyclerView
|
import android.support.v7.widget.RecyclerView
|
||||||
@ -34,6 +35,7 @@ import java.util.regex.Pattern
|
|||||||
import com.omadahealth.github.swipyrefreshlayout.library.SwipyRefreshLayout
|
import com.omadahealth.github.swipyrefreshlayout.library.SwipyRefreshLayout
|
||||||
import com.omadahealth.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection
|
import com.omadahealth.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection
|
||||||
|
|
||||||
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
class ColumnViewHolder(
|
class ColumnViewHolder(
|
||||||
val activity : ActMain,
|
val activity : ActMain,
|
||||||
val viewRoot : View
|
val viewRoot : View
|
||||||
@ -341,7 +343,7 @@ class ColumnViewHolder(
|
|||||||
btnQuickFilterFollow = viewRoot.findViewById(R.id.btnQuickFilterFollow)
|
btnQuickFilterFollow = viewRoot.findViewById(R.id.btnQuickFilterFollow)
|
||||||
btnQuickFilterReaction = viewRoot.findViewById(R.id.btnQuickFilterReaction)
|
btnQuickFilterReaction = viewRoot.findViewById(R.id.btnQuickFilterReaction)
|
||||||
btnQuickFilterVote = viewRoot.findViewById(R.id.btnQuickFilterVote)
|
btnQuickFilterVote = viewRoot.findViewById(R.id.btnQuickFilterVote)
|
||||||
|
val llColumnSettingInside : LinearLayout = viewRoot.findViewById(R.id.llColumnSettingInside)
|
||||||
|
|
||||||
btnQuickFilterAll.setOnClickListener(this)
|
btnQuickFilterAll.setOnClickListener(this)
|
||||||
btnQuickFilterMention.setOnClickListener(this)
|
btnQuickFilterMention.setOnClickListener(this)
|
||||||
@ -390,6 +392,22 @@ class ColumnViewHolder(
|
|||||||
cbEnableSpeech.setOnCheckedChangeListener(this)
|
cbEnableSpeech.setOnCheckedChangeListener(this)
|
||||||
cbOldApi.setOnCheckedChangeListener(this)
|
cbOldApi.setOnCheckedChangeListener(this)
|
||||||
|
|
||||||
|
if(Pref.bpMoveNotificationsQuickFilter(activity.pref)){
|
||||||
|
(svQuickFilter.parent as? ViewGroup)?.removeView(svQuickFilter)
|
||||||
|
llColumnSettingInside.addView(svQuickFilter,0)
|
||||||
|
|
||||||
|
svQuickFilter.setOnTouchListener { v, event ->
|
||||||
|
val action = event.action
|
||||||
|
if(action == MotionEvent.ACTION_DOWN){
|
||||||
|
val sv = v as? HorizontalScrollView
|
||||||
|
if(sv != null && sv.getChildAt(0).width > sv.width ){
|
||||||
|
sv.requestDisallowInterceptTouchEvent(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
v.onTouchEvent(event)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
initLoadingTextView()
|
initLoadingTextView()
|
||||||
|
|
||||||
// 入力の追跡
|
// 入力の追跡
|
||||||
@ -1456,27 +1474,56 @@ class ColumnViewHolder(
|
|||||||
|
|
||||||
vg(btnQuickFilterFavourite, !column.isMisskey)
|
vg(btnQuickFilterFavourite, !column.isMisskey)
|
||||||
|
|
||||||
val colorBg = column.getHeaderBackgroundColor()
|
val insideColumnSetting = Pref.bpMoveNotificationsQuickFilter(activity.pref)
|
||||||
val colorFg = column.getHeaderNameColor()
|
|
||||||
val colorBgSelected = Color.rgb(
|
|
||||||
(Color.red(colorBg) *3 + Color.red(colorFg)) / 4,
|
|
||||||
(Color.green(colorBg)*3 + Color.green(colorFg)) / 4,
|
|
||||||
(Color.blue(colorBg)*3 + Color.blue(colorFg)) / 4
|
|
||||||
)
|
|
||||||
svQuickFilter.setBackgroundColor(colorBg)
|
|
||||||
|
|
||||||
fun showQuickFilterButton(btn : View, iconId : Int, selected : Boolean) {
|
val showQuickFilterButton:(btn : View, iconId : Int, selected : Boolean)->Unit
|
||||||
|
|
||||||
|
if(insideColumnSetting){
|
||||||
|
svQuickFilter.setBackgroundColor(0)
|
||||||
|
|
||||||
|
val colorFg = getAttributeColor(activity,R.attr.colorContentText)
|
||||||
|
val colorBgSelected = colorFg.applyAlphaMultiplier(0.25f)
|
||||||
|
|
||||||
ViewCompat.setBackground(
|
showQuickFilterButton = { btn , iconId , selected ->
|
||||||
btn,
|
ViewCompat.setBackground(
|
||||||
getAdaptiveRippleDrawable(
|
btn,
|
||||||
if(selected) colorBgSelected else colorBg,
|
if(selected) {
|
||||||
colorFg
|
getAdaptiveRippleDrawable(
|
||||||
|
colorBgSelected,
|
||||||
|
colorFg
|
||||||
|
)
|
||||||
|
}else {
|
||||||
|
ContextCompat.getDrawable(activity,R.drawable.btn_bg_transparent)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
when(btn) {
|
||||||
|
is ImageButton -> setIconDrawableId(activity, btn, iconId, colorFg)
|
||||||
|
is TextView -> btn.textColor = colorFg
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
val colorBg = column.getHeaderBackgroundColor()
|
||||||
|
val colorFg = column.getHeaderNameColor()
|
||||||
|
val colorBgSelected = Color.rgb(
|
||||||
|
(Color.red(colorBg) * 3 + Color.red(colorFg)) / 4,
|
||||||
|
(Color.green(colorBg) * 3 + Color.green(colorFg)) / 4,
|
||||||
|
(Color.blue(colorBg) * 3 + Color.blue(colorFg)) / 4
|
||||||
)
|
)
|
||||||
when(btn){
|
svQuickFilter.setBackgroundColor(colorBg)
|
||||||
is ImageButton ->setIconDrawableId(activity,btn,iconId,colorFg)
|
|
||||||
is TextView -> btn.textColor = colorFg
|
showQuickFilterButton = { btn , iconId , selected ->
|
||||||
|
|
||||||
|
ViewCompat.setBackground(
|
||||||
|
btn,
|
||||||
|
getAdaptiveRippleDrawable(
|
||||||
|
if(selected) colorBgSelected else colorBg,
|
||||||
|
colorFg
|
||||||
|
)
|
||||||
|
)
|
||||||
|
when(btn) {
|
||||||
|
is ImageButton -> setIconDrawableId(activity, btn, iconId, colorFg)
|
||||||
|
is TextView -> btn.textColor = colorFg
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,6 +351,11 @@ object Pref {
|
|||||||
false,
|
false,
|
||||||
R.id.swLinksInContextMenu
|
R.id.swLinksInContextMenu
|
||||||
)
|
)
|
||||||
|
val bpMoveNotificationsQuickFilter = BooleanPref(
|
||||||
|
"MoveNotificationsQuickFilter",
|
||||||
|
false,
|
||||||
|
R.id.swMoveNotificationsQuickFilter
|
||||||
|
)
|
||||||
|
|
||||||
// int
|
// int
|
||||||
|
|
||||||
|
@ -513,5 +513,23 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View style="@style/setting_divider"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/setting_row_label"
|
||||||
|
android:text="@string/move_notifications_quick_filter_to_column_setting"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout style="@style/setting_row_form">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/swMoveNotificationsQuickFilter"
|
||||||
|
style="@style/setting_horizontal_stretch"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View style="@style/setting_divider"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
@ -142,6 +142,7 @@
|
|||||||
android:paddingTop="3dp"
|
android:paddingTop="3dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:paddingBottom="3dp"
|
android:paddingBottom="3dp"
|
||||||
|
android:id="@+id/llColumnSettingInside"
|
||||||
>
|
>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
|
@ -845,5 +845,6 @@
|
|||||||
<string name="all">All</string>
|
<string name="all">All</string>
|
||||||
<string name="show_links_in_context_menu">本文中のリンクをコンテキストメニューに表示する</string>
|
<string name="show_links_in_context_menu">本文中のリンクをコンテキストメニューに表示する</string>
|
||||||
<string name="scheduled_status_requires_mastodon_2_7_0">予約投稿はマストドン2.7.0以降で使えます</string>
|
<string name="scheduled_status_requires_mastodon_2_7_0">予約投稿はマストドン2.7.0以降で使えます</string>
|
||||||
|
<string name="move_notifications_quick_filter_to_column_setting">通知カラムのクイックフィルタをカラム設定内部に表示する(アプリ再起動が必要)</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -866,5 +866,6 @@
|
|||||||
<string name="all">All</string>
|
<string name="all">All</string>
|
||||||
<string name="show_links_in_context_menu">Show links in context menu</string>
|
<string name="show_links_in_context_menu">Show links in context menu</string>
|
||||||
<string name="scheduled_status_requires_mastodon_2_7_0">Scheduled status requires Mastodon 2.7.0 or later.</string>
|
<string name="scheduled_status_requires_mastodon_2_7_0">Scheduled status requires Mastodon 2.7.0 or later.</string>
|
||||||
|
<string name="move_notifications_quick_filter_to_column_setting">Show notifications quick filter in column setting (app restart required)</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user