mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
@@ -24,6 +24,7 @@ import android.os.*;
|
||||
import org.isoron.uhabits.*;
|
||||
import org.isoron.uhabits.activities.*;
|
||||
import org.isoron.uhabits.activities.habits.list.model.*;
|
||||
import org.isoron.uhabits.preferences.*;
|
||||
|
||||
/**
|
||||
* Activity that allows the user to see and modify the list of habits.
|
||||
@@ -38,6 +39,15 @@ public class ListHabitsActivity extends BaseActivity
|
||||
|
||||
private ListHabitsComponent component;
|
||||
|
||||
private boolean pureBlack;
|
||||
|
||||
private Preferences prefs;
|
||||
|
||||
public ListHabitsComponent getListHabitsComponent()
|
||||
{
|
||||
return component;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
@@ -59,6 +69,9 @@ public class ListHabitsActivity extends BaseActivity
|
||||
rootView = component.getRootView();
|
||||
screen = component.getScreen();
|
||||
|
||||
prefs = app.getComponent().getPreferences();
|
||||
pureBlack = prefs.isPureBlackEnabled();
|
||||
|
||||
screen.setMenu(menu);
|
||||
screen.setController(controller);
|
||||
screen.setSelectionMenu(selectionMenu);
|
||||
@@ -68,11 +81,6 @@ public class ListHabitsActivity extends BaseActivity
|
||||
controller.onStartup();
|
||||
}
|
||||
|
||||
public ListHabitsComponent getListHabitsComponent()
|
||||
{
|
||||
return component;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause()
|
||||
{
|
||||
@@ -87,6 +95,13 @@ public class ListHabitsActivity extends BaseActivity
|
||||
adapter.refresh();
|
||||
screen.onAttached();
|
||||
rootView.postInvalidate();
|
||||
|
||||
if (prefs.getTheme() == ThemeSwitcher.THEME_DARK &&
|
||||
prefs.isPureBlackEnabled() != pureBlack)
|
||||
{
|
||||
restartWithFade();
|
||||
}
|
||||
|
||||
super.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user