Show the direction on gaps + bug fix

This commit is contained in:
Grishka
2024-11-12 22:12:05 +03:00
parent 134bd13d60
commit ea1216b352
5 changed files with 11 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ android {
applicationId "org.joinmastodon.android" applicationId "org.joinmastodon.android"
minSdk 23 minSdk 23
targetSdk 34 targetSdk 34
versionCode 127 versionCode 128
versionName "2.9.0" versionName "2.9.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

View File

@@ -308,8 +308,9 @@ public class HomeTimelineFragment extends StatusListFragment implements ToolbarD
if(!gap.visible){ if(!gap.visible){
gap.visible=true; gap.visible=true;
gap.enteredFromTop=child.getTop()<list.getHeight()/2; gap.enteredFromTop=child.getTop()<list.getHeight()/2;
gaps.remove(gap); holder.text.setText(gap.enteredFromTop ? R.string.load_missing_posts_above : R.string.load_missing_posts_below);
} }
gaps.remove(gap);
} }
} }
for(GapStatusDisplayItem gap:gaps){ for(GapStatusDisplayItem gap:gaps){

View File

@@ -40,6 +40,7 @@ public class GapStatusDisplayItem extends StatusDisplayItem{
public void onBind(GapStatusDisplayItem item){ public void onBind(GapStatusDisplayItem item){
text.setVisibility(item.loading ? View.GONE : View.VISIBLE); text.setVisibility(item.loading ? View.GONE : View.VISIBLE);
progress.setVisibility(item.loading ? View.VISIBLE : View.GONE); progress.setVisibility(item.loading ? View.VISIBLE : View.GONE);
text.setText(item.enteredFromTop ? R.string.load_missing_posts_above : R.string.load_missing_posts_below);
} }
@Override @Override

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="75dp" android:layout_height="75dp"
android:background="@drawable/bg_timeline_gap"> android:background="@drawable/bg_timeline_gap">
@@ -9,10 +10,13 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginHorizontal="16dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:textAppearance="@style/m3_body_large" android:textAppearance="@style/m3_body_large"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:text="@string/load_missing_posts"/> android:maxLines="2"
android:ellipsize="end"
tools:text="@string/load_missing_posts_above"/>
<ProgressBar <ProgressBar
android:id="@+id/progress" android:id="@+id/progress"

View File

@@ -240,7 +240,6 @@
<string name="local_timeline_info_banner">These are all the posts from all users in your server (%s).</string> <string name="local_timeline_info_banner">These are all the posts from all users in your server (%s).</string>
<string name="recommended_accounts_info_banner">You might like these accounts based on others you follow.</string> <string name="recommended_accounts_info_banner">You might like these accounts based on others you follow.</string>
<string name="see_new_posts">New posts</string> <string name="see_new_posts">New posts</string>
<string name="load_missing_posts">Load missing posts</string>
<string name="follow_back">Follow back</string> <string name="follow_back">Follow back</string>
<string name="button_follow_pending">Pending</string> <string name="button_follow_pending">Pending</string>
<string name="follows_you">Follows you</string> <string name="follows_you">Follows you</string>
@@ -856,4 +855,6 @@
</plurals> </plurals>
<!-- The complete string will look like "You will lose X people you follow". See will_lose_x_following --> <!-- The complete string will look like "You will lose X people you follow". See will_lose_x_following -->
<string name="server_x_following_will_be_removed">You will lose %s.</string> <string name="server_x_following_will_be_removed">You will lose %s.</string>
<string name="load_missing_posts_above">Load missing posts above</string>
<string name="load_missing_posts_below">Load missing posts below</string>
</resources> </resources>