-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to change theme via overflow menu
- Loading branch information
Showing
7 changed files
with
33 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
app/src/main/java/com/edwnmrtnz/trendingrepo/core/domain/ReloadTrendingRepoUseCase.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/edwnmrtnz/trendingrepo/ui/ThemeChanger.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.edwnmrtnz.trendingrepo.ui | ||
|
||
import androidx.appcompat.app.AppCompatDelegate | ||
|
||
object ThemeChanger { | ||
private var isNight = false | ||
|
||
fun set() { | ||
isNight = false | ||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) | ||
} | ||
|
||
fun change() { | ||
isNight = !isNight | ||
AppCompatDelegate.setDefaultNightMode( | ||
if (isNight) { | ||
AppCompatDelegate.MODE_NIGHT_YES | ||
} else { | ||
AppCompatDelegate.MODE_NIGHT_NO | ||
} | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
<resources> | ||
<string name="app_name">TrendyRepo</string> | ||
<string name="action_settings">Settings</string> | ||
<string name="toolbar_force_refresh">Refresh</string> | ||
<string name="action_retry">RETRY</string> | ||
<string name="title_detault_error">Something went wrong…</string> | ||
<string name="title_default_error">Something went wrong…</string> | ||
<string name="subtitle_default_error">An alien is probably blocking your signal</string> | ||
<string name="subtitle_error_no_trending">Seems likes there\'s no trending repositories as of the moment</string> | ||
|
||
<string name="toolbar_change_theme">Change Theme</string> | ||
</resources> |
53 changes: 0 additions & 53 deletions
53
...est/java/com/edwnmrtnz/trendingrepo/core/domain/ReloadTrendingTrendingReposUseCaseTest.kt
This file was deleted.
Oops, something went wrong.