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) {
}
});