Add transition to search view
This commit is contained in:
@@ -21,6 +21,7 @@ import androidx.fragment.app.FragmentTransaction
|
||||
import androidx.fragment.app.commit
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.swiperefreshlayout.widget.CircularProgressDrawable
|
||||
import androidx.transition.TransitionManager
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.navigation.NavigationView
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
@@ -344,6 +345,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(),
|
||||
private fun onSearchOpened() {
|
||||
binding.drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED)
|
||||
drawerToggle.isDrawerIndicatorEnabled = false
|
||||
TransitionManager.beginDelayedTransition(binding.appbar)
|
||||
// Avoiding shadows on the sides if the color is transparent, so we make the AppBarLayout white/grey/black
|
||||
if (isDarkAmoledTheme()) {
|
||||
binding.toolbar.setBackgroundColor(Color.BLACK)
|
||||
@@ -368,6 +370,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(),
|
||||
if (isDarkAmoledTheme()) {
|
||||
binding.toolbar.setBackgroundColor(ContextCompat.getColor(this, R.color.color_background))
|
||||
}
|
||||
TransitionManager.beginDelayedTransition(binding.appbar)
|
||||
// Returning transparent color
|
||||
binding.appbar.setBackgroundColor(Color.TRANSPARENT)
|
||||
binding.appbar.elevation = 0f
|
||||
|
||||
@@ -6,7 +6,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.0.2'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
Reference in New Issue
Block a user