本文整理汇总了Java中android.widget.SeekBar.getContext方法的典型用法代码示例。如果您正苦于以下问题:Java SeekBar.getContext方法的具体用法?Java SeekBar.getContext怎么用?Java SeekBar.getContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.SeekBar
的用法示例。
在下文中一共展示了SeekBar.getContext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onProgressChanged
import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
Activity activity = (Activity) seekBar.getContext();
SeekBar redBar = activity.findViewById(R.id.RedBar);
float red = (redBar.getProgress()+1);
red = red/100;
SeekBar greenBar = activity.findViewById(R.id.GreenBar);
float green = (greenBar.getProgress()+1);
green = green/100;
SeekBar blueBar = activity.findViewById(R.id.BlueBar);
float blue = (blueBar.getProgress()+1);
blue = blue/100;
helper.sh(String.format("killall echo; echo 1015 i32 1 f %f f 0 f 0 f 0 f 0 f %f f 0 f 0 f 0 f 0 f %f f 0 f 0 f 0 f 0 f 1 > %s &", red, green, blue, activity.getCacheDir()+"/pipe"));
}
示例2: onProgressChanged
import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
public void onProgressChanged(SeekBar seekbar, int progress, boolean fromUser) {
ReactContext reactContext = (ReactContext) seekbar.getContext();
reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher().dispatchEvent(
new ReactSliderEvent(
seekbar.getId(),
((ReactSlider) seekbar).toRealProgress(progress),
fromUser));
}
示例3: onStopTrackingTouch
import android.widget.SeekBar; //导入方法依赖的package包/类
@Override
public void onStopTrackingTouch(SeekBar seekbar) {
ReactContext reactContext = (ReactContext) seekbar.getContext();
reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher().dispatchEvent(
new ReactSlidingCompleteEvent(
seekbar.getId(),
((ReactSlider) seekbar).toRealProgress(seekbar.getProgress())));
}