Skip to content

Commit

Permalink
Add scroller (experimental)
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersantos committed Jun 10, 2015
1 parent e730596 commit ec6071d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
2 changes: 2 additions & 0 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/iconics/1.0.2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/materialdrawer/3.0.6/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.pnikosis/materialish-progress/1.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/xyz.danoz/recyclerviewfastscroller/0.1.3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
Expand Down Expand Up @@ -110,6 +111,7 @@
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="ambilwarna-2.0" level="project" />
<orderEntry type="library" exported="" name="material-dialogs-0.7.5.5" level="project" />
<orderEntry type="library" exported="" name="recyclerviewfastscroller-0.1.3" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-22.2.0" level="project" />
</component>
</module>
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies {
compile 'com.afollestad:material-dialogs:0.7.5.5'
compile 'com.github.yukuku:ambilwarna:2.0'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'xyz.danoz:recyclerviewfastscroller:0.1.3'
compile('com.mikepenz:materialdrawer:3.0.6@aar') {
transitive = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import java.util.Comparator;
import java.util.List;

import xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller;


public class MainActivity extends AppCompatActivity {
// Load Settings
Expand Down Expand Up @@ -60,6 +62,7 @@ public class MainActivity extends AppCompatActivity {
private Toolbar toolbar;
private Context context;
private RecyclerView recyclerView;
private VerticalRecyclerViewFastScroller fastScroller;
private FloatingActionButton fab;
private ProgressWheel progressWheel;

Expand All @@ -74,8 +77,14 @@ protected void onCreate(Bundle savedInstanceState) {
setAppDir();

recyclerView = (RecyclerView) findViewById(R.id.appList);
fastScroller = (VerticalRecyclerViewFastScroller) findViewById(R.id.fast_scroller);
progressWheel = (ProgressWheel) findViewById(R.id.progress);

fastScroller.setRecyclerView(recyclerView);
fastScroller.setBarColor(getResources().getColor(R.color.transparent));
fastScroller.setHandleBackground(getResources().getDrawable(R.drawable.fast_scroller_handle_rounded));
recyclerView.setOnScrollListener(fastScroller.getOnScrollListener());

recyclerView.setHasFixedSize(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_app.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
Expand Down
25 changes: 17 additions & 8 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:wheel="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
xmlns:recyclerviewfastscroller="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_content"
android:layout_below="@id/toolbar">
<com.pnikosis.materialishprogress.ProgressWheel
Expand All @@ -24,9 +24,18 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/appList"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_marginRight="30dp" />
<xyz.danoz.recyclerviewfastscroller.vertical.VerticalRecyclerViewFastScroller
android:id="@+id/fast_scroller"
android:layout_width="24dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:paddingRight="@dimen/margin_small"
android:paddingEnd="@dimen/margin_small" />

</LinearLayout>
</RelativeLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand Down

0 comments on commit ec6071d

Please sign in to comment.