use of com.abewy.android.apps.klyph.widget.KlyphGridView in project Klyph by jonathangerbaud.
the class KlyphFragment2 method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Log.d("KlyphFragment2", "onCreateView");
View view = inflater.inflate(getCustomLayout(), container, false);
gridView = (KlyphGridView) view.findViewById(R.id.grid);
View emptyView = getEmptyView();
if (emptyView != null) {
emptyView.setId(android.R.id.empty);
((ViewGroup) gridView.getParent()).addView(emptyView);
gridView.setEmptyView(emptyView);
}
// Now set the ScrollView as the refreshable view, and the refresh listener (this)
if (requestNewestType != Query.NONE)
attachViewToPullToRefresh();
return view;
}
use of com.abewy.android.apps.klyph.widget.KlyphGridView in project Klyph by jonathangerbaud.
the class KlyphFragment2 method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (gridView == null)
throw new IllegalStateException("KlyphFragment2 : There is no KlyphGridView with id \"grid\" defined in the layout");
backToTopButton = (ImageButton) view.findViewById(R.id.back_to_top_button);
if (backToTopButton != null) {
backToTopButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setBackToTopButtonVisibility(false);
gridView.setSelection(0);
}
});
}
gridView.setDrawSelectorOnTop(true);
gridView.setNumColumns(getNumColumn());
gridView.setFadingEdgeLength(0);
gridView.setVerticalFadingEdgeEnabled(false);
loadingObject = new Progress();
loadingObject.setLoading(true);
gridView.setVisibility(View.GONE);
((View) gridView.getParent()).setVisibility(View.GONE);
loadingView = view.findViewById(android.R.id.progress);
gridView.setOnScrollListener(this);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> gridView, View view, int position, long id) {
onGridItemClick((KlyphGridView) gridView, view, position, id);
}
});
if (getArguments() != null) {
elementId = getArguments().getString(KlyphBundleExtras.ELEMENT_ID);
}
if ((canAutoLoad && elementId != null) || (loadWhenViewCreated == true && elementId != null)) {
load();
}
}
Aggregations