Skip to content

Commit a66351a

Browse files
committed
- Fixes #52. That is, it makes the setScrollbarHidden(true) call work correctly.
- Updated dependencies.
1 parent aeb9264 commit a66351a

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 25
5-
buildToolsVersion '25.0.0'
5+
buildToolsVersion '25.0.1'
66

77
defaultConfig {
88
applicationId "com.turingtechnologies.materialscrollbardemo"

app/src/main/java/com/turingtechnologies/materialscrollbardemo/MainActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ protected void onCreate(Bundle savedInstanceState) {
2121
RecyclerView recyclerView = ((RecyclerView)findViewById(R.id.recyclerView));
2222
recyclerView.setAdapter(new DemoAdapter(this));
2323
recyclerView.setLayoutManager(new LinearLayoutManager(this));
24-
((DragScrollBar)findViewById(R.id.dragScrollBar)).setIndicator(new AlphabetIndicator(this), true).setHandleColour(Utils.fetchAccentColor(this));
24+
((DragScrollBar)findViewById(R.id.dragScrollBar))
25+
.setIndicator(new AlphabetIndicator(this), true)
26+
.setHandleColour(Utils.fetchAccentColor(this));
2527
}
2628

2729
@Override

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
9+
classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
1010
classpath 'com.android.tools.build:gradle:2.2.2'
1111

1212
// NOTE: Do not place your application dependencies here; they belong

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
1212
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
13+
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
1414

1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit

lib/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apply plugin: 'com.android.library'
22

3-
def libVersion = '11.0.0'
3+
def libVersion = '11.0.1'
44

55
android {
66
compileSdkVersion 25
7-
buildToolsVersion '25.0.0'
7+
buildToolsVersion '25.0.1'
88

99
defaultConfig {
1010
minSdkVersion 11

lib/src/main/java/com/turingtechnologies/materialscrollbar/MaterialScrollBar.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,11 @@ public T setBarThickness(int thickness){
586586
*/
587587
public void setScrollBarHidden(boolean hidden){
588588
hiddenByUser = hidden;
589-
fadeOut();
589+
if(hiddenByUser){
590+
setVisibility(GONE);
591+
} else {
592+
setVisibility(VISIBLE);
593+
}
590594
}
591595

592596
//CHAPTER IV - MISC METHODS
@@ -627,6 +631,7 @@ public void run() {
627631
* Animates the bar into view
628632
*/
629633
void fadeIn(){
634+
System.out.println(hiddenByUser);
630635
if(hidden && getHide() && !hiddenByUser){
631636
hidden = false;
632637
TranslateAnimation anim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, getHideRatio(), Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f);

0 commit comments

Comments
 (0)