Use own divider with outsideInset scrollbar

This commit is contained in:
Adrian Ulrich 2016-04-02 20:47:59 +02:00
parent 90a021f9fa
commit a023b75ec7
10 changed files with 30 additions and 9 deletions

View File

@ -0,0 +1,6 @@
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="?android:attr/dividerHorizontal"
android:insetLeft="7sp"
android:insetRight="3sp" >
</inset>

View File

@ -0,0 +1,11 @@
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="0dp"
android:insetRight="0dp" >
<!-- holo version of divider which doesn't really have an inset.
It would be very nice to inherit from "?android:attr/dividerHorizontal"
but this seems to crash on Android 4 -->
<shape android:shape="rectangle">
<solid android:color="#2affffff"/>
</shape>
</inset>

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<View
android:id="@+id/pmark"
android:visibility="gone"
android:layout_width="4dip"
android:layout_width="@dimen/pmark_size"
android:layout_height="@dimen/row_normal_height"
android:background="@color/now_playing_marker" />
@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:scaleType="centerCrop"
android:layout_width="@dimen/cover_size"
android:layout_height="@dimen/cover_size"
android:layout_marginLeft="@dimen/cover_padding"
android:layout_marginLeft="@dimen/cover_padding_with_pmark"
android:layout_gravity="center_vertical"
android:visibility="gone" />
<TextView
@ -73,6 +73,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/dividerHorizontal"/>
android:background="@drawable/divider_outside_inset" />
</ch.blinkenlights.android.vanilla.DraggableRow>

View File

@ -56,11 +56,10 @@ THE SOFTWARE.
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="?android:attr/dividerHorizontal"
android:dividerHeight="1dip"
android:listSelector="?android:attr/selectableItemBackground"
android:divider="@drawable/divider_outside_inset"
android:dividerHeight="1dip"
android:scrollbarStyle="outsideInset" />
</LinearLayout>

View File

@ -24,6 +24,6 @@ THE SOFTWARE.
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="?android:attr/dividerHorizontal"
android:divider="@drawable/divider_outside_inset"
android:dividerHeight="1dip"
android:scrollbarStyle="outsideInset" />

View File

@ -6,7 +6,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:listSelector="?android:attr/selectableItemBackground"
android:scrollbarStyle="outsideOverlay"
android:scrollbarStyle="outsideInset"
android:divider="@null"
dslv:drag_enabled="true"
dslv:drag_start_mode="onMove"

View File

@ -35,6 +35,7 @@ THE SOFTWARE.
android:layout_width="fill_parent"
android:layout_weight="1"
android:choiceMode="multipleChoice"
android:scrollbarStyle="outsideInset"
dslv:drag_enabled="true"
dslv:drag_start_mode="onMove"
dslv:float_background_color="?float_color"

View File

@ -3,6 +3,8 @@
<resources>
<dimen name="cover_size">44sp</dimen>
<dimen name="cover_padding">14sp</dimen>
<dimen name="pmark_size">4sp</dimen>
<dimen name="cover_padding_with_pmark">10sp</dimen>
<dimen name="text_padding">14sp</dimen>
<dimen name="row_normal_height">56sp</dimen>
<dimen name="divider_size">0dip</dimen>

View File

@ -3,6 +3,8 @@
<resources>
<dimen name="cover_size">44sp</dimen>
<dimen name="cover_padding">0sp</dimen>
<dimen name="pmark_size">4sp</dimen>
<dimen name="cover_padding_with_pmark">0sp</dimen>
<dimen name="text_padding">3sp</dimen>
<dimen name="row_normal_height">44sp</dimen>
<dimen name="divider_size">1dip</dimen>

View File

@ -359,7 +359,7 @@ public class LibraryPagerAdapter
view.setAdapter(adapter);
if (type != MediaUtils.TYPE_FILE)
loadSortOrder((MediaAdapter)adapter);
view.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
adapter.setFilter(mFilter);
mAdapters[type] = adapter;