本文整理汇总了Java中android.widget.SeekBar.getPaddingLeft方法的典型用法代码示例。如果您正苦于以下问题:Java SeekBar.getPaddingLeft方法的具体用法?Java SeekBar.getPaddingLeft怎么用?Java SeekBar.getPaddingLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.SeekBar
的用法示例。
在下文中一共展示了SeekBar.getPaddingLeft方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.SeekBar; //导入方法依赖的package包/类
/**
* Simple onCreate function. Here there is the init of the GUI.
*
* @param savedInstanceState As usual ...
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setContentView(R.layout.materialcolorpicker__layout_color_picker);
} else {
setContentView(R.layout.materialcolorpicker__layout_color_picker_old_android);
}
colorView = findViewById(R.id.colorView);
redSeekBar = (SeekBar) findViewById(R.id.redSeekBar);
greenSeekBar = (SeekBar) findViewById(R.id.greenSeekBar);
blueSeekBar = (SeekBar) findViewById(R.id.blueSeekBar);
seekBarLeft = redSeekBar.getPaddingLeft();
redToolTip = (TextView) findViewById(R.id.redToolTip);
greenToolTip = (TextView) findViewById(R.id.greenToolTip);
blueToolTip = (TextView) findViewById(R.id.blueToolTip);
codHex = (EditText) findViewById(R.id.codHex);
redSeekBar.setOnSeekBarChangeListener(this);
greenSeekBar.setOnSeekBarChangeListener(this);
blueSeekBar.setOnSeekBarChangeListener(this);
redSeekBar.setProgress(red);
greenSeekBar.setProgress(green);
blueSeekBar.setProgress(blue);
colorView.setBackgroundColor(Color.rgb(red, green, blue));
codHex.setText(String.format(COLOR_STRING_FORMAT, red, green, blue));
codHex.setEnabled(false);
// codHex.setOnEditorActionListener(
// new EditText.OnEditorActionListener() {
// @Override
// public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
// if (actionId == EditorInfo.IME_ACTION_SEARCH ||
// actionId == EditorInfo.IME_ACTION_DONE ||
// event.getAction() == KeyEvent.ACTION_DOWN &&
// event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
// updateColorView(v.getText().toString());
// InputMethodManager imm = (InputMethodManager) c.getSystemService(Context.INPUT_METHOD_SERVICE);
// imm.hideSoftInputFromWindow(codHex.getWindowToken(), 0);
//
// return true;
// }
// return false;
// }
// });
}