1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
public enum RecyclerViewLayoutManager { LINEAR { public ViewGroup.LayoutParams getLayoutParams() { return new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); } ; }, GRID { public ViewGroup.LayoutParams getLayoutParams() { return new GridLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); } ; }, STAGGERED { public ViewGroup.LayoutParams getLayoutParams() { return new StaggeredGridLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); } ; }; public abstract ViewGroup.LayoutParams getLayoutParams(); } |