コード例 #1
0
ファイル: RegionView.java プロジェクト: Hi-Mike/EmotionShow
 public RegionVH(View view) {
   super(new MaterialRippleLayout(view.getContext()));
   tv = new TextView(getContext());
   tv.setLayoutParams(
       new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, JUtils.dip2px(48)));
   tv.setGravity(Gravity.CENTER);
   ((MaterialRippleLayout) itemView).addView(tv);
   ((MaterialRippleLayout) itemView)
       .setRippleColor(getContext().getResources().getColor(R.color.gray));
   itemView.setLayoutParams(
       new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, JUtils.dip2px(48)));
 }
コード例 #2
0
ファイル: RegionView.java プロジェクト: Hi-Mike/EmotionShow
    @Override
    public View onCreateView(ViewGroup parent) {
      MaterialRippleLayout layout = new MaterialRippleLayout(getContext());
      TextView tv = new TextView(parent.getContext());
      tv.setLayoutParams(
          new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, JUtils.dip2px(48)));
      tv.setGravity(Gravity.CENTER);
      tv.setText(title);
      layout.addView(tv);
      layout.setRippleColor(getContext().getResources().getColor(R.color.gray));
      layout.setLayoutParams(
          new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, JUtils.dip2px(48)));

      return layout;
    }