/** * It returns the layout that has to be passed to the view holder. * * @param rowView the layout that has to be shown * @return a wrapped layout */ public ViewGroup getRowLayout(View rowView) { LinearLayout rowLayout = mLayout.getContainerRowLayout(); rowLayout.addView(rowView); return rowLayout; }
/** * Returns the container for the row layout, that includes the floating pin * @return */ public LinearLayout getContainerRowLayout() { LinearLayout ll = new LinearLayout(this.getContext()); ll.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); if (mPinVerticalPosition == PIN_GRAVITY_CENTER) { ll.setGravity(Gravity.CENTER_VERTICAL); } ll.setOrientation(LinearLayout.HORIZONTAL); FrameLayout frameLayout = (FrameLayout) getPinLayout(); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); frameLayout.setLayoutParams(params); ll.addView(frameLayout); return ll; }
public PinnedListLayout(Context context) { super(context); initializeViews(context); }
super.onFinishInflate(); mRecyclerView = (RecyclerView) this.findViewById(R.id.custom_list); mRecyclerView.setHasFixedSize(true); mPinLayout = (FrameLayout) this.findViewById(R.id.layout_pin); colorDrawable = ((ColorDrawable) this.getBackground()).getColor(); } catch (NullPointerException e) { this.setBackgroundColor(opaqueColor); mPinLayout.setBackgroundColor(opaqueColor); setIndicatorAnimation();
private void initLayout() { mListLayout = (PinnedListLayout) findViewById(R.id.pinned_layout); mRecyclerView = mListLayout.getRecyclerView(); GroupListWrapper listGroup = createItems(); mListAdapter = new ContactAdapter(this, listGroup, mListLayout); mRecyclerView.setAdapter(mListAdapter); }
private View getPinLayout() { FrameLayout pinLayout = new FrameLayout(this.getContext()); TextView tvPin = ((TextView) mPinLayout.findViewById(R.id.pin)); LayoutInflater inflater = (LayoutInflater) this.getContext().getSystemService (Context.LAYOUT_INFLATER_SERVICE); TextView tvLabel = (TextView) (inflater.inflate(R.layout.pin_tv, null)); ImageView ivPin = ((ImageView) mPinLayout.findViewById(R.id.pin)); ImageView ivLabel = new ImageView(this.getContext());
private void initLayout() { mPinnedListLayout = (PinnedListLayout) findViewById(R.id.pinned_layout); mRecyclerView = mPinnedListLayout.getRecyclerView();