Fix counter issue

This commit is contained in:
stom79 2018-12-22 14:48:36 +01:00
parent fe30985a2f
commit 3eecc584d9
2 changed files with 2 additions and 4 deletions

View File

@ -708,9 +708,7 @@ public abstract class BaseMainActivity extends BaseActivity
tabLayout.addTab(tabHome);
tabLayout.addTab(tabNotif);
tabPosition.put("home",0);
typePosition.put(0, RetrieveFeedsAsyncTask.Type.HOME);
tabPosition.put("notifications",1);
typePosition.put(1, null);
int i = 2;
if( display_direct) {
tabLayout.addTab(tabDirect);

View File

@ -161,7 +161,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
textviewNoAction = rootView.findViewById(R.id.no_action);
mainLoader.setVisibility(View.VISIBLE);
nextElementLoader.setVisibility(View.GONE);
userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
instance = sharedpreferences.getString(Helper.PREF_INSTANCE, context!=null?Helper.getLiveInstance(context):null);
Account account = new AccountDAO(context, db).getAccountByID(userId);
@ -521,8 +520,9 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
//Update the id of the last toot retrieved
MainActivity.lastHomeId = status.getId();
statuses.add(0, status);
if (!status.getAccount().getId().equals(userId))
if (!status.getAccount().getId().equals(userId)) {
MainActivity.countNewStatus++;
}
try {
((MainActivity) context).updateHomeCounter();
}catch (Exception ignored){}