rename and add attr for pagedlist

Test: manually verified
Change-Id: Iccfe198b86c1235251dee7bf69480f51ffcd7430
diff --git a/car-stream-ui-lib/res/layout/car_drawer_activity.xml b/car-stream-ui-lib/res/layout/car_drawer_activity.xml
index 0fe37d2..17feb76 100644
--- a/car-stream-ui-lib/res/layout/car_drawer_activity.xml
+++ b/car-stream-ui-lib/res/layout/car_drawer_activity.xml
@@ -43,7 +43,8 @@
                 android:id="@+id/drawer_list"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                app:usedInDrawer="true" />
+                app:rightMargin="@dimen/car_drawer_margin_right"
+                app:offsetScrollBar="true" />
 
             <ProgressBar
                 android:id="@+id/drawer_progress"
diff --git a/car-stream-ui-lib/res/values/attrs.xml b/car-stream-ui-lib/res/values/attrs.xml
index b7db9df..344b1a5 100644
--- a/car-stream-ui-lib/res/values/attrs.xml
+++ b/car-stream-ui-lib/res/values/attrs.xml
@@ -20,12 +20,14 @@
         <!-- Set to true/false to offset rows as they slide off screen. Defaults to true -->
         <attr name="offsetRows" format="boolean" />
         <attr name="glowColor" format="color" />
-        <!-- Whether loading list view in drawer or not -->
-        <attr name="usedInDrawer" format="boolean" />
-        <!-- Whether show a divider line between each row or not -->
+        <!-- Whether offsetting the list view by the amount of left scroll bar -->
+        <attr name="offsetScrollBar" format="boolean" />
+        <!-- Whether or not the list view is offset by the width of the scroll bar. -->
         <attr name="showDivider" format="boolean" />
         <!-- The width of the container for the scroll -->
         <attr name="scrollbarContainerWidth" format="dimension" />
+        <!-- The width of the margin on the right side of the list -->
+        <attr name="rightMargin" format="dimension" />
     </declare-styleable>
 
     <declare-styleable name="StreamCardView">
diff --git a/car-stream-ui-lib/src/com/android/car/view/PagedListView.java b/car-stream-ui-lib/src/com/android/car/view/PagedListView.java
index 08a7a9e..f0e93cd 100644
--- a/car-stream-ui-lib/src/com/android/car/view/PagedListView.java
+++ b/car-stream-ui-lib/src/com/android/car/view/PagedListView.java
@@ -120,13 +120,13 @@
             scrollContainer.setLayoutParams(params);
         }
 
-        boolean usedInDrawer = a.getBoolean(R.styleable.PagedListView_usedInDrawer, false);
-        if (usedInDrawer) {
+        boolean offsetScrollBar = a.getBoolean(R.styleable.PagedListView_offsetScrollBar, false);
+        if (offsetScrollBar) {
             FrameLayout maxWidthLayout = (FrameLayout) findViewById(R.id.max_width_layout);
             LayoutParams params = (LayoutParams) maxWidthLayout.getLayoutParams();
             params.leftMargin = scrollContainerWidth;
-            params.rightMargin = getResources().getDimensionPixelSize(
-                    R.dimen.car_drawer_margin_right);
+            int rightMargin = a.getDimensionPixelSize(R.styleable.PagedListView_rightMargin, 0);
+            params.rightMargin = rightMargin;
             maxWidthLayout.setLayoutParams(params);
         }
         boolean showDivider = a.getBoolean(R.styleable.PagedListView_showDivider, true);