Add elevation effect for buttom action bar
Before:
https://screenshot.googleplex.com/6AKO6cTzebj.png
https://screenshot.googleplex.com/c9mkDWSNiu7.png
After:
https://screenshot.googleplex.com/rfBrN5hhApO.png
https://screenshot.googleplex.com/Sq2Z2WMhFHV.png
Video:
https://drive.google.com/file/d/1ieZqCqWz6OnLrxKAbC2It6BCakq_-34F/view?usp=sharing
Test: Manually
Bug: 155353471
Change-Id: I6a7ad9d00e5b82acfbb4f601a8b550cec9c274de
diff --git a/res/layout/bottom_actions_layout.xml b/res/layout/bottom_actions_layout.xml
index 31ad2cc..e499f13 100644
--- a/res/layout/bottom_actions_layout.xml
+++ b/res/layout/bottom_actions_layout.xml
@@ -13,17 +13,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout
+<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical">
+ android:clipChildren="false">
<!-- Bottom Sheet -->
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:layout_above="@id/action_tabs"
+ android:elevation="@dimen/bottom_action_bar_elevation">
<!-- Bottom sheet view should be a child view of CoordinatorLayout -->
<FrameLayout
android:id="@+id/action_bottom_sheet"
@@ -33,20 +35,22 @@
android:theme="@style/WallpaperPicker.BottomPaneStyle"
android:clickable="true"
android:elevation="@dimen/bottom_action_bar_elevation"
- android:layout_marginTop="@dimen/bottom_action_bar_bottom_sheet_margin_top"
app:behavior_peekHeight="@dimen/preview_attribution_pane_collapsed_height"
- app:layout_behavior="com.android.wallpaper.widget.BottomActionBar$QueueStateBottomSheetBehavior"/>
+ app:layout_behavior="com.android.wallpaper.widget.BottomActionBar$QueueStateBottomSheetBehavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<!-- Bottom Tabs -->
<androidx.constraintlayout.widget.ConstraintLayout
+ android:id="@+id/action_tabs"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_navbar_height"
android:paddingTop="@dimen/bottom_action_bar_padding_top"
android:paddingHorizontal="@dimen/bottom_action_bar_padding_horizontal"
android:clickable="true"
+ android:elevation="@dimen/bottom_action_bar_elevation"
android:background="@color/bottom_bar_background_color"
android:theme="@style/BottomActionItemStyle"
+ android:layout_alignParentBottom="true"
android:layoutDirection="locale">
<ImageView
@@ -172,4 +176,4 @@
app:layout_constraintStart_toEndOf="@id/action_progress" />
</androidx.constraintlayout.widget.ConstraintLayout>
-</LinearLayout>
+</RelativeLayout>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 23c836c..174d08c 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -222,7 +222,6 @@
<dimen name="bottom_action_button_size">48dp</dimen>
<dimen name="bottom_action_button_padding">12dp</dimen>
<dimen name="bottom_action_icon_size">24dp</dimen>
- <dimen name="bottom_action_bar_bottom_sheet_margin_top">2dp</dimen>
<dimen name="wallpaper_info_pane_top_padding">20dp</dimen>
<dimen name="wallpaper_info_pane_bottom_padding">24dp</dimen>