当前位置: 首页>>代码示例>>Java>>正文


Java Slider.setOnValueChangedListener方法代码示例

本文整理汇总了Java中com.gc.materialdesign.views.Slider.setOnValueChangedListener方法的典型用法代码示例。如果您正苦于以下问题:Java Slider.setOnValueChangedListener方法的具体用法?Java Slider.setOnValueChangedListener怎么用?Java Slider.setOnValueChangedListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.gc.materialdesign.views.Slider的用法示例。


在下文中一共展示了Slider.setOnValueChangedListener方法的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);
}
 
开发者ID:LINKIWI,项目名称:mobile-manager-for-cloudflare,代码行数:38,代码来源:ColorSelector.java

示例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);
}
 
开发者ID:quangctkm9207,项目名称:screen-corner,代码行数:38,代码来源:ColorSelector.java

示例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);
}
 
开发者ID:shegang,项目名称:meishiDemo,代码行数:52,代码来源:ColorSelector.java

示例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);
}
 
开发者ID:zubiix,项目名称:nearby-places,代码行数:52,代码来源:ColorSelector.java

示例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);
}
 
开发者ID:callmesusheel,项目名称:yelli,代码行数:52,代码来源:ColorSelector.java

示例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);
}
 
开发者ID:manuelsc,项目名称:Raven-Messenger,代码行数:42,代码来源:ColorSelector2.java


注:本文中的com.gc.materialdesign.views.Slider.setOnValueChangedListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。