Commit e01c0684 authored by Nihar Thakkar's avatar Nihar Thakkar
Browse files

Retain toolbar shadow across orientation changes

parent 83fc98a8
......@@ -58,8 +58,21 @@ class ApplicationActivity : AppCompatActivity(), ApplicationStateListener,
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setDisplayShowTitleEnabled(false)
initialiseDimensions()
val applicationPackageName: String? = intent.getStringExtra(APPLICATION_PACKAGE_NAME_KEY)
if (!applicationPackageName.isNullOrEmpty()) {
this.applicationPackageName = applicationPackageName!!
applicationManagerServiceConnection.bindService(this)
}
}
private fun initialiseElevation() {
if (scroll_view.scrollY == 0) {
toolbar.elevation = 0f
} else {
toolbar.elevation = defaultElevation
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
scroll_view.setOnScrollChangeListener { view, ia, ib, ic, id ->
......@@ -70,14 +83,6 @@ class ApplicationActivity : AppCompatActivity(), ApplicationStateListener,
}
}
}
initialiseDimensions()
val applicationPackageName: String? = intent.getStringExtra(APPLICATION_PACKAGE_NAME_KEY)
if (!applicationPackageName.isNullOrEmpty()) {
this.applicationPackageName = applicationPackageName!!
applicationManagerServiceConnection.bindService(this)
}
}
override fun onServiceBind(applicationManager: ApplicationManager) {
......@@ -147,6 +152,8 @@ class ApplicationActivity : AppCompatActivity(), ApplicationStateListener,
}
private fun onApplicationInfoLoaded() {
initialiseElevation()
val basicData = application.basicData!!
val fullData = application.fullData!!
......
......@@ -12,7 +12,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:elevation="@dimen/default_elevation"
android:elevation="0dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:layout_constraintTop_toTopOf="parent"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment