CardView卡片,SeekBar

https://github.com/wanglianghai/LightCardView
A FrameLayout with a rounded corner background and shadow.

//一个圆角背景和阴影的框架布局

<android.support.v7.widget.CardView
        android:id="@+id/card_view"
        android:layout_width="match_parent"
        android:layout_height="250dp">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@drawable/card_view"
            android:scaleType="centerCrop"/>
    </android.support.v7.widget.CardView>

A SeekBar is an extension of ProgressBar that adds a draggable
thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. Placing focusable widgets to the left or right of a SeekBar is discouraged.
一个SeekBar是一个扩展的ProgressBar添加了一个手指可拖动的。
用户可以触摸这(手指可拖动)的拖左右去设置当前的进度等级或用箭头。
放置聚集小部件在SeekBar左右是被劝阻的

Clients of the SeekBar can attach a SeekBar.OnSeekBarChangeListener to be notified of the user’s actions.
SeekBar的客户可以附属一个SeekBar.OnSeekBarChangeListener去提示用户的动作

<SeekBar
            android:id="@+id/control_radius_size"
            android:layout_width="200dp"
            android:layout_height="wrap_content"/>

SeekBar的进度条的值改变cardView的值

final CardView cardView = (CardView) findViewById(R.id.card_view);
        SeekBar seekBar = (SeekBar) findViewById(R.id.control_radius_size);
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                cardView.setRadius(progress);
                Toast.makeText(CardViewActivity.this, "" + progress, Toast.LENGTH_SHORT).show();
                Log.i(TAG, "onProgressChanged: " + progress);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值