only reload timeline on pref change when necessary
This commit is contained in:
parent
8c425c44e5
commit
51e2ccc5a5
@ -98,6 +98,10 @@ public final class TimelineAdapter extends RecyclerView.Adapter {
|
|||||||
mediaPreviewEnabled = enabled;
|
mediaPreviewEnabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getMediaPreviewEnabled() {
|
||||||
|
return mediaPreviewEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getItemId(int position) {
|
public long getItemId(int position) {
|
||||||
return dataSource.getItemAt(position).getViewDataId();
|
return dataSource.getItemAt(position).getViewDataId();
|
||||||
|
@ -610,8 +610,11 @@ public class TimelineFragment extends SFragment implements
|
|||||||
}
|
}
|
||||||
case "mediaPreviewEnabled": {
|
case "mediaPreviewEnabled": {
|
||||||
boolean enabled = sharedPreferences.getBoolean("mediaPreviewEnabled", true);
|
boolean enabled = sharedPreferences.getBoolean("mediaPreviewEnabled", true);
|
||||||
adapter.setMediaPreviewEnabled(enabled);
|
boolean oldMediaPreviewEnabled = adapter.getMediaPreviewEnabled();
|
||||||
fullyRefresh();
|
if(enabled != oldMediaPreviewEnabled) {
|
||||||
|
adapter.setMediaPreviewEnabled(enabled);
|
||||||
|
fullyRefresh();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "tabFilterHomeReplies": {
|
case "tabFilterHomeReplies": {
|
||||||
|
Loading…
Reference in New Issue
Block a user