New fastscroller. Updated licenses.

This commit is contained in:
Karim Abou Zeid 2016-01-21 17:05:04 +01:00
commit b853c9fd4c
4 changed files with 32 additions and 27 deletions

View file

@ -15,7 +15,6 @@ import android.widget.TextView;
import com.kabouzeid.gramophone.R;
import com.kabouzeid.gramophone.interfaces.MusicServiceEventListener;
import com.kabouzeid.gramophone.views.FastScroller;
import butterknife.Bind;
import butterknife.ButterKnife;
@ -27,14 +26,13 @@ public abstract class AbsMainActivityRecyclerViewFragment<A extends RecyclerView
public static final String TAG = AbsMainActivityRecyclerViewFragment.class.getSimpleName();
@Bind(R.id.container)
View container;
@Bind(R.id.recycler_view)
RecyclerView recyclerView;
@Nullable
@Bind(android.R.id.empty)
TextView empty;
@Nullable
@Bind(R.id.fast_scroller)
FastScroller fastScroller;
private A adapter;
private LM layoutManager;
@ -50,10 +48,6 @@ public abstract class AbsMainActivityRecyclerViewFragment<A extends RecyclerView
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (fastScroller != null) {
fastScroller.setRecyclerView(recyclerView);
}
getMainActivity().addOnAppBarOffsetChangedListener(this);
getMainActivity().addMusicServiceEventListener(this);
@ -98,15 +92,7 @@ public abstract class AbsMainActivityRecyclerViewFragment<A extends RecyclerView
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int i) {
if (fastScroller != null) {
fastScroller.setPadding(
fastScroller.getPaddingLeft(),
fastScroller.getPaddingTop(),
fastScroller.getPaddingRight(),
getMainActivity().getTotalAppBarScrollingRange() + i
);
fastScroller.updateHandlePosition();
}
container.setPadding(container.getPaddingLeft(), container.getPaddingTop(), container.getPaddingRight(), container.getPaddingBottom() + getMainActivity().getTotalAppBarScrollingRange() + i);
}
@Override

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout android:id="@+id/container"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -20,10 +21,4 @@
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/empty_text_size" />
<com.kabouzeid.gramophone.views.FastScroller
android:id="@+id/fast_scroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end" />
</FrameLayout>

View file

@ -34,12 +34,30 @@
<copyright>Copyright (C) 2015 The Android Open Source Project</copyright>
<license>Apache Software License 2.0</license>
</notice>
<notice>
<name>Launcher 3</name>
<url>https://android.googlesource.com/platform/packages/apps/Launcher3</url>
<copyright>Copyright (C) 2010 The Android Open Source Project</copyright>
<license>Apache Software License 2.0</license>
</notice>
<notice>
<name>RecyclerView-FastScroll</name>
<url>https://github.com/timusus/RecyclerView-FastScroll</url>
<copyright>Copyright (C) 2016 Tim Malseed</copyright>
<license>Apache Software License 2.0</license>
</notice>
<notice>
<name>Android-ObservableScrollView</name>
<url>https://github.com/ksoichiro/Android-ObservableScrollView</url>
<copyright>Copyright 2014 Soichiro Kashima</copyright>
<license>Apache Software License 2.0</license>
</notice>
<notice>
<name>Eleven</name>
<url>https://github.com/CyanogenMod/android_packages_apps_Eleven</url>
<copyright>Copyright (c) 2014, The CyanogenMod Project</copyright>
<license>Apache Software License 2.0</license>
</notice>
<notice>
<name>Android Sliding Up Panel</name>
<url>https://github.com/umano/AndroidSlidingUpPanel</url>