use of com.github.ksoichiro.android.observablescrollview.ObservableGridView in project Android-ObservableScrollView by ksoichiro.
the class ActionBarControlGridViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_actionbarcontrolgridview);
ObservableGridView gridView = (ObservableGridView) findViewById(R.id.grid);
gridView.setScrollViewCallbacks(this);
setDummyData(gridView);
}
use of com.github.ksoichiro.android.observablescrollview.ObservableGridView in project Android-ObservableScrollView by ksoichiro.
the class HeaderGridViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gridview);
ObservableGridView scrollable = (ObservableGridView) findViewById(R.id.scrollable);
// Set padding view for GridView. This is the flexible space.
headerView = new View(this);
final int flexibleSpaceImageHeight = getResources().getDimensionPixelSize(R.dimen.flexible_space_image_height);
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, flexibleSpaceImageHeight);
headerView.setLayoutParams(lp);
// This is required to disable header's list selector effect
headerView.setClickable(true);
scrollable.addHeaderView(headerView);
// Footer is also available.
footerView = new View(this);
FrameLayout.LayoutParams lpf = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, flexibleSpaceImageHeight);
footerView.setLayoutParams(lpf);
scrollable.addFooterView(footerView);
scrollable.setScrollViewCallbacks(this);
UiTestUtils.setDummyData(this, scrollable);
scrollable.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
}
});
}
use of com.github.ksoichiro.android.observablescrollview.ObservableGridView in project Android-ObservableScrollView by ksoichiro.
the class ViewPagerTab2GridViewFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_gridview, container, false);
Activity parentActivity = getActivity();
final ObservableGridView gridView = (ObservableGridView) view.findViewById(R.id.scroll);
UiTestUtils.setDummyData(getActivity(), gridView);
gridView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
if (parentActivity instanceof ObservableScrollViewCallbacks) {
gridView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
return view;
}
use of com.github.ksoichiro.android.observablescrollview.ObservableGridView in project Android-ObservableScrollView by ksoichiro.
the class SlidingUpGridViewActivity method createScrollable.
@Override
protected ObservableGridView createScrollable() {
ObservableGridView gridView = (ObservableGridView) findViewById(R.id.scroll);
gridView.setScrollViewCallbacks(this);
setDummyData(gridView);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(SlidingUpGridViewActivity.this, "Item " + (position + 1) + " clicked", Toast.LENGTH_SHORT).show();
}
});
return gridView;
}
use of com.github.ksoichiro.android.observablescrollview.ObservableGridView in project Android-ObservableScrollView by ksoichiro.
the class ViewPagerTab2GridViewFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_gridview, container, false);
Activity parentActivity = getActivity();
final ObservableGridView gridView = (ObservableGridView) view.findViewById(R.id.scroll);
setDummyData(gridView);
gridView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
if (parentActivity instanceof ObservableScrollViewCallbacks) {
gridView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
return view;
}
Aggregations