This commit is contained in:
stom79 2019-01-22 16:31:54 +01:00
parent c4c6f7995f
commit fa9723bc99
6 changed files with 30 additions and 0 deletions

View File

@ -947,6 +947,9 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
}
}
this.statuses.addAll(position, tmpStatuses);
boolean display_content_after_fetch_more = sharedpreferences.getBoolean(Helper.SET_DISPLAY_CONTENT_AFTER_FM, true);
if( position > 0 && display_content_after_fetch_more)
lv_status.scrollToPosition(position + tmpStatuses.size());
statusListAdapter.notifyItemRangeInserted(position, tmpStatuses.size());
if( textviewNoAction.getVisibility() == View.VISIBLE && tmpStatuses.size() > 0){
textviewNoAction.setVisibility(View.GONE);

View File

@ -100,6 +100,19 @@ public class SettingsFragment extends Fragment {
editor.apply();
}
});
boolean display_content_after_fetch_more = sharedpreferences.getBoolean(Helper.SET_DISPLAY_CONTENT_AFTER_FM, true);
final CheckBox set_display_content_after_fetch_more = rootView.findViewById(R.id.set_display_content_after_fetch_more);
set_display_content_after_fetch_more.setChecked(display_content_after_fetch_more);
set_display_content_after_fetch_more.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_DISPLAY_CONTENT_AFTER_FM, set_display_content_after_fetch_more.isChecked());
editor.apply();
}
});
count1 = 0;
count2 = 0;
count3 = 0;

View File

@ -295,6 +295,7 @@ public class Helper {
public static final String SET_BATTERY_PROFILE = "set_battery_profile";
public static final String SET_DEFAULT_LOCALE_NEW = "set_default_locale_new";
public static final String SET_NOTIFICATION_ACTION = "set_notification_action";
public static final String SET_DISPLAY_CONTENT_AFTER_FM = "set_display_content_after_fm";
public static final int S_512KO = 1;
public static final int S_1MO = 2;
public static final int S_2MO = 3;

View File

@ -192,6 +192,12 @@
android:text="@string/set_old_direct_timeline"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_content_after_fetch_more"
android:layout_width="wrap_content"
android:text="@string/set_display_content_after_fetch_more"
android:layout_height="wrap_content" />
<!-- TRUNCATE LONG TOOTS -->
<TextView
android:layout_marginTop="10dp"

View File

@ -195,6 +195,12 @@
android:text="@string/set_old_direct_timeline"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_content_after_fetch_more"
android:layout_width="wrap_content"
android:text="@string/set_display_content_after_fetch_more"
android:layout_height="wrap_content" />
<!-- TRUNCATE LONG TOOTS -->
<TextView
android:layout_marginTop="10dp"

View File

@ -834,6 +834,7 @@
<string name="toots_server">Toots (Server)</string>
<string name="toots_client">Toots (Device)</string>
<string name="modify">Modify</string>
<string name="set_display_content_after_fetch_more">Display new toots above the \"Fetch more\" button</string>
<!-- end languages -->