本文整理汇总了Java中com.gc.materialdesign.views.Slider.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java Slider.setValue方法的具体用法?Java Slider.setValue怎么用?Java Slider.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.gc.materialdesign.views.Slider
的用法示例。
在下文中一共展示了Slider.setValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.gc.materialdesign.views.Slider; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.color_selector);
colorView = findViewById(R.id.viewColor);
colorView.setBackgroundColor(color);
// Resize ColorView
colorView.post(new Runnable() {
@Override
public void run() {
LayoutParams params = (LayoutParams) colorView.getLayoutParams();
params.height = colorView.getWidth();
colorView.setLayoutParams(params);
}
});
// Configure Sliders
red = (Slider) findViewById(R.id.red);
green = (Slider) findViewById(R.id.green);
blue = (Slider) findViewById(R.id.blue);
int r = (this.color >> 16) & 0xFF;
int g = (this.color >> 8) & 0xFF;
int b = (this.color >> 0) & 0xFF;
red.setValue(r);
green.setValue(g);
blue.setValue(b);
red.setOnValueChangedListener(this);
green.setOnValueChangedListener(this);
blue.setOnValueChangedListener(this);
}
示例2: onCreate
import com.gc.materialdesign.views.Slider; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.color_selector);
colorView = findViewById(R.id.viewColor);
colorView.setBackgroundColor(color);
// Resize ColorView
colorView.post(new Runnable() {
@Override
public void run() {
LinearLayout.LayoutParams params = (LayoutParams) colorView.getLayoutParams();
params.height = colorView.getWidth();
colorView.setLayoutParams(params);
}
});
// Configure Sliders
red = (Slider) findViewById(R.id.red);
green = (Slider) findViewById(R.id.green);
blue = (Slider) findViewById(R.id.blue);
int r = (this.color >> 16) & 0xFF;
int g = (this.color >> 8) & 0xFF;
int b = (this.color >> 0) & 0xFF;
red.setValue(r);
green.setValue(g);
blue.setValue(b);
red.setOnValueChangedListener(this);
green.setOnValueChangedListener(this);
blue.setOnValueChangedListener(this);
}
示例3: onCreate
import com.gc.materialdesign.views.Slider; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.color_selector);
view = (LinearLayout)findViewById(R.id.contentSelector);
backView = (RelativeLayout)findViewById(R.id.rootSelector);
backView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getX() < view.getLeft() || event.getX() >view.getRight()
|| event.getY() > view.getBottom() || event.getY() < view.getTop()) {
dismiss();
}
return false;
}
});
colorView = findViewById(R.id.viewColor);
colorView.setBackgroundColor(color);
// Resize ColorView
colorView.post(new Runnable() {
@Override
public void run() {
LayoutParams params = (LayoutParams) colorView.getLayoutParams();
params.height = colorView.getWidth();
colorView.setLayoutParams(params);
}
});
// Configure Sliders
red = (Slider) findViewById(R.id.red);
green = (Slider) findViewById(R.id.green);
blue = (Slider) findViewById(R.id.blue);
int r = (this.color >> 16) & 0xFF;
int g = (this.color >> 8) & 0xFF;
int b = (this.color >> 0) & 0xFF;
red.setValue(r);
green.setValue(g);
blue.setValue(b);
red.setOnValueChangedListener(this);
green.setOnValueChangedListener(this);
blue.setOnValueChangedListener(this);
}
示例4: onCreate
import com.gc.materialdesign.views.Slider; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.color_selector);
view = (LinearLayout)findViewById(R.id.contentSelector);
backView = (RelativeLayout)findViewById(R.id.rootSelector);
backView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getX() < view.getLeft() || event.getX() >view.getRight()
|| event.getY() > view.getBottom() || event.getY() < view.getTop()) {
dismiss();
}
return false;
}
});
colorView = findViewById(R.id.viewColor);
colorView.setBackgroundColor(color);
// Resize ColorView
colorView.post(new Runnable() {
@Override
public void run() {
LinearLayout.LayoutParams params = (LayoutParams) colorView.getLayoutParams();
params.height = colorView.getWidth();
colorView.setLayoutParams(params);
}
});
// Configure Sliders
red = (Slider) findViewById(R.id.red);
green = (Slider) findViewById(R.id.green);
blue = (Slider) findViewById(R.id.blue);
int r = (this.color >> 16) & 0xFF;
int g = (this.color >> 8) & 0xFF;
int b = (this.color >> 0) & 0xFF;
red.setValue(r, true);
green.setValue(g, true);
blue.setValue(b, true);
red.setOnValueChangedListener(this);
green.setOnValueChangedListener(this);
blue.setOnValueChangedListener(this);
}
示例5: onCreate
import com.gc.materialdesign.views.Slider; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.color_selector);
view = (LinearLayout)findViewById(R.id.contentSelector);
backView = (RelativeLayout)findViewById(R.id.rootSelector);
backView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getX() < view.getLeft() || event.getX() >view.getRight()
|| event.getY() > view.getBottom() || event.getY() < view.getTop()) {
dismiss();
}
return false;
}
});
colorView = findViewById(R.id.viewColor);
colorView.setBackgroundColor(color);
// Resize ColorView
colorView.post(new Runnable() {
@Override
public void run() {
LinearLayout.LayoutParams params = (LayoutParams) colorView.getLayoutParams();
params.height = colorView.getWidth();
colorView.setLayoutParams(params);
}
});
// Configure Sliders
red = (Slider) findViewById(R.id.red);
green = (Slider) findViewById(R.id.green);
blue = (Slider) findViewById(R.id.blue);
int r = (this.color >> 16) & 0xFF;
int g = (this.color >> 8) & 0xFF;
int b = (this.color >> 0) & 0xFF;
red.setValue(r);
green.setValue(g);
blue.setValue(b);
red.setOnValueChangedListener(this);
green.setOnValueChangedListener(this);
blue.setOnValueChangedListener(this);
}
示例6: onCreate
import com.gc.materialdesign.views.Slider; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.color_selector);
colorView = findViewById(R.id.viewColor);
colorView.setBackgroundColor(color);
colorView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
colorView.post(new Runnable() {
@Override
public void run() {
LinearLayout.LayoutParams params = (LayoutParams) colorView.getLayoutParams();
params.height = colorView.getWidth();
colorView.setLayoutParams(params);
}
});
red = (Slider) findViewById(R.id.red);
green = (Slider) findViewById(R.id.green);
blue = (Slider) findViewById(R.id.blue);
int r = (this.color >> 16) & 0xFF;
int g = (this.color >> 8) & 0xFF;
int b = (this.color >> 0) & 0xFF;
red.setValue(r);
green.setValue(g);
blue.setValue(b);
red.setOnValueChangedListener(this);
green.setOnValueChangedListener(this);
blue.setOnValueChangedListener(this);
}