mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-11 02:18:33 +00:00
Re-enable view prefetching.
This commit is contained in:
parent
eafccc5721
commit
4ea8bac10d
@ -168,6 +168,8 @@ public class ConversationFragment extends LoggingFragment {
|
|||||||
FrameLayout parent = new FrameLayout(context);
|
FrameLayout parent = new FrameLayout(context);
|
||||||
parent.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
|
parent.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
|
||||||
|
|
||||||
|
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_received_text_only, parent, 15);
|
||||||
|
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_sent_text_only, parent, 15);
|
||||||
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_received_multimedia, parent, 10);
|
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_received_multimedia, parent, 10);
|
||||||
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_sent_multimedia, parent, 10);
|
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_sent_multimedia, parent, 10);
|
||||||
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_update, parent, 5);
|
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_update, parent, 5);
|
||||||
|
@ -88,6 +88,7 @@ import org.thoughtcrime.securesms.components.reminder.ServiceOutageReminder;
|
|||||||
import org.thoughtcrime.securesms.components.reminder.ShareReminder;
|
import org.thoughtcrime.securesms.components.reminder.ShareReminder;
|
||||||
import org.thoughtcrime.securesms.components.reminder.SystemSmsImportReminder;
|
import org.thoughtcrime.securesms.components.reminder.SystemSmsImportReminder;
|
||||||
import org.thoughtcrime.securesms.components.reminder.UnauthorizedReminder;
|
import org.thoughtcrime.securesms.components.reminder.UnauthorizedReminder;
|
||||||
|
import org.thoughtcrime.securesms.conversation.ConversationFragment;
|
||||||
import org.thoughtcrime.securesms.conversationlist.model.Conversation;
|
import org.thoughtcrime.securesms.conversationlist.model.Conversation;
|
||||||
import org.thoughtcrime.securesms.conversationlist.model.MessageResult;
|
import org.thoughtcrime.securesms.conversationlist.model.MessageResult;
|
||||||
import org.thoughtcrime.securesms.conversationlist.model.SearchResult;
|
import org.thoughtcrime.securesms.conversationlist.model.SearchResult;
|
||||||
@ -266,8 +267,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
// TODO [greyson] Re-enable when we figure out how to invalidate the cache after a system theme change
|
ConversationFragment.prepare(requireContext());
|
||||||
// ConversationFragment.prepare(requireContext());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,11 +17,21 @@ public class DynamicTheme {
|
|||||||
public static final String LIGHT = "light";
|
public static final String LIGHT = "light";
|
||||||
public static final String SYSTEM = "system";
|
public static final String SYSTEM = "system";
|
||||||
|
|
||||||
|
private static boolean isDarkTheme;
|
||||||
|
|
||||||
private int currentTheme;
|
private int currentTheme;
|
||||||
|
|
||||||
public void onCreate(Activity activity) {
|
public void onCreate(Activity activity) {
|
||||||
|
boolean wasDarkTheme = isDarkTheme;
|
||||||
|
|
||||||
currentTheme = getSelectedTheme(activity);
|
currentTheme = getSelectedTheme(activity);
|
||||||
|
isDarkTheme = isDarkTheme(activity);
|
||||||
|
|
||||||
activity.setTheme(currentTheme);
|
activity.setTheme(currentTheme);
|
||||||
|
|
||||||
|
if (isDarkTheme != wasDarkTheme) {
|
||||||
|
CachedInflater.from(activity).clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onResume(Activity activity) {
|
public void onResume(Activity activity) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user