color the selected element in the NavigationView too
This commit is contained in:
parent
5f2b3aa496
commit
3e909ab68f
|
@ -26,7 +26,6 @@ import android.app.PendingIntent
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.IntentFilter
|
import android.content.IntentFilter
|
||||||
import android.graphics.Color
|
|
||||||
import android.nfc.NfcAdapter
|
import android.nfc.NfcAdapter
|
||||||
import android.nfc.NfcManager
|
import android.nfc.NfcManager
|
||||||
import android.nfc.tech.NfcA
|
import android.nfc.tech.NfcA
|
||||||
|
@ -39,6 +38,7 @@ import androidx.core.view.GravityCompat
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentTransaction
|
import androidx.fragment.app.FragmentTransaction
|
||||||
import com.afollestad.aesthetic.Aesthetic
|
import com.afollestad.aesthetic.Aesthetic
|
||||||
|
import com.afollestad.aesthetic.NavigationViewMode
|
||||||
import com.google.android.material.navigation.NavigationView
|
import com.google.android.material.navigation.NavigationView
|
||||||
import kotlinx.android.synthetic.main.activity_main.*
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
import kotlinx.android.synthetic.main.app_bar_main.*
|
import kotlinx.android.synthetic.main.app_bar_main.*
|
||||||
|
@ -50,7 +50,6 @@ import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.
|
||||||
import org.mosad.seil0.projectlaogai.fragments.*
|
import org.mosad.seil0.projectlaogai.fragments.*
|
||||||
import kotlin.system.measureTimeMillis
|
import kotlin.system.measureTimeMillis
|
||||||
|
|
||||||
|
|
||||||
// TODO save the current fragment to show it when the app is restarted
|
// TODO save the current fragment to show it when the app is restarted
|
||||||
class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
|
class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
|
||||||
|
@ -176,21 +175,20 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
|
||||||
// this is executed on the first app start, use this to show tutorial etc.
|
// this is executed on the first app start, use this to show tutorial etc.
|
||||||
Aesthetic.config {
|
Aesthetic.config {
|
||||||
activityTheme(R.style.AppTheme_Light)
|
activityTheme(R.style.AppTheme_Light)
|
||||||
colorPrimary(Color.BLACK)
|
|
||||||
colorPrimaryDark(Color.BLACK)
|
|
||||||
colorAccent(Color.parseColor("#3f51b5"))
|
|
||||||
apply()
|
apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsFragment().selectCourse(this)
|
SettingsFragment().selectCourse(this) // FIXME this is not working
|
||||||
} else {
|
|
||||||
Aesthetic.config {
|
|
||||||
colorPrimary(cColorPrimary)
|
|
||||||
colorPrimaryDark(cColorPrimary)
|
|
||||||
colorAccent(cColorAccent)
|
|
||||||
apply()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Aesthetic.config {
|
||||||
|
colorPrimary(cColorPrimary)
|
||||||
|
colorPrimaryDark(cColorPrimary)
|
||||||
|
colorAccent(cColorAccent)
|
||||||
|
navigationViewMode(NavigationViewMode.SELECTED_ACCENT)
|
||||||
|
apply()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initForegroundDispatch() {
|
private fun initForegroundDispatch() {
|
||||||
|
|
Loading…
Reference in New Issue