Remove more actions view.
b/15409230
Change-Id: Ibfb2e3e08500bf736aa20c490cce0456b596d901
diff --git a/v17/leanback/res/layout/lb_details_overview.xml b/v17/leanback/res/layout/lb_details_overview.xml
index beca042..97d1490 100644
--- a/v17/leanback/res/layout/lb_details_overview.xml
+++ b/v17/leanback/res/layout/lb_details_overview.xml
@@ -38,23 +38,10 @@
android:adjustViewBounds="true"
/>
- <ImageView
- android:id="@+id/details_overview_actions_more"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/lb_ic_actions_right_arrow"
- android:layout_alignParentRight="true"
- android:layout_alignParentBottom="true"
- android:layout_marginRight="@dimen/lb_details_overview_actions_more_margin_right"
- android:layout_marginBottom="@dimen/lb_details_overview_actions_more_margin_bottom"
- />
-
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@id/details_overview_image"
- android:layout_marginLeft="@dimen/lb_details_overview_description_margin_left"
- android:layout_marginRight="@dimen/lb_details_overview_description_margin_right"
android:layout_marginBottom="@dimen/lb_details_overview_description_margin_bottom"
android:layout_marginTop="@dimen/lb_details_overview_description_margin_top"
android:orientation="vertical" >
@@ -64,7 +51,10 @@
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
- android:gravity="top" />
+ android:gravity="top"
+ android:layout_marginLeft="@dimen/lb_details_overview_description_margin_left"
+ android:layout_marginRight="@dimen/lb_details_overview_description_margin_right"
+ />
<android.support.v17.leanback.widget.HorizontalGridView
android:id="@+id/details_overview_actions"
@@ -75,6 +65,8 @@
android:clipToPadding="false"
android:focusable="true"
android:focusableInTouchMode="true"
+ android:paddingLeft="@dimen/lb_details_overview_description_margin_left"
+ android:paddingRight="@dimen/lb_details_overview_description_margin_right"
lb:horizontalMargin="@dimen/lb_details_overview_action_items_margin"
lb:rowHeight="@dimen/lb_details_overview_actions_height" />
diff --git a/v17/leanback/res/values/dimens.xml b/v17/leanback/res/values/dimens.xml
index 747aebb..f01e615 100644
--- a/v17/leanback/res/values/dimens.xml
+++ b/v17/leanback/res/values/dimens.xml
@@ -76,8 +76,6 @@
<dimen name="lb_details_overview_actions_padding_left">294dp</dimen>
<dimen name="lb_details_overview_actions_padding_right">132dp</dimen>
<dimen name="lb_details_overview_actions_height">56dp</dimen>
- <dimen name="lb_details_overview_actions_more_margin_right">12dp</dimen>
- <dimen name="lb_details_overview_actions_more_margin_bottom">28dp</dimen>
<dimen name="lb_details_overview_actions_fade_size">16dp</dimen>
<dimen name="lb_details_rows_align_top">167dp</dimen>
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/DetailsOverviewRowPresenter.java b/v17/leanback/src/android/support/v17/leanback/widget/DetailsOverviewRowPresenter.java
index a8a50f9..f0a9483 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/DetailsOverviewRowPresenter.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/DetailsOverviewRowPresenter.java
@@ -46,21 +46,16 @@
final ImageView mImageView;
final FrameLayout mDetailsDescriptionFrame;
final HorizontalGridView mActionsRow;
- final View mMoreActionsView;
Presenter.ViewHolder mDetailsDescriptionViewHolder;
int mNumItems;
boolean mShowMoreRight;
boolean mShowMoreLeft;
- boolean mShowMoreActions;
void bind(ItemBridgeAdapter bridgeAdapter) {
mNumItems = bridgeAdapter.getItemCount();
bridgeAdapter.setAdapterListener(mAdapterListener);
- mMoreActionsView.setAlpha(0f);
mShowMoreRight = false;
- mShowMoreActions = false;
-
mShowMoreLeft = true;
showMoreLeft(false);
}
@@ -101,16 +96,12 @@
boolean showRight = (viewHolder == null ||
viewHolder.itemView.getRight() > mActionsRow.getWidth());
- boolean showMore = (viewHolder == null ||
- getViewCenter(viewHolder.itemView) > mActionsRow.getWidth());
-
viewHolder = mActionsRow.findViewHolderForPosition(0);
boolean showLeft = (viewHolder == null || viewHolder.itemView.getLeft() < 0);
if (DEBUG) Log.v(TAG, "checkFirstAndLast fromScroll " + fromScroll +
" showRight " + showRight + " showLeft " + showLeft);
- showMoreActions(showMore);
showMoreRight(showRight);
showMoreLeft(showLeft);
}
@@ -129,14 +120,6 @@
}
}
- private void showMoreActions(boolean show) {
- if (show != mShowMoreActions) {
- mMoreActionsView.animate().alpha(show ? 1f : 0).setDuration(
- MORE_ACTIONS_FADE_MS).start();
- mShowMoreActions = show;
- }
- }
-
public ViewHolder(View rootView) {
super(rootView);
mImageView = (ImageView) rootView.findViewById(R.id.details_overview_image);
@@ -149,11 +132,7 @@
final int fadeLength = rootView.getResources().getDimensionPixelSize(
R.dimen.lb_details_overview_actions_fade_size);
mActionsRow.setFadingRightEdgeLength(fadeLength);
- mActionsRow.setFadingRightEdgeOffset(-fadeLength);
mActionsRow.setFadingLeftEdgeLength(fadeLength);
- mActionsRow.setFadingLeftEdgeOffset(-fadeLength);
-
- mMoreActionsView = rootView.findViewById(R.id.details_overview_actions_more);
}
}