1
0
Fork 0

For #1072: Fixes nits

master
Sawyer Blatz 2019-03-21 10:44:50 -07:00 committed by Colin Lee
parent f4648525f1
commit da35581c54
2 changed files with 19 additions and 63 deletions

View File

@ -62,18 +62,19 @@ class QuickActionSheet @JvmOverloads constructor(
val peakHeightMultiplier = if (duration == demoBounceAnimationLength)
demoBounceAnimationPeekHeightMultiplier else bounceAnimationPeekHeightMultiplier
val valueAnimator = ValueAnimator.ofFloat(normalPeekHeight.toFloat(),
normalPeekHeight * peakHeightMultiplier)
ValueAnimator.ofFloat(normalPeekHeight.toFloat(),
normalPeekHeight * peakHeightMultiplier)?.let {
valueAnimator.addUpdateListener {
quickActionSheetBehavior.peekHeight = (it.animatedValue as Float).toInt()
it.addUpdateListener {
quickActionSheetBehavior.peekHeight = (it.animatedValue as Float).toInt()
}
it.repeatMode = ValueAnimator.REVERSE
it.repeatCount = 1
it.interpolator = FastOutSlowInInterpolator()
it.duration = duration
it.start()
}
valueAnimator.repeatMode = ValueAnimator.REVERSE
valueAnimator.repeatCount = 1
valueAnimator.interpolator = FastOutSlowInInterpolator()
valueAnimator.duration = duration
valueAnimator.start()
}
companion object {

View File

@ -20,59 +20,6 @@
android:background="?attr/quickActionPullTabColor"
android:src="@drawable/ic_drawer_pull_tab"/>
<LinearLayout
android:orientation="horizontal"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_marginBottom="3dp"
android:layout_height="wrap_content"
android:background="?attr/toolbarColor">
<androidx.appcompat.widget.AppCompatImageButton
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/quick_action_share"
android:src="@drawable/quick_action_icon_share"
android:background="?attr/toolbarColor"/>
<androidx.appcompat.widget.AppCompatImageButton
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/quick_action_download"
android:src="@drawable/library_icon_downloads_circle_background"
android:background="?attr/toolbarColor"/>
<androidx.appcompat.widget.AppCompatImageButton
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/quick_action_favorite"
android:src="@drawable/library_icon_favorites_circle_background"
android:background="?attr/toolbarColor"/>
<androidx.appcompat.widget.AppCompatImageButton
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/quick_action_read"
android:src="@drawable/quick_action_icon_read"
android:background="?attr/toolbarColor"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_gravity="bottom"
@ -84,6 +31,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
android:drawableTop="@drawable/quick_action_icon_share"
android:drawablePadding="5dp"
android:textAlignment="center"
android:textSize="12sp"
android:textColor="?attr/toolbarTextColor"
@ -93,6 +42,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
android:drawableTop="@drawable/library_icon_downloads_circle_background"
android:drawablePadding="5dp"
android:textAlignment="center"
android:textSize="12sp"
android:textColor="?attr/toolbarTextColor"
@ -102,6 +53,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
android:drawableTop="@drawable/library_icon_favorites_circle_background"
android:drawablePadding="5dp"
android:textAlignment="center"
android:textSize="12sp"
android:textColor="?attr/toolbarTextColor"
@ -111,6 +64,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
android:drawableTop="@drawable/quick_action_icon_read"
android:drawablePadding="5dp"
android:textAlignment="center"
android:textSize="12sp"
android:textColor="?attr/toolbarTextColor"