diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/activity/NavigationActivity.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/activity/NavigationActivity.kt index d1ba3153..57c7cb69 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/activity/NavigationActivity.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/activity/NavigationActivity.kt @@ -73,8 +73,6 @@ class NavigationActivity : AppCompatActivity() { private var host: NavHostFragment? = null private var selectServerButton: MaterialButton? = null private var headerBackgroundImage: ImageView? = null - private var ultrasonicLogoImage: ImageView? = null - private var ultrasonicNameText: TextView? = null private lateinit var appBarConfiguration: AppBarConfiguration private lateinit var nowPlayingEventListener: NowPlayingEventListener @@ -222,10 +220,7 @@ class NavigationActivity : AppCompatActivity() { ContextCompat.getDrawable(this, R.drawable.ic_menu_select_server_dark) selectServerButton?.iconTint = ColorStateList.valueOf(foregroundColor) - ultrasonicLogoImage?.imageTintList = ColorStateList.valueOf(foregroundColor) - selectServerButton?.setTextColor(foregroundColor) - ultrasonicNameText?.setTextColor(foregroundColor) headerBackgroundImage?.setBackgroundColor(backgroundColor) } @@ -289,10 +284,6 @@ class NavigationActivity : AppCompatActivity() { } headerBackgroundImage = navigationView?.getHeaderView(0)?.findViewById(R.id.img_header_bg) - ultrasonicLogoImage = - navigationView?.getHeaderView(0)?.findViewById(R.id.img_profile) - ultrasonicNameText = - navigationView?.getHeaderView(0)?.findViewById(R.id.name) } private fun setupActionBar(navController: NavController, appBarConfig: AppBarConfiguration) { diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/ServerColor.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/ServerColor.kt index aa48f383..28ab8f29 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/ServerColor.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/ServerColor.kt @@ -12,7 +12,7 @@ import androidx.core.content.ContextCompat import androidx.core.graphics.ColorUtils import org.moire.ultrasonic.R -private const val LUMINANCE_LIMIT = 0.25 +private const val LUMINANCE_LIMIT = 0.4 /** * Contains functions for computing server display colors diff --git a/ultrasonic/src/main/res/drawable/ic_header_bg.xml b/ultrasonic/src/main/res/drawable/ic_header_bg.xml new file mode 100644 index 00000000..145d5b9c --- /dev/null +++ b/ultrasonic/src/main/res/drawable/ic_header_bg.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/ultrasonic/src/main/res/layout/navigation_header.xml b/ultrasonic/src/main/res/layout/navigation_header.xml index 37401c11..87d27efd 100644 --- a/ultrasonic/src/main/res/layout/navigation_header.xml +++ b/ultrasonic/src/main/res/layout/navigation_header.xml @@ -14,67 +14,32 @@ a:layout_width="match_parent" a:layout_height="0dp" a:scaleType="fitXY" + a:src="@drawable/ic_header_bg" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" a:importantForAccessibility="no" /> - - - -