From a15ebf693d2535802192c6621e2ff0cee86dd6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lanie=20Chauvel?= Date: Wed, 9 Dec 2020 17:58:12 +0000 Subject: [PATCH 01/20] Translated using Weblate (French) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/fr/ Translated using Weblate (Esperanto) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/eo/ Translated using Weblate (French) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/fr/ Translated using Weblate (Esperanto) Currently translated at 99.7% (433 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/eo/ --- app/src/main/res/values-eo/strings.xml | 8 ++++++++ app/src/main/res/values-fr/strings.xml | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index 13a065971..829888980 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -474,4 +474,12 @@ iu petas sekvi min Malsupro Supro + Konservita! + Via privata noto pri ĉi tiu konto + Kaŝi la titolon de la supra ilobreto + Montri antaŭvidojn de ligiloj en tempolinioj + Montri konfirman fenestron antaŭ ol diskonigi + Estas neniu anonco. + Ebligi ŝovumadon por ŝanĝi inter la langetoj + Mastodon havas minimuman intervalon de planado de 5 minutoj. \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f25543404..732f65a25 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -452,18 +452,18 @@ Les fichiers audio doivent avoir moins de 40 Mo. Vous n’avez aucun brouillon. Vous n’avez aucun pouet planifié. - L’intervalle minimum de planification sur Mastodon est de5 minutes. + L’intervalle minimum de planification sur Mastodon est de 5 minutes. Demandes d\'abonnement Bloquer @%s \? Afficher une fenêtre de confirmation avant de partager - Afficher des aperçus des liens dans les fils + Afficher les aperçus des liens dans les fils %s a demandé à vous suivre Notifications à propos des demandes d’abonnement on demande à me suivre Mettre en sourdine @%s \? Enlever la sourdine à la conversation Masquer la conversation - Activer les gestes de glissement pour passer d’un onglet à l’autre + Activer le glissement pour changer d’onglet Hashtags Ajouter un hashtag Afficher des dégradés en couleur pour les médias cachés @@ -486,6 +486,6 @@ Sauvegardé ! Votre note privée sur ce compte - Il n’y a pas d’annonces. + Il n’y a pas d’annonce. Annonces \ No newline at end of file From 370c495b5623fb10b5a00de54c13a14b09a80fab Mon Sep 17 00:00:00 2001 From: Ho Nhat Duy Date: Wed, 9 Dec 2020 17:58:13 +0000 Subject: [PATCH 02/20] Translated using Weblate (Vietnamese) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/vi/ Translated using Weblate (Vietnamese) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/vi/ Translated using Weblate (Vietnamese) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/vi/ Translated using Weblate (Vietnamese) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/vi/ --- app/src/main/res/values-vi/strings.xml | 54 +++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 1730919ef..e6a93e82c 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -48,7 +48,7 @@ Làm tươi Tìm kiếm Trang cá nhân - Riêng bạn + Tài khoản Cài đặt Đăng xuất Xong @@ -97,7 +97,7 @@ Tải về Chia sẻ với tư cách … Mở với tư cách %s - Sao chép URL + Chép URL Đang tải %1$s Mở tập tin #%d Links @@ -131,7 +131,7 @@ Ẩn Chia sẻ Chụp hình - Tạo vău + Tạo bình chọn Thêm tệp Mở trong trình duyệt Bộ sưu tập @@ -221,7 +221,7 @@ Bảng tin Chủ đề Giao diện - vău đã kết thúc + cuộc bình chọn kết thúc tút được thích tút được chia sẻ yêu cầu theo dõi @@ -236,7 +236,7 @@ Thông báo Nhắn tin: Chỉ người được nhắc tới mới thấy Người theo dõi: Ai đã theo dõi mới xem được - Mở: Công khai, không hiện trên bảng tin + Riêng tư: Không hiện trên bảng tin Công khai: Mọi người đều có thể thấy Ẩn @%s\? Chặn @%s\? @@ -253,20 +253,20 @@ Nhỏ Kích thức phông chữ Người theo dõi - Mở + Riêng tư Công khai Dưới màn hình Trên màn hình Vị trí menu Đồng bộ hoá thất bại Đăng (đồng bộ với máy chủ) - Luôn đánh dấu nội dung là nhạy cảm + Tài khoản nhạy cảm Trạng thái tút mặc định - HTTP proxy server - HTTP proxy port - Bật HTTP proxy - HTTP proxy - Proxy + Máy chủ proxy + Cổng + Bật proxy + Dùng proxy + Vượt tường lửa Thông báo khi của bạn được chia sẻ Chia sẻ Thông báo về lượt yêu cầu theo dõi @@ -278,8 +278,8 @@ Powered by Tusky Tusky %s Tài khoản bị khóa - Thông báo khi những vău kết thúc - Vău + Thông báo khi một cuộc bình chọn kết thúc + Bình chọn Thông báo khi ai đó thích tút của bạn Lượt thích Toàn bộ câu @@ -315,9 +315,9 @@ Bạn không có tút đã lên lịch. Bạn không có bản nháp nào. Sửa - Bình chọn %d - Cho phép vău nhiều bình chọn - Thêm bình chọn + Lựa chọn %d + Cho phép chọn nhiều lựa chọn + Thêm lựa chọn 7 ngày 3 ngày 1 ngày @@ -325,8 +325,8 @@ 1 giờ 30 phút 5 phút - Vău - Vuốt để chuyển qua lại giữa các tab + Bình chọn + Vuốt qua lại giữa các tab Hiện bộ lọc thông báo Không thể tìm thấy Người @@ -349,18 +349,18 @@ %d ngày nữa kết thúc - Vău bạn tạo đã kết thúc - Vău mà bạn tham gia đã kết thúc - Vău + Cuộc bình chọn bạn tạo đã kết thúc + Cuộc bình chọn của bạn đã kết thúc + Bình chọn Kết thúc kết thúc lúc %s %s người - %s vău + %s người - %1$s • %2$s + %1$s • %2$s Mô tả cho hình %s Viết Viết tút @@ -376,7 +376,7 @@ Lượt bình chọn: %1$s, %2$s, %3$s, %4$s; %5$s Tin nhắn Người theo dõi - Mở + Riêng tư Công khai Đã lưu Đã thích @@ -456,7 +456,7 @@ Bỏ ẩn %s Ẩn tiêu đề tab Đã lưu! - Chú thích của bạn về người này + Ghi chú của bạn Chưa có thông báo. - Thông báo + Tin tức \ No newline at end of file From f7beecdcd250dfb30f93d8c9052bc4d5f8d43dc4 Mon Sep 17 00:00:00 2001 From: x Date: Wed, 9 Dec 2020 17:58:13 +0000 Subject: [PATCH 03/20] Translated using Weblate (Italian) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/it/ --- app/src/main/res/values-it/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 2cc0cfb2b..a704c110f 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -482,4 +482,5 @@ Disattiva le notifiche da %s Riattiva le notifiche da %s Annunci + Richieste di seguirti \ No newline at end of file From c39c5cb0ba712a5bfc515a99a9d23969fbaa101f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isak=20Holmstr=C3=B6m?= Date: Wed, 9 Dec 2020 17:58:13 +0000 Subject: [PATCH 04/20] Translated using Weblate (Swedish) Currently translated at 100.0% (434 of 434 strings) Translation: Tusky/Tusky Translate-URL: https://weblate.tusky.app/projects/tusky/tusky/sv/ --- app/src/main/res/values-sv/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index de4b4409c..8e3d5fb7d 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -480,4 +480,8 @@ Dölj aviseringar Tysta aviseringar från %s Aktivera aviseringar från %s + Sparat! + Din privata notering om detta kontot + Det finns inga meddelanden. + Meddelanden \ No newline at end of file From 8a5ca252f8e0508fef9416e95e2ff54a3b605dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isak=20Holmstr=C3=B6m?= Date: Wed, 9 Dec 2020 18:04:21 +0000 Subject: [PATCH 05/20] Translated using Weblate (Swedish) Currently translated at 90.9% (10 of 11 strings) Translation: Tusky/Tusky description Translate-URL: https://weblate.tusky.app/projects/tusky/tusky-app/sv/ --- fastlane/metadata/android/sv/changelogs/77.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fastlane/metadata/android/sv/changelogs/77.txt diff --git a/fastlane/metadata/android/sv/changelogs/77.txt b/fastlane/metadata/android/sv/changelogs/77.txt new file mode 100644 index 000000000..bb3c96625 --- /dev/null +++ b/fastlane/metadata/android/sv/changelogs/77.txt @@ -0,0 +1,10 @@ +Tusky v13.0 + +- support for profile notes (Mastodon 3.2.0 feature) +- support for admin announcements (Mastodon 3.1.0 feature) + +- the avatar of your selected account will now be shown in the main toolbar +- clicking the display name in a timeline will now open the profile page of that user + +- a lot of bug fixes and small improvements +- improved translations From 9cdf486ceb36852e0c07af4678eeab934fc39a98 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Wed, 9 Dec 2020 19:08:16 +0100 Subject: [PATCH 06/20] remove ThemeUtils.getTintedDrawable (#2015) --- .../tusky/adapter/ListSelectionAdapter.kt | 6 +--- .../adapter/PreviewPollOptionsAdapter.kt | 5 +-- .../tusky/adapter/StatusBaseViewHolder.java | 5 +-- .../keylesspalace/tusky/adapter/TabAdapter.kt | 8 ++--- .../components/compose/ComposeActivity.kt | 3 +- .../compose/view/ComposeScheduleView.java | 4 +-- .../preference/AccountPreferencesFragment.kt | 36 ++++++++----------- .../preference/PreferencesFragment.kt | 8 ++--- .../tusky/util/StatusViewHelper.kt | 5 +-- .../keylesspalace/tusky/util/ThemeUtils.java | 13 ------- app/src/main/res/layout/activity_compose.xml | 27 +++++++------- .../res/layout/item_autocomplete_hashtag.xml | 5 ++- app/src/main/res/layout/item_conversation.xml | 4 +++ .../res/layout/item_poll_preview_option.xml | 4 ++- .../main/res/layout/item_report_status.xml | 5 +-- app/src/main/res/layout/item_status.xml | 6 +++- .../main/res/layout/item_status_detailed.xml | 4 +++ .../main/res/layout/item_tab_preference.xml | 1 + .../res/layout/item_tab_preference_small.xml | 14 ++++---- .../main/res/layout/view_compose_schedule.xml | 5 +-- app/src/main/res/values/styles.xml | 6 ++++ 21 files changed, 82 insertions(+), 92 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/ListSelectionAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/adapter/ListSelectionAdapter.kt index e5470df6b..f9b19c697 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/ListSelectionAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/ListSelectionAdapter.kt @@ -22,7 +22,6 @@ import android.view.ViewGroup import android.widget.ArrayAdapter import com.keylesspalace.tusky.R import com.keylesspalace.tusky.entity.MastoList -import com.keylesspalace.tusky.util.ThemeUtils import kotlinx.android.synthetic.main.item_picker_list.view.* class ListSelectionAdapter(context: Context) : ArrayAdapter(context, R.layout.item_autocomplete_hashtag) { @@ -34,10 +33,7 @@ class ListSelectionAdapter(context: Context) : ArrayAdapter(context, ?: layoutInflater.inflate(R.layout.item_picker_list, parent, false) getItem(position)?.let { list -> - val title = view.title - title.text = list.title - val icon = ThemeUtils.getTintedDrawable(context, R.drawable.ic_list, R.attr.iconColor) - title.setCompoundDrawablesRelativeWithIntrinsicBounds(icon, null, null, null) + view.title.text = list.title } return view diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/PreviewPollOptionsAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/adapter/PreviewPollOptionsAdapter.kt index bb77cd274..328e96267 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/PreviewPollOptionsAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/PreviewPollOptionsAdapter.kt @@ -22,7 +22,6 @@ import android.widget.TextView import androidx.core.widget.TextViewCompat import androidx.recyclerview.widget.RecyclerView import com.keylesspalace.tusky.R -import com.keylesspalace.tusky.util.ThemeUtils class PreviewPollOptionsAdapter: RecyclerView.Adapter() { @@ -55,9 +54,7 @@ class PreviewPollOptionsAdapter: RecyclerView.Adapter() { R.drawable.ic_radio_button_unchecked_18dp } - val iconDrawable = ThemeUtils.getTintedDrawable(textView.context, iconId, android.R.attr.textColorTertiary) - - TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(textView, iconDrawable, null, null, null) + TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(textView, iconId, 0, 0, 0) textView.text = options[position] diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index 3869ca026..046ab9cf3 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -57,7 +57,6 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; -import java.util.Objects; import at.connyduck.sparkbutton.SparkButton; import at.connyduck.sparkbutton.helpers.Utils; @@ -566,9 +565,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { // Set the icon next to the label. int drawableId = getLabelIcon(attachments.get(0).getType()); - Drawable drawable = Objects.requireNonNull(context.getDrawable(drawableId)); - ThemeUtils.setDrawableTint(context, drawable, android.R.attr.textColorTertiary); - mediaLabel.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); + mediaLabel.setCompoundDrawablesWithIntrinsicBounds(drawableId, 0, 0, 0); setAttachmentClickListener(mediaLabel, listener, i, attachment, false); } else { diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/TabAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/adapter/TabAdapter.kt index cd877a15e..b4517dc6a 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/TabAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/TabAdapter.kt @@ -15,6 +15,7 @@ package com.keylesspalace.tusky.adapter +import android.content.res.ColorStateList import android.view.LayoutInflater import android.view.MotionEvent import android.view.View @@ -68,8 +69,7 @@ class TabAdapter(private var data: List, } else { holder.itemView.textView.setText(tab.text) } - val iconDrawable = ThemeUtils.getTintedDrawable(context, tab.icon, android.R.attr.textColorSecondary) - holder.itemView.textView.setCompoundDrawablesRelativeWithIntrinsicBounds(iconDrawable, null, null, null) + holder.itemView.textView.setCompoundDrawablesRelativeWithIntrinsicBounds(tab.icon, 0, 0, 0) if (small) { holder.itemView.textView.setOnClickListener { listener.onTabAdded(tab) @@ -110,6 +110,7 @@ class TabAdapter(private var data: List, val chip = holder.itemView.chipGroup.getChildAt(i).takeUnless { it.id == R.id.actionChip } as Chip? ?: Chip(context).apply { holder.itemView.chipGroup.addView(this, holder.itemView.chipGroup.size - 1) + chipIconTint = ColorStateList.valueOf(ThemeUtils.getColor(context, android.R.attr.textColorPrimary)) } chip.text = arg @@ -118,8 +119,7 @@ class TabAdapter(private var data: List, chip.chipIcon = null chip.setOnClickListener(null) } else { - val cancelIcon = ThemeUtils.getTintedDrawable(context, R.drawable.ic_cancel_24dp, android.R.attr.textColorPrimary) - chip.chipIcon = cancelIcon + chip.setChipIconResource(R.drawable.ic_cancel_24dp) chip.setOnClickListener { listener.onChipClicked(tab, holder.adapterPosition, i) } diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt index 4eba7e321..e9615d33f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt @@ -534,8 +534,7 @@ class ComposeActivity : BaseActivity(), Status.Visibility.UNLISTED -> R.drawable.ic_lock_open_24dp else -> R.drawable.ic_lock_open_24dp } - val drawable = ThemeUtils.getTintedDrawable(this, iconRes, android.R.attr.textColorTertiary) - composeToggleVisibilityButton.setImageDrawable(drawable) + composeToggleVisibilityButton.setImageResource(iconRes) } private fun showComposeOptions() { diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/view/ComposeScheduleView.java b/app/src/main/java/com/keylesspalace/tusky/components/compose/view/ComposeScheduleView.java index ca6639369..a1a99a7dc 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/compose/view/ComposeScheduleView.java +++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/view/ComposeScheduleView.java @@ -26,13 +26,13 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.core.content.ContextCompat; import com.google.android.material.datepicker.CalendarConstraints; import com.google.android.material.datepicker.DateValidatorPointForward; import com.google.android.material.datepicker.MaterialDatePicker; import com.keylesspalace.tusky.R; import com.keylesspalace.tusky.fragment.TimePickerFragment; -import com.keylesspalace.tusky.util.ThemeUtils; import java.text.DateFormat; import java.text.ParseException; @@ -106,7 +106,7 @@ public class ComposeScheduleView extends ConstraintLayout { } private void setEditIcons() { - Drawable icon = ThemeUtils.getTintedDrawable(getContext(), R.drawable.ic_create_24dp, android.R.attr.textColorTertiary); + Drawable icon = ContextCompat.getDrawable(getContext(), R.drawable.ic_create_24dp); if (icon == null) { return; } diff --git a/app/src/main/java/com/keylesspalace/tusky/components/preference/AccountPreferencesFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/preference/AccountPreferencesFragment.kt index af882977e..286b49b56 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/preference/AccountPreferencesFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/preference/AccountPreferencesFragment.kt @@ -16,10 +16,10 @@ package com.keylesspalace.tusky.components.preference import android.content.Intent -import android.graphics.drawable.Drawable import android.os.Build import android.os.Bundle import android.util.Log +import androidx.annotation.DrawableRes import androidx.preference.PreferenceFragmentCompat import com.google.android.material.snackbar.Snackbar import com.keylesspalace.tusky.* @@ -71,7 +71,7 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), Injectable { preference { setTitle(R.string.title_tab_preferences) - icon = getTintedIcon(R.drawable.ic_tabs) + setIcon(R.drawable.ic_tabs) setOnPreferenceClickListener { val intent = Intent(context, TabPreferenceActivity::class.java) activity?.startActivity(intent) @@ -83,7 +83,7 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), Injectable { preference { setTitle(R.string.action_view_mutes) - icon = getTintedIcon(R.drawable.ic_mute_24dp) + setIcon(R.drawable.ic_mute_24dp) setOnPreferenceClickListener { val intent = Intent(context, AccountListActivity::class.java) intent.putExtra("type", AccountListActivity.Type.MUTES) @@ -112,7 +112,7 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), Injectable { preference { setTitle(R.string.title_domain_mutes) - icon = getTintedIcon(R.drawable.ic_mute_24dp) + setIcon(R.drawable.ic_mute_24dp) setOnPreferenceClickListener { val intent = Intent(context, InstanceListActivity::class.java) activity?.startActivity(intent) @@ -132,11 +132,9 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), Injectable { val visibility = accountManager.activeAccount?.defaultPostPrivacy ?: Status.Visibility.PUBLIC value = visibility.serverString() - icon = getIconForVisibility(visibility) + setIcon(getIconForVisibility(visibility)) setOnPreferenceChangeListener { _, newValue -> - icon = getIconForVisibility( - Status.Visibility.byString(newValue as String) - ) + setIcon(getIconForVisibility(Status.Visibility.byString(newValue as String))) syncWithServer(visibility = newValue) eventHub.dispatch(PreferenceChangedEvent(key)) true @@ -151,9 +149,9 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), Injectable { val sensitivity = accountManager.activeAccount?.defaultMediaSensitivity ?: false setDefaultValue(sensitivity) - icon = getIconForSensitivity(sensitivity) + setIcon(getIconForSensitivity(sensitivity)) setOnPreferenceChangeListener { _, newValue -> - icon = getIconForSensitivity(newValue as Boolean) + setIcon(getIconForSensitivity(newValue as Boolean)) syncWithServer(sensitive = newValue) eventHub.dispatch(PreferenceChangedEvent(key)) true @@ -303,30 +301,24 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), Injectable { } } - private fun getIconForVisibility(visibility: Status.Visibility): Drawable? { - val drawableId = when (visibility) { + @DrawableRes + private fun getIconForVisibility(visibility: Status.Visibility): Int { + return when (visibility) { Status.Visibility.PRIVATE -> R.drawable.ic_lock_outline_24dp Status.Visibility.UNLISTED -> R.drawable.ic_lock_open_24dp else -> R.drawable.ic_public_24dp } - - return getTintedIcon(drawableId) } - private fun getIconForSensitivity(sensitive: Boolean): Drawable? { - val drawableId = if (sensitive) { + @DrawableRes + private fun getIconForSensitivity(sensitive: Boolean): Int { + return if (sensitive) { R.drawable.ic_hide_media_24dp } else { R.drawable.ic_eye_24dp } - - return getTintedIcon(drawableId) - } - - private fun getTintedIcon(iconId: Int): Drawable? { - return ThemeUtils.getTintedDrawable(requireContext(), iconId, R.attr.iconColor) } private fun launchFilterActivity(filterContext: String, titleResource: Int) { diff --git a/app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesFragment.kt index edddffca4..5e61e2fa6 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesFragment.kt @@ -39,7 +39,6 @@ class PreferencesFragment : PreferenceFragmentCompat(), Injectable { private var httpProxyPref: Preference? = null override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - val context = requireContext() makePreferenceScreen { preferenceCategory(R.string.pref_title_appearance_settings) { listPreference { @@ -115,11 +114,8 @@ class PreferencesFragment : PreferenceFragmentCompat(), Injectable { key = PrefKeys.SHOW_BOT_OVERLAY setTitle(R.string.pref_title_bot_overlay) isSingleLineTitle = false - icon = ThemeUtils.getTintedDrawable( - context, - R.drawable.ic_bot_24dp, - R.attr.iconColor - ) + setIcon(R.drawable.ic_bot_24dp) + } switchPreference { diff --git a/app/src/main/java/com/keylesspalace/tusky/util/StatusViewHelper.kt b/app/src/main/java/com/keylesspalace/tusky/util/StatusViewHelper.kt index cb4651fd3..2fb9ad428 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/StatusViewHelper.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/StatusViewHelper.kt @@ -23,7 +23,6 @@ import android.view.View import android.widget.ImageView import android.widget.TextView import androidx.annotation.DrawableRes -import androidx.appcompat.content.res.AppCompatResources import com.bumptech.glide.Glide import com.keylesspalace.tusky.R import com.keylesspalace.tusky.entity.Attachment @@ -220,9 +219,7 @@ class StatusViewHelper(private val itemView: View) { // Set the icon next to the label. val drawableId = getLabelIcon(attachments[0].type) - val drawable = AppCompatResources.getDrawable(context, drawableId) - ThemeUtils.setDrawableTint(context, drawable!!, android.R.attr.textColorTertiary) - mediaLabel.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null) + mediaLabel.setCompoundDrawablesWithIntrinsicBounds(drawableId, 0, 0, 0) mediaLabel.setOnClickListener { listener.onViewMedia(null, 0) } } diff --git a/app/src/main/java/com/keylesspalace/tusky/util/ThemeUtils.java b/app/src/main/java/com/keylesspalace/tusky/util/ThemeUtils.java index 9f7be6214..d01775dd6 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/ThemeUtils.java +++ b/app/src/main/java/com/keylesspalace/tusky/util/ThemeUtils.java @@ -22,9 +22,7 @@ import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import androidx.annotation.AttrRes; import androidx.annotation.ColorInt; -import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatDelegate; import android.util.TypedValue; @@ -59,17 +57,6 @@ public class ThemeUtils { return dimen; } - /** this can be replaced with drawableTint in xml once minSdkVersion >= 23 */ - @Nullable - public static Drawable getTintedDrawable(@NonNull Context context, @DrawableRes int drawableId, @AttrRes int colorAttr) { - Drawable drawable = context.getDrawable(drawableId); - if(drawable == null) { - return null; - } - setDrawableTint(context, drawable, colorAttr); - return drawable; - } - public static void setDrawableTint(Context context, Drawable drawable, @AttrRes int attribute) { drawable.setColorFilter(getColor(context, attribute), PorterDuff.Mode.SRC_IN); } diff --git a/app/src/main/res/layout/activity_compose.xml b/app/src/main/res/layout/activity_compose.xml index 5f8d6ffd6..4a92ff112 100644 --- a/app/src/main/res/layout/activity_compose.xml +++ b/app/src/main/res/layout/activity_compose.xml @@ -136,10 +136,10 @@ + android:scrollbars="none" + android:visibility="gone" /> + app:srcCompat="@drawable/ic_attach_file_24dp" + app:tooltipText="@string/action_add_media" /> + app:srcCompat="@drawable/ic_cw_24dp" + app:tooltipText="@string/action_content_warning" /> + app:srcCompat="@drawable/ic_emoji_24dp" + app:tooltipText="@string/action_emoji_keyboard" /> + app:srcCompat="@drawable/ic_access_time" + app:tooltipText="@string/action_schedule_toot" /> + android:textStyle="normal|bold" + app:drawableStartCompat="@drawable/ic_list" + app:drawableTint="?attr/iconColor" /> diff --git a/app/src/main/res/layout/item_conversation.xml b/app/src/main/res/layout/item_conversation.xml index a2dd4e3db..d746f99ec 100644 --- a/app/src/main/res/layout/item_conversation.xml +++ b/app/src/main/res/layout/item_conversation.xml @@ -340,6 +340,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -353,6 +354,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_0" /> @@ -366,6 +368,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_1" /> @@ -379,6 +382,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_2" /> diff --git a/app/src/main/res/layout/item_poll_preview_option.xml b/app/src/main/res/layout/item_poll_preview_option.xml index d7f5887a6..e8fa98499 100644 --- a/app/src/main/res/layout/item_poll_preview_option.xml +++ b/app/src/main/res/layout/item_poll_preview_option.xml @@ -1,5 +1,6 @@ \ No newline at end of file + android:maxEms="20" + app:drawableTint="?android:attr/textColorTertiary" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_report_status.xml b/app/src/main/res/layout/item_report_status.xml index b7ed05552..56a2dea92 100644 --- a/app/src/main/res/layout/item_report_status.xml +++ b/app/src/main/res/layout/item_report_status.xml @@ -198,8 +198,8 @@ app:layout_constraintLeft_toLeftOf="@+id/status_media_preview_container" app:layout_constraintTop_toTopOf="@+id/status_media_preview_container" app:srcCompat="@drawable/ic_eye_24dp" - tools:visibility="visible" - app:tint="@color/white" /> + app:tint="@color/white" + tools:visibility="visible" /> diff --git a/app/src/main/res/layout/item_status.xml b/app/src/main/res/layout/item_status.xml index 8d8317573..b6c597254 100644 --- a/app/src/main/res/layout/item_status.xml +++ b/app/src/main/res/layout/item_status.xml @@ -167,9 +167,9 @@ android:foreground="?attr/selectableItemBackground" android:minHeight="80dp" android:orientation="vertical" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="@id/status_display_name" app:layout_constraintTop_toBottomOf="@+id/button_toggle_content" - app:layout_constraintEnd_toEndOf="parent" tools:visibility="gone"> @@ -411,6 +412,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_0" /> @@ -424,6 +426,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_1" /> @@ -437,6 +440,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_2" /> diff --git a/app/src/main/res/layout/item_status_detailed.xml b/app/src/main/res/layout/item_status_detailed.xml index 019ab8bda..f3ad6ed52 100644 --- a/app/src/main/res/layout/item_status_detailed.xml +++ b/app/src/main/res/layout/item_status_detailed.xml @@ -344,6 +344,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -357,6 +358,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_0" /> @@ -370,6 +372,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_1" /> @@ -383,6 +386,7 @@ android:importantForAccessibility="no" android:textSize="?attr/status_text_medium" android:visibility="gone" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/status_media_label_2" /> diff --git a/app/src/main/res/layout/item_tab_preference.xml b/app/src/main/res/layout/item_tab_preference.xml index b0926cead..9eb164c3e 100644 --- a/app/src/main/res/layout/item_tab_preference.xml +++ b/app/src/main/res/layout/item_tab_preference.xml @@ -32,6 +32,7 @@ android:paddingBottom="8dp" android:textColor="?android:attr/textColorSecondary" android:textSize="?attr/status_text_large" + app:drawableTint="?android:attr/textColorSecondary" app:layout_constraintBottom_toTopOf="@id/chipGroup" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/imageView" diff --git a/app/src/main/res/layout/item_tab_preference_small.xml b/app/src/main/res/layout/item_tab_preference_small.xml index bee49eb21..15daafe08 100644 --- a/app/src/main/res/layout/item_tab_preference_small.xml +++ b/app/src/main/res/layout/item_tab_preference_small.xml @@ -1,17 +1,19 @@ + android:textSize="?attr/status_text_large" + app:drawableStartCompat="@drawable/ic_home_24dp" + app:drawableTint="?android:attr/textColorSecondary" /> diff --git a/app/src/main/res/layout/view_compose_schedule.xml b/app/src/main/res/layout/view_compose_schedule.xml index b07270f6a..7ae003c47 100644 --- a/app/src/main/res/layout/view_compose_schedule.xml +++ b/app/src/main/res/layout/view_compose_schedule.xml @@ -23,6 +23,7 @@ android:paddingBottom="16dp" android:textColor="?android:textColorTertiary" android:textSize="?attr/status_text_medium" + app:drawableTint="?android:attr/textColorTertiary" app:layout_constraintBottom_toTopOf="@id/invalidScheduleWarning" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="1" @@ -39,11 +40,11 @@ android:paddingBottom="16dp" android:textColor="?android:textColorTertiary" android:textSize="?attr/status_text_medium" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="1" app:layout_constraintStart_toStartOf="parent" - tools:text="@string/warning_scheduling_interval" - android:visibility="gone" /> + tools:text="@string/warning_scheduling_interval" /> \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 50da2622e..693c8427f 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -80,6 +80,8 @@ ?attr/colorSurface @style/Widget.MaterialComponents.Chip.Choice + + @style/TuskyPreferenceTheme + +