Unverified Commit 475f195e authored by Filipe Brito's avatar Filipe Brito Committed by GitHub

Merge pull request #2304 from HusseinElFeky/viewpager-rtl

[FIX][IMPROVEMENT][I18N] Adds support for RTL ViewPager for RTL languages
parents 556733e8 cc83b9ea
......@@ -86,10 +86,10 @@ object DrawableHelper {
return
} else {
for (i in textView.indices) {
if (textView[i].resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_LTR) {
textView[i].setCompoundDrawablesWithIntrinsicBounds(drawables[i], null, null, null)
} else {
if (textView[i].resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_RTL) {
textView[i].setCompoundDrawablesWithIntrinsicBounds(null, null, drawables[i], null)
} else {
textView[i].setCompoundDrawablesWithIntrinsicBounds(drawables[i], null, null, null)
}
}
}
......@@ -103,10 +103,10 @@ object DrawableHelper {
* @see compoundDrawables
*/
fun compoundStartDrawable(textView: TextView, drawable: Drawable) =
if (textView.resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_LTR) {
textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null)
} else {
if (textView.resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_RTL) {
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
} else {
textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null)
}
/**
......@@ -117,10 +117,10 @@ object DrawableHelper {
* @see compoundStartDrawable
*/
fun compoundEndDrawable(textView: TextView, drawable: Drawable) =
if (textView.resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_LTR) {
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
} else {
if (textView.resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_RTL) {
textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null)
} else {
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)
}
/**
......@@ -136,10 +136,10 @@ object DrawableHelper {
startDrawable: Drawable,
endDrawable: Drawable
) =
if (textView.resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_LTR) {
textView.setCompoundDrawablesWithIntrinsicBounds(startDrawable, null, endDrawable, null)
} else {
if (textView.resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_RTL) {
textView.setCompoundDrawablesWithIntrinsicBounds(endDrawable, null, startDrawable, null)
} else {
textView.setCompoundDrawablesWithIntrinsicBounds(startDrawable, null, endDrawable, null)
}
/**
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportHeight="20.0"
android:viewportWidth="22.0">
<path
android:fillColor="#FF1D74F5"
android:fillType="nonZero"
android:pathData="M0.869,1.32C0.731,0.987 0.79,0.565 1.045,0.276C1.281,0.01 1.634,-0.079 1.967,0.076L20.645,9.134C20.939,9.29 21.136,9.645 21.136,10C21.155,10.377 20.939,10.71 20.645,10.866L1.967,19.924C1.634,20.079 1.281,19.99 1.045,19.724C0.79,19.435 0.712,19.036 0.869,18.68L4.263,10L0.869,1.32ZM18.193,10L3.262,2.741L5.832,9.29L9.953,9.334C10.404,9.312 10.777,9.734 10.777,10.266C10.796,10.777 10.423,11.199 9.953,11.199L5.636,11.199L3.262,17.259L18.193,10Z" />
</vector>
\ No newline at end of file
This diff is collapsed.
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string>
<string name="msg_server_version">Serverversion: %1$s</string>
<string name="msg_send_analytics">Analysesaten senden</string>
<string name="msg_send_analytics_tracking">Anonyme Statistiken senden um diese App weiter zu verbessern</string>
<string name="msg_do_not_send_analytics_tracking">KEINE anonymen Statistiken senden um diese App weiter zu verbessern</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Nicht anwendbar, da es sich um eine FOSS version handelt</string>
<string name="msg_logout_from_rocket_chat">Logout von Rocket.Chat</string>
<string name="msg_delete_account">Konto löschen</string>
<string name="msg_change_status">Status ändern</string>
......@@ -219,13 +222,6 @@
<string name="msg_send_email">E-Mail senden</string>
<string name="msg_android_app_support">Android App-Unterstützung</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Daten für Analysezwecke</string>
<string name="msg_send_analytics_tracking">Anonyme Statistiken senden um diese App weiter zu verbessern</string>
<string name="msg_do_not_send_analytics_tracking">KEINE anonymen Statistiken senden um diese App weiter zu verbessern</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Nicht anwendbar, da es sich um eine FOSS version handelt</string>
<!-- System messages -->
<string name="message_room_name_changed">Raum Namen geändert zu: %1$s von %2$s</string>
<string name="message_user_added_by">Benutzer %1$s hinzugefügt von %2$s</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">Envía estadísticas anónimas para ayudar a mejorar esta aplicación</string>
<string name="msg_do_not_send_analytics_tracking">No envíe estadísticas anónimas para ayudar a mejorar esta aplicación</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">No aplica ya que es una versión FOSS</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -215,12 +218,6 @@
<string name="msg_camera_permission_denied">Camera permission is needed to open camera.</string> <!-- TODO Add translation -->
<string name="msg_storage_permission_denied">Storage permission is needed to open Drawing.</string> <!-- TODO Add translation -->
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Seguimiento analítico</string>
<string name="msg_send_analytics_tracking">Envía estadísticas anónimas para ayudar a mejorar esta aplicación</string>
<string name="msg_do_not_send_analytics_tracking">No envíe estadísticas anónimas para ayudar a mejorar esta aplicación</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">No aplica ya que es una versión FOSS</string>
<!-- System messages -->
<string name="message_room_name_changed">Nombre de la sala cambiado para: %1$s por %2$s</string>
<string name="message_user_added_by">Usuario %1$s añadido por %2$s</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">برای بهبود این کاره آمار ناشناس بفرستید</string>
<string name="msg_do_not_send_analytics_tracking">برای بهبود این کاره آمار ناشناس نفرستید</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">قابل اجرا نیست زیرا نسخه‌ی FOSS است</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -220,12 +223,6 @@
<string name="msg_view_less">مشاهده‌ی کمتر</string>
<string name="msg_muted_on_this_channel">آیا این کانال را بی‌صدا کردید؟</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">ردگیری تحلیلی</string>
<string name="msg_send_analytics_tracking">برای بهبود این کاره آمار ناشناس بفرستید</string>
<string name="msg_do_not_send_analytics_tracking">برای بهبود این کاره آمار ناشناس نفرستید</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">قابل اجرا نیست زیرا نسخه‌ی FOSS است</string>
<!-- System messages -->
<string name="message_room_name_changed">Room name changed to: %1$s by %2$s</string> <!-- TODO Add translation -->
<string name="message_user_added_by">User %1$s added by %2$s</string> <!-- TODO Add translation -->
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">Envoyer des statistiques anonymes pour aider à l\'amélioration de l\'application</string>
<string name="msg_do_not_send_analytics_tracking">Ne pas envoyer des statistiques anonymes pour aider à l\'amélioration de l\'application</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Ne s\'applique pas étant donné qu\'il s\'agit d\'une version FOSS</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -218,12 +221,6 @@
<string name="msg_member_not_found">Membre non trouvé</string>
<string name="msg_channel_created_successfully">Salon créé</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Pistage à des fins d\'analyses</string>
<string name="msg_send_analytics_tracking">Envoyer des statistiques anonymes pour aider à l\'amélioration de l\'application</string>
<string name="msg_do_not_send_analytics_tracking">Ne pas envoyer des statistiques anonymes pour aider à l\'amélioration de l\'application</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Ne s\'applique pas étant donné qu\'il s\'agit d\'une version FOSS</string>
<!-- System messages -->
<string name="message_room_name_changed">Le nom du salon %1$s a été changé en %2$s</string>
<string name="message_user_added_by">Utilisateur %1$s ajouté par %2$s</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">इस ऐप को बेहतर बनाने में मदद के लिए अज्ञात स्टेटिक्स भेजें</string>
<string name="msg_do_not_send_analytics_tracking">इस ऐप को बेहतर बनाने में मदद के लिए अनाम स्टेटिक न भेजें</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">लागू नहीं है क्योंकि यह एक FOSS संस्करण है</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -221,12 +224,6 @@
<string name="msg_add_new_server">Add New Server</string> <!-- TODO Translate -->
<string name="msg_directory">Directory</string> <!-- TODO Translate -->
<!-- Preferences messages -->
<string name="msg_analytics_tracking">एनालिटिक्स ट्रैकिंग</string>
<string name="msg_send_analytics_tracking">इस ऐप को बेहतर बनाने में मदद के लिए अज्ञात स्टेटिक्स भेजें</string>
<string name="msg_do_not_send_analytics_tracking">इस ऐप को बेहतर बनाने में मदद के लिए अनाम स्टेटिक न भेजें</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">लागू नहीं है क्योंकि यह एक FOSS संस्करण है</string>
<!-- System messages -->
<string name="message_room_name_changed">%2$s ने रूम का नाम बदलकर %1$s किया</string>
<string name="message_user_added_by">उपयोगकर्ता %1$s द्वारा %2$s को जोड़ा गया</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">Invia statistiche anonime per migliorare questa app</string>
<string name="msg_do_not_send_analytics_tracking">Non inviare statiche anonime per migliorare questa app</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Non applicabile poiché è una versione FOSS</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -217,12 +220,6 @@
<string name="msg_view_less">vedere di meno</string>
<string name="msg_muted_on_this_channel">Sei disattivato su questo canale</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Tracciamento Analitico</string>
<string name="msg_send_analytics_tracking">Invia statistiche anonime per migliorare questa app</string>
<string name="msg_do_not_send_analytics_tracking">Non inviare statiche anonime per migliorare questa app</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Non applicabile poiché è una versione FOSS</string>
<!-- System messages -->
<string name="message_room_name_changed">Nome della camera cambiato in: %1$s da %2$s</string>
<string name="message_user_added_by">Utente %1$s aggiunto da %2$s</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">アプリ改善のための匿名統計情報を送信する</string>
<string name="msg_do_not_send_analytics_tracking">アプリ改善のための匿名統計情報を送信しない</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">FOSSバージョンのため、適用できません</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -220,12 +223,6 @@
<string name="msg_send_email">Send email</string> <!-- TODO - Add proper translation -->
<string name="msg_android_app_support">Android app support</string> <!-- TODO - Add proper translation -->
<!-- Preferences messages -->
<string name="msg_analytics_tracking">トラッキングの分析</string>
<string name="msg_send_analytics_tracking">アプリ改善のための匿名統計情報を送信する</string>
<string name="msg_do_not_send_analytics_tracking">アプリ改善のための匿名統計情報を送信しない</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">FOSSバージョンのため、適用できません</string>
<!-- System messages -->
<string name="message_room_name_changed">ルーム名を %1$s から %2$s へ変更しました。</string>
<string name="message_user_added_by">%1$s がユーザー %2$s を追加しました。</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">Envie estatísticas anônimas para ajudar a melhorar este app</string>
<string name="msg_do_not_send_analytics_tracking">Não envie estatísticas anônimas para ajudar a melhorar este app</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Não aplicável devido a versão do aplicativo ser FOSS</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -219,12 +222,6 @@
<string name="msg_member_not_found">Membro não encontrado</string>
<string name="msg_channel_created_successfully">Chat criado com sucesso</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Rastreamento de análises</string>
<string name="msg_send_analytics_tracking">Envie estatísticas anônimas para ajudar a melhorar este app</string>
<string name="msg_do_not_send_analytics_tracking">Não envie estatísticas anônimas para ajudar a melhorar este app</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Não aplicável devido a versão do aplicativo ser FOSS</string>
<!-- System messages -->
<string name="message_room_name_changed">Nome da sala alterado para: %1$s por %2$s</string>
<string name="message_user_added_by">Usuário %1$s adicionado por %2$s</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">Enviar estatísticas anónimas para ajudar a melhorar esta aplicação</string>
<string name="msg_do_not_send_analytics_tracking">Não enviar estatísticas anónimas para ajudar a melhorar esta aplicação</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Não aplicável, visto ser uma versão FOSS</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -219,12 +222,6 @@
<string name="msg_view_less">mostrar menos</string>
<string name="msg_muted_on_this_channel">Você está silenciado neste canal</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Acompanhamento de análise</string>
<string name="msg_send_analytics_tracking">Enviar estatísticas anónimas para ajudar a melhorar esta aplicação</string>
<string name="msg_do_not_send_analytics_tracking">Não enviar estatísticas anónimas para ajudar a melhorar esta aplicação</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Não aplicável, visto ser uma versão FOSS</string>
<!-- System messages -->
<string name="message_room_name_changed">Nome da sala alterado para: %1$s por %2$s</string>
<string name="message_user_added_by">Utilizador %1$s adicionado por %2$s</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Версия программы: %1$s (%2$d)</string>
<string name="msg_server_version">Версия сервера: %1$s</string>
<string name="msg_send_analytics">Отправка аналитики</string>
<string name="msg_send_analytics_tracking">Отправлять анонимную статистику для улучшения приложения.</string>
<string name="msg_do_not_send_analytics_tracking">Не отправлять анонимную статистику для улучшения приложения</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Не применимо, так как это FOSS версия</string>
<string name="msg_logout_from_rocket_chat">Выйти из Rocket.Chat</string>
<string name="msg_delete_account">Удалить аккаунт</string>
<string name="msg_change_status">Изменить статус</string>
......@@ -217,12 +220,6 @@
<string name="msg_member_not_found">Пользователь не найден</string>
<string name="msg_channel_created_successfully">Канал создан успешно</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Отслеживание аналитики</string>
<string name="msg_send_analytics_tracking">Отправлять анонимную статистику для улучшения приложения.</string>
<string name="msg_do_not_send_analytics_tracking">Не отправлять анонимную статистику для улучшения приложения</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Не применимо, так как это FOSS версия</string>
<!-- System messages -->
<string name="message_room_name_changed">%2$s изменил название канала на %1$s</string>
<string name="message_user_added_by">Пользователь %1$s добавлен пользователем %2$s</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">Uygulamanın gelişmesine katkıda bulunmak için anonim istatistik bilgisi gönder</string>
<string name="msg_do_not_send_analytics_tracking">Uygulamanın gelişmesine katkıda bulunmak için anonim istatistik bilgisi gönderme</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">FOSS sürümü olduğundan uygulanabilir değil</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -220,12 +223,6 @@
<string name="msg_add_new_server">Add New Server</string> <!-- TODO Translate -->
<string name="msg_directory">Directory</string> <!-- TODO Translate -->
<!-- Preferences messages -->
<string name="msg_analytics_tracking">İstatistik takibi</string>
<string name="msg_send_analytics_tracking">Uygulamanın gelişmesine katkıda bulunmak için anonim istatistik bilgisi gönder</string>
<string name="msg_do_not_send_analytics_tracking">Uygulamanın gelişmesine katkıda bulunmak için anonim istatistik bilgisi gönderme</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">FOSS sürümü olduğundan uygulanabilir değil</string>
<!-- System messages -->
<string name="message_room_name_changed">Oda ismi %2$s\'dan %1$s\'a değiştirildi</string>
<string name="message_user_added_by">%1$s kullanıcısı %2$s tarafından eklendi</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">Надсилати анонімну статистику для покращення роботи програми</string>
<string name="msg_do_not_send_analytics_tracking">Не надсилати анонімну статистику для покращення роботи програми</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Недоступно у FOSS версії</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -216,12 +219,6 @@
<string name="msg_member_not_found">"Користувача не знайдено "</string>
<string name="msg_channel_created_successfully">Канал був створений успішно</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Збір аналітики</string>
<string name="msg_send_analytics_tracking">Надсилати анонімну статистику для покращення роботи програми</string>
<string name="msg_do_not_send_analytics_tracking">Не надсилати анонімну статистику для покращення роботи програми</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Недоступно у FOSS версії</string>
<!-- System messages -->
<string name="message_room_name_changed">%2$s змінив назву каналу на %1$s</string>
<string name="message_user_added_by">Користувач %2$s додав користувача %1$s</string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">发送匿名统计信息来帮助改善App</string>
<string name="msg_do_not_send_analytics_tracking">不要发送匿名统计信息,我不想帮组改善App</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">不适用,因为这事开源软件</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -217,12 +220,6 @@
<string name="msg_view_less">显示更少</string>
<string name="msg_muted_on_this_channel">您被禁言了</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">跟踪分析</string>
<string name="msg_send_analytics_tracking">发送匿名统计信息来帮助改善App</string>
<string name="msg_do_not_send_analytics_tracking">不要发送匿名统计信息,我不想帮组改善App</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">不适用,因为这事开源软件</string>
<!-- System messages -->
<string name="message_room_name_changed">频道名改为: %1$s by %2$s</string>
<string name="message_user_added_by">%2$s增加了用户%1$s </string>
......
......@@ -70,6 +70,9 @@
<string name="msg_app_version">Version: %1$s (%2$d)</string> <!-- TODO Translate -->
<string name="msg_server_version">Server version: %1$s</string> <!-- TODO Translate -->
<string name="msg_send_analytics">Send analytics</string> <!-- TODO Translate -->
<string name="msg_send_analytics_tracking">發送匿名訊息來改善App</string>
<string name="msg_do_not_send_analytics_tracking">不要發送匿名訊息,我不想幫助這個App</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">不適用,因為這個軟體是Foss版本</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string> <!-- TODO Translate -->
<string name="msg_delete_account">Delete account</string> <!-- TODO Translate -->
<string name="msg_change_status">Change status</string> <!-- TODO Translate -->
......@@ -198,12 +201,6 @@
<string name="msg_view_less">顯示更少</string>
<string name="msg_muted_on_this_channel">您被禁言了</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">追蹤分析</string>
<string name="msg_send_analytics_tracking">發送匿名訊息來改善App</string>
<string name="msg_do_not_send_analytics_tracking">不要發送匿名訊息,我不想幫助這個App</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">不適用,因為這個軟體是Foss版本</string>
<!-- System messages -->
<string name="message_room_name_changed">頻道已經改名為: %1$s by %2$s</string>
<string name="message_user_added_by">%2$s增加了新的成員%1$s </string>
......
......@@ -82,6 +82,9 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string name="msg_app_version">Version: %1$s (%2$d)</string>
<string name="msg_server_version">Server version: %1$s</string>
<string name="msg_send_analytics">Send analytics</string>
<string name="msg_send_analytics_tracking">Send anonymous statistics to help improve this app</string>
<string name="msg_do_not_send_analytics_tracking">Do not send anonymous statistics to help improve this app</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Not applicable since it is a FOSS version</string>
<string name="msg_logout_from_rocket_chat">Logout from Rocket.Chat</string>
<string name="msg_delete_account">Delete account</string>
<string name="msg_change_status">Change status</string>
......@@ -233,12 +236,6 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string name="msg_view_less">view less</string>
<string name="msg_muted_on_this_channel">You are muted on this channel</string>
<!-- Preferences messages -->
<string name="msg_analytics_tracking">Analytics tracking</string>
<string name="msg_send_analytics_tracking">Send anonymous statistics to help improve this app</string>
<string name="msg_do_not_send_analytics_tracking">Do not send anonymous statistics to help improve this app</string>
<string name="msg_not_applicable_since_it_is_a_foss_version">Not applicable since it is a FOSS version</string>
<!-- System messages -->
<string name="message_room_name_changed">Room name changed to: %1$s by %2$s</string>
<string name="message_user_added_by">User %1$s added by %2$s</string>
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
</vector>
......@@ -16,7 +16,6 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.content.edit
import androidx.core.graphics.drawable.DrawableCompat
import androidx.viewpager.widget.ViewPager
import chat.rocket.android.emoji.internal.EmojiCategory
import chat.rocket.android.emoji.internal.EmojiPagerAdapter
import chat.rocket.android.emoji.internal.PREF_EMOJI_SKIN_TONE
......@@ -27,7 +26,7 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow(context, view) {
private lateinit var viewPager: ViewPager
private lateinit var viewPager: EmojiViewPager
private lateinit var tabLayout: TabLayout
private lateinit var searchView: View
private lateinit var backspaceView: View
......@@ -155,7 +154,7 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
val fragments = (it as AppCompatActivity).supportFragmentManager.fragments
if (fragments.size == 0 || fragments[0] !is EmojiKeyboardListener) {
// Since the app can arrive in an inconsistent state at this point, do not throw
// throw IllegalStateException("activity/fragment should implement Listener interface")
// throw IllegalStateException("activity/fragment should implement Listener interface")
null
} else {
fragments[0] as EmojiKeyboardListener
......@@ -177,8 +176,8 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
val tab = tabLayout.getTabAt(category.ordinal)
val tabView = LayoutInflater.from(context).inflate(R.layout.emoji_picker_tab, null)
tab?.customView = tabView
val textView = tabView.findViewById(R.id.image_category) as ImageView
textView.setImageResource(category.resourceIcon())
val imageView = tabView.findViewById(R.id.image_category) as ImageView
imageView.setImageResource(category.resourceIcon())
}
val currentTab = if (EmojiRepository.getRecents().isEmpty()) {
......@@ -186,7 +185,6 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
} else {
EmojiCategory.RECENTS.ordinal
}
viewPager.currentItem = currentTab
}
}
......@@ -203,7 +201,7 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
val start = message.getSpanStart(span)
val end = message.getSpanEnd(span)
// Remove the span
// Remove the span.
message.removeSpan(span)
// Remove the remaining emoticon text.
......
......@@ -7,9 +7,6 @@ import android.view.LayoutInflater
import android.view.Window
import android.view.WindowManager
import android.widget.ImageView
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import androidx.core.content.edit
import chat.rocket.android.emoji.internal.EmojiCategory
import chat.rocket.android.emoji.internal.EmojiPagerAdapter
import chat.rocket.android.emoji.internal.PREF_EMOJI_SKIN_TONE
......@@ -18,7 +15,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
class EmojiPickerPopup(context: Context) : Dialog(context) {
var listener: EmojiKeyboardListener? = null
......@@ -60,15 +56,15 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
changeSkinTone(Fitzpatrick.valueOf(it))
}
pager_categories.adapter = adapter
pager_categories.offscreenPageLimit = EmojiCategory.values().size
pager_categories.adapter = adapter
for (category in EmojiCategory.values()) {
val tab = tabs.getTabAt(category.ordinal)
val tabView = LayoutInflater.from(context).inflate(R.layout.emoji_picker_tab, null)
tab?.customView = tabView
val textView = tabView.findViewById(R.id.image_category) as ImageView
textView.setImageResource(category.resourceIcon())
val imageView = tabView.findViewById(R.id.image_category) as ImageView
imageView.setImageResource(category.resourceIcon())
}
val currentTab = if (EmojiRepository.getRecents().isEmpty()) {
......
package chat.rocket.android.emoji
import android.content.Context
import android.database.DataSetObserver
import android.os.Parcelable
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import androidx.core.view.ViewCompat
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
class EmojiViewPager : ViewPager {
private var mLayoutDirection = ViewCompat.LAYOUT_DIRECTION_LTR
private val mPageChangeListeners = hashMapOf<OnPageChangeListener, ReversingOnPageChangeListener>()
private val isRtl: Boolean
get() = mLayoutDirection == ViewCompat.LAYOUT_DIRECTION_RTL
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
override fun onRtlPropertiesChanged(layoutDirection: Int) {
super.onRtlPropertiesChanged(layoutDirection)
val viewCompatLayoutDirection = if (layoutDirection == View.LAYOUT_DIRECTION_RTL) {
ViewCompat.LAYOUT_DIRECTION_RTL
} else {
ViewCompat.LAYOUT_DIRECTION_LTR
}
if (viewCompatLayoutDirection != mLayoutDirection) {
val adapter = super.getAdapter()
var position = 0
if (adapter != null) {
position = currentItem
}
mLayoutDirection = viewCompatLayoutDirection
if (adapter != null) {
adapter.notifyDataSetChanged()
currentItem = position
}
}
}
override fun setAdapter(adapter: PagerAdapter?) {
val adapter = if (adapter != null) {
ReversingAdapter(adapter)
} else {
adapter
}
super.setAdapter(adapter)
currentItem = 0
}
override fun getAdapter(): PagerAdapter? {
return super.getAdapter() as ReversingAdapter?
}
override fun getCurrentItem(): Int {
var item = super.getCurrentItem()
val adapter = super.getAdapter()
if (adapter != null && isRtl) {
item = adapter.count - item - 1
}
return item
}
override fun setCurrentItem(position: Int, smoothScroll: Boolean) {
val adapter = super.getAdapter()
val position = if (adapter != null && isRtl) {
adapter.count - position - 1
} else {
position
}
super.setCurrentItem(position, smoothScroll)
}
override fun setCurrentItem(position: Int) {
val adapter = super.getAdapter()
val position = if (adapter != null && isRtl) {
adapter.count - position - 1
} else {
position
}
super.setCurrentItem(position)
}
override fun setOnPageChangeListener(listener: OnPageChangeListener) {
super.setOnPageChangeListener(ReversingOnPageChangeListener(listener))
}
override fun addOnPageChangeListener(listener: OnPageChangeListener) {
val reversingListener = ReversingOnPageChangeListener(listener)
mPageChangeListeners.put(listener, reversingListener)
super.addOnPageChangeListener(reversingListener)
}
override fun removeOnPageChangeListener(listener: OnPageChangeListener) {
val reverseListener = mPageChangeListeners.remove(listener)
if (reverseListener != null) {
super.removeOnPageChangeListener(reverseListener)
}
}
override fun clearOnPageChangeListeners() {
super.clearOnPageChangeListeners()
mPageChangeListeners.clear()
}
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
val heightMeasureSpec = if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.UNSPECIFIED) {
var height = 0
for (i in 0 until childCount) {
val child = getChildAt(i)
child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED))
val h = child.measuredHeight
if (h > height) {
height = h
}
}
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
} else {
heightMeasureSpec
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
}
private inner class ReversingOnPageChangeListener(
private val mListener: OnPageChangeListener
) : OnPageChangeListener {
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
var position = position
var positionOffset = positionOffset
var positionOffsetPixels = positionOffsetPixels
val width = width
val adapter = super@EmojiViewPager.getAdapter()
if (adapter != null && isRtl) {
val count = adapter.count
var remainingWidth = (width * (1 - adapter.getPageWidth(position))).toInt() +
positionOffsetPixels
while (position < count && remainingWidth > 0) {
position += 1
remainingWidth -= (width * adapter.getPageWidth(position)).toInt()
}
position = count - position - 1
positionOffsetPixels = -remainingWidth
positionOffset = positionOffsetPixels / (width * adapter.getPageWidth(position))
}
mListener.onPageScrolled(position, positionOffset, positionOffsetPixels)
}
override fun onPageSelected(position: Int) {
val adapter = super@EmojiViewPager.getAdapter()
val position = if (adapter != null && isRtl) {
adapter.count - position - 1
} else {
position
}
mListener.onPageSelected(position)
}
override fun onPageScrollStateChanged(state: Int) {
mListener.onPageScrollStateChanged(state)
}
}
private inner class ReversingAdapter(private val adapter: PagerAdapter) : PagerAdapter() {
override fun isViewFromObject(view: View, obj: Any): Boolean {
return adapter.isViewFromObject(view, obj)
}
override fun getCount(): Int {
return adapter.count
}
override fun getItemPosition(obj: Any): Int {
var position = adapter.getItemPosition(obj)
if (isRtl) {
if (position == POSITION_UNCHANGED || position == POSITION_NONE) {
position = POSITION_NONE
} else {
position = getCount() - position - 1
}
}
return position
}
override fun getPageTitle(position: Int): CharSequence? {
return adapter.getPageTitle(position)
}
override fun getPageWidth(position: Int): Float {
return adapter.getPageWidth(position)
}
override fun instantiateItem(container: ViewGroup, position: Int): Any {
val position = if (isRtl) {
count - position - 1
} else {
position
}
return adapter.instantiateItem(container, position)
}
override fun instantiateItem(container: View, position: Int): Any {
val position = if (isRtl) {
count - position - 1
} else {
position
}
return adapter.instantiateItem(container, position)
}
override fun destroyItem(container: ViewGroup, position: Int, obj: Any) {
val position = if (isRtl) {
count - position - 1
} else {
position
}
adapter.destroyItem(container, position, obj)
}
override fun destroyItem(container: View, position: Int, obj: Any) {
val position = if (isRtl) {
count - position - 1
} else {
position
}
adapter.destroyItem(container, position, obj)
}
override fun setPrimaryItem(container: ViewGroup, position: Int, obj: Any) {
val position = if (isRtl) {
count - position - 1
} else {
position
}
adapter.setPrimaryItem(container, position, obj)
}
override fun setPrimaryItem(container: View, position: Int, obj: Any) {
val position = if (isRtl) {
count - position - 1
} else {
position
}
adapter.setPrimaryItem(container, position, obj)
}
override fun startUpdate(container: ViewGroup) {
adapter.startUpdate(container)
}
override fun startUpdate(container: View) {
adapter.startUpdate(container)
}
override fun finishUpdate(container: ViewGroup) {
adapter.finishUpdate(container)
}
override fun finishUpdate(container: View) {
adapter.finishUpdate(container)
}
override fun saveState(): Parcelable? {
return adapter.saveState()
}
override fun restoreState(state: Parcelable?, loader: ClassLoader?) {
adapter.restoreState(state, loader)
}
override fun notifyDataSetChanged() {
adapter.notifyDataSetChanged()
}
override fun registerDataSetObserver(observer: DataSetObserver) {
adapter.registerDataSetObserver(observer)
}
override fun unregisterDataSetObserver(observer: DataSetObserver) {
adapter.unregisterDataSetObserver(observer)
}
}
}
......@@ -2,6 +2,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportHeight="24"
android:viewportWidth="24">
......
......@@ -15,7 +15,7 @@
app:tabGravity="fill"
app:tabMode="scrollable" />
<androidx.viewpager.widget.ViewPager
<chat.rocket.android.emoji.EmojiViewPager
android:id="@+id/pager_categories"
android:layout_width="match_parent"
android:layout_height="match_parent"
......
......@@ -16,7 +16,7 @@
app:tabMaxWidth="48dp"
app:tabMode="scrollable" />
<androidx.viewpager.widget.ViewPager
<chat.rocket.android.emoji.EmojiViewPager
android:id="@+id/pager_categories"
android:layout_width="match_parent"
android:layout_height="match_parent"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment