private void setupFragment() { VerticalGridPresenter gridPresenter = new VerticalGridPresenter(FocusHighlight.ZOOM_FACTOR_SMALL); gridPresenter.setNumberOfColumns(numColumns); //gridPresenter.setShadowEnabled(false); setGridPresenter(gridPresenter); mAdapter = new ArrayObjectAdapter(new CardPresenter()); List<Contact> contacts = ContactProvider.getContactList(); mAdapter.addAll(0, contacts); setAdapter(mAdapter); setOnItemViewClickedListener(new ItemViewClickedListener()); setOnItemViewSelectedListener(new ItemViewSelectedListener()); }
private void setupFragment() { VerticalGridPresenter gridPresenter = new VerticalGridPresenter(FocusHighlight.ZOOM_FACTOR_NONE); gridPresenter.setNumberOfColumns(numColumns); //gridPresenter.setShadowEnabled(false); setGridPresenter(gridPresenter); mAdapter = new ArrayObjectAdapter(new ContactPresenter()); List<Contact> contacts = ContactProvider.getContactList(); mAdapter.addAll(0, contacts); setAdapter(mAdapter); setOnItemViewClickedListener(new ItemViewClickedListener()); setOnItemViewSelectedListener(new ItemViewSelectedListener()); }
@Override public void onCreate(Bundle savedInstanceState) { Log.i(TAG, "onCreate"); super.onCreate(savedInstanceState); VerticalGridPresenter gridPresenter = new VerticalGridPresenter(FocusHighlight.ZOOM_FACTOR_MEDIUM); gridPresenter.setNumberOfColumns(4); setGridPresenter(gridPresenter); setOnItemViewClickedListener(this); setOnItemViewSelectedListener(this); backgroundManager = ((MainActivity) getActivity()).getBackgroundManager(); metrics = new DisplayMetrics(); getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics); mainHandler = new Handler(getContext().getMainLooper()); }
private VerticalGridPresenter buildGridPresenter() { final int zoom; final boolean focusDimmer; final int numberOfColumns; final boolean shadowEnabled; switch (mDisplayMode) { case GRID: zoom = FocusHighlight.ZOOM_FACTOR_LARGE; focusDimmer = false; numberOfColumns = 6; shadowEnabled = true; break; case LIST: zoom = FocusHighlight.ZOOM_FACTOR_SMALL; focusDimmer = false; numberOfColumns = 1; shadowEnabled = true; break; default: throw new IllegalArgumentException("Invalid Display Mode! "+mDisplayMode); } VerticalGridPresenter vgp = new VerticalGridPresenter(zoom, focusDimmer); vgp.setNumberOfColumns(numberOfColumns); vgp.setShadowEnabled(shadowEnabled); return vgp; }