Beispiel #1
0
 public void showCorrectButtons(Boolean isPlay) {
   if (isPlay) {
     layout_player.setVisibility(View.VISIBLE);
     ripplePause.setVisibility(View.VISIBLE);
     ripplePlay.setVisibility(View.GONE);
   } else {
     // layout_player.setVisibility(View.GONE);
     ripplePause.setVisibility(View.GONE);
     ripplePlay.setVisibility(View.VISIBLE);
   }
 }
Beispiel #2
0
 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)));
 }
Beispiel #3
0
    @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;
    }
Beispiel #4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_schedule);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    TextView toolbarText = (TextView) findViewById(R.id.scheduleTollbarText);
    Typeface nova = Typeface.createFromAsset(this.getAssets(), "fonts/ProximaNova-Reg.ttf");
    toolbarText.setTypeface(nova);
    day1Ripple = (MaterialRippleLayout) findViewById(R.id.day1Ripple);
    day2Ripple = (MaterialRippleLayout) findViewById(R.id.day2Ripple);
    day3Ripple = (MaterialRippleLayout) findViewById(R.id.day3Ripple);

    day1Ripple.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Schedule.this, Day_One.class);
            intent.putExtra("day_number", 1);
            startActivity(intent);
          }
        });

    day2Ripple.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Schedule.this, Day_One.class);
            intent.putExtra("day_number", 2);
            startActivity(intent);
          }
        });
    day3Ripple.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(Schedule.this, Day_One.class);
            intent.putExtra("day_number", 3);
            startActivity(intent);
          }
        });
  }
 @Override
 public MyViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
   final LayoutInflater inflater = LayoutInflater.from(viewGroup.getContext());
   return new MyViewHolder(
       MaterialRippleLayout.on(inflater.inflate(R.layout.demo_recycler_item, viewGroup, false))
           .rippleOverlay(true)
           .rippleAlpha(0.2f)
           .rippleColor(0xFF585858)
           .rippleHover(true)
           .create());
 }
  /** @Description: 弹框选择图片来源 */
  @SuppressLint("InflateParams")
  private void showAlbumDialog() {
    albumDialog = new AlertDialog.Builder(this).create();
    albumDialog.setCanceledOnTouchOutside(true);
    View v = LayoutInflater.from(this).inflate(R.layout.dialog_select_picture, null);
    albumDialog.show();
    albumDialog.setContentView(v);
    albumDialog.getWindow().setGravity(Gravity.CENTER);

    TextView albumPic = (TextView) v.findViewById(R.id.album_pic);
    TextView cameraPic = (TextView) v.findViewById(R.id.camera_pic);
    // 动态特效
    MaterialRippleLayout.on(albumPic)
        .rippleColor(Color.parseColor(CommonConstant.RIPPLE_COLOR_DARK))
        .rippleAlpha(CommonConstant.RIPPLE_ALPHA)
        .rippleHover(true)
        .create();
    MaterialRippleLayout.on(cameraPic)
        .rippleColor(Color.parseColor(CommonConstant.RIPPLE_COLOR_DARK))
        .rippleAlpha(CommonConstant.RIPPLE_ALPHA)
        .rippleHover(true)
        .create();
    albumPic.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View arg0) {
            albumDialog.dismiss();
            getPicFromAlbum();
          }
        });
    cameraPic.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            albumDialog.dismiss();
            getPicFromCamera();
          }
        });
  }
 public ViewHolder(View itemView) {
   super(itemView);
   projectName = (TextView) itemView.findViewById(R.id.project_name);
   projectStatus = (TextView) itemView.findViewById(R.id.status);
   projectId = (TextView) itemView.findViewById(R.id.project_id);
   projectOfflineId = (TextView) itemView.findViewById(R.id.project_offline_id);
   rippleLayout = (MaterialRippleLayout) itemView.findViewById(R.id.ripple);
   rippleLayout.setOnClickListener(
       new View.OnClickListener() {
         @Override
         public void onClick(View v) {
           Bundle bundle = new Bundle();
           bundle.putString("project_id", projectId.getText().toString());
           bundle.putString("project_offline_id", projectOfflineId.getText().toString());
           ProjectsComponentsContainerFragment projectsComponentsContainerFragment =
               new ProjectsComponentsContainerFragment();
           projectsComponentsContainerFragment.setArguments(bundle);
           MainActivity.replaceFragment(projectsComponentsContainerFragment, TAG);
         }
       });
 }
  /** @Description: 瓷砖特效 */
  private void initMaterialRipple() {
    alimonyET.setPaddings(DensityUtils.sp2px(this, 32), 0, 0, 0);
    // 设置验证信息
    alimonyET.addValidator(
        new METValidator("请输入整数~") {

          @Override
          public boolean isValid(@NonNull CharSequence text, boolean isEmpty) {
            String number = text.toString();
            if ("".equals(number) || VerifyUtils.isDigit(number)) {
              return true;
            }
            return false;
          }
        });
    // 动态特效
    MaterialRippleLayout.on(commitBtn)
        .rippleColor(Color.parseColor(CommonConstant.RIPPLE_COLOR_DARK))
        .rippleAlpha(CommonConstant.RIPPLE_ALPHA)
        .rippleHover(true)
        .create();
  }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_two_player);
   for (int i = 0; i < 9; i++) {
     if (i == 0) {
       ar_imageView[0] = (ImageView) findViewById(R.id.imageView);
     } else {
       String id = "imageView" + (i + 1);
       ar_imageView[i] =
           (ImageView) findViewById(getResources().getIdentifier(id, "id", getPackageName()));
     }
   }
   result = (TextView) findViewById(R.id.result);
   engine = new Engine();
   Button button2 = (Button) findViewById(R.id.bt_new_game2);
   MaterialRippleLayout.on(button2)
       .rippleColor(Color.GRAY)
       .rippleHover(true)
       .rippleOverlay(true)
       .rippleAlpha(0.2f)
       .create();
 }
  /** @Description: 瓷砖特效 */
  private void initMaterialRipple() {
    // 设置Spinner的Adapter
    String[] types = getResources().getStringArray(R.array.second_hand_type);
    List<String> typeList = Arrays.asList(types);
    MyArrayAdapter typeAdapter = new MyArrayAdapter(this, typeList);
    typeSp.setAdapter(typeAdapter);
    String[] bargains = getResources().getStringArray(R.array.second_hand_bargain);
    List<String> bargainList = Arrays.asList(bargains);
    MyArrayAdapter bargainAdapter = new MyArrayAdapter(this, bargainList);
    bargainSp.setAdapter(bargainAdapter);
    // 设置Padding
    titleET.setPaddings(DensityUtils.sp2px(this, 32), 0, 0, 0);
    typeSp.setPaddings(DensityUtils.sp2px(this, 32), 0, 0, 0);
    priceET.setPaddings(DensityUtils.sp2px(this, 32), 0, 0, 0);
    describeET.setPaddings(DensityUtils.sp2px(this, 32), 0, 0, 0);
    bargainSp.setPaddings(DensityUtils.sp2px(this, 32), 0, 0, 0);
    qqET.setPaddings(DensityUtils.sp2px(this, 32), 0, 0, 0);
    phoneET.setPaddings(DensityUtils.sp2px(this, 32), 0, 0, 0);
    // 设置验证信息
    priceET.addValidator(
        new METValidator("只能输入整数~") {

          @Override
          public boolean isValid(@NonNull CharSequence text, boolean isEmpty) {
            String number = text.toString();
            if ("".equals(number) || VerifyUtils.isDigit(number)) {
              return true;
            }
            return false;
          }
        });
    qqET.addValidator(
        new METValidator("请输入正确的QQ格式~") {

          @Override
          public boolean isValid(@NonNull CharSequence text, boolean isEmpty) {
            String number = text.toString();
            if ("".equals(number) || VerifyUtils.isDigit(number)) {
              return true;
            }
            return false;
          }
        });
    phoneET.addValidator(
        new METValidator("请输入正确的联系号码格式~") {

          @Override
          public boolean isValid(@NonNull CharSequence text, boolean isEmpty) {
            String number = text.toString();
            if ("".equals(number) || VerifyUtils.checkPhone(number)) {
              return true;
            }
            return false;
          }
        });

    // 动态特效
    MaterialRippleLayout.on(itemTitleRL)
        .rippleColor(Color.parseColor(CommonConstant.RIPPLE_COLOR_LITHT))
        .rippleAlpha(CommonConstant.RIPPLE_ALPHA)
        .rippleHover(true)
        .create();
    MaterialRippleLayout.on(contactTitleRL)
        .rippleColor(Color.parseColor(CommonConstant.RIPPLE_COLOR_LITHT))
        .rippleAlpha(CommonConstant.RIPPLE_ALPHA)
        .rippleHover(true)
        .create();
  }
Beispiel #11
0
  @Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    artEvent1Text = (TextView) view.findViewById(R.id.artEvent1Text);
    artEvent2Text = (TextView) view.findViewById(R.id.artEvent2Text);
    artEvent3Text = (TextView) view.findViewById(R.id.artEvent3Text);
    artEvent4Text = (TextView) view.findViewById(R.id.artEvent4Text);

    subhi = (TextView) view.findViewById(R.id.shubi);
    sanjana = (TextView) view.findViewById(R.id.sanjana);
    Typeface tfMatter = Typeface.createFromAsset(getActivity().getAssets(), "fonts/Reckoner.ttf");
    Typeface Oswald =
        Typeface.createFromAsset(getActivity().getAssets(), "fonts/Oswald-Regular.ttf");
    subhi.setTypeface(Oswald, Typeface.NORMAL);
    sanjana.setTypeface(Oswald, Typeface.NORMAL);
    subhiCallfab = (FloatingActionButton) view.findViewById(R.id.shubiCallFab);
    sanjanaCallfab = (FloatingActionButton) view.findViewById(R.id.sanjanaCallFab);
    subhiCallfab.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent callIntent = new Intent(Intent.ACTION_DIAL);
            callIntent.setData(Uri.parse("tel:09912758669"));
            startActivity(callIntent);
          }
        });
    sanjanaCallfab.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent callIntent = new Intent(Intent.ACTION_DIAL);
            callIntent.setData(Uri.parse("tel:0818592061"));
            startActivity(callIntent);
          }
        });
    artEvent1Text.setTypeface(tfMatter, Typeface.NORMAL);
    artEvent2Text.setTypeface(tfMatter, Typeface.NORMAL);
    artEvent3Text.setTypeface(tfMatter, Typeface.NORMAL);
    artEvent4Text.setTypeface(tfMatter, Typeface.NORMAL);

    artEvent1Ripple = (MaterialRippleLayout) view.findViewById(R.id.artEvent1Ripple);
    artEvent2Ripple = (MaterialRippleLayout) view.findViewById(R.id.artEvent2Ripple);
    artEvent3Ripple = (MaterialRippleLayout) view.findViewById(R.id.artEvent3Ripple);
    artEvent4Ripple = (MaterialRippleLayout) view.findViewById(R.id.artEvent4Ripple);

    artEvent1Ripple.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            new MaterialDialog.Builder(getActivity())
                .title(
                    Html.fromHtml(
                        "Avant Grade"
                            + "<br />"
                            + "<small>"
                            + "15 MAR 1:00 pm"
                            + "</small>"
                            + "<br />"
                            + "<small>"
                            + "Rocks"
                            + "</small>"))
                .content(R.string.avant_grade)
                .positiveText("CLOSE")
                .positiveColorRes(R.color.material_red_400)
                .titleGravity(GravityEnum.CENTER)
                .titleColorRes(R.color.material_red_400)
                .contentColorRes(android.R.color.white)
                .backgroundColorRes(R.color.material_blue_grey_800)
                .dividerColorRes(R.color.material_pink_500)
                .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE)
                .positiveColor(Color.WHITE)
                .theme(Theme.DARK)
                .show();
          }
        });
    artEvent2Ripple.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            new MaterialDialog.Builder(getActivity())
                .title(
                    Html.fromHtml(
                        "Schedios"
                            + "<br />"
                            + "<small>"
                            + "14 MAR 2:00 pm"
                            + "</small>"
                            + "<br />"
                            + "<small>"
                            + "F 201"
                            + "</small>"))
                .content(R.string.schedios)
                .positiveText("CLOSE")
                .positiveColorRes(R.color.material_red_400)
                .titleGravity(GravityEnum.CENTER)
                .titleColorRes(R.color.material_red_400)
                .contentColorRes(android.R.color.white)
                .backgroundColorRes(R.color.material_blue_grey_800)
                .dividerColorRes(R.color.material_pink_500)
                .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE)
                .positiveColor(Color.WHITE)
                .theme(Theme.DARK)
                .show();
          }
        });
    artEvent3Ripple.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            new MaterialDialog.Builder(getActivity())
                .title(
                    Html.fromHtml(
                        "Spawn It"
                            + "<br />"
                            + "<small>"
                            + "13 MAR 11:00 am"
                            + "</small>"
                            + "<br />"
                            + "<small>"
                            + "F 201"
                            + "</small>"))
                .content(R.string.spawn_it)
                .positiveText("CLOSE")
                .positiveColorRes(R.color.material_red_400)
                .titleGravity(GravityEnum.CENTER)
                .titleColorRes(R.color.material_red_400)
                .contentColorRes(android.R.color.white)
                .backgroundColorRes(R.color.material_blue_grey_800)
                .dividerColorRes(R.color.material_pink_500)
                .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE)
                .positiveColor(Color.WHITE)
                .theme(Theme.DARK)
                .show();
          }
        });
    artEvent4Ripple.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            new MaterialDialog.Builder(getActivity())
                .title(
                    Html.fromHtml(
                        "Waste smART"
                            + "<br />"
                            + "<small>"
                            + "15 MAR 3:00 pm"
                            + "</small>"
                            + "<br />"
                            + "<small>"
                            + "Stage 2"
                            + "</small>"))
                .content(R.string.waste_smart)
                .positiveText("CLOSE")
                .positiveColorRes(R.color.material_red_400)
                .titleGravity(GravityEnum.CENTER)
                .titleColorRes(R.color.material_red_400)
                .contentColorRes(android.R.color.white)
                .backgroundColorRes(R.color.material_blue_grey_800)
                .dividerColorRes(R.color.material_pink_500)
                .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE)
                .positiveColor(Color.WHITE)
                .theme(Theme.DARK)
                .show();
          }
        });
  }