|
|
@ -21,12 +21,10 @@ import com.novel.read.utlis.VersionUtil |
|
|
|
import com.squareup.otto.Subscribe |
|
|
|
import com.squareup.otto.Subscribe |
|
|
|
import kotlinx.android.synthetic.main.activity_setting.* |
|
|
|
import kotlinx.android.synthetic.main.activity_setting.* |
|
|
|
|
|
|
|
|
|
|
|
class NovelSettingActivity : NovelBaseActivity(), View.OnClickListener { |
|
|
|
class NovelSettingActivity(override val layoutId: Int = R.layout.activity_setting) : NovelBaseActivity(), View.OnClickListener { |
|
|
|
|
|
|
|
|
|
|
|
private var resp: VersionResp? = null |
|
|
|
private var resp: VersionResp? = null |
|
|
|
|
|
|
|
|
|
|
|
override val layoutId: Int get() = R.layout.activity_setting |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun initView() { |
|
|
|
override fun initView() { |
|
|
|
EventManager.instance.registerSubscriber(this) |
|
|
|
EventManager.instance.registerSubscriber(this) |
|
|
|
} |
|
|
|
} |
|
|
@ -63,12 +61,7 @@ class NovelSettingActivity : NovelBaseActivity(), View.OnClickListener { |
|
|
|
AlertDialog.Builder(this) |
|
|
|
AlertDialog.Builder(this) |
|
|
|
.setTitle(getString(R.string.clear_cache)) |
|
|
|
.setTitle(getString(R.string.clear_cache)) |
|
|
|
.setCancelable(true) |
|
|
|
.setCancelable(true) |
|
|
|
.setMultiChoiceItems( |
|
|
|
.setMultiChoiceItems(arrayOf(getString(R.string.clear_cache), getString(R.string.clear_book)), selected) { _, which, isChecked -> selected[which] = isChecked } |
|
|
|
arrayOf( |
|
|
|
|
|
|
|
getString(R.string.clear_cache), |
|
|
|
|
|
|
|
getString(R.string.clear_book) |
|
|
|
|
|
|
|
), selected |
|
|
|
|
|
|
|
) { _, which, isChecked -> selected[which] = isChecked } |
|
|
|
|
|
|
|
.setPositiveButton(getString(R.string.sure)) { dialog, _ -> |
|
|
|
.setPositiveButton(getString(R.string.sure)) { dialog, _ -> |
|
|
|
Thread { |
|
|
|
Thread { |
|
|
|
CleanCacheUtils.getInstance() |
|
|
|
CleanCacheUtils.getInstance() |
|
|
@ -89,7 +82,7 @@ class NovelSettingActivity : NovelBaseActivity(), View.OnClickListener { |
|
|
|
}.start() |
|
|
|
}.start() |
|
|
|
dialog.dismiss() |
|
|
|
dialog.dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
.setNegativeButton(getString(R.string.cancel)) { dialog, which -> dialog.dismiss() } |
|
|
|
.setNegativeButton(getString(R.string.cancel)) { dialog, _ -> dialog.dismiss() } |
|
|
|
.create().show() |
|
|
|
.create().show() |
|
|
|
} |
|
|
|
} |
|
|
|
R.id.tv_check -> |
|
|
|
R.id.tv_check -> |
|
|
|