Unverified Commit b7827d3c authored by Max Lv's avatar Max Lv Committed by GitHub

Merge pull request #2019 from shadowsocks/revert-1990-fix-bab

Revert "Fix bottom app bar"
parents 286ff227 9559afe5
......@@ -39,6 +39,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.content.ContextCompat
import androidx.core.net.toUri
import androidx.core.view.GravityCompat
import androidx.core.view.updateLayoutParams
import androidx.drawerlayout.widget.DrawerLayout
import androidx.preference.PreferenceDataStore
import com.crashlytics.android.Crashlytics
......@@ -56,6 +57,7 @@ import com.github.shadowsocks.widget.ServiceButton
import com.github.shadowsocks.widget.StatsBar
import com.google.android.material.navigation.NavigationView
import com.google.android.material.snackbar.Snackbar
import kotlin.math.roundToInt
class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, OnPreferenceDataStoreChangeListener,
NavigationView.OnNavigationItemSelectedListener {
......@@ -74,7 +76,9 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, OnPre
val snackbar by lazy { findViewById<CoordinatorLayout>(R.id.snackbar) }
fun snackbar(text: CharSequence = "") = Snackbar.make(snackbar, text, Snackbar.LENGTH_LONG).apply {
view.translationY += fab.top + fab.translationY - snackbar.measuredHeight
view.updateLayoutParams<CoordinatorLayout.LayoutParams> {
bottomMargin += snackbar.measuredHeight - fab.top - fab.translationY.roundToInt()
}
}
private val customTabsIntent by lazy {
......
......@@ -24,8 +24,8 @@ android {
}
dependencies {
api "androidx.core:core-ktx:$androidxVersion"
api "com.google.android.material:material:1.1.0-alpha01"
api "androidx.core:core-ktx:1.0.1"
api "com.google.android.material:material:1.0.0"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test:runner:$androidTestVersion"
......
Markdown is supported
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