improved filters subscriptions url check

This commit is contained in:
Mariotaku Lee 2017-01-13 00:34:45 +08:00
parent 0cc1f5cc29
commit bddf6c8dd0
39 changed files with 44 additions and 41 deletions

View File

@ -52,7 +52,7 @@ public class KeyboardShortcutsHandler implements KeyboardShortcutConstants {
sActionLabelMap.put(ACTION_NAVIGATION_PAGE_DOWN, R.string.page_down);
sActionLabelMap.put(ACTION_NAVIGATION_PAGE_UP, R.string.page_up);
sActionLabelMap.put(ACTION_NAVIGATION_TOP, R.string.jump_to_top);
sActionLabelMap.put(ACTION_NAVIGATION_REFRESH, R.string.refresh);
sActionLabelMap.put(ACTION_NAVIGATION_REFRESH, R.string.action_refresh);
sActionLabelMap.put(ACTION_NAVIGATION_PREVIOUS_TAB, R.string.previous_tab);
sActionLabelMap.put(ACTION_NAVIGATION_NEXT_TAB, R.string.next_tab);
sActionLabelMap.put(ACTION_NAVIGATION_BACK, R.string.keyboard_shortcut_back);

View File

@ -193,7 +193,7 @@ class SettingsActivity : BaseActivity(), OnItemClickListener, OnPreferenceStartF
CustomTabsFragment::class.java)
entriesAdapter.addPreference("extension", R.drawable.ic_action_extension, getString(R.string.extensions),
ExtensionsListFragment::class.java)
entriesAdapter.addPreference("refresh", R.drawable.ic_action_refresh, getString(R.string.refresh),
entriesAdapter.addPreference("refresh", R.drawable.ic_action_refresh, getString(R.string.action_refresh),
R.xml.preferences_refresh)
entriesAdapter.addPreference("notifications", R.drawable.ic_action_notification, getString(R.string.settings_notifications),
R.xml.preferences_notifications)

View File

@ -13,6 +13,7 @@ import android.support.v7.app.AlertDialog
import android.view.*
import com.rengwuxian.materialedittext.MaterialEditText
import kotlinx.android.synthetic.main.layout_list_with_empty_view.*
import okhttp3.HttpUrl
import org.mariotaku.abstask.library.TaskStarter
import org.mariotaku.ktextension.empty
import org.mariotaku.ktextension.isEmpty
@ -58,7 +59,7 @@ class FiltersSubscriptionsFragment : BaseFragment(), LoaderManager.LoaderCallbac
df.show(fragmentManager, "add_url_subscription")
return true
}
R.id.sync_now -> {
R.id.refresh -> {
val dfRef = WeakReference(ProgressDialogFragment.show(childFragmentManager, "refresh_filters"))
val task = RefreshFiltersSubscriptionsTask(context)
task.callback = {
@ -133,7 +134,9 @@ class FiltersSubscriptionsFragment : BaseFragment(), LoaderManager.LoaderCallbac
val positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE)
fun updateEnableState() {
positiveButton.isEnabled = !editName.empty && !editUrl.empty
val nameValid = !editName.empty
val urlValid = HttpUrl.parse(editUrl.text.toString()) != null
positiveButton.isEnabled = nameValid && urlValid
}
val watcher = object : SimpleTextWatcher() {

View File

@ -125,7 +125,7 @@
<!-- [noun] Twitter's favorite, in the plural -->
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">إعجاب</string>
<string name="refresh">تحديث</string>
<string name="action_refresh">تحديث</string>
<string name="settings_refresh">تحديث</string>
<string name="retry">إعادة المحاولة</string>
<string name="more">المزيد</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Préstames</string>
<string name="tab_editor_hint_name">Nome</string>
<string name="refresh">Refrescu</string>
<string name="action_refresh">Refrescu</string>
<string name="settings_refresh">Refrescu</string>
<string name="retry">Reintentar</string>
<string name="more">Más</string>

View File

@ -134,7 +134,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">M\'agrada</string>
<string name="tab_editor_hint_name">Nom</string>
<string name="refresh">Actualitza</string>
<string name="action_refresh">Actualitza</string>
<string name="settings_refresh">Actualitza</string>
<string name="retry">Torna-ho a intentar</string>
<string name="more">Més</string>

View File

@ -126,7 +126,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Oblíbené</string>
<string name="tab_editor_hint_name">Jméno</string>
<string name="refresh">Aktualizovat</string>
<string name="action_refresh">Aktualizovat</string>
<string name="settings_refresh">Aktualizovat</string>
<string name="retry">Opakovat</string>
<string name="more">Více</string>

View File

@ -121,7 +121,7 @@
<string name="title_favorites">Favoritter</string>
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="tab_editor_hint_name">Navn</string>
<string name="refresh">Genopfrisk</string>
<string name="action_refresh">Genopfrisk</string>
<string name="settings_refresh">Genopfrisk</string>
<string name="retry">Prøv igen</string>
<string name="more">Mere</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Likes</string>
<string name="tab_editor_hint_name">Name</string>
<string name="refresh">Aktualisieren</string>
<string name="action_refresh">Aktualisieren</string>
<string name="settings_refresh">Aktualisieren</string>
<string name="retry">Wiederholen</string>
<string name="more">Mehr</string>

View File

@ -82,7 +82,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Likes</string>
<string name="tab_editor_hint_name">Name</string>
<string name="refresh">Refresh</string>
<string name="action_refresh">Refresh</string>
<string name="settings_refresh">Refresh</string>
<string name="retry">Retry</string>
<string name="more">More</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Me gusta</string>
<string name="tab_editor_hint_name">Nombre</string>
<string name="refresh">Actualizar</string>
<string name="action_refresh">Actualizar</string>
<string name="settings_refresh">Actualizar</string>
<string name="retry">Reintentar</string>
<string name="more">Más</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">پسندها</string>
<string name="tab_editor_hint_name">نام</string>
<string name="refresh">تازه‌سازی</string>
<string name="action_refresh">تازه‌سازی</string>
<string name="settings_refresh">تازه‌سازی</string>
<string name="retry">سعی دوباره</string>
<string name="more">بیش‌تر</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Tykkäykset</string>
<string name="tab_editor_hint_name">Nimi</string>
<string name="refresh">Päivitys</string>
<string name="action_refresh">Päivitys</string>
<string name="settings_refresh">Päivitä</string>
<string name="retry">Yritä uudelleen</string>
<string name="more">Lisää</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">J\'aime</string>
<string name="tab_editor_hint_name">Nom</string>
<string name="refresh">Rafraîchir</string>
<string name="action_refresh">Rafraîchir</string>
<string name="settings_refresh">Rafraîchir</string>
<string name="retry">Rééssayer</string>
<string name="more">Plus</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Gústame</string>
<string name="tab_editor_hint_name">Nome</string>
<string name="refresh">Recargar</string>
<string name="action_refresh">Recargar</string>
<string name="settings_refresh">Recargar</string>
<string name="retry">Tentar de novo</string>
<string name="more">Máis</string>

View File

@ -108,7 +108,7 @@
<string name="title_favorites">पसंदीदा</string>
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="tab_editor_hint_name">नाम</string>
<string name="refresh">ताज़ा</string>
<string name="action_refresh">ताज़ा</string>
<string name="settings_refresh">ताज़ा</string>
<string name="retry">पुन: प्रयास</string>
<string name="more">अधिक</string>

View File

@ -129,7 +129,7 @@
<string name="title_favorites">Favoriti</string>
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="tab_editor_hint_name">Ime</string>
<string name="refresh">Osvježi</string>
<string name="action_refresh">Osvježi</string>
<string name="settings_refresh">Osvježi</string>
<string name="retry">Pokušaj ponovno</string>
<string name="more">Više</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Kedvelés</string>
<string name="tab_editor_hint_name">Név</string>
<string name="refresh">Frissít</string>
<string name="action_refresh">Frissít</string>
<string name="settings_refresh">Frissítés</string>
<string name="retry">Újrapróbál</string>
<string name="more">Tovább</string>

View File

@ -131,7 +131,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Suka</string>
<string name="tab_editor_hint_name">Nama</string>
<string name="refresh">Segarkan</string>
<string name="action_refresh">Segarkan</string>
<string name="settings_refresh">Perbaharui</string>
<string name="retry">Coba lagi</string>
<string name="more">Lebih</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Like</string>
<string name="tab_editor_hint_name">Nome</string>
<string name="refresh">Aggiorna</string>
<string name="action_refresh">Aggiorna</string>
<string name="settings_refresh">Aggiorna</string>
<string name="retry">Riprova</string>
<string name="more">Altro</string>

View File

@ -124,7 +124,7 @@
<string name="title_favorites">מועדפים</string>
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="tab_editor_hint_name">שם</string>
<string name="refresh">רענן</string>
<string name="action_refresh">רענן</string>
<string name="settings_refresh">רענן</string>
<string name="retry">נסה שנית</string>
<string name="more">עוד</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">いいね</string>
<string name="tab_editor_hint_name">名前</string>
<string name="refresh">更新</string>
<string name="action_refresh">更新</string>
<string name="settings_refresh">更新</string>
<string name="retry">再試行</string>
<string name="more">設定</string>

View File

@ -134,7 +134,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">마음</string>
<string name="tab_editor_hint_name">이름</string>
<string name="refresh">새로고침</string>
<string name="action_refresh">새로고침</string>
<string name="settings_refresh">새로고침</string>
<string name="retry">다시 시도</string>
<string name="more">기타</string>

View File

@ -131,7 +131,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Likes</string>
<string name="tab_editor_hint_name">Naam</string>
<string name="refresh">Vernieuwen</string>
<string name="action_refresh">Vernieuwen</string>
<string name="settings_refresh">Vernieuwen</string>
<string name="retry">Opnieuw proberen</string>
<string name="more">Meer</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Liker</string>
<string name="tab_editor_hint_name">Navn</string>
<string name="refresh">Oppdater</string>
<string name="action_refresh">Oppdater</string>
<string name="settings_refresh">Oppdater</string>
<string name="retry">Prøv igjen</string>
<string name="more">Mer</string>

View File

@ -126,7 +126,7 @@
<string name="title_favorites">Ulubione</string>
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="tab_editor_hint_name">Nazwa</string>
<string name="refresh">Odśwież</string>
<string name="action_refresh">Odśwież</string>
<string name="settings_refresh">Odśwież</string>
<string name="retry">Ponów</string>
<string name="more">Więcej</string>

View File

@ -134,7 +134,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Curtidas</string>
<string name="tab_editor_hint_name">Nome</string>
<string name="refresh">Atualizar</string>
<string name="action_refresh">Atualizar</string>
<string name="settings_refresh">Atualizar</string>
<string name="retry">Tentar novamente</string>
<string name="more">Mais</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Понравившееся</string>
<string name="tab_editor_hint_name">Имя</string>
<string name="refresh">Обновления</string>
<string name="action_refresh">Обновления</string>
<string name="settings_refresh">Обновления</string>
<string name="retry">Повторить</string>
<string name="more">Еще</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Gillningar</string>
<string name="tab_editor_hint_name">Namn</string>
<string name="refresh">Uppdatera</string>
<string name="action_refresh">Uppdatera</string>
<string name="settings_refresh">Uppdatera</string>
<string name="retry">Försök igen</string>
<string name="more">Mer</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">ถูกใจ</string>
<string name="tab_editor_hint_name">ชื่อ</string>
<string name="refresh">โหลดใหม่</string>
<string name="action_refresh">โหลดใหม่</string>
<string name="settings_refresh">โหลดใหม่</string>
<string name="retry">ลองอีกครั้ง</string>
<string name="more">เพิ่มเติม</string>

View File

@ -134,7 +134,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Beğen</string>
<string name="tab_editor_hint_name">Ad</string>
<string name="refresh">Yenile</string>
<string name="action_refresh">Yenile</string>
<string name="settings_refresh">Yenile</string>
<string name="retry">Tekrar Dene</string>
<string name="more">Dahası</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">Вподобання</string>
<string name="tab_editor_hint_name">Ім\'я</string>
<string name="refresh">Оновлення</string>
<string name="action_refresh">Оновлення</string>
<string name="settings_refresh">Оновлення</string>
<string name="retry">Повторити спробу</string>
<string name="more">Більше</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">喜欢</string>
<string name="tab_editor_hint_name">名称</string>
<string name="refresh">刷新</string>
<string name="action_refresh">刷新</string>
<string name="settings_refresh">刷新</string>
<string name="retry">重试</string>
<string name="more">更多</string>

View File

@ -135,7 +135,7 @@
<!-- [noun] Like, Formerly Twitter's favorite, in the plural -->
<string name="title_likes">喜歡</string>
<string name="tab_editor_hint_name">名字</string>
<string name="refresh">更新</string>
<string name="action_refresh">更新</string>
<string name="settings_refresh">更新</string>
<string name="retry">重試</string>
<string name="more">更多</string>

View File

@ -11,10 +11,10 @@
app:showAsAction="always"
tools:ignore="AlwaysShowAction"/>
<item
android:id="@+id/sync_now"
android:id="@+id/refresh"
android:enabled="@bool/debug"
android:showAsAction="never"
android:title="@string/action_sync_sync_now"
android:title="@string/action_refresh"
android:visible="@bool/debug"
app:showAsAction="never"/>

View File

@ -22,7 +22,7 @@
<item
android:id="@id/refresh"
android:icon="@drawable/ic_action_refresh"
android:title="@string/refresh"
android:title="@string/action_refresh"
app:showAsAction="ifRoom" />
<item
android:id="@id/share"

View File

@ -139,7 +139,7 @@
<string name="title_likes">Likes</string>
<string name="tab_editor_hint_name">Name</string>
<string name="refresh">Refresh</string>
<string name="action_refresh">Refresh</string>
<string name="settings_refresh">Refresh</string>
<string name="retry">Retry</string>
<string name="more">More</string>

View File

@ -56,7 +56,7 @@
<org.mariotaku.twidere.preference.KeyboardShortcutPreference
android:action="navigation.refresh"
android:tag="navigation"
android:title="@string/refresh"/>
android:title="@string/action_refresh"/>
<org.mariotaku.twidere.preference.KeyboardShortcutPreference
android:action="navigation.back"
android:tag="navigation"

View File

@ -3,7 +3,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/refresh">
android:title="@string/action_refresh">
<org.mariotaku.twidere.preference.AutoRefreshAccountsListPreference
android:key="cat_auto_refresh"