本文整理汇总了Java中org.adw.library.widgets.discreteseekbar.internal.drawable.MarkerDrawable.setMarkerListener方法的典型用法代码示例。如果您正苦于以下问题:Java MarkerDrawable.setMarkerListener方法的具体用法?Java MarkerDrawable.setMarkerListener怎么用?Java MarkerDrawable.setMarkerListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.adw.library.widgets.discreteseekbar.internal.drawable.MarkerDrawable
的用法示例。
在下文中一共展示了MarkerDrawable.setMarkerListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Marker
import org.adw.library.widgets.discreteseekbar.internal.drawable.MarkerDrawable; //导入方法依赖的package包/类
public Marker(Context context, AttributeSet attrs, int defStyleAttr, String maxValue, int thumbSize, int separation) {
super(context, attrs, defStyleAttr);
//as we're reading the parent DiscreteSeekBar attributes, it may wrongly set this view's visibility.
setVisibility(View.VISIBLE);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DiscreteSeekBar,
R.attr.discreteSeekBarStyle, R.style.Widget_DiscreteSeekBar);
int padding = (int) (PADDING_DP * displayMetrics.density) * 2;
int textAppearanceId = a.getResourceId(R.styleable.DiscreteSeekBar_dsb_indicatorTextAppearance,
R.style.Widget_DiscreteIndicatorTextAppearance);
mNumber = new TextView(context);
//Add some padding to this textView so the bubble has some space to breath
mNumber.setPadding(padding, 0, padding, 0);
mNumber.setTextAppearance(context, textAppearanceId);
mNumber.setGravity(Gravity.CENTER);
mNumber.setText(maxValue);
mNumber.setMaxLines(1);
mNumber.setSingleLine(true);
SeekBar.setTextDirection(mNumber, TEXT_DIRECTION_LOCALE);
mNumber.setVisibility(View.INVISIBLE);
//add some padding for the elevation shadow not to be clipped
//I'm sure there are better ways of doing this...
setPadding(padding, padding, padding, padding);
resetSizes(maxValue);
mSeparation = separation;
ColorStateList color = a.getColorStateList(R.styleable.DiscreteSeekBar_dsb_indicatorColor);
mMarkerDrawable = new MarkerDrawable(color, thumbSize);
mMarkerDrawable.setCallback(this);
mMarkerDrawable.setMarkerListener(this);
mMarkerDrawable.setExternalOffset(padding);
float elevation = a.getDimension(R.styleable.DiscreteSeekBar_dsb_indicatorElevation, ELEVATION_DP * displayMetrics.density);
setElevation(elevation);
SeekBar.setOutlineProvider(this, mMarkerDrawable);
a.recycle();
}
示例2: Marker
import org.adw.library.widgets.discreteseekbar.internal.drawable.MarkerDrawable; //导入方法依赖的package包/类
public Marker(Context context, AttributeSet attrs, int defStyleAttr, String maxValue) {
super(context, attrs, defStyleAttr);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DiscreteSeekBar,
R.attr.discreteSeekBarStyle, R.style.DefaultSeekBar);
int padding = (int) (PADDING_DP * displayMetrics.density) * 2;
int textAppearanceId = a.getResourceId(R.styleable.DiscreteSeekBar_dsb_indicatorTextAppearance,
R.style.DefaultIndicatorTextAppearance);
mNumber = new TextView(context);
//Add some padding to this textView so the bubble has some space to breath
mNumber.setPadding(padding, 0, padding, 0);
mNumber.setTextAppearance(context, textAppearanceId);
mNumber.setGravity(Gravity.CENTER);
mNumber.setText(maxValue);
mNumber.setMaxLines(1);
mNumber.setSingleLine(true);
SeekBarCompat.setTextDirection(mNumber, TEXT_DIRECTION_LOCALE);
mNumber.setVisibility(View.INVISIBLE);
//add some padding for the elevation shadow not to be clipped
//I'm sure there are better ways of doing this...
setPadding(padding, padding, padding, padding);
resetSizes(maxValue);
mSeparation = (int) (SEPARATION_DP * displayMetrics.density);
int thumbSize = (int) (ThumbDrawable.DEFAULT_SIZE_DP * displayMetrics.density);
ColorStateList color = a.getColorStateList(R.styleable.DiscreteSeekBar_dsb_indicatorColor);
mMarkerDrawable = new MarkerDrawable(color, thumbSize);
mMarkerDrawable.setCallback(this);
mMarkerDrawable.setMarkerListener(this);
mMarkerDrawable.setExternalOffset(padding);
//Elevation for anroid 5+
float elevation = a.getDimension(R.styleable.DiscreteSeekBar_dsb_indicatorElevation, ELEVATION_DP * displayMetrics.density);
ViewCompat.setElevation(this, elevation);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
SeekBarCompat.setOutlineProvider(this, mMarkerDrawable);
}
a.recycle();
}
示例3: Marker
import org.adw.library.widgets.discreteseekbar.internal.drawable.MarkerDrawable; //导入方法依赖的package包/类
public Marker(Context context, AttributeSet attrs, int defStyleAttr, String maxValue, int thumbSize, int separation) {
super(context, attrs, defStyleAttr);
//as we're reading the parent DiscreteSeekBar attributes, it may wrongly set this view's visibility.
setVisibility(View.VISIBLE);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DiscreteSeekBar,
R.attr.discreteSeekBarStyle, R.style.Widget_DiscreteSeekBar);
int padding = (int) (PADDING_DP * displayMetrics.density) * 2;
int textAppearanceId = a.getResourceId(R.styleable.DiscreteSeekBar_dsb_indicatorTextAppearance,
R.style.Widget_DiscreteIndicatorTextAppearance);
mNumber = new TextView(context);
//Add some padding to this textView so the bubble has some space to breath
mNumber.setPadding(padding, 0, padding, 0);
mNumber.setTextAppearance(context, textAppearanceId);
mNumber.setGravity(Gravity.CENTER);
mNumber.setText(maxValue);
mNumber.setMaxLines(1);
mNumber.setSingleLine(true);
SeekBarCompat.setTextDirection(mNumber, TEXT_DIRECTION_LOCALE);
mNumber.setVisibility(View.INVISIBLE);
//add some padding for the elevation shadow not to be clipped
//I'm sure there are better ways of doing this...
setPadding(padding, padding, padding, padding);
resetSizes(maxValue);
mSeparation = separation;
ColorStateList color = a.getColorStateList(R.styleable.DiscreteSeekBar_dsb_indicatorColor);
mMarkerDrawable = new MarkerDrawable(color, thumbSize);
mMarkerDrawable.setCallback(this);
mMarkerDrawable.setMarkerListener(this);
mMarkerDrawable.setExternalOffset(padding);
//Elevation for anroid 5+
float elevation = a.getDimension(R.styleable.DiscreteSeekBar_dsb_indicatorElevation, ELEVATION_DP * displayMetrics.density);
ViewCompat.setElevation(this, elevation);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
SeekBarCompat.setOutlineProvider(this, mMarkerDrawable);
}
a.recycle();
}
示例4: Marker
import org.adw.library.widgets.discreteseekbar.internal.drawable.MarkerDrawable; //导入方法依赖的package包/类
public Marker(Context context, AttributeSet attrs, int defStyleAttr, String maxValue, int thumbSize, int separation) {
super(context, attrs, defStyleAttr);
//as we're reading the parent DiscreteSeekBar attributes, it may wrongly set this view's visibility.
setVisibility(View.VISIBLE);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DiscreteSeekBar,
R.attr.discreteSeekBarStyle, R.style.Widget_DiscreteSeekBar);
int padding = (int) (PADDING_DP * displayMetrics.density) * 2;
int textAppearanceId = a.getResourceId(R.styleable.DiscreteSeekBar_dsb_indicatorTextAppearance,
R.style.Widget_DiscreteIndicatorTextAppearance);
mNumber = new TextView(context);
//Add some padding to this textView so the bubble has some space to breath
mNumber.setPadding(padding, 0, padding, 0);
mNumber.setTextAppearance(context, textAppearanceId);
mNumber.setGravity(Gravity.CENTER);
mNumber.setText(maxValue);
mNumber.setMaxLines(1);
mNumber.setSingleLine(true);
SeekBarCompat.setTextDirection(mNumber, TEXT_DIRECTION_LOCALE);
mNumber.setVisibility(View.INVISIBLE);
//add some padding for the elevation shadow not to be clipped
//I'm sure there are better ways of doing this...
setPadding(padding, padding, padding, padding);
resetSizes(maxValue);
mSeparation = separation;
ColorStateList color = a.getColorStateList(R.styleable.DiscreteSeekBar_dsb_indicatorColor);
mMarkerDrawable = new MarkerDrawable(color, thumbSize);
mMarkerDrawable.setCallback(this);
mMarkerDrawable.setMarkerListener(this);
mMarkerDrawable.setExternalOffset(padding);
//Elevation for anroid 5+
float elevation = a.getDimension(R.styleable.DiscreteSeekBar_dsb_indicatorElevation, ELEVATION_DP * displayMetrics.density);
ViewCompat.setElevation(this, elevation);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
SeekBarCompat.setOutlineProvider(this, mMarkerDrawable);
}
a.recycle();
}
示例5: Marker
import org.adw.library.widgets.discreteseekbar.internal.drawable.MarkerDrawable; //导入方法依赖的package包/类
public Marker(Context context, AttributeSet attrs, int defStyleAttr, String maxValue) {
super(context, attrs, defStyleAttr);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DiscreteSeekBar,
R.attr.discreteSeekBarStyle, R.style.Widget_DiscreteSeekBar);
int padding = (int) (PADDING_DP * displayMetrics.density) * 2;
int textAppearanceId = a.getResourceId(R.styleable.DiscreteSeekBar_dsb_indicatorTextAppearance,
R.style.Widget_DiscreteIndicatorTextAppearance);
mNumber = new TextView(context);
//Add some padding to this textView so the bubble has some space to breath
mNumber.setPadding(padding, 0, padding, 0);
mNumber.setTextAppearance(context, textAppearanceId);
mNumber.setGravity(Gravity.CENTER);
mNumber.setText(maxValue);
mNumber.setMaxLines(1);
mNumber.setSingleLine(true);
SeekBarCompat.setTextDirection(mNumber, TEXT_DIRECTION_LOCALE);
mNumber.setVisibility(View.INVISIBLE);
//add some padding for the elevation shadow not to be clipped
//I'm sure there are better ways of doing this...
setPadding(padding, padding, padding, padding);
resetSizes(maxValue);
mSeparation = (int) (SEPARATION_DP * displayMetrics.density);
int thumbSize = (int) (ThumbDrawable.DEFAULT_SIZE_DP * displayMetrics.density);
ColorStateList color = a.getColorStateList(R.styleable.DiscreteSeekBar_dsb_indicatorColor);
mMarkerDrawable = new MarkerDrawable(color, thumbSize);
mMarkerDrawable.setCallback(this);
mMarkerDrawable.setMarkerListener(this);
mMarkerDrawable.setExternalOffset(padding);
//Elevation for anroid 5+
float elevation = a.getDimension(R.styleable.DiscreteSeekBar_dsb_indicatorElevation, ELEVATION_DP * displayMetrics.density);
ViewCompat.setElevation(this, elevation);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
SeekBarCompat.setOutlineProvider(this, mMarkerDrawable);
}
a.recycle();
}