Fix a bug with cache and new toots order
This commit is contained in:
parent
5fd42ea30a
commit
6f8822db7c
|
@ -27,7 +27,6 @@ import android.support.v7.app.ActionBar;
|
|||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
@ -110,7 +109,6 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
|||
}
|
||||
if( detailsStatus == null || detailsStatus.getId() == null)
|
||||
finish();
|
||||
Log.v(Helper.TAG,"detailsStatus: " + detailsStatus);
|
||||
|
||||
if( getSupportActionBar() != null)
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
|
|
@ -42,7 +42,6 @@ import android.text.SpannableString;
|
|||
import android.text.Spanned;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
|
@ -705,7 +704,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
b.putParcelable("status", status);
|
||||
else
|
||||
b.putParcelable("status", status.getReblog());
|
||||
Log.v(Helper.TAG,"status.getReblog(): " + status.getReblog());
|
||||
intent.putExtras(b);
|
||||
if (type == RetrieveFeedsAsyncTask.Type.CONTEXT)
|
||||
((Activity) context).finish();
|
||||
|
|
|
@ -441,13 +441,12 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
if (type == RetrieveFeedsAsyncTask.Type.HOME) {
|
||||
String bookmark = null;
|
||||
//Toots are older than the bookmark -> no special treatment with them
|
||||
if( initialBookMark == null || Long.parseLong(statuses.get(0).getId())+1 < Long.parseLong(initialBookMark)){
|
||||
if( initialBookMark == null || Long.parseLong(statuses.get(0).getId()) <= Long.parseLong(initialBookMark)){
|
||||
this.statuses.addAll(statuses);
|
||||
statusListAdapter.notifyItemRangeInserted(previousPosition, statuses.size());
|
||||
}else { //Toots are younger than the bookmark
|
||||
String currentMaxId = sharedpreferences.getString(Helper.LAST_HOMETIMELINE_MAX_ID + userId + instance, null);
|
||||
int position = 0;
|
||||
int positionNotFiltered = 0;
|
||||
while (position < this.statuses.size() && Long.parseLong(statuses.get(0).getId()) < Long.parseLong(this.statuses.get(position).getId())) {
|
||||
position++;
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ public class SettingsOptimizationFragment extends Fragment {
|
|||
editor.apply();
|
||||
break;
|
||||
}
|
||||
Helper.changeBatteryProfile(context);
|
||||
if( position < 2 ){
|
||||
try {
|
||||
((MainActivity) context).startSreaming();
|
||||
|
|
Loading…
Reference in New Issue