Cleanup filter
This commit is contained in:
1 parent
4c286a279f
commit
459dd50e91
3 files changed
+5
-11
No files matched your search
@@ -7,10 +7,10 @@ import androidx.room.PrimaryKey
|
||||
@Entity(tableName = "FILTER")
|
||||
data class Filter(
|
||||
@ColumnInfo(name = "MODE")
|
||||
var mode: Int = 0,
|
||||
val mode: Int,
|
||||
|
||||
@ColumnInfo(name = "TEXT")
|
||||
var text: String = "INVALID",
|
||||
var text: String,
|
||||
|
||||
@ColumnInfo(name = "ENABLE")
|
||||
var enable: Boolean = true,
|
||||
|
||||
@@ -304,9 +304,7 @@ class GalleryCommentsScene : BaseToolbarScene(), View.OnClickListener, OnRefresh
|
||||
BaseDialogBuilder(context)
|
||||
.setMessage(getString(R.string.filter_the_commenter, commenter))
|
||||
.setPositiveButton(android.R.string.ok) { _: DialogInterface?, _: Int ->
|
||||
val filter = Filter()
|
||||
filter.mode = EhFilter.MODE_COMMENTER
|
||||
filter.text = commenter
|
||||
val filter = Filter(EhFilter.MODE_COMMENTER, commenter)
|
||||
EhFilter.addFilter(filter)
|
||||
hideComment(position)
|
||||
showTip(R.string.filter_added, LENGTH_SHORT)
|
||||
|
||||
@@ -1232,9 +1232,7 @@ class GalleryDetailScene : BaseScene(), DownloadInfoListener {
|
||||
BaseDialogBuilder(context)
|
||||
.setMessage(getString(R.string.filter_the_tag, tag))
|
||||
.setPositiveButton(android.R.string.ok) { _: DialogInterface?, _: Int ->
|
||||
val filter = Filter()
|
||||
filter.mode = EhFilter.MODE_TAG
|
||||
filter.text = tag
|
||||
val filter = Filter(EhFilter.MODE_TAG, tag)
|
||||
EhFilter.addFilter(filter)
|
||||
showTip(R.string.filter_added, LENGTH_SHORT)
|
||||
}
|
||||
@@ -1341,9 +1339,7 @@ class GalleryDetailScene : BaseScene(), DownloadInfoListener {
|
||||
BaseDialogBuilder(context)
|
||||
.setMessage(getString(R.string.filter_the_uploader, uploader))
|
||||
.setPositiveButton(android.R.string.ok) { _: DialogInterface?, _: Int ->
|
||||
val filter = Filter()
|
||||
filter.mode = EhFilter.MODE_UPLOADER
|
||||
filter.text = uploader
|
||||
val filter = Filter(EhFilter.MODE_UPLOADER, uploader)
|
||||
EhFilter.addFilter(filter)
|
||||
showTip(R.string.filter_added, LENGTH_SHORT)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user