mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-02 09:46:51 +01:00
implementing filter scope ui
This commit is contained in:
parent
16cd763043
commit
c06c500092
@ -79,6 +79,7 @@ subprojects {
|
||||
ACRA : '4.9.2',
|
||||
AbstractTask : '0.9.5',
|
||||
Dagger : '2.11',
|
||||
ExpandableLayout : '1.6.0',
|
||||
]
|
||||
|
||||
}
|
||||
|
@ -25,16 +25,21 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@IntDef(value = {FilterScope.HOME, FilterScope.INTERACTIONS, FilterScope.MESSAGES,
|
||||
FilterScope.SEARCH_RESULT, FilterScope.LIST_GROUP_TIMELINE, FilterScope.FAVORITES,
|
||||
FilterScope.ALL, FilterScope.FLAG_MATCH_NAME}, flag = true)
|
||||
FilterScope.SEARCH_RESULTS, FilterScope.LIST_GROUP_TIMELINE, FilterScope.FAVORITES,
|
||||
FilterScope.USER_TIMELINE, FilterScope.PUBLIC_TIMELINE, FilterScope.ALL,
|
||||
FilterScope.FLAG_MATCH_NAME, FilterScope.FLAG_MATCH_TEXT, FilterScope.UGC_TIMELINE}, flag = true)
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface FilterScope {
|
||||
int HOME = 0x1;
|
||||
int INTERACTIONS = 0x2;
|
||||
int MESSAGES = 0x4;
|
||||
int SEARCH_RESULT = 0x8;
|
||||
int SEARCH_RESULTS = 0x8;
|
||||
int LIST_GROUP_TIMELINE = 0x10;
|
||||
int FAVORITES = 0x20;
|
||||
int USER_TIMELINE = 0x40;
|
||||
int PUBLIC_TIMELINE = 0x80;
|
||||
|
||||
int UGC_TIMELINE = LIST_GROUP_TIMELINE | FAVORITES | USER_TIMELINE | PUBLIC_TIMELINE;
|
||||
|
||||
int FLAG_MATCH_NAME = 0x80000000;
|
||||
int FLAG_MATCH_TEXT = 0x40000000;
|
||||
@ -42,6 +47,11 @@ public @interface FilterScope {
|
||||
int MASK_FLAG = 0xFF000000;
|
||||
int MASK_SCOPE = 0x00FFFFFF;
|
||||
|
||||
int VALID_MASKS_USERS = MASK_SCOPE;
|
||||
int VALID_MASKS_KEYWORDS = MASK_SCOPE | MASK_FLAG;
|
||||
int VALID_MASKS_SOURCES = MASK_SCOPE & ~MESSAGES;
|
||||
int VALID_MASKS_LINKS = MASK_SCOPE;
|
||||
|
||||
// Contains all flags
|
||||
int ALL = 0xFFFFFFFF;
|
||||
}
|
||||
|
@ -105,6 +105,8 @@ public interface IntentConstants {
|
||||
String EXTRA_TEXT = "text";
|
||||
String EXTRA_TITLE = "title";
|
||||
String EXTRA_TYPE = "type";
|
||||
String EXTRA_VALUE = "value";
|
||||
String EXTRA_SCOPE = "scope";
|
||||
// public static final String EXTRA_SUCCEED = "succeed";
|
||||
String EXTRA_IDS = "ids";
|
||||
String EXTRA_REFRESH_IDS = "refresh_ids";
|
||||
|
@ -224,6 +224,7 @@ dependencies {
|
||||
implementation "com.github.bumptech.glide:okhttp3-integration:${libVersions['GlideOkHttp3']}@aar"
|
||||
implementation "jp.wasabeef:glide-transformations:${libVersions['GlideTransformations']}"
|
||||
implementation "com.theartofdev.edmodo:android-image-cropper:${libVersions['AndroidImageCropper']}"
|
||||
implementation "com.github.aakira:expandable-layout:${libVersions['ExpandableLayout']}@aar"
|
||||
|
||||
implementation "com.github.mariotaku.MediaViewerLibrary:base:${libVersions['MediaViewerLibrary']}"
|
||||
implementation "com.github.mariotaku.MediaViewerLibrary:subsample-image-view:${libVersions['MediaViewerLibrary']}"
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Twidere - Twitter client for Android
|
||||
*
|
||||
* Copyright (C) 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.mariotaku.twidere.extension.util
|
||||
|
||||
import org.mariotaku.twidere.util.premium.ExtraFeaturesService
|
||||
import org.mariotaku.twidere.util.premium.ExtraFeaturesService.Companion.FEATURE_ADVANCED_FILTERS
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 2017/9/14.
|
||||
*/
|
||||
val ExtraFeaturesService.isAdvancedFiltersEnabled: Boolean
|
||||
get() = isEnabled(FEATURE_ADVANCED_FILTERS) || isEnabled("filters_subscriptions")
|
@ -0,0 +1,247 @@
|
||||
/*
|
||||
* Twidere - Twitter client for Android
|
||||
*
|
||||
* Copyright (C) 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.mariotaku.twidere.fragment.filter
|
||||
|
||||
import android.accounts.AccountManager
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import android.support.v7.app.AlertDialog
|
||||
import android.view.View
|
||||
import android.widget.CheckBox
|
||||
import android.widget.Toast
|
||||
import kotlinx.android.synthetic.main.dialog_filter_rule_editor.*
|
||||
import org.mariotaku.ktextension.ContentValues
|
||||
import org.mariotaku.ktextension.contains
|
||||
import org.mariotaku.ktextension.set
|
||||
import org.mariotaku.ktextension.string
|
||||
import org.mariotaku.sqliteqb.library.Expression
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.adapter.ComposeAutoCompleteAdapter
|
||||
import org.mariotaku.twidere.adapter.SourceAutoCompleteAdapter
|
||||
import org.mariotaku.twidere.annotation.FilterScope
|
||||
import org.mariotaku.twidere.constant.IntentConstants.*
|
||||
import org.mariotaku.twidere.extension.applyOnShow
|
||||
import org.mariotaku.twidere.extension.applyTheme
|
||||
import org.mariotaku.twidere.extension.queryCount
|
||||
import org.mariotaku.twidere.fragment.BaseDialogFragment
|
||||
import org.mariotaku.twidere.model.util.AccountUtils
|
||||
import org.mariotaku.twidere.provider.TwidereDataStore.Filters
|
||||
|
||||
class AddEditItemFragment : BaseDialogFragment(), DialogInterface.OnClickListener {
|
||||
|
||||
private val contentUri: Uri
|
||||
get() = arguments.getParcelable(EXTRA_URI)
|
||||
|
||||
private val rowId: Long
|
||||
get() = arguments.getLong(EXTRA_ID, -1)
|
||||
|
||||
private val defaultValue: String?
|
||||
get() = arguments.getString(EXTRA_VALUE)
|
||||
|
||||
private val defaultScope: FilterScopes
|
||||
get() = FilterScopes(filterMasks, arguments.getInt(EXTRA_SCOPE, filterMasks))
|
||||
|
||||
private val filterMasks: Int
|
||||
get() = when (contentUri) {
|
||||
Filters.Users.CONTENT_URI -> FilterScope.VALID_MASKS_USERS
|
||||
Filters.Keywords.CONTENT_URI -> FilterScope.VALID_MASKS_KEYWORDS
|
||||
Filters.Sources.CONTENT_URI -> FilterScope.VALID_MASKS_SOURCES
|
||||
Filters.Links.CONTENT_URI -> FilterScope.VALID_MASKS_LINKS
|
||||
else -> 0
|
||||
}
|
||||
|
||||
private var Dialog.value: String?
|
||||
get() = editText.string?.takeIf(String::isNotEmpty)
|
||||
set(value) {
|
||||
editText.string = value
|
||||
}
|
||||
|
||||
private var Dialog.scope: FilterScopes?
|
||||
get() = defaultScope.also { applyScopes(it) }
|
||||
set(value) {
|
||||
loadScopes(value ?: defaultScope)
|
||||
}
|
||||
|
||||
override fun onClick(dialog: DialogInterface, which: Int) {
|
||||
dialog as AlertDialog
|
||||
when (which) {
|
||||
DialogInterface.BUTTON_POSITIVE -> {
|
||||
val value = dialog.value ?: return
|
||||
val scope = dialog.scope ?: return
|
||||
|
||||
val values = ContentValues {
|
||||
this[Filters.VALUE] = value
|
||||
this[Filters.SCOPE] = scope.value
|
||||
}
|
||||
val uri = contentUri
|
||||
val id = rowId
|
||||
val resolver = context.contentResolver
|
||||
if (id >= 0) {
|
||||
val valueWhere = Expression.equalsArgs(Filters.VALUE).sql
|
||||
val valueWhereArgs = arrayOf(value)
|
||||
if (resolver.queryCount(uri, valueWhere, valueWhereArgs) == 0) {
|
||||
val idWhere = Expression.equals(Filters._ID, id).sql
|
||||
resolver.update(uri, values, idWhere, null)
|
||||
} else {
|
||||
Toast.makeText(context, R.string.message_toast_duplicate_filter_rule,
|
||||
Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
} else {
|
||||
resolver.insert(uri, values)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val builder = AlertDialog.Builder(context)
|
||||
builder.setView(R.layout.dialog_filter_rule_editor)
|
||||
|
||||
if (arguments.getLong(EXTRA_ID, -1) >= 0) {
|
||||
builder.setTitle(R.string.action_edit_filter_rule)
|
||||
} else {
|
||||
builder.setTitle(R.string.action_add_filter_rule)
|
||||
}
|
||||
builder.setPositiveButton(android.R.string.ok, this)
|
||||
builder.setNegativeButton(android.R.string.cancel, this)
|
||||
val dialog = builder.create()
|
||||
dialog.applyOnShow {
|
||||
applyTheme()
|
||||
editText.setAdapter(when (contentUri) {
|
||||
Filters.Sources.CONTENT_URI -> SourceAutoCompleteAdapter(activity)
|
||||
Filters.Users.CONTENT_URI -> ComposeAutoCompleteAdapter(activity, requestManager).apply {
|
||||
val am = AccountManager.get(activity)
|
||||
account = AccountUtils.getDefaultAccountDetails(activity, am, false)
|
||||
}
|
||||
else -> null
|
||||
})
|
||||
editText.threshold = 1
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
value = defaultValue
|
||||
scope = defaultScope
|
||||
} else {
|
||||
value = savedInstanceState.getString(EXTRA_VALUE)
|
||||
scope = savedInstanceState.getParcelable(EXTRA_SCOPE)
|
||||
}
|
||||
}
|
||||
return dialog
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
outState.putString(EXTRA_VALUE, dialog.value)
|
||||
outState.putParcelable(EXTRA_SCOPE, dialog.scope)
|
||||
}
|
||||
|
||||
private fun Dialog.applyScopes(scopes: FilterScopes) {
|
||||
targetText.applyScope(scopes, FilterScope.FLAG_MATCH_TEXT)
|
||||
targetName.applyScope(scopes, FilterScope.FLAG_MATCH_NAME)
|
||||
scopeHome.applyScope(scopes, FilterScope.HOME)
|
||||
scopeInteractions.applyScope(scopes, FilterScope.INTERACTIONS)
|
||||
scopeMessages.applyScope(scopes, FilterScope.MESSAGES)
|
||||
scopeSearchResults.applyScope(scopes, FilterScope.SEARCH_RESULTS)
|
||||
scopeOther.applyScope(scopes, FilterScope.UGC_TIMELINE)
|
||||
}
|
||||
|
||||
private fun Dialog.loadScopes(scopes: FilterScopes) {
|
||||
targetText.loadScope(scopes, FilterScope.FLAG_MATCH_TEXT)
|
||||
targetName.loadScope(scopes, FilterScope.FLAG_MATCH_NAME)
|
||||
scopeHome.loadScope(scopes, FilterScope.HOME)
|
||||
scopeInteractions.loadScope(scopes, FilterScope.INTERACTIONS)
|
||||
scopeMessages.loadScope(scopes, FilterScope.MESSAGES)
|
||||
scopeSearchResults.loadScope(scopes, FilterScope.SEARCH_RESULTS)
|
||||
scopeOther.loadScope(scopes, FilterScope.UGC_TIMELINE)
|
||||
}
|
||||
|
||||
private fun CheckBox.applyScope(scopes: FilterScopes, scope: Int) {
|
||||
if (!isEnabled || visibility != View.VISIBLE) return
|
||||
scopes[scope] = isChecked
|
||||
}
|
||||
|
||||
private fun CheckBox.loadScope(scopes: FilterScopes, scope: Int) {
|
||||
if (scope in scopes) {
|
||||
isEnabled = true
|
||||
visibility = View.VISIBLE
|
||||
} else {
|
||||
isEnabled = false
|
||||
visibility = View.GONE
|
||||
return
|
||||
}
|
||||
isChecked = scopes[scope]
|
||||
}
|
||||
|
||||
class FilterScopes(val masks: Int, value: Int = 0) : Parcelable {
|
||||
|
||||
var value: Int = 0
|
||||
get() = field and masks
|
||||
private set(v) {
|
||||
field = v and masks
|
||||
}
|
||||
|
||||
constructor(parcel: Parcel) : this(parcel.readInt(), parcel.readInt())
|
||||
|
||||
init {
|
||||
this.value = value
|
||||
}
|
||||
|
||||
operator fun set(scope: Int, enabled: Boolean) {
|
||||
value = if (enabled) {
|
||||
value or scope
|
||||
} else {
|
||||
value and scope.inv()
|
||||
}
|
||||
}
|
||||
|
||||
operator fun get(scope: Int): Boolean {
|
||||
return scope in value
|
||||
}
|
||||
|
||||
operator fun contains(scope: Int): Boolean {
|
||||
return scope in masks
|
||||
}
|
||||
|
||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
||||
parcel.writeInt(masks)
|
||||
parcel.writeInt(value)
|
||||
}
|
||||
|
||||
override fun describeContents(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
companion object CREATOR : Parcelable.Creator<FilterScopes> {
|
||||
override fun createFromParcel(parcel: Parcel): FilterScopes {
|
||||
return FilterScopes(parcel)
|
||||
}
|
||||
|
||||
override fun newArray(size: Int): Array<FilterScopes?> {
|
||||
return arrayOfNulls(size)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -19,12 +19,7 @@
|
||||
|
||||
package org.mariotaku.twidere.fragment.filter
|
||||
|
||||
import android.accounts.AccountManager
|
||||
import android.app.Dialog
|
||||
import android.content.ContentValues
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.content.DialogInterface.OnClickListener
|
||||
import android.database.Cursor
|
||||
import android.graphics.PorterDuff
|
||||
import android.net.Uri
|
||||
@ -35,36 +30,31 @@ import android.support.v4.content.CursorLoader
|
||||
import android.support.v4.content.Loader
|
||||
import android.support.v4.view.ViewCompat
|
||||
import android.support.v4.widget.SimpleCursorAdapter
|
||||
import android.support.v7.app.AlertDialog
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.Spanned
|
||||
import android.text.TextUtils
|
||||
import android.view.*
|
||||
import android.widget.AbsListView
|
||||
import android.widget.AbsListView.MultiChoiceModeListener
|
||||
import android.widget.ListView
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import kotlinx.android.synthetic.main.dialog_auto_complete_textview.*
|
||||
import kotlinx.android.synthetic.main.fragment_content_listview.*
|
||||
import org.mariotaku.ktextension.Bundle
|
||||
import org.mariotaku.ktextension.set
|
||||
import org.mariotaku.ktextension.setGroupAvailability
|
||||
import org.mariotaku.library.objectcursor.ObjectCursor
|
||||
import org.mariotaku.sqliteqb.library.Columns
|
||||
import org.mariotaku.sqliteqb.library.Expression
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.TwidereConstants.EXTRA_ID
|
||||
import org.mariotaku.twidere.TwidereConstants.EXTRA_URI
|
||||
import org.mariotaku.twidere.TwidereConstants.*
|
||||
import org.mariotaku.twidere.activity.iface.IControlBarActivity
|
||||
import org.mariotaku.twidere.adapter.ComposeAutoCompleteAdapter
|
||||
import org.mariotaku.twidere.adapter.SourceAutoCompleteAdapter
|
||||
import org.mariotaku.twidere.extension.*
|
||||
import org.mariotaku.twidere.extension.invertSelection
|
||||
import org.mariotaku.twidere.extension.selectAll
|
||||
import org.mariotaku.twidere.extension.selectNone
|
||||
import org.mariotaku.twidere.extension.updateSelectionItems
|
||||
import org.mariotaku.twidere.fragment.AbsContentListViewFragment
|
||||
import org.mariotaku.twidere.fragment.BaseDialogFragment
|
||||
import org.mariotaku.twidere.model.FiltersData
|
||||
import org.mariotaku.twidere.model.util.AccountUtils
|
||||
import org.mariotaku.twidere.provider.TwidereDataStore.Filters
|
||||
import org.mariotaku.twidere.text.style.EmojiSpan
|
||||
import org.mariotaku.twidere.util.ParseUtils
|
||||
import org.mariotaku.twidere.util.ThemeUtils
|
||||
|
||||
|
||||
@ -82,7 +72,6 @@ abstract class BaseFiltersFragment : AbsContentListViewFragment<SimpleCursorAdap
|
||||
protected abstract val contentUri: Uri
|
||||
protected abstract val contentColumns: Array<String>
|
||||
protected open val sortOrder: String? = "${Filters.SOURCE} >= 0"
|
||||
protected open val autoCompleteType: Int = 0
|
||||
protected open val supportsEdit: Boolean = true
|
||||
|
||||
private val isQuickReturnEnabled: Boolean
|
||||
@ -97,7 +86,7 @@ abstract class BaseFiltersFragment : AbsContentListViewFragment<SimpleCursorAdap
|
||||
val adapter = this.adapter as FilterListAdapter
|
||||
val item = adapter.getFilterItem(pos) ?: return@setOnItemClickListener
|
||||
if (item.source >= 0) return@setOnItemClickListener
|
||||
addOrEditItem(item.id, item.value)
|
||||
addOrEditItem(item.id, item.value, item.scope)
|
||||
}
|
||||
listView.setMultiChoiceModeListener(this)
|
||||
loaderManager.initLoader(0, null, this)
|
||||
@ -233,14 +222,14 @@ abstract class BaseFiltersFragment : AbsContentListViewFragment<SimpleCursorAdap
|
||||
context.contentResolver.delete(contentUri, where.sql, Array(ids.size) { ids[it].toString() })
|
||||
}
|
||||
|
||||
protected open fun addOrEditItem(id: Long = -1, value: String? = null) {
|
||||
val args = Bundle()
|
||||
args.putParcelable(EXTRA_URI, contentUri)
|
||||
args.putInt(EXTRA_AUTO_COMPLETE_TYPE, autoCompleteType)
|
||||
args.putLong(EXTRA_ID, id)
|
||||
args.putString(EXTRA_VALUE, value)
|
||||
protected open fun addOrEditItem(id: Long = -1, value: String? = null, scope: Int = 0) {
|
||||
val dialog = AddEditItemFragment()
|
||||
dialog.arguments = args
|
||||
dialog.arguments = Bundle {
|
||||
this[EXTRA_URI] = contentUri
|
||||
this[EXTRA_ID] = id
|
||||
this[EXTRA_VALUE] = value
|
||||
this[EXTRA_SCOPE] = scope
|
||||
}
|
||||
dialog.show(fragmentManager, "add_rule")
|
||||
}
|
||||
|
||||
@ -251,80 +240,6 @@ abstract class BaseFiltersFragment : AbsContentListViewFragment<SimpleCursorAdap
|
||||
mode.title = resources.getQuantityString(R.plurals.Nitems_selected, count, count)
|
||||
}
|
||||
|
||||
class AddEditItemFragment : BaseDialogFragment(), OnClickListener {
|
||||
|
||||
override fun onClick(dialog: DialogInterface, which: Int) {
|
||||
when (which) {
|
||||
DialogInterface.BUTTON_POSITIVE -> {
|
||||
val text = text
|
||||
if (TextUtils.isEmpty(text)) return
|
||||
val values = ContentValues()
|
||||
values.put(Filters.VALUE, text)
|
||||
val uri: Uri = arguments.getParcelable(EXTRA_URI)
|
||||
val id = arguments.getLong(EXTRA_ID, -1)
|
||||
val resolver = context.contentResolver
|
||||
if (id >= 0) {
|
||||
val valueWhere = Expression.equalsArgs(Filters.VALUE).sql
|
||||
val valueWhereArgs = arrayOf(text)
|
||||
if (resolver.queryCount(uri, valueWhere, valueWhereArgs) == 0) {
|
||||
val idWhere = Expression.equals(Filters._ID, id).sql
|
||||
resolver.update(uri, values, idWhere, null)
|
||||
} else {
|
||||
Toast.makeText(context, R.string.message_toast_duplicate_filter_rule,
|
||||
Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
} else {
|
||||
resolver.insert(uri, values)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val builder = AlertDialog.Builder(context)
|
||||
builder.setView(R.layout.dialog_auto_complete_textview)
|
||||
|
||||
if (arguments.getLong(EXTRA_ID, -1) >= 0) {
|
||||
builder.setTitle(R.string.action_edit_filter_rule)
|
||||
} else {
|
||||
builder.setTitle(R.string.action_add_filter_rule)
|
||||
}
|
||||
builder.setPositiveButton(android.R.string.ok, this)
|
||||
builder.setNegativeButton(android.R.string.cancel, this)
|
||||
val dialog = builder.create()
|
||||
dialog.onShow {
|
||||
it.applyTheme()
|
||||
val editText = it.editText
|
||||
if (savedInstanceState == null) {
|
||||
editText.setText(arguments.getString(EXTRA_VALUE))
|
||||
}
|
||||
val autoCompleteType = arguments.getInt(EXTRA_AUTO_COMPLETE_TYPE, 0)
|
||||
if (autoCompleteType != 0) {
|
||||
val userAutoCompleteAdapter: SimpleCursorAdapter
|
||||
if (autoCompleteType == AUTO_COMPLETE_TYPE_SOURCES) {
|
||||
userAutoCompleteAdapter = SourceAutoCompleteAdapter(activity)
|
||||
} else {
|
||||
val adapter = ComposeAutoCompleteAdapter(activity, requestManager)
|
||||
val am = AccountManager.get(activity)
|
||||
adapter.account = AccountUtils.getDefaultAccountDetails(activity, am, false)
|
||||
userAutoCompleteAdapter = adapter
|
||||
}
|
||||
editText.setAdapter(userAutoCompleteAdapter)
|
||||
editText.threshold = 1
|
||||
}
|
||||
}
|
||||
return dialog
|
||||
}
|
||||
|
||||
private val text: String
|
||||
get() {
|
||||
val alertDialog = dialog as AlertDialog
|
||||
return ParseUtils.parseString(alertDialog.editText.text)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface IFilterAdapter {
|
||||
fun isReadOnly(position: Int): Boolean
|
||||
}
|
||||
@ -382,9 +297,6 @@ abstract class BaseFiltersFragment : AbsContentListViewFragment<SimpleCursorAdap
|
||||
|
||||
companion object {
|
||||
|
||||
internal const val EXTRA_AUTO_COMPLETE_TYPE = "auto_complete_type"
|
||||
internal const val EXTRA_VALUE = "value"
|
||||
internal const val AUTO_COMPLETE_TYPE_SOURCES = 2
|
||||
internal const val REQUEST_ADD_USER_SELECT_ACCOUNT = 201
|
||||
internal const val REQUEST_IMPORT_BLOCKS_SELECT_ACCOUNT = 202
|
||||
internal const val REQUEST_IMPORT_MUTES_SELECT_ACCOUNT = 203
|
||||
|
@ -29,6 +29,7 @@ import org.mariotaku.twidere.adapter.iface.ILoadMoreSupportAdapter.IndicatorPosi
|
||||
import org.mariotaku.twidere.constant.IntentConstants.*
|
||||
import org.mariotaku.twidere.extension.applyTheme
|
||||
import org.mariotaku.twidere.extension.onShow
|
||||
import org.mariotaku.twidere.extension.util.isAdvancedFiltersEnabled
|
||||
import org.mariotaku.twidere.fragment.*
|
||||
import org.mariotaku.twidere.loader.iface.IExtendedLoader
|
||||
import org.mariotaku.twidere.loader.users.AbsRequestUsersLoader
|
||||
@ -105,9 +106,9 @@ abstract class BaseFiltersImportFragment : AbsContentListRecyclerViewFragment<Se
|
||||
Toast.makeText(context, R.string.message_toast_no_user_selected, Toast.LENGTH_SHORT).show()
|
||||
return true
|
||||
}
|
||||
if (!extraFeaturesService.isEnabled(ExtraFeaturesService.FEATURE_FILTERS_IMPORT)) {
|
||||
if (!extraFeaturesService.isAdvancedFiltersEnabled) {
|
||||
ExtraFeaturesIntroductionDialogFragment.show(fragmentManager,
|
||||
feature = ExtraFeaturesService.FEATURE_FILTERS_IMPORT,
|
||||
feature = ExtraFeaturesService.FEATURE_ADVANCED_FILTERS,
|
||||
requestCode = REQUEST_PURCHASE_EXTRA_FEATURES)
|
||||
return true
|
||||
}
|
||||
@ -185,9 +186,9 @@ abstract class BaseFiltersImportFragment : AbsContentListRecyclerViewFragment<Se
|
||||
override fun onCreateAdapter(context: Context, requestManager: RequestManager): SelectableUsersAdapter {
|
||||
val adapter = SelectableUsersAdapter(context, this.requestManager)
|
||||
adapter.itemCheckedListener = listener@ { _, _ ->
|
||||
if (!extraFeaturesService.isEnabled(ExtraFeaturesService.FEATURE_FILTERS_IMPORT)) {
|
||||
if (!extraFeaturesService.isAdvancedFiltersEnabled) {
|
||||
ExtraFeaturesIntroductionDialogFragment.show(fragmentManager,
|
||||
feature = ExtraFeaturesService.FEATURE_FILTERS_IMPORT,
|
||||
feature = ExtraFeaturesService.FEATURE_ADVANCED_FILTERS,
|
||||
requestCode = REQUEST_PURCHASE_EXTRA_FEATURES)
|
||||
return@listener false
|
||||
}
|
||||
|
@ -9,6 +9,4 @@ class FilteredSourcesFragment : BaseFiltersFragment() {
|
||||
|
||||
override val contentUri: Uri = Filters.Sources.CONTENT_URI
|
||||
|
||||
override val autoCompleteType: Int = AUTO_COMPLETE_TYPE_SOURCES
|
||||
|
||||
}
|
@ -161,7 +161,7 @@ class FilteredUsersFragment : BaseFiltersFragment() {
|
||||
return FilterUsersListAdapter(context)
|
||||
}
|
||||
|
||||
override fun addOrEditItem(id: Long, value: String?) {
|
||||
override fun addOrEditItem(id: Long, value: String?, scope: Int) {
|
||||
// No-op
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ import org.mariotaku.twidere.extension.*
|
||||
import org.mariotaku.twidere.extension.model.getComponentLabel
|
||||
import org.mariotaku.twidere.extension.model.instantiateComponent
|
||||
import org.mariotaku.twidere.extension.model.setupUrl
|
||||
import org.mariotaku.twidere.extension.util.isAdvancedFiltersEnabled
|
||||
import org.mariotaku.twidere.fragment.BaseDialogFragment
|
||||
import org.mariotaku.twidere.fragment.BaseFragment
|
||||
import org.mariotaku.twidere.fragment.ExtraFeaturesIntroductionDialogFragment
|
||||
@ -78,9 +79,9 @@ class FiltersSubscriptionsFragment : BaseFragment(), LoaderManager.LoaderCallbac
|
||||
if (savedInstanceState == null) {
|
||||
when (arguments?.getString(EXTRA_ACTION)) {
|
||||
ACTION_ADD_URL_SUBSCRIPTION -> {
|
||||
if (!extraFeaturesService.isEnabled(ExtraFeaturesService.FEATURE_FILTERS_SUBSCRIPTION)) {
|
||||
if (!extraFeaturesService.isAdvancedFiltersEnabled) {
|
||||
val df = ExtraFeaturesIntroductionDialogFragment.create(
|
||||
ExtraFeaturesService.FEATURE_FILTERS_SUBSCRIPTION)
|
||||
ExtraFeaturesService.FEATURE_ADVANCED_FILTERS)
|
||||
df.setTargetFragment(this, REQUEST_ADD_URL_SUBSCRIPTION_PURCHASE)
|
||||
df.show(fragmentManager, ExtraFeaturesIntroductionDialogFragment.FRAGMENT_TAG)
|
||||
} else {
|
||||
@ -88,9 +89,9 @@ class FiltersSubscriptionsFragment : BaseFragment(), LoaderManager.LoaderCallbac
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
if (!extraFeaturesService.isEnabled(ExtraFeaturesService.FEATURE_FILTERS_SUBSCRIPTION)) {
|
||||
if (!extraFeaturesService.isAdvancedFiltersEnabled) {
|
||||
val df = ExtraFeaturesIntroductionDialogFragment.create(
|
||||
ExtraFeaturesService.FEATURE_FILTERS_SUBSCRIPTION)
|
||||
ExtraFeaturesService.FEATURE_ADVANCED_FILTERS)
|
||||
df.setTargetFragment(this, REQUEST_PURCHASE_EXTRA_FEATURES)
|
||||
df.show(fragmentManager, ExtraFeaturesIntroductionDialogFragment.FRAGMENT_TAG)
|
||||
}
|
||||
|
@ -50,8 +50,7 @@ abstract class ExtraFeaturesService {
|
||||
|
||||
companion object {
|
||||
const val FEATURE_FEATURES_PACK = "features_pack"
|
||||
const val FEATURE_FILTERS_IMPORT = "import_filters"
|
||||
const val FEATURE_FILTERS_SUBSCRIPTION = "filters_subscriptions"
|
||||
const val FEATURE_ADVANCED_FILTERS = "import_filters"
|
||||
const val FEATURE_SYNC_DATA = "sync_data"
|
||||
const val FEATURE_SCHEDULE_STATUS = "schedule_status"
|
||||
const val FEATURE_SHARE_GIF = "share_gif"
|
||||
@ -67,12 +66,10 @@ abstract class ExtraFeaturesService {
|
||||
fun getIntroduction(context: Context, feature: String): Introduction {
|
||||
return when (feature) {
|
||||
FEATURE_FEATURES_PACK -> Introduction(R.drawable.ic_action_infinity, "")
|
||||
FEATURE_FILTERS_IMPORT -> Introduction(R.drawable.ic_action_speaker_muted,
|
||||
context.getString(R.string.extra_feature_description_filters_import))
|
||||
FEATURE_ADVANCED_FILTERS -> Introduction(R.drawable.ic_action_speaker_muted,
|
||||
context.getString(R.string.extra_feature_description_advanced_filters))
|
||||
FEATURE_SYNC_DATA -> Introduction(R.drawable.ic_action_refresh,
|
||||
context.getString(R.string.extra_feature_description_sync_data))
|
||||
FEATURE_FILTERS_SUBSCRIPTION -> Introduction(R.drawable.ic_action_speaker_muted,
|
||||
context.getString(R.string.extra_feature_description_filters_subscription))
|
||||
FEATURE_SCHEDULE_STATUS -> Introduction(R.drawable.ic_action_time,
|
||||
context.getString(R.string.extra_feature_description_schedule_status))
|
||||
FEATURE_SHARE_GIF -> Introduction(R.drawable.ic_action_gif,
|
||||
|
@ -296,12 +296,12 @@
|
||||
<string name="external_group_host_format">Grupu esternu en <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Usuariu esternu en <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Configuraciones estra</string>
|
||||
<string name="extra_feature_description_filters_import">Importa\'l llistáu de peñeres de bloqueos/silenciaos</string>
|
||||
<string name="extra_feature_description_advanced_filters">Importa\'l llistáu de peñeres de bloqueos/silenciaos</string>
|
||||
<string name="extra_feature_description_filters_subscription">Soscríbite a peñeres de silenciu y sincronízales automáticamentes</string>
|
||||
<string name="extra_feature_description_schedule_status">Planificar tuit (unviar más sero)</string>
|
||||
<string name="extra_feature_description_share_gif">Compartir GIF en tuit</string>
|
||||
<string name="extra_feature_description_sync_data">Sincroniza datos con Dropbox, Google Drive… etc</string>
|
||||
<string name="extra_feature_title_filters_import">Importación de peñeres</string>
|
||||
<string name="extra_feature_title_advanced_filters">Importación de peñeres</string>
|
||||
<string name="extra_feature_title_filters_subscription">Soscripción de peñeres</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Sofita Twidere pa consiguir carauterístiques ameyoraes</string>
|
||||
|
@ -301,12 +301,12 @@
|
||||
<string name="external_group_host_format">Externe Gruppe bei <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Externer Benutzer bei <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Erweiterte Einstellungen</string>
|
||||
<string name="extra_feature_description_filters_import">Importiere Filterliste von blockierten/stummgeschalteten</string>
|
||||
<string name="extra_feature_description_advanced_filters">Importiere Filterliste von blockierten/stummgeschalteten</string>
|
||||
<string name="extra_feature_description_filters_subscription">Abonniere Stummschaltfilter und Synchronisation automatisch</string>
|
||||
<string name="extra_feature_description_schedule_status">Tweet planen (später senden)</string>
|
||||
<string name="extra_feature_description_share_gif">GIF in Tweet teilen</string>
|
||||
<string name="extra_feature_description_sync_data">Synchronisieren von Daten mit Dropbox, Google Drive etc.</string>
|
||||
<string name="extra_feature_title_filters_import">Filterimport</string>
|
||||
<string name="extra_feature_title_advanced_filters">Filterimport</string>
|
||||
<string name="extra_feature_title_filters_subscription">Filterabonnement</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Unterstütze Twidere und erhalte erweiterte Funktionen</string>
|
||||
|
@ -301,12 +301,12 @@
|
||||
<string name="external_group_host_format">Grupo externo en <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Usuario externo en <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Configuraciones Extra</string>
|
||||
<string name="extra_feature_description_filters_import">Importar lista de filtros de bloqueados/silenciados</string>
|
||||
<string name="extra_feature_description_advanced_filters">Importar lista de filtros de bloqueados/silenciados</string>
|
||||
<string name="extra_feature_description_filters_subscription">Suscripción a filtros y sincronización automática</string>
|
||||
<string name="extra_feature_description_schedule_status">Planifica tu tweet (envíalo más tarde)</string>
|
||||
<string name="extra_feature_description_share_gif">Compartir GIF en tweet</string>
|
||||
<string name="extra_feature_description_sync_data">Sincronizar datos con Dropbox, Google Drive etc</string>
|
||||
<string name="extra_feature_title_filters_import">Importar filtros</string>
|
||||
<string name="extra_feature_title_advanced_filters">Importar filtros</string>
|
||||
<string name="extra_feature_title_filters_subscription">Suscripción a filtros</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Apoyar Twidere y obtener características mejoradas</string>
|
||||
|
@ -297,12 +297,12 @@
|
||||
<string name="external_group_host_format">گروه خارجی در <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">کاربر خارجی در <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">پیکربندیهای اضافی</string>
|
||||
<string name="extra_feature_description_filters_import">درونریزی فهرستهای پالایه از انسداد/خموشیها</string>
|
||||
<string name="extra_feature_description_advanced_filters">درونریزی فهرستهای پالایه از انسداد/خموشیها</string>
|
||||
<string name="extra_feature_description_filters_subscription">اشتراک در پالایههای خموشی و همگام سازی خودکار</string>
|
||||
<string name="extra_feature_description_schedule_status">زمانبندی توییت (ارسال بعداً)</string>
|
||||
<string name="extra_feature_description_share_gif">هم رسانی جیف در توییت</string>
|
||||
<string name="extra_feature_description_sync_data">همگام سازی داده با دراپباکس، گوگلدرایو و…</string>
|
||||
<string name="extra_feature_title_filters_import">درونریزی پالایهها</string>
|
||||
<string name="extra_feature_title_advanced_filters">درونریزی پالایهها</string>
|
||||
<string name="extra_feature_title_filters_subscription">اشتراک پالایهها</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">حمایت از توییدر و گرفتن ویژگیهای بهبودیافته</string>
|
||||
|
@ -301,12 +301,12 @@
|
||||
<string name="external_group_host_format">Groupe externe venant de <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Utilisateur externe venant de <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Configurations supplémentaires</string>
|
||||
<string name="extra_feature_description_filters_import">Importer la liste de filtres depuis les blocages et \"mutes\"</string>
|
||||
<string name="extra_feature_description_advanced_filters">Importer la liste de filtres depuis les blocages et \"mutes\"</string>
|
||||
<string name="extra_feature_description_filters_subscription">S\'abonner aux filtres de mise en sourdine et les synchroniser automatiquement</string>
|
||||
<string name="extra_feature_description_schedule_status">Tweet programmé (envoyé plus tard)</string>
|
||||
<string name="extra_feature_description_share_gif">Partager un GIF dans le tweet</string>
|
||||
<string name="extra_feature_description_sync_data">Synchronisation des données avec Dropbox, Google Drive, etc</string>
|
||||
<string name="extra_feature_title_filters_import">Importer des filtres</string>
|
||||
<string name="extra_feature_title_advanced_filters">Importer des filtres</string>
|
||||
<string name="extra_feature_title_filters_subscription">Abonnement à des filtres</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Soutenez Twidere et accédez à des fonctionnalités avancées</string>
|
||||
|
@ -308,12 +308,12 @@
|
||||
<string name="external_group_host_format">Grupo externo en <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Usuario externo en <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Axustes extra</string>
|
||||
<string name="extra_feature_description_filters_import">Importar filtro de lista de bloqueados/silenciados</string>
|
||||
<string name="extra_feature_description_advanced_filters">Importar filtro de lista de bloqueados/silenciados</string>
|
||||
<string name="extra_feature_description_filters_subscription">Subscribir a filtros silenciados e sincronizar automaticamente</string>
|
||||
<string name="extra_feature_description_schedule_status">Programar chío (enviar máis tarde)</string>
|
||||
<string name="extra_feature_description_share_gif">Compartir GIF nun chío</string>
|
||||
<string name="extra_feature_description_sync_data">Sincroniza datos con Dropbox, Google Drive, etc</string>
|
||||
<string name="extra_feature_title_filters_import">Importación de filtros</string>
|
||||
<string name="extra_feature_title_advanced_filters">Importación de filtros</string>
|
||||
<string name="extra_feature_title_filters_subscription">Subscrición de filtros</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Apoia Twidere e consegue características avanzadas</string>
|
||||
|
@ -305,12 +305,12 @@
|
||||
<string name="external_group_host_format">Külső csoport innen: <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Külső felhasználó innen: <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Egyéb beállítások</string>
|
||||
<string name="extra_feature_description_filters_import">Blokkolt/elnémított szűrők importálása</string>
|
||||
<string name="extra_feature_description_advanced_filters">Blokkolt/elnémított szűrők importálása</string>
|
||||
<string name="extra_feature_description_filters_subscription">Feliratkozás elnémító szűrőkre és automatikus szinkronizációra</string>
|
||||
<string name="extra_feature_description_schedule_status">Tweet ütemezése (küldés később)</string>
|
||||
<string name="extra_feature_description_share_gif">GIF megosztása tweetben</string>
|
||||
<string name="extra_feature_description_sync_data">Szinkronizálás a Dropbox, Google Drive stb. szolgáltatásokkal</string>
|
||||
<string name="extra_feature_title_filters_import">Szűrők importálása</string>
|
||||
<string name="extra_feature_title_advanced_filters">Szűrők importálása</string>
|
||||
<string name="extra_feature_title_filters_subscription">Feliratkozás szűrőkre</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Támogassa Twidere alkalmazást, és jusson hozzá a bővített funkciókhoz</string>
|
||||
|
@ -269,7 +269,7 @@
|
||||
<string name="external_group_host_format">Grup eksternal di <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Pengguna eksternal di <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Pengaturan Ekstra</string>
|
||||
<string name="extra_feature_description_filters_import">Mengimpor daftar penyaringan dari blok/didiamkan</string>
|
||||
<string name="extra_feature_description_advanced_filters">Mengimpor daftar penyaringan dari blok/didiamkan</string>
|
||||
<string name="extra_feature_description_schedule_status">Jadwalkan tweer (kirim nanti)</string>
|
||||
<string name="extra_feature_description_sync_data">Sinkronisasi data dengan Dropbox, Google Drive, dll</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
|
@ -305,12 +305,12 @@
|
||||
<string name="external_group_host_format"><xliff:g id="host">%s</xliff:g> の外部グループ</string>
|
||||
<string name="external_user_host_format"><xliff:g id="host">%s</xliff:g>の外部ユーザー</string>
|
||||
<string name="extra_configurations">追加設定</string>
|
||||
<string name="extra_feature_description_filters_import">ブロック/ミュート 一覧からフィルターリストをインポート</string>
|
||||
<string name="extra_feature_description_advanced_filters">ブロック/ミュート 一覧からフィルターリストをインポート</string>
|
||||
<string name="extra_feature_description_filters_subscription">ミュートフィルターを購読、かつ自動同期</string>
|
||||
<string name="extra_feature_description_schedule_status">予約ツイート (あとで送る)</string>
|
||||
<string name="extra_feature_description_share_gif">ツイートでGIF動画を共有</string>
|
||||
<string name="extra_feature_description_sync_data">データを Dropbox や Google ドライブなどで同期</string>
|
||||
<string name="extra_feature_title_filters_import">フィルターをインポート</string>
|
||||
<string name="extra_feature_title_advanced_filters">フィルターをインポート</string>
|
||||
<string name="extra_feature_title_filters_subscription">フィルターを購読</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Twidere を支援して追加機能を取得</string>
|
||||
|
@ -300,12 +300,12 @@
|
||||
<string name="external_group_host_format"><xliff:g id="host">%s</xliff:g>의 외부 그룹</string>
|
||||
<string name="external_user_host_format"><xliff:g id="host">%s</xliff:g>의 외부 사용자</string>
|
||||
<string name="extra_configurations">추가 설정</string>
|
||||
<string name="extra_feature_description_filters_import">블락/뮤트에서 필터 리스트 가져오기</string>
|
||||
<string name="extra_feature_description_advanced_filters">블락/뮤트에서 필터 리스트 가져오기</string>
|
||||
<string name="extra_feature_description_filters_subscription">뮤트 필터를 구독하고 자동으로 동기화</string>
|
||||
<string name="extra_feature_description_schedule_status">트윗 예약 (나중에 보내기)</string>
|
||||
<string name="extra_feature_description_share_gif">트윗에 GIF 공유</string>
|
||||
<string name="extra_feature_description_sync_data">데이터를 Dropbox, Google Drive 등에 동기화하기</string>
|
||||
<string name="extra_feature_title_filters_import">필터 가져오기</string>
|
||||
<string name="extra_feature_title_advanced_filters">필터 가져오기</string>
|
||||
<string name="extra_feature_title_filters_subscription">필터 구독</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Twidere를 지원하시고 확장 기능을 받으세요.</string>
|
||||
|
@ -270,7 +270,7 @@
|
||||
<string name="extra_feature_description_filters_subscription">Inscreva-se para silenciar os filtros e sincronizar automaticamente</string>
|
||||
<string name="extra_feature_description_schedule_status">Agendar Tweet(enviar depois)</string>
|
||||
<string name="extra_feature_description_sync_data">Dados de sincronização com o Dropbox, Google Drive etc</string>
|
||||
<string name="extra_feature_title_filters_import">Importar Filtros</string>
|
||||
<string name="extra_feature_title_advanced_filters">Importar Filtros</string>
|
||||
<string name="extra_feature_title_filters_subscription">Assinatura de filtros</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Suporte Twidere e obter recursos avançados</string>
|
||||
|
@ -274,7 +274,7 @@
|
||||
<string name="external_group_host_format">Внешняя группа на <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Внешний пользователь на <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Дополнительные настройки</string>
|
||||
<string name="extra_feature_description_filters_import">Импортировать список блокированных/заглушенных</string>
|
||||
<string name="extra_feature_description_advanced_filters">Импортировать список блокированных/заглушенных</string>
|
||||
<string name="extra_feature_description_schedule_status">Расписание твитов</string>
|
||||
<string name="extra_feature_description_sync_data">Синхронизация с Dropbox, Google Drive и др.</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
|
@ -292,12 +292,12 @@
|
||||
<string name="external_group_host_format">Extern grupp på <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">Extern användare på <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">Extra inställningar</string>
|
||||
<string name="extra_feature_description_filters_import">Importera filterlista från blockeringar/tystningar</string>
|
||||
<string name="extra_feature_description_advanced_filters">Importera filterlista från blockeringar/tystningar</string>
|
||||
<string name="extra_feature_description_filters_subscription">Prenumerera på mute-filter och synkronisera automatiskt</string>
|
||||
<string name="extra_feature_description_schedule_status">Schemalägg tweet (Skicka senare)</string>
|
||||
<string name="extra_feature_description_share_gif">Dela GIF i tweet</string>
|
||||
<string name="extra_feature_description_sync_data">Synkronisera data med exempelvis Dropbox eller Google Drive</string>
|
||||
<string name="extra_feature_title_filters_import">Import-filter</string>
|
||||
<string name="extra_feature_title_advanced_filters">Import-filter</string>
|
||||
<string name="extra_feature_title_filters_subscription">Prenumerations-filter</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Stöd Twidere och få extrafunktioner</string>
|
||||
|
@ -301,12 +301,12 @@
|
||||
<string name="external_group_host_format">กลุ่มภายนอกที่ <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="external_user_host_format">ผู้ใช้ภายนอกที่ <xliff:g id="host">%s</xliff:g></string>
|
||||
<string name="extra_configurations">การตั้งค่าเพิ่มเติม</string>
|
||||
<string name="extra_feature_description_filters_import">นำเข้ารายการตัวกรองจากบล็อก/ปิดเสียง</string>
|
||||
<string name="extra_feature_description_advanced_filters">นำเข้ารายการตัวกรองจากบล็อก/ปิดเสียง</string>
|
||||
<string name="extra_feature_description_filters_subscription">สมัครสมาชิกเพื่อปิดการกรอง และซิงค์โดยอัตโนมัติ</string>
|
||||
<string name="extra_feature_description_schedule_status">ตั้งเวลาทวีต (ส่งในภายหลัง)</string>
|
||||
<string name="extra_feature_description_share_gif">แชร์ GIF ในทวีต</string>
|
||||
<string name="extra_feature_description_sync_data">ซิงค์ข้อมูลกับ Dropbox, Google ไดรฟ์ ฯลฯ</string>
|
||||
<string name="extra_feature_title_filters_import">นำเข้าตัวกรอง</string>
|
||||
<string name="extra_feature_title_advanced_filters">นำเข้าตัวกรอง</string>
|
||||
<string name="extra_feature_title_filters_subscription">การใช้งานตัวกรอง</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">สนับสนุน Twidere และรับคุณลักษณะขั้นสูง</string>
|
||||
|
@ -312,12 +312,12 @@
|
||||
<string name="external_group_host_format"><xliff:g id="host">%s</xliff:g> 的外部群组</string>
|
||||
<string name="external_user_host_format"><xliff:g id="host">%s</xliff:g> 的外部用户</string>
|
||||
<string name="extra_configurations">额外设置</string>
|
||||
<string name="extra_feature_description_filters_import">从被隐藏/阻止的用户导入过滤列表</string>
|
||||
<string name="extra_feature_description_advanced_filters">从被隐藏/阻止的用户导入过滤列表</string>
|
||||
<string name="extra_feature_description_filters_subscription">订阅到过滤器,并且自动同步</string>
|
||||
<string name="extra_feature_description_schedule_status">推文排期(稍后发送)</string>
|
||||
<string name="extra_feature_description_share_gif">在推文中分享 GIF</string>
|
||||
<string name="extra_feature_description_sync_data">与 Dropbox、Google 云端硬盘等同步数据</string>
|
||||
<string name="extra_feature_title_filters_import">过滤器导入</string>
|
||||
<string name="extra_feature_title_advanced_filters">过滤器导入</string>
|
||||
<string name="extra_feature_title_filters_subscription">过滤器订阅</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">支持 Twidere 并获得增强功能</string>
|
||||
|
@ -313,12 +313,12 @@
|
||||
<string name="external_group_host_format"><xliff:g id="host">%s</xliff:g> 的外部群組</string>
|
||||
<string name="external_user_host_format"><xliff:g id="host">%s</xliff:g> 的外部使用者</string>
|
||||
<string name="extra_configurations">額外設定</string>
|
||||
<string name="extra_feature_description_filters_import">從被封鎖/靜音的使用者導入過濾列表</string>
|
||||
<string name="extra_feature_description_advanced_filters">從被封鎖/靜音的使用者導入過濾列表</string>
|
||||
<string name="extra_feature_description_filters_subscription">訂閱到過濾器列表,並且自動同步</string>
|
||||
<string name="extra_feature_description_schedule_status">定期發推 (稍候傳送)</string>
|
||||
<string name="extra_feature_description_share_gif">在推文中分享 GIF</string>
|
||||
<string name="extra_feature_description_sync_data">透過 Dropbox 或 Google Drive 等同步資料</string>
|
||||
<string name="extra_feature_title_filters_import">過濾器匯入</string>
|
||||
<string name="extra_feature_title_advanced_filters">過濾器匯入</string>
|
||||
<string name="extra_feature_title_filters_subscription">過濾器訂閱</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">支持 Twidere 並且得到強化功能</string>
|
||||
|
@ -313,12 +313,12 @@
|
||||
<string name="external_group_host_format"><xliff:g id="host">%s</xliff:g> 的外部群組</string>
|
||||
<string name="external_user_host_format"><xliff:g id="host">%s</xliff:g> 的外部使用者</string>
|
||||
<string name="extra_configurations">額外設定</string>
|
||||
<string name="extra_feature_description_filters_import">從被封鎖/靜音的使用者導入過濾列表</string>
|
||||
<string name="extra_feature_description_advanced_filters">從被封鎖/靜音的使用者導入過濾列表</string>
|
||||
<string name="extra_feature_description_filters_subscription">訂閱到過濾器列表,並且自動同步</string>
|
||||
<string name="extra_feature_description_schedule_status">定期發推 (稍候傳送)</string>
|
||||
<string name="extra_feature_description_share_gif">在推文中分享 GIF</string>
|
||||
<string name="extra_feature_description_sync_data">透過 Dropbox 或 Google Drive 等同步資料</string>
|
||||
<string name="extra_feature_title_filters_import">過濾器匯入</string>
|
||||
<string name="extra_feature_title_advanced_filters">過濾器匯入</string>
|
||||
<string name="extra_feature_title_filters_subscription">過濾器訂閱</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">支持 Twidere 並且得到強化功能</string>
|
||||
|
92
twidere/src/main/res/layout/dialog_filter_rule_editor.xml
Normal file
92
twidere/src/main/res/layout/dialog_filter_rule_editor.xml
Normal file
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<android.support.v7.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/editText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:completionThreshold="1"
|
||||
android:maxLines="1"
|
||||
app:backgroundTint="?colorAccent"/>
|
||||
|
||||
<TextView
|
||||
style="?android:listSeparatorTextViewStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_for"
|
||||
android:textColor="?colorAccent"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/targetText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_target_text"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/targetName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_target_name"/>
|
||||
|
||||
<TextView
|
||||
style="?android:listSeparatorTextViewStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_apply_to"
|
||||
android:textColor="?colorAccent"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/scopeHome"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_scope_home"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/scopeInteractions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_scope_interactions"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/scopeMessages"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_scope_messages"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/scopeSearchResults"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_scope_search_results"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/scopeOther"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_filter_scope_search_other"/>
|
||||
</LinearLayout>
|
@ -376,13 +376,11 @@
|
||||
<string name="external_user_host_format">External user at <xliff:g id="host">%s</xliff:g></string>
|
||||
|
||||
<string name="extra_configurations">Extra configurations</string>
|
||||
<string name="extra_feature_description_filters_import">Import filter list from blocks/mutes</string>
|
||||
<string name="extra_feature_description_filters_subscription">Subscribe to mute filters and sync automatically</string>
|
||||
<string name="extra_feature_description_advanced_filters">Filter subscription, advanced rules etc</string>
|
||||
<string name="extra_feature_description_schedule_status">Schedule tweet (send later)</string>
|
||||
<string name="extra_feature_description_share_gif">Share GIF in tweet</string>
|
||||
<string name="extra_feature_description_sync_data">Sync data with Dropbox, Google Drive etc</string>
|
||||
<string name="extra_feature_title_filters_import">Filters import</string>
|
||||
<string name="extra_feature_title_filters_subscription">Filters subscription</string>
|
||||
<string name="extra_feature_title_advanced_filters">Advanced filters</string>
|
||||
<!-- Enhanced (paid) features description -->
|
||||
<string name="extra_features_description">Support Twidere and get enhanced features</string>
|
||||
<string name="extra_features_pack_description">Or buy features pack to get all features (including features in future releases)</string>
|
||||
@ -518,6 +516,15 @@
|
||||
<string name="label_data_provider">Twidere database provider</string>
|
||||
<string name="label_feedback_content">Content</string>
|
||||
<string name="label_feedback_title">Title</string>
|
||||
<string name="label_filter_apply_to">Apply to…</string>
|
||||
<string name="label_filter_for">For…</string>
|
||||
<string name="label_filter_scope_home">Home</string>
|
||||
<string name="label_filter_scope_interactions">Interactions</string>
|
||||
<string name="label_filter_scope_messages">Messages</string>
|
||||
<string name="label_filter_scope_search_other">Other</string>
|
||||
<string name="label_filter_scope_search_results">Search results</string>
|
||||
<string name="label_filter_target_name">Name</string>
|
||||
<string name="label_filter_target_text">Text</string>
|
||||
<string name="label_filters_subscription">Subscription</string>
|
||||
<string name="label_follow_request_sent">Follow request sent</string>
|
||||
<string name="label_format_buffer_time_source"><xliff:g example="12:00, April 1" id="time">%1$s</xliff:g> via <xliff:g example="api" id="source">%2$s</xliff:g></string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user