Add new Theme "Use System Design" + fixes to night mode (#1069)

* Add theme system

A theme which follows system design.
See: https://www.xda-developers.com/samsung-galaxy-s9-update-night-mode-schedule/

* update

to be in line with https://github.com/tuskyapp/Tusky/pull/1060/files

* Update ThemeUtils.java

* update

* Cleanup

* Update Deps

* Cleanup

* Update PreferencesActivity.kt

* Workaround to make MODE_NIGHT_FOLLOW_SYSTEM work

* Update ThemeUtils.java

* Use ThemeUtils.THEME_SYSTEM

* Update SplashActivity.kt

* Update strings.xml

* Update Deps

* Update build.gradle

* Update build.gradle

* fix tests
This commit is contained in:
Bernd 2019-03-07 21:33:29 +01:00 committed by Konrad Pozniak
commit 507ffb1b41
9 changed files with 45 additions and 41 deletions

View file

@ -26,6 +26,7 @@ import com.keylesspalace.tusky.entity.Account
import com.keylesspalace.tusky.entity.Emoji
import com.keylesspalace.tusky.entity.Instance
import com.keylesspalace.tusky.network.MastodonApi
import com.keylesspalace.tusky.util.ThemeUtils
import okhttp3.Request
import okhttp3.ResponseBody
import org.junit.Assert
@ -44,6 +45,7 @@ import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
/**
* Created by charlag on 3/7/18.
*/
@ -55,6 +57,7 @@ class ComposeActivityTest {
lateinit var activity: ComposeActivity
lateinit var accountManagerMock: AccountManager
lateinit var apiMock: MastodonApi
lateinit var themeUtilsMock: ThemeUtils
val account = AccountEntity(
id = 1,
@ -135,9 +138,12 @@ class ComposeActivityTest {
val dbMock = mock(AppDatabase::class.java)
`when`(dbMock.instanceDao()).thenReturn(instanceDaoMock)
themeUtilsMock = Mockito.mock(ThemeUtils::class.java)
activity.mastodonApi = apiMock
activity.accountManager = accountManagerMock
activity.database = dbMock
activity.themeUtils = themeUtilsMock
`when`(accountManagerMock.activeAccount).thenReturn(account)