Some fixes

This commit is contained in:
stom79 2018-12-24 09:51:02 +01:00
parent 05d080ad8c
commit 63cb53892a
2 changed files with 4 additions and 2 deletions

View File

@ -157,7 +157,7 @@ public class LanguageActivity extends BaseActivity implements OnRetrieveRemoteAc
SharedPreferences.Editor editor = sharedpreferences.edit();
switch (position) {
case 0:
editor.putString(Helper.SET_DEFAULT_LOCALE_NEW, Locale.getDefault().getLanguage());
editor.remove(Helper.SET_DEFAULT_LOCALE_NEW);
editor.commit();
break;
case 1:

View File

@ -830,6 +830,8 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
return;
}
List<Status> statuses = apiResponse.getStatuses();
if( statuses == null || statuses.size() == 0 )
return;
//Find the position of toots between those already present
int position = 0;
while (position < this.statuses.size() && Long.parseLong(statuses.get(0).getId()) < Long.parseLong(this.statuses.get(position).getId())) {
@ -853,7 +855,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
int tootPerPage = sharedpreferences.getInt(Helper.SET_TOOTS_PER_PAGE, 40);
//Display the fetch more toot button
if( tmpStatuses.size() >= tootPerPage) {
if (!fetchMoreButtonDisplayed && tmpStatuses.size() > 0 && Long.parseLong(tmpStatuses.get(tmpStatuses.size() - 1).getId()) > Long.parseLong(initialBookMark)) {
if (initialBookMark != null && !fetchMoreButtonDisplayed && tmpStatuses.size() > 0 && Long.parseLong(tmpStatuses.get(tmpStatuses.size() - 1).getId()) > Long.parseLong(initialBookMark)) {
tmpStatuses.get(tmpStatuses.size() - 1).setFetchMore(true);
fetchMoreButtonDisplayed = true;
}