Merge "Update CachingWidgetPreviewLoaderTest members to be non-static. These classes are stubbed by roboelectric so they cannot be static" into sc-dev
diff --git a/go/quickstep/res/drawable/arrow_toast_rounded_background.xml b/go/quickstep/res/drawable/arrow_toast_rounded_background.xml
new file mode 100644
index 0000000..9c815fd
--- /dev/null
+++ b/go/quickstep/res/drawable/arrow_toast_rounded_background.xml
@@ -0,0 +1,19 @@
+<!--
+    Copyright (C) 2021 The Android Open Source Project
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+    <solid android:color="@color/arrow_tip_view_bg" />
+    <corners android:radius="@dimen/tooltip_corner_radius" />
+</shape>
diff --git a/go/quickstep/res/layout/niu_actions_confirmation_dialog.xml b/go/quickstep/res/layout/niu_actions_confirmation_dialog.xml
index db1531a..5dbcca5 100644
--- a/go/quickstep/res/layout/niu_actions_confirmation_dialog.xml
+++ b/go/quickstep/res/layout/niu_actions_confirmation_dialog.xml
@@ -76,12 +76,12 @@
             <Button
                 style="@style/ModalDialogButton"
                 android:id="@+id/niu_actions_confirmation_reject"
-                android:text="@string/niu_actions_confirmation_no"/>
+                android:text="@string/dialog_cancel"/>
 
             <Button
                 style="@style/ModalDialogButton"
                 android:id="@+id/niu_actions_confirmation_accept"
-                android:text="@string/niu_actions_confirmation_yes"/>
+                android:text="@string/dialog_acknowledge"/>
         </LinearLayout>
 
     </LinearLayout>
diff --git a/go/quickstep/res/values/colors.xml b/go/quickstep/res/values/colors.xml
index 8034be2..4ce7669 100644
--- a/go/quickstep/res/values/colors.xml
+++ b/go/quickstep/res/values/colors.xml
@@ -23,4 +23,8 @@
     <!-- Modal Dialogs -->
     <color name="go_modal_dialog_background">#FFFFFF</color>
     <color name="go_modal_dialog_background_dark">#424242</color>
+
+    <!-- Tooltip Color -->
+    <color name="arrow_tip_view_bg">#1A73E8</color>
+    <color name="arrow_tip_view_content">#FFFFFF</color>
 </resources>
diff --git a/go/quickstep/res/values/dimens.xml b/go/quickstep/res/values/dimens.xml
index 0a7ac45..c14df50 100644
--- a/go/quickstep/res/values/dimens.xml
+++ b/go/quickstep/res/values/dimens.xml
@@ -36,4 +36,8 @@
     <dimen name="modal_dialog_vertical_spacer">12dp</dimen>
     <dimen name="modal_dialog_corner_radius">8dp</dimen>
     <dimen name="confirmation_dialog_text_height">216dp</dimen>
+
+    <!-- Tooltip -->
+    <dimen name="tooltip_corner_radius">8dp</dimen>
+    <dimen name="tooltip_top_margin">3dp</dimen>
 </resources>
diff --git a/go/quickstep/res/values/strings.xml b/go/quickstep/res/values/strings.xml
index 6e9e63e..8429f6a 100644
--- a/go/quickstep/res/values/strings.xml
+++ b/go/quickstep/res/values/strings.xml
@@ -11,13 +11,34 @@
     <string name="action_translate">Translate</string>
     <!-- Label for a button that triggers Search on a screenshot of the current app. [CHAR_LIMIT=40] -->
     <string name="action_search">Lens</string>
+
+    <!-- ******* Dialogs ******* -->
+    <!-- Label for a button that acknowledges the contents of the dialog. [CHAR_LIMIT=40] -->
+    <string name="dialog_acknowledge">GOT IT</string>
+    <!-- Label for a button that cancels the dialog. [CHAR_LIMIT=40] -->
+    <string name="dialog_cancel">CANCEL</string>
+    <!-- Label for a button that redirects the user to Settings. [CHAR_LIMIT=40] -->
+    <string name="dialog_settings">SETTINGS</string>
+
     <!-- ******* NIU Actions First-Run Confirmation Dialog ******* -->
     <!-- Dialog title -->
     <string name="niu_actions_confirmation_title">Translate or listen to text on screen</string>
     <!-- Dialog content -->
     <string name="niu_actions_confirmation_text">Information such as text on your screen, web addresses, and screenshots may be shared with Google.\n\nTo change what information you share, go to <b>Settings > Apps > Default apps > Digital assistant app</b>.</string>
-    <!-- Label for a button that rejects the feature. [CHAR_LIMIT=40] -->
-    <string name="niu_actions_confirmation_no">CANCEL</string>
-    <!-- Label for a button that accepts the feature. [CHAR_LIMIT=40] -->
-    <string name="niu_actions_confirmation_yes">GOT IT</string>
+
+    <!-- ******* NIU Actions Default Assistant Error Dialogs ******* -->
+    <!-- Assistant not selected: Dialog title -->
+    <string name="assistant_not_selected_title">Choose an assistant to use this feature</string>
+    <!-- Assistant not selected: Dialog content -->
+    <string name="assistant_not_selected_text">To listen to or translate text on your screen, choose a digital assistant app in Settings</string>
+    <!-- Assistant not supported: Dialog title -->
+    <string name="assistant_not_supported_title">Change your assistant to use this feature</string>
+    <!-- Assistant not supported: Dialog content -->
+    <string name="assistant_not_supported_text">To listen to or translate text on your screen, change your digital assistant app in Settings</string>
+
+    <!-- ******* NIU Actions Tooltip ******* -->
+    <!-- Tooltip to highlight and explain the Listen button -->
+    <string name="tooltip_listen">Tap here to listen to text on this screen</string>
+    <!-- Tooltip to highlight and explain the Translate button -->
+    <string name="tooltip_translate">Tap here to translate text on this screen</string>
 </resources>
diff --git a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
index 37f5352..f3c7a02 100644
--- a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
+++ b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java
@@ -16,6 +16,8 @@
 
 package com.android.quickstep;
 
+import static android.view.Surface.ROTATION_0;
+
 import static com.android.quickstep.views.OverviewActionsView.DISABLED_NO_THUMBNAIL;
 import static com.android.quickstep.views.OverviewActionsView.DISABLED_ROTATED;
 
@@ -30,6 +32,7 @@
 import android.graphics.Color;
 import android.graphics.Matrix;
 import android.graphics.drawable.ColorDrawable;
+import android.os.Handler;
 import android.os.SystemClock;
 import android.os.UserManager;
 import android.provider.Settings;
@@ -46,7 +49,8 @@
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.quickstep.util.AssistContentRequester;
-import com.android.quickstep.views.OverviewActionsView;
+import com.android.quickstep.util.RecentsOrientedState;
+import com.android.quickstep.views.GoOverviewActionsView;
 import com.android.quickstep.views.TaskThumbnailView;
 import com.android.systemui.shared.recents.model.Task;
 import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -67,6 +71,9 @@
     private static final String NIU_ACTIONS_CONFIRMED = "launcher_go.niu_actions_confirmed";
     private static final String TAG = "TaskOverlayFactoryGo";
 
+    public static final String LISTEN_TOOL_TIP_SEEN = "launcher.go_listen_tip_seen";
+    public static final String TRANSLATE_TOOL_TIP_SEEN = "launcher.go_translate_tip_seen";
+
     private AssistContentRequester mContentRequester;
 
     public TaskOverlayFactoryGo(Context context) {
@@ -84,7 +91,7 @@
      * Overlay on each task handling Overview Action Buttons.
      * @param <T> The type of View in which the overlay will be placed
      */
-    public static final class TaskOverlayGo<T extends OverviewActionsView> extends TaskOverlay {
+    public static final class TaskOverlayGo<T extends GoOverviewActionsView> extends TaskOverlay {
         private String mNIUPackageName;
         private String mTaskPackageName;
         private String mWebUrl;
@@ -99,6 +106,7 @@
                 AssistContentRequester assistContentRequester) {
             super(taskThumbnailView);
             mFactoryContentRequester = assistContentRequester;
+            mSharedPreferences = Utilities.getPrefs(mApplicationContext);
         }
 
         /**
@@ -134,6 +142,18 @@
 
             int taskId = task.key.id;
             mFactoryContentRequester.requestAssistContent(taskId, this::onAssistContentReceived);
+
+            RecentsOrientedState orientedState =
+                    mThumbnailView.getTaskView().getRecentsView().getPagedViewOrientedState();
+            boolean isInLandscape = orientedState.getDisplayRotation() != ROTATION_0;
+
+            // show tooltips in portrait mode only
+            // TODO: remove If check once b/183714277 is fixed
+            if (!isInLandscape) {
+                new Handler().post(() -> {
+                    showTooltipsIfUnseen();
+                });
+            }
         }
 
         /** Provide Assist Content to the overlay. */
@@ -149,6 +169,12 @@
             mWebUrl = null;
         }
 
+        @Override
+        public void updateOrientationState(RecentsOrientedState state) {
+            super.updateOrientationState(state);
+            ((GoOverviewActionsView) getActionsView()).updateOrientationState(state);
+        }
+
         /**
          * Creates and sends an Intent corresponding to the button that was clicked
          */
@@ -275,6 +301,20 @@
         private void onNiuActionsConfirmationReject(View v) {
             mConfirmationDialog.cancel();
         }
+
+        /**
+         * Checks and Shows the tooltip if they are not seen by user
+         * Order of tooltips are translate and then listen
+         */
+        private void showTooltipsIfUnseen() {
+            if (!mSharedPreferences.getBoolean(TRANSLATE_TOOL_TIP_SEEN, false)) {
+                ((GoOverviewActionsView) getActionsView()).showTranslateToolTip();
+                mSharedPreferences.edit().putBoolean(TRANSLATE_TOOL_TIP_SEEN, true).apply();
+            } else if (!mSharedPreferences.getBoolean(LISTEN_TOOL_TIP_SEEN, false)) {
+                ((GoOverviewActionsView) getActionsView()).showListenToolTip();
+                mSharedPreferences.edit().putBoolean(LISTEN_TOOL_TIP_SEEN, true).apply();
+            }
+        }
     }
 
     /**
diff --git a/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java b/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java
index 9997d16..5b535a2 100644
--- a/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java
@@ -21,14 +21,20 @@
 import android.view.View;
 
 import androidx.annotation.Nullable;
+import androidx.annotation.Px;
 
 import com.android.launcher3.R;
+import com.android.launcher3.views.ArrowTipView;
 import com.android.quickstep.TaskOverlayFactoryGo.OverlayUICallbacksGo;
+import com.android.quickstep.util.RecentsOrientedState;
 
 /**
  * View for showing Go-specific action buttons in Overview
  */
-public final class GoOverviewActionsView extends OverviewActionsView<OverlayUICallbacksGo> {
+public class GoOverviewActionsView extends OverviewActionsView<OverlayUICallbacksGo> {
+
+    private ArrowTipView mArrowTipView;
+
     public GoOverviewActionsView(Context context) {
         this(context, null);
     }
@@ -72,4 +78,46 @@
             mCallbacks.onSearch();
         }
     }
+
+    /**
+     * Shows Tooltip for action icons
+     */
+    private void showToolTip(int viewId, int textResourceId) {
+        int[] location = new int[2];
+        @Px int topMargin = getResources().getDimensionPixelSize(R.dimen.tooltip_top_margin);
+        findViewById(viewId).getLocationOnScreen(location);
+        mArrowTipView = new ArrowTipView(getContext(),  /* isPointingUp= */ false)
+            .showAtLocation(getResources().getString(textResourceId),
+                /* arrowXCoord= */ location[0] + findViewById(viewId).getWidth() / 2,
+                /* yCoord= */ location[1] - topMargin);
+
+        mArrowTipView.bringToFront();
+    }
+
+    /**
+     * Shows Tooltip for listen action icon
+     */
+    public void showListenToolTip() {
+        showToolTip(/* viewId= */ R.id.action_listen,
+                /* textResourceId= */ R.string.tooltip_listen);
+    }
+
+    /**
+     * Shows Tooltip for translate action icon
+     */
+    public void showTranslateToolTip() {
+        showToolTip(/* viewId= */ R.id.action_translate,
+                /* textResourceId= */ R.string.tooltip_translate);
+    }
+
+    /**
+     * Called when device orientation is changed
+     */
+    public void updateOrientationState(RecentsOrientedState orientedState) {
+        // dismiss tooltip
+        boolean canLauncherRotate = orientedState.canRecentsActivityRotate();
+        if (mArrowTipView != null && !canLauncherRotate) {
+            mArrowTipView.close(/* animate= */ false);
+        }
+    }
 }
diff --git a/quickstep/res/layout/task_menu.xml b/quickstep/res/layout/task_menu.xml
index 3a47e99..a5c9445 100644
--- a/quickstep/res/layout/task_menu.xml
+++ b/quickstep/res/layout/task_menu.xml
@@ -40,7 +40,6 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
-        android:divider="@drawable/all_apps_divider"
         android:showDividers="middle" />
 
 </com.android.quickstep.views.TaskMenuView>
\ No newline at end of file
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 1f86d62..6cc64e0 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -25,6 +25,7 @@
     <!--  Task Menu View  -->
     <dimen name="task_menu_corner_radius">22dp</dimen>
     <dimen name="task_menu_item_corner_radius">4dp</dimen>
+    <dimen name="task_menu_spacing">2dp</dimen>
     <dimen name="overview_proactive_row_height">48dp</dimen>
     <dimen name="overview_proactive_row_bottom_margin">16dp</dimen>
 
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index 06a3c70..e75d751 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -267,6 +267,12 @@
             return mThumbnailView.getScaledInsets();
         }
 
+        /**
+         * Called when the device rotated.
+         */
+        public void updateOrientationState(RecentsOrientedState state) {
+        }
+
         protected void showBlockedByPolicyMessage() {
             Toast.makeText(
                     mThumbnailView.getContext(),
diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
index bfd9008..c515bdf 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -65,7 +65,7 @@
  * This class has initial default state assuming the device and foreground app have
  * no ({@link Surface#ROTATION_0} rotation.
  */
-public final class RecentsOrientedState implements
+public class RecentsOrientedState implements
         SharedPreferences.OnSharedPreferenceChangeListener {
 
     private static final String TAG = "RecentsOrientedState";
diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
index 2c6533c..906e854 100644
--- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
@@ -26,6 +26,8 @@
 import android.graphics.Outline;
 import android.graphics.PointF;
 import android.graphics.Rect;
+import android.graphics.drawable.ShapeDrawable;
+import android.graphics.drawable.shapes.RectShape;
 import android.util.AttributeSet;
 import android.view.Gravity;
 import android.view.MotionEvent;
@@ -237,6 +239,8 @@
         PagedOrientationHandler orientationHandler = taskView.getPagedOrientationHandler();
         measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
         orientationHandler.setTaskMenuAroundTaskView(this, mTaskInsetMargin);
+
+        // Get Position
         mActivity.getDragLayer().getDescendantRectRelativeToSelf(taskView, sTempRect);
         Rect insets = mActivity.getDragLayer().getInsets();
         BaseDragLayer.LayoutParams params = (BaseDragLayer.LayoutParams) getLayoutParams();
@@ -248,8 +252,15 @@
         setLayoutParams(params);
         setScaleX(taskView.getScaleX());
         setScaleY(taskView.getScaleY());
+
+        // Set divider spacing
+        ShapeDrawable divider = new ShapeDrawable(new RectShape());
+        divider.getPaint().setColor(getResources().getColor(android.R.color.transparent));
+        int dividerSpacing = (int) getResources().getDimension(R.dimen.task_menu_spacing);
+        mOptionLayout.setShowDividers(SHOW_DIVIDER_MIDDLE);
+
         orientationHandler.setTaskOptionsMenuLayoutOrientation(
-                mActivity.getDeviceProfile(), mOptionLayout);
+                mActivity.getDeviceProfile(), mOptionLayout, dividerSpacing, divider);
         setPosition(sTempRect.left - insets.left, sTempRect.top - insets.top, 0);
     }
 
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index 7690102..2d322e9 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -800,6 +800,7 @@
         mIconView.setRotation(orientationHandler.getDegreesRotated());
         snapshotParams.topMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
         mSnapshotView.setLayoutParams(snapshotParams);
+        getThumbnail().getTaskOverlay().updateOrientationState(orientationState);
     }
 
     private void setIconAndDimTransitionProgress(float progress, boolean invert) {
diff --git a/res/drawable/padded_rounded_action_button.xml b/res/drawable/padded_rounded_action_button.xml
new file mode 100644
index 0000000..900f5fc
--- /dev/null
+++ b/res/drawable/padded_rounded_action_button.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ~ Copyright (C) 2021 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+    <item android:bottom="8dp" android:top="8dp">
+        <shape android:shape="rectangle">
+
+        <corners android:radius="@dimen/rounded_button_radius" />
+        <stroke android:width="1dp" android:color="?androidprv:attr/colorAccentPrimaryVariant" />
+        <padding
+            android:left="@dimen/rounded_button_padding"
+            android:right="@dimen/rounded_button_padding" />
+        </shape>
+    </item>
+</layer-list>
+
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 2a2cf89..4735983 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -128,6 +128,8 @@
     <dimen name="work_profile_footer_text_size">16sp</dimen>
     <dimen name="work_edu_card_margin">16dp</dimen>
 
+    <!-- rounded button shown inside card views, and snack bars  -->
+    <dimen name="padded_rounded_button_height">48dp</dimen>
     <dimen name="rounded_button_height">32dp</dimen>
     <dimen name="rounded_button_radius">16dp</dimen>
     <dimen name="rounded_button_padding">8dp</dimen>
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index 11c9649..d047eca 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -29,6 +29,7 @@
 import android.graphics.PointF;
 import android.graphics.Rect;
 import android.graphics.RectF;
+import android.graphics.drawable.ShapeDrawable;
 import android.util.FloatProperty;
 import android.view.MotionEvent;
 import android.view.Surface;
@@ -269,8 +270,11 @@
 
     @Override
     public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
-        LinearLayout taskMenuLayout) {
+            LinearLayout taskMenuLayout, int dividerSpacing,
+            ShapeDrawable dividerDrawable) {
         taskMenuLayout.setOrientation(LinearLayout.HORIZONTAL);
+        dividerDrawable.setIntrinsicWidth(dividerSpacing);
+        taskMenuLayout.setDividerDrawable(dividerDrawable);
     }
 
     @Override
diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java
index e0b89c7..266e05f 100644
--- a/src/com/android/launcher3/touch/PagedOrientationHandler.java
+++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java
@@ -22,6 +22,7 @@
 import android.graphics.PointF;
 import android.graphics.Rect;
 import android.graphics.RectF;
+import android.graphics.drawable.ShapeDrawable;
 import android.util.FloatProperty;
 import android.view.MotionEvent;
 import android.view.VelocityTracker;
@@ -123,7 +124,8 @@
      * inside task menu view.
      */
     void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
-            LinearLayout taskMenuLayout);
+            LinearLayout taskMenuLayout, int dividerSpacing,
+            ShapeDrawable dividerDrawable);
     /**
      * Sets layout param attributes for {@link com.android.launcher3.popup.SystemShortcut} child
      * views inside task menu view.
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index dcbb7ca..dd97af5 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -27,6 +27,7 @@
 import android.graphics.PointF;
 import android.graphics.Rect;
 import android.graphics.RectF;
+import android.graphics.drawable.ShapeDrawable;
 import android.util.FloatProperty;
 import android.view.MotionEvent;
 import android.view.Surface;
@@ -274,14 +275,18 @@
 
     @Override
     public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
-        LinearLayout taskMenuLayout) {
+            LinearLayout taskMenuLayout, int dividerSpacing,
+            ShapeDrawable dividerDrawable) {
         if (deviceProfile.isLandscape && !deviceProfile.isTablet) {
             // Phone landscape
             taskMenuLayout.setOrientation(LinearLayout.HORIZONTAL);
+            dividerDrawable.setIntrinsicWidth(dividerSpacing);
         } else {
             // Phone Portrait, LargeScreen Landscape/Portrait
             taskMenuLayout.setOrientation(LinearLayout.VERTICAL);
+            dividerDrawable.setIntrinsicHeight(dividerSpacing);
         }
+        taskMenuLayout.setDividerDrawable(dividerDrawable);
     }
 
     @Override