mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Fix EditHabitDialog theme
This commit is contained in:
@@ -60,4 +60,11 @@ class AndroidThemeSwitcher
|
||||
activity.window.navigationBarColor =
|
||||
ContextCompat.getColor(activity, R.color.black)
|
||||
}
|
||||
|
||||
fun getDialogTheme(): Int {
|
||||
return when {
|
||||
isNightMode -> R.style.DarkDialogWithTitle
|
||||
else -> R.style.DialogWithTitle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,5 +51,5 @@ interface HabitsActivityComponent {
|
||||
val listHabitsScreen: ListHabitsScreen
|
||||
val listHabitsSelectionMenu: ListHabitsSelectionMenu
|
||||
val showHabitScreen: ShowHabitScreen
|
||||
val themeSwitcher: ThemeSwitcher
|
||||
val themeSwitcher: AndroidThemeSwitcher
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ import org.isoron.uhabits.core.preferences.*;
|
||||
import butterknife.*;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static org.isoron.uhabits.core.ui.ThemeSwitcher.THEME_LIGHT;
|
||||
|
||||
public class EditHabitDialog extends AppCompatDialogFragment
|
||||
{
|
||||
@@ -78,13 +77,8 @@ public class EditHabitDialog extends AppCompatDialogFragment
|
||||
@Override
|
||||
public int getTheme()
|
||||
{
|
||||
HabitsApplicationComponent component =
|
||||
((HabitsApplication) getContext().getApplicationContext()).getComponent();
|
||||
|
||||
if(component.getPreferences().getTheme() == THEME_LIGHT)
|
||||
return R.style.DialogWithTitle;
|
||||
else
|
||||
return R.style.DarkDialogWithTitle;
|
||||
HabitsActivity activity = (HabitsActivity) getActivity();
|
||||
return activity.getComponent().getThemeSwitcher().getDialogTheme();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user