From 63bcef990beddf71d81400e4498607931a210adc Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Thu, 15 Jun 2023 15:19:20 -0300 Subject: [PATCH 1/3] feat: use correct coloring for new exclusive list explanation cc: @sk22 --- mastodon/src/main/res/layout/list_timeline_editor.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/mastodon/src/main/res/layout/list_timeline_editor.xml b/mastodon/src/main/res/layout/list_timeline_editor.xml index 31362bd4f..878f85d28 100644 --- a/mastodon/src/main/res/layout/list_timeline_editor.xml +++ b/mastodon/src/main/res/layout/list_timeline_editor.xml @@ -86,6 +86,7 @@ android:layout_height="wrap_content" android:layout_marginHorizontal="24dp" android:layout_marginBottom="8dp" + android:textColor="?android:textColorSecondary" android:textSize="14sp" android:text="@string/sk_list_exclusive_switch_explanation" /> \ No newline at end of file From 50360059ce1a4d0d799d8a7babcae6ee7f9b5f0f Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 15 Jun 2023 20:38:47 +0200 Subject: [PATCH 2/3] fix margins --- mastodon/src/main/res/layout/list_timeline_editor.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mastodon/src/main/res/layout/list_timeline_editor.xml b/mastodon/src/main/res/layout/list_timeline_editor.xml index 878f85d28..31e6d2616 100644 --- a/mastodon/src/main/res/layout/list_timeline_editor.xml +++ b/mastodon/src/main/res/layout/list_timeline_editor.xml @@ -45,7 +45,7 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginHorizontal="8dp" + android:layout_marginHorizontal="24dp" android:minHeight="48dp" android:gravity="center_vertical" android:layoutDirection="locale"> @@ -54,7 +54,7 @@ android:id="@+id/icon" android:layout_width="24dp" android:layout_height="24dp" - android:layout_marginHorizontal="16dp" + android:layout_marginEnd="16dp" android:importantForAccessibility="no" android:tint="?android:textColorPrimary" android:src="@drawable/ic_fluent_rss_24_regular"/> @@ -63,7 +63,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:layout_marginStart="16dp" android:paddingVertical="8dp" android:textSize="16sp" android:textColor="?android:textColorPrimary" @@ -74,7 +73,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="16dp" - android:layout_marginEnd="12dp" android:duplicateParentState="true" android:focusable="false" android:clickable="false"/> From bb4a52f03a2121142a117982975c48be3f4425f1 Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 15 Jun 2023 22:44:46 +0200 Subject: [PATCH 3/3] fix threads opened from notification --- .../main/java/org/joinmastodon/android/MainActivity.java | 4 +++- .../org/joinmastodon/android/fragments/ThreadFragment.java | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java b/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java index 67b29e14f..7af4b8fdb 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java +++ b/mastodon/src/main/java/org/joinmastodon/android/MainActivity.java @@ -123,7 +123,9 @@ public class MainActivity extends FragmentStackActivity implements ProvidesAssis Log.w("MainActivity", x); return; } - UiUtils.showFragmentForNotification(this, notification, accountID, null); + Bundle args = new Bundle(); + args.putBoolean("noTransition", true); + UiUtils.showFragmentForNotification(this, notification, accountID, args); } private void showFragmentForExternalShare(Bundle args) { diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java index 063b4fb04..8f53b1c13 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java @@ -65,6 +65,7 @@ public class ThreadFragment extends StatusListFragment implements ProvidesAssist data.add(mainStatus); onAppendItems(Collections.singletonList(mainStatus)); setTitle(HtmlParser.parseCustomEmoji(getString(R.string.post_from_user, mainStatus.account.displayName), mainStatus.account.emojis)); + transitionFinished = getArguments().getBoolean("noTransition", false); } @Override @@ -359,7 +360,7 @@ public class ThreadFragment extends StatusListFragment implements ProvidesAssist int nextDisplayItemsIndex = -1, indexOfPreviousDisplayItem = -1; - for (int i = 0; i < displayItems.size(); i++) { + if (ancestry != null) for (int i = 0; i < displayItems.size(); i++) { StatusDisplayItem item = displayItems.get(i); if (repliedToStatus.id.equals(item.parentID)) { // saving the replied-to status' display items index to eventually reach the last one @@ -382,7 +383,7 @@ public class ThreadFragment extends StatusListFragment implements ProvidesAssist int nextDataIndex = data.indexOf(repliedToStatus) + 1; // if replied-to status already has another reply... - if (ancestry.descendantNeighbor != null) { + if (ancestry != null && ancestry.descendantNeighbor != null) { // update the reply's ancestry to remove its ancestoring neighbor (as we did above) ancestryMap.get(ancestry.descendantNeighbor.id).ancestoringNeighbor = null; // make sure the existing reply has a reply line @@ -399,7 +400,7 @@ public class ThreadFragment extends StatusListFragment implements ProvidesAssist } // update replied-to status' ancestry - ancestry.descendantNeighbor = ev.status; + if (ancestry != null) ancestry.descendantNeighbor = ev.status; // add ancestry for newly created status before building its display items ancestryMap.put(ev.status.id, new NeighborAncestryInfo(ev.status, null, repliedToStatus));