Does not work with simple Scroll View
rohan90 opened this issue · 2 comments
rohan90 commented
I tried your lib, i see the fab in the preview [ so obviously my layout is correct]
I get the exception upon opening the fragment view.
Caused by: java.lang.ClassCastException: android.widget.ScrollView cannot be cast to com.melnykov.fab.ObservableScrollView
at com.prontoitlabs.hunter.activity.AddJobsActivity.initFAB(AddJobsActivity.java:113)
at com.prontoitlabs.hunter.activity.AddJobsActivity.init(AddJobsActivity.java:107)
at com.prontoitlabs.hunter.activity.AddJobsActivity.onCreate(AddJobsActivity.java:100)
at
this the code being used
private void initFAB() {
ScrollView scrollView = (ScrollView) findViewById(R.id.sv_add_jobs);
fab = (FloatingActionButton) findViewById(R.id.fab_add_jobs);
fab.attachToScrollView((ObservableScrollView) scrollView);
}
iceteahh commented
Use ObservableScrollView
instead ScrollView
makovkastar commented
@iceteahh is right, you should use the ObservableScrollView
from the library (https://github.com/makovkastar/FloatingActionButton/blob/master/library/src/main/java/com/melnykov/fab/ObservableScrollView.java).