이번에 어플리케이션을 플레이스토어에 등록하면서 알게된 내용입니다.
플레이스토어 생각보다 만만하지 않은 곳이였습니다...
다크모드까지 확인하니 출시를 생각하시는 개발자는 다크모드로도 테스트하면 좋을 것 같습니다.
인터넷에 널리 있는 방법으로 theme을 수정해서 다크모드를 제한하는 방법입니다.
res -> value -> theme.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Portfolian" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Primary brand color. -->
<item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryVariant">@color/base</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<style name="Theme.Portfolian" parent="Theme.MaterialComponents.Light.NoActionBar">
이 부분의 부모 테마를 Light로 만들어주면 됩니다.
근데 나는 왜!!!! 적용이 안되는거야!!!!!!!!
그래서 찾은 두번째 방법입니다.
이것 또한 정말 간단한 방법입니다.
제일 처음 실행되는 activity에 코드 한 줄만 추가해주면 해결됩니다.
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
주의할 점은 한번만 실행해도 전체적으로 다크모드가 해제된다는 것입니다.
그래서 onCreate()
함수 내에 한번만 선언해주면 다크모드 해제 완료~!!