From cad0ad7a5963a56d7832931d40dfc90c25c3b12a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 25 Sep 2023 22:25:17 +0200 Subject: [PATCH 1/5] New translations strings.xml (Ukrainian) --- .../src/main/res/values-uk-rUA/strings.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mastodon/src/main/res/values-uk-rUA/strings.xml b/mastodon/src/main/res/values-uk-rUA/strings.xml index ad861a7073..d2080f40e2 100644 --- a/mastodon/src/main/res/values-uk-rUA/strings.xml +++ b/mastodon/src/main/res/values-uk-rUA/strings.xml @@ -641,5 +641,24 @@ %dгод. тому %dд. тому + Перекласти з %s + Перекладено з %1$s за допомогою %2$s + Показати оригінал + Не вдалося виконати переклад. Можливо, адміністратор не активував переклади на цьому сервері або цей сервер використовує стару версію Mastodon, де переклади ще не підтримуються. + Приватність і досяжність + Враховувати профіль та дописи в алгоритмах пошуку + Включити загальнодоступні дописи в результати пошуку + + %,d учасник + %,d учасники + %,d учасників + %,d учасника + + + %,d допис сьогодні + %,d дописи сьогодні + %,d дописів сьогодні + %,d дописа сьогодні + From b4cdf35d36b94de585a5a54eb6621f0c2c2cc04b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 25 Sep 2023 23:39:42 +0200 Subject: [PATCH 2/5] New translations strings.xml (Russian) --- mastodon/src/main/res/values-ru-rRU/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/res/values-ru-rRU/strings.xml b/mastodon/src/main/res/values-ru-rRU/strings.xml index 871d43f04d..2e5bb9bfd3 100644 --- a/mastodon/src/main/res/values-ru-rRU/strings.xml +++ b/mastodon/src/main/res/values-ru-rRU/strings.xml @@ -643,7 +643,7 @@ Перевести %s - Переведено с %1$s с помощью %2$s + %1$s переведён с помощью %2$s Показать оригинал Перевод не удался. Возможно, администратор не включил переводы на этом сервере или на этом сервере установлена ​​более старая версия Mastodon, где переводы еще не поддерживаются. Приватность и доступ From 6d56771abaa50c3b1300194fb09d45eb39acc174 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 28 Sep 2023 16:51:59 +0200 Subject: [PATCH 3/5] New translations strings.xml (Galician) --- mastodon/src/main/res/values-gl-rES/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mastodon/src/main/res/values-gl-rES/strings.xml b/mastodon/src/main/res/values-gl-rES/strings.xml index c32381c69a..550afd2608 100644 --- a/mastodon/src/main/res/values-gl-rES/strings.xml +++ b/mastodon/src/main/res/values-gl-rES/strings.xml @@ -4,12 +4,14 @@ Seguinte Obtendo info do servidor… Erro + %s non semella ser un servidor Mastodon. OK Preparándose para a autenticación… Rematando coa autenticación… %s promoveu Como resposta a %s Notificacións + %s comezou a seguirte Compartir Axustes Publicar From 283b56be5b5bc4bedfcb87156a26ff5a99fe6c5a Mon Sep 17 00:00:00 2001 From: Grishka Date: Thu, 28 Sep 2023 19:56:25 +0300 Subject: [PATCH 4/5] Finally fix the mysterious RecyclerView crash --- mastodon/build.gradle | 4 ++-- .../android/fragments/ProfileFragment.java | 18 +++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/mastodon/build.gradle b/mastodon/build.gradle index f277c8376b..b7b7e49cf3 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.joinmastodon.android" minSdk 23 targetSdk 33 - versionCode 68 - versionName "2.1.2" + versionCode 69 + versionName "2.1.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" resConfigs "ar-rSA", "be-rBY", "bn-rBD", "bs-rBA", "ca-rES", "cs-rCZ", "da-rDK", "de-rDE", "el-rGR", "es-rES", "eu-rES", "fa-rIR", "fi-rFI", "fil-rPH", "fr-rFR", "ga-rIE", "gd-rGB", "gl-rES", "hi-rIN", "hr-rHR", "hu-rHU", "hy-rAM", "ig-rNG", "in-rID", "is-rIS", "it-rIT", "iw-rIL", "ja-rJP", "kab", "ko-rKR", "my-rMM", "nl-rNL", "no-rNO", "oc-rFR", "pl-rPL", "pt-rBR", "pt-rPT", "ro-rRO", "ru-rRU", "si-rLK", "sl-rSI", "sv-rSE", "th-rTH", "tr-rTR", "uk-rUA", "ur-rIN", "vi-rVN", "zh-rCN", "zh-rTW" } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index cff9f787e9..b4a8679b01 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -238,7 +238,6 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){ pager.setOffscreenPageLimit(4); pager.setAdapter(new ProfilePagerAdapter()); pager.getLayoutParams().height=getResources().getDisplayMetrics().heightPixels; - pager.setVisibility(View.GONE); // Prevents a strange NPE when search is opened on the search tab. Shown in onShown() scrollView.setScrollableChildSupplier(this::getScrollableRecyclerView); @@ -1041,19 +1040,11 @@ private boolean isActionButtonInView(){ return actionButton.getVisibility()==View.VISIBLE && actionButtonWrap.getTop()+actionButtonWrap.getHeight()>scrollView.getScrollY(); } - @Override - protected void onShown(){ - super.onShown(); - pager.setVisibility(View.VISIBLE); - } - private class ProfilePagerAdapter extends RecyclerView.Adapter{ @NonNull @Override public SimpleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){ - FrameLayout view=tabViews[viewType]; - ((ViewGroup)view.getParent()).removeView(view); - view.setVisibility(View.VISIBLE); + FrameLayout view=new FrameLayout(parent.getContext()); view.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); return new SimpleViewHolder(view); } @@ -1061,8 +1052,13 @@ public SimpleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewTy @Override public void onBindViewHolder(@NonNull SimpleViewHolder holder, int position){ Fragment fragment=getFragmentForPage(position); + FrameLayout fragmentView=tabViews[position]; + fragmentView.setVisibility(View.VISIBLE); + if(fragmentView.getParent() instanceof ViewGroup parent) + parent.removeView(fragmentView); + ((FrameLayout)holder.itemView).addView(fragmentView); if(!fragment.isAdded()){ - getChildFragmentManager().beginTransaction().add(holder.itemView.getId(), fragment).commit(); + getChildFragmentManager().beginTransaction().add(fragmentView.getId(), fragment).commit(); holder.itemView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){ @Override public boolean onPreDraw(){ From 2cd98a662011f091f1df6fbfd567ec789b26340c Mon Sep 17 00:00:00 2001 From: Grishka Date: Thu, 28 Sep 2023 20:11:43 +0300 Subject: [PATCH 5/5] More crash fixes --- mastodon/build.gradle | 2 +- .../android/ui/photoviewer/ZoomPanView.java | 5 +++-- .../android/ui/views/MediaGridLayout.java | 12 ++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mastodon/build.gradle b/mastodon/build.gradle index b7b7e49cf3..517d1ee11e 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -76,7 +76,7 @@ dependencies { implementation 'me.grishka.litex:viewpager:1.0.0' implementation 'me.grishka.litex:viewpager2:1.0.0' implementation 'me.grishka.litex:palette:1.0.0' - implementation 'me.grishka.appkit:appkit:1.2.12' + implementation 'me.grishka.appkit:appkit:1.2.13' implementation 'com.google.code.gson:gson:2.8.9' implementation 'org.jsoup:jsoup:1.14.3' implementation 'com.squareup:otto:1.3.8' diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java index 58a4dfe2e3..ac9f5fbaa9 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java @@ -119,6 +119,9 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto int width=right-left; int height=bottom-top; + if(width==0 || height==0) + return; + float scale=Math.min(width/(float)child.getWidth(), height/(float)child.getHeight()); minScale=scale; maxScale=Math.max(3f, height/(float)child.getHeight()); @@ -306,8 +309,6 @@ public void setValue(ZoomPanView object, float value){ }, 1f).setMinimumVisibleChange(DynamicAnimation.MIN_VISIBLE_CHANGE_ALPHA)); } }else{ - if(animatingTransition) - Log.w(TAG, "updateViewTransform: ", new Throwable().fillInStackTrace()); child.setScaleX(matrixValues[Matrix.MSCALE_X]); child.setScaleY(matrixValues[Matrix.MSCALE_Y]); child.setTranslationX(matrixValues[Matrix.MTRANS_X]); diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/views/MediaGridLayout.java b/mastodon/src/main/java/org/joinmastodon/android/ui/views/MediaGridLayout.java index bd6b297b6a..67ff45d8d7 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/views/MediaGridLayout.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/views/MediaGridLayout.java @@ -18,7 +18,7 @@ public class MediaGridLayout extends ViewGroup{ public static final int MAX_WIDTH=400; // dp private static final int GAP=2; // dp private PhotoLayoutHelper.TiledLayoutResult tiledLayout; - private int[] columnStarts=new int[10], columnEnds=new int[10], rowStarts=new int[10], rowEnds=new int[10]; + private int[] columnStarts, columnEnds, rowStarts, rowEnds; public MediaGridLayout(Context context){ this(context, null); @@ -45,6 +45,14 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){ width=Math.round(width*(tiledLayout.width/(float)PhotoLayoutHelper.MAX_WIDTH)); } + if(rowStarts==null || rowStarts.length