本文整理汇总了Java中com.github.anastr.speedviewlib.Speedometer类的典型用法代码示例。如果您正苦于以下问题:Java Speedometer类的具体用法?Java Speedometer怎么用?Java Speedometer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Speedometer类属于com.github.anastr.speedviewlib包,在下文中一共展示了Speedometer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initSpeedView
import com.github.anastr.speedviewlib.Speedometer; //导入依赖的package包/类
private void initSpeedView() {
svATMO.setTrembleDegree(0.1F);
svATMO.setMinMaxSpeed(1, 10);
svATMO.setStartEndDegree(180, 360);
svATMO.setIndicator(Indicator.Indicators.SpindleIndicator);
svATMO.setLowSpeedPercent(30);
svATMO.setMediumSpeedPercent(70);
svATMO.setSpeedometerTextRightToLeft(true);
svATMO.setUnit("");
svATMO.setLowSpeedColor(0xFF0099CC);
svATMO.setMediumSpeedColor(0xFFFF8800);
svATMO.setHighSpeedColor(0xFFFF1744);
svATMO.setTickNumber(10);
svATMO.setSpeedTextSize(0);
svATMO.setSpeedTextPosition(Speedometer.Position.TOP_CENTER);
}
示例2: CharacterViewHolder
import com.github.anastr.speedviewlib.Speedometer; //导入依赖的package包/类
CharacterViewHolder(View itemView) {
super(itemView);
iv_icon = (ImageView) itemView.findViewById(R.id.iv_icon);
tv_name = (TextView) itemView.findViewById(R.id.tv_name);
speedometer = (Speedometer) itemView.findViewById(R.id.speedometer);
}
示例3: onItemSelected
import com.github.anastr.speedviewlib.Speedometer; //导入依赖的package包/类
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
speedometer.setSpeedometerMode(Speedometer.Mode.values()[position]);
// simple usage:
// speedometer.setSpeedometerMode(Speedometer.Mode.RIGHT);
}
示例4: onItemSelected
import com.github.anastr.speedviewlib.Speedometer; //导入依赖的package包/类
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
speedometer.setSpeedTextPosition(Speedometer.Position.values()[position]);
// simple usage:
// speedometer.setSpeedTextPosition(Speedometer.Position.TOP_LEFT);
}
示例5: updateData
import com.github.anastr.speedviewlib.Speedometer; //导入依赖的package包/类
private void updateData(Speedometer speedometer) {
this.viewSize = speedometer.getSize();
this.speedometerWidth = speedometer.getSpeedometerWidth();
this.padding = speedometer.getPadding();
this.inEditMode = speedometer.isInEditMode();
}
示例6: onSizeChange
import com.github.anastr.speedviewlib.Speedometer; //导入依赖的package包/类
/**
* must call in {@code speedometer.onSizeChanged()}
* @param speedometer target speedometer.
*/
public void onSizeChange(Speedometer speedometer) {
setTargetSpeedometer(speedometer);
}
示例7: setTargetSpeedometer
import com.github.anastr.speedviewlib.Speedometer; //导入依赖的package包/类
/**
* to change indicator's data,
* this method called by the library.
* @param speedometer target speedometer.
*/
public void setTargetSpeedometer(Speedometer speedometer) {
updateData(speedometer);
updateIndicator();
}