mirror of
https://github.com/tateisu/SubwayTooter
synced 2025-01-31 02:54:57 +01:00
「アプリ設定/タブレットモード/簡易投稿でも可能ならアカウント選択を省略する」を追加。
This commit is contained in:
parent
584cd36d8d
commit
79fe9608c0
@ -337,7 +337,7 @@ class ActMain : AppCompatActivity()
|
|||||||
)
|
)
|
||||||
|
|
||||||
private val TabletEnv.visibleColumnsIndices : IntRange
|
private val TabletEnv.visibleColumnsIndices : IntRange
|
||||||
get(){
|
get() {
|
||||||
var vs = tablet_layout_manager.findFirstVisibleItemPosition()
|
var vs = tablet_layout_manager.findFirstVisibleItemPosition()
|
||||||
var ve = tablet_layout_manager.findLastVisibleItemPosition()
|
var ve = tablet_layout_manager.findLastVisibleItemPosition()
|
||||||
if(vs == RecyclerView.NO_POSITION || ve == RecyclerView.NO_POSITION) {
|
if(vs == RecyclerView.NO_POSITION || ve == RecyclerView.NO_POSITION) {
|
||||||
@ -356,10 +356,10 @@ class ActMain : AppCompatActivity()
|
|||||||
|
|
||||||
private val TabletEnv.visibleColumns : List<Column>
|
private val TabletEnv.visibleColumns : List<Column>
|
||||||
get() = visibleColumnsIndices
|
get() = visibleColumnsIndices
|
||||||
.mapNotNull{
|
.mapNotNull {
|
||||||
try{
|
try {
|
||||||
app_state.column_list[it]
|
app_state.column_list[it]
|
||||||
} catch(ex:Throwable){
|
} catch(ex : Throwable) {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -872,7 +872,14 @@ class ActMain : AppCompatActivity()
|
|||||||
|
|
||||||
private fun performQuickPost(account : SavedAccount?) {
|
private fun performQuickPost(account : SavedAccount?) {
|
||||||
if(account == null) {
|
if(account == null) {
|
||||||
val a = currentPostTarget
|
val a = if(tabletEnv != null && ! Pref.bpQuickTootOmitAccountSelection(pref)) {
|
||||||
|
// タブレットモードでオプションが無効なら
|
||||||
|
// 簡易投稿は常にアカウント選択する
|
||||||
|
null
|
||||||
|
} else {
|
||||||
|
currentPostTarget
|
||||||
|
}
|
||||||
|
|
||||||
if(a != null && ! a.isPseudo) {
|
if(a != null && ! a.isPseudo) {
|
||||||
performQuickPost(a)
|
performQuickPost(a)
|
||||||
} else {
|
} else {
|
||||||
@ -1084,7 +1091,7 @@ class ActMain : AppCompatActivity()
|
|||||||
} catch(ex : Throwable) {
|
} catch(ex : Throwable) {
|
||||||
}
|
}
|
||||||
}, { env ->
|
}, { env ->
|
||||||
visibleColumnList.addAll( env.visibleColumns )
|
visibleColumnList.addAll(env.visibleColumns)
|
||||||
})
|
})
|
||||||
|
|
||||||
return visibleColumnList.filter { ! it.dont_close }
|
return visibleColumnList.filter { ! it.dont_close }
|
||||||
@ -1522,7 +1529,7 @@ class ActMain : AppCompatActivity()
|
|||||||
val ve = env.tablet_layout_manager.findLastVisibleItemPosition()
|
val ve = env.tablet_layout_manager.findLastVisibleItemPosition()
|
||||||
val vr = if(vs == RecyclerView.NO_POSITION || ve == RecyclerView.NO_POSITION) {
|
val vr = if(vs == RecyclerView.NO_POSITION || ve == RecyclerView.NO_POSITION) {
|
||||||
IntRange(- 1, - 2) // empty and less than zero
|
IntRange(- 1, - 2) // empty and less than zero
|
||||||
}else{
|
} else {
|
||||||
IntRange(vs, min(ve, vs + nScreenColumn - 1))
|
IntRange(vs, min(ve, vs + nScreenColumn - 1))
|
||||||
}
|
}
|
||||||
var slide_ratio = 0f
|
var slide_ratio = 0f
|
||||||
|
@ -436,6 +436,12 @@ object Pref {
|
|||||||
R.id.swEnablePixelfed
|
R.id.swEnablePixelfed
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val bpQuickTootOmitAccountSelection = BooleanPref(
|
||||||
|
"QuickTootOmitAccountSelection",
|
||||||
|
false,
|
||||||
|
R.id.swQuickTootOmitAccountSelection
|
||||||
|
)
|
||||||
|
|
||||||
// int
|
// int
|
||||||
|
|
||||||
val ipBackButtonAction = IntPref("back_button_action", 0)
|
val ipBackButtonAction = IntPref("back_button_action", 0)
|
||||||
|
@ -76,6 +76,24 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View style="@style/setting_divider"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/setting_row_label"
|
||||||
|
android:text="@string/quick_toot_omit_account_selection"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout style="@style/setting_row_form">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/swQuickTootOmitAccountSelection"
|
||||||
|
style="@style/setting_horizontal_stretch"
|
||||||
|
android:gravity="center"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<View style="@style/setting_divider"/>
|
<View style="@style/setting_divider"/>
|
||||||
|
|
||||||
<!-- =============================================== -->
|
<!-- =============================================== -->
|
||||||
|
@ -954,5 +954,6 @@
|
|||||||
<string name="extra_actions">追加のアクション</string>
|
<string name="extra_actions">追加のアクション</string>
|
||||||
<string name="block_domain">ドメイン全体をブロック</string>
|
<string name="block_domain">ドメイン全体をブロック</string>
|
||||||
<string name="instance_actions_for">\"%1$s\" サーバへのアクション</string>
|
<string name="instance_actions_for">\"%1$s\" サーバへのアクション</string>
|
||||||
|
<string name="quick_toot_omit_account_selection">簡易投稿でも可能ならアカウント選択を省略する</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -949,4 +949,5 @@
|
|||||||
<string name="extra_actions">Extra actions</string>
|
<string name="extra_actions">Extra actions</string>
|
||||||
<string name="block_domain">Block whole domain</string>
|
<string name="block_domain">Block whole domain</string>
|
||||||
<string name="instance_actions_for">Actions for the server \"%1$s\"</string>
|
<string name="instance_actions_for">Actions for the server \"%1$s\"</string>
|
||||||
|
<string name="quick_toot_omit_account_selection">When using quick toot, omit account selection if possible</string>
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user