Skip to content

Commit

Permalink
Version 10.1.0
Browse files Browse the repository at this point in the history
Closes #48.
  • Loading branch information
TuringTechnologies committed Jul 14, 2016
1 parent 28b3257 commit 605f0c3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

def version = '10.0.3'
def version = '10.1.0'

install {
repositories.mavenInstaller {
Expand Down Expand Up @@ -46,7 +46,7 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 24
versionCode 23
versionCode 24
versionName version
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ void setUpProps(Context context, AttributeSet attrs){
R.styleable.MaterialScrollBar,
0, 0);
ArrayList<String> missing = new ArrayList<>();
//Ensures that a recyclerView is associated with the bar.
if(!a.hasValue(R.styleable.MaterialScrollBar_msb_recyclerView)){
missing.add("recyclerView");
}
// //Ensures that a recyclerView is associated with the bar.
// if(!a.hasValue(R.styleable.MaterialScrollBar_msb_recyclerView)){
// missing.add("recyclerView");
// }
//Ensures that a preference is expressed for lightOnTouch.
if(!a.hasValue(R.styleable.MaterialScrollBar_msb_lightOnTouch)){
missing.add("lightOnTouch");
Expand Down Expand Up @@ -202,6 +202,17 @@ void implementPreferences(){
implementFlavourPreferences(a);
}

public T setRecyclerView(RecyclerView rv){
if(seekId != 0){
throw new RuntimeException("There is already a recyclerView set by XML.");
} else if (recyclerView != null){
throw new RuntimeException("There is already a recyclerView set.");
}
recyclerView = rv;
generalSetup();
return (T)this;
}

//XML case only. Waits for all of the views to be attached to the window and then implements general setup.
//Waiting must occur so that the relevant recyclerview can be found.
@Override
Expand Down Expand Up @@ -258,6 +269,10 @@ void identifySwipeRefreshParents(){
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);

if(recyclerView == null){
throw new RuntimeException("You need to set a recyclerView for the scroll bar, either in the XML or using setRecyclerView().");
}

if(sizeUnchecked && !isInEditMode()){
scrollUtils.getCurScrollState();
if(scrollUtils.getAvailableScrollHeight() <= 0){
Expand Down

0 comments on commit 605f0c3

Please sign in to comment.