use of com.github.ksoichiro.android.observablescrollview.ObservableListView in project Android-ObservableScrollView by ksoichiro.
the class FlexibleSpaceWithImageListViewFragment method updateFlexibleSpace.
@Override
protected void updateFlexibleSpace(int scrollY, View view) {
int flexibleSpaceImageHeight = getResources().getDimensionPixelSize(R.dimen.flexible_space_image_height);
View listBackgroundView = view.findViewById(R.id.list_background);
// Translate list background
ViewHelper.setTranslationY(listBackgroundView, Math.max(0, -scrollY + flexibleSpaceImageHeight));
// Also pass this event to parent Activity
FlexibleSpaceWithImageWithViewPagerTabActivity parentActivity = (FlexibleSpaceWithImageWithViewPagerTabActivity) getActivity();
if (parentActivity != null) {
parentActivity.onScrollChanged(scrollY, (ObservableListView) view.findViewById(R.id.scroll));
}
}
use of com.github.ksoichiro.android.observablescrollview.ObservableListView in project Android-ObservableScrollView by ksoichiro.
the class FillGapListViewActivity method createScrollable.
@Override
protected ObservableListView createScrollable() {
ObservableListView listView = (ObservableListView) findViewById(R.id.scroll);
listView.setScrollViewCallbacks(this);
setDummyDataWithHeader(listView, mFlexibleSpaceImageHeight);
return listView;
}
use of com.github.ksoichiro.android.observablescrollview.ObservableListView in project Android-ObservableScrollView by ksoichiro.
the class HandleTouchListViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_handletouchlistview);
ObservableListView listView = (ObservableListView) findViewById(R.id.scroll);
listView.setScrollViewCallbacks(this);
listView.setAdapter(new CustomAdapter(this, getDummyData()));
}
use of com.github.ksoichiro.android.observablescrollview.ObservableListView in project Android-ObservableScrollView by ksoichiro.
the class ActionBarControlListViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_actionbarcontrollistview);
ObservableListView listView = (ObservableListView) findViewById(R.id.list);
listView.setScrollViewCallbacks(this);
setDummyData(listView);
// ObservableListView uses setOnScrollListener, but it still works.
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
Log.v(TAG, "onScrollStateChanged: " + scrollState);
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
Log.v(TAG, "onScroll: firstVisibleItem: " + firstVisibleItem + " visibleItemCount: " + visibleItemCount + " totalItemCount: " + totalItemCount);
}
});
}
use of com.github.ksoichiro.android.observablescrollview.ObservableListView in project Android-ObservableScrollView by ksoichiro.
the class FillGap2ListViewActivity method createScrollable.
@Override
protected ObservableListView createScrollable() {
ObservableListView listView = (ObservableListView) findViewById(R.id.scroll);
listView.setScrollViewCallbacks(this);
setDummyDataWithHeader(listView, mFlexibleSpaceImageHeight);
return listView;
}
Aggregations