Skip to content

Commit

Permalink
流星プロテクトを廃止
Browse files Browse the repository at this point in the history
fix #245
  • Loading branch information
shibafu528 committed Jul 7, 2019
1 parent f3644a0 commit ccf3404
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import android.widget.ImageButton
import android.widget.Toast
import shibafu.yukari.R
import shibafu.yukari.activity.AccountChooserActivity
import shibafu.yukari.activity.MainActivity
import shibafu.yukari.activity.TweetActivity
import shibafu.yukari.common.StatusChildUI
import shibafu.yukari.common.StatusUI
Expand Down Expand Up @@ -394,19 +393,6 @@ class StatusMainFragment : YukariBaseFragment(), StatusChildUI, SimpleAlertDialo

override fun onDialogChose(requestCode: Int, which: Int, extras: Bundle?) {
when (requestCode) {
DIALOG_FAVORITE_NUISANCE -> {
when (which) {
DialogInterface.BUTTON_POSITIVE -> {
createFavorite(withQuotes = extras?.getBoolean("withQuotes") ?: false, skipCheck = true)
}
DialogInterface.BUTTON_NEUTRAL -> {
val intent = Intent(activity, MainActivity::class.java)
val query = String.format("\"%s\" -RT", status.originStatus.text)
intent.putExtra(MainActivity.EXTRA_SEARCH_WORD, query)
startActivity(intent)
}
}
}
DIALOG_FAVORITE_CONFIRM -> {
if (which == DialogInterface.BUTTON_POSITIVE) {
createFavorite(withQuotes = extras?.getBoolean("withQuotes") ?: false, skipCheck = true)
Expand Down Expand Up @@ -507,19 +493,7 @@ class StatusMainFragment : YukariBaseFragment(), StatusChildUI, SimpleAlertDialo
val userRecord = userRecord ?: return

if (!skipCheck) {
if (defaultSharedPreferences.getBoolean("pref_guard_nuisance", true) && NUISANCES.contains(status.source)) {
val dialog = SimpleAlertDialogFragment.Builder(DIALOG_FAVORITE_NUISANCE)
.setTitle("確認")
.setMessage("このツイートは${status.originStatus}を使用して投稿されています。お気に入り登録してもよろしいですか?")
.setPositive("ふぁぼる")
.setNeutral("本文で検索")
.setNegative("キャンセル")
.setExtras(Bundle().apply { putBoolean("withQuotes", withQuotes) })
.build()
dialog.setTargetFragment(this, DIALOG_FAVORITE_NUISANCE)
dialog.show(fragmentManager, "dialog_favorite_nuisance")
return
} else if (defaultSharedPreferences.getBoolean("pref_dialog_fav", false)) {
if (defaultSharedPreferences.getBoolean("pref_dialog_fav", false)) {
val dialog = SimpleAlertDialogFragment.Builder(DIALOG_FAVORITE_CONFIRM)
.setTitle("確認")
.setMessage("お気に入り登録しますか?")
Expand Down Expand Up @@ -624,13 +598,6 @@ class StatusMainFragment : YukariBaseFragment(), StatusChildUI, SimpleAlertDialo

companion object {
private const val BUTTON_SHOW_DURATION = 260
private val NUISANCES = arrayOf(
"ShootingStar",
"TheWorld",
"Biyon",
"MoonStrike",
"NightFox"
)

private const val REQUEST_CHANGE_ACCOUNT = 0
private const val REQUEST_REPLY = 1
Expand All @@ -641,7 +608,6 @@ class StatusMainFragment : YukariBaseFragment(), StatusChildUI, SimpleAlertDialo
private const val REQUEST_MULTI_REPOST = 6
private const val REQUEST_MULTI_FAVRT = 7

private const val DIALOG_FAVORITE_NUISANCE = 0
private const val DIALOG_FAVORITE_CONFIRM = 1
private const val DIALOG_REPOST_CONFIRM = 2
private const val DIALOG_FAV_AND_REPOST_CONFIRM = 3
Expand Down
5 changes: 0 additions & 5 deletions Yukari/src/main/res/xml/pref_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
android:title="お気に入りに登録してRT"
android:summary="お気に入りに登録してRTする前に実行するか確認を行います"
android:defaultValue="true"/>
<CheckBoxPreference
android:key="pref_guard_nuisance"
android:title="流星プロテクト"
android:summary="お気に入り登録前に発言元クライアント次第で確認をとります\n通常の確認ダイアログとは別に独立して発動します"
android:defaultValue="true"/>
<CheckBoxPreference
android:key="pref_dialog_post"
android:title="投稿前に確認"
Expand Down

0 comments on commit ccf3404

Please sign in to comment.