本文整理了Java中android.widget.ImageView.setImageLevel()
方法的一些代码示例,展示了ImageView.setImageLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setImageLevel()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setImageLevel
暂无
代码示例来源:origin: commonsguy/cw-omnibus
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
image.setImageLevel(progress);
}
代码示例来源:origin: commonsguy/cw-omnibus
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
setRetainInstance(true);
View result=inflater.inflate(R.layout.scaleclip, container, false);
SeekBar bar=((SeekBar)result.findViewById(R.id.level));
bar.setOnSeekBarChangeListener(this);
image=(ImageView)result.findViewById(R.id.image);
setImageBackground(image);
image.setImageLevel(bar.getProgress());
return(result);
}
代码示例来源:origin: stackoverflow.com
//This is any view subclass that you have chosen to do this
ImageView progress;
progress.setImageResource(R.drawable.progress_background);
//Adjust the progress by adjusting the drawable's level
progress.setImageLevel(500);
// -- OR --
progress.getDrawable().setLevel(500);
代码示例来源:origin: ome450901/SimpleRatingBar
public void setPartialFilled(float rating) {
float percentage = rating % 1;
int level = (int) (10000 * percentage);
level = level == 0 ? 10000 : level;
mFilledView.setImageLevel(level);
mEmptyView.setImageLevel(10000 - level);
}
代码示例来源:origin: ome450901/SimpleRatingBar
public void setFilled() {
mFilledView.setImageLevel(10000);
mEmptyView.setImageLevel(0);
}
代码示例来源:origin: ome450901/SimpleRatingBar
public void setEmpty() {
mFilledView.setImageLevel(0);
mEmptyView.setImageLevel(10000);
}
代码示例来源:origin: huangweicai/OkLibDemo
public void setPartialFilled(float rating) {
float percentage = rating % 1;
int level = (int) (10000 * percentage);
level = level == 0 ? 10000 : level;
mFilledView.setImageLevel(level);
mEmptyView.setImageLevel(10000 - level);
}
代码示例来源:origin: huangweicai/OkLibDemo
public void setEmpty() {
mFilledView.setImageLevel(0);
mEmptyView.setImageLevel(10000);
}
代码示例来源:origin: huangweicai/OkLibDemo
public void setFilled() {
mFilledView.setImageLevel(10000);
mEmptyView.setImageLevel(0);
}
代码示例来源:origin: stackoverflow.com
int count = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ImageView img = (ImageView) findViewById(R.id.level_image);
img.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (count%2==0) img.setImageLevel(1);
else img.setImageLevel(0);
count++;
}
});
}
代码示例来源:origin: stackoverflow.com
ImageView wheel;
//You only do this once
wheel.setImageResource(R.drawable.wheel_rotate);
//Adjust the progress any time you need to by adjusting the drawable's level
wheel.setImageLevel(500);
代码示例来源:origin: wangxp423/ViewExercise
public void computScrollLine(){
int level = mLineScroller.getCurrX();
mLineLeft.setImageLevel(level);
mLineRight.setImageLevel(level);
invalidate();
}
代码示例来源:origin: wangxp423/ViewExercise
public void computScrollCircle(){
int level = mCircleScroller.getCurrX();
mCircleTop.setImageLevel(level);
mCircleBottom.setImageLevel(level);
invalidate();
}
public void computScrollLine(){
代码示例来源:origin: Meiqia/MeiqiaSDK-Android
private void changeState(int status) {
if (mCurrentState != status) {
mCurrentState = status;
switch (mCurrentState) {
case STATE_NORMAL:
mStatusTv.setText(R.string.mq_audio_status_normal);
mAnimIv.setImageLevel(1);
break;
case STATE_RECORDING:
mStatusTv.setText(R.string.mq_audio_status_recording);
break;
case STATE_WANT_CANCEL:
mStatusTv.setText(R.string.mq_audio_status_want_cancel);
mAnimIv.setImageLevel(10);
break;
}
}
}
代码示例来源:origin: M66B/XPrivacyLua
void updateExpand() {
XApp app = filtered.get(getAdapterPosition());
boolean isExpanded = (group == null && expanded.containsKey(app.packageName) && expanded.get(app.packageName));
ivExpander.setImageLevel(isExpanded ? 1 : 0);
ivExpander.setVisibility(group == null ? View.VISIBLE : View.INVISIBLE);
grpExpanded.setVisibility(isExpanded ? View.VISIBLE : View.GONE);
}
}
代码示例来源:origin: NordicSemiconductor/Android-nRF-Toolbox
@Override
public View getView(final int position, final View convertView, final ViewGroup parent) {
View view = convertView;
if (view == null) {
view = LayoutInflater.from(getActivity()).inflate(R.layout.feature_uart_dialog_edit_icon, parent, false);
}
final ImageView image = (ImageView) view;
image.setImageLevel(position);
image.setActivated(position == mActiveIcon && mActiveCheckBox.isChecked());
return view;
}
}
代码示例来源:origin: Meiqia/MeiqiaSDK-Android
@Override
public void run() {
if (mCurrentState == STATE_RECORDING) {
mAnimIv.setImageLevel(mAudioRecorderManager.getVoiceLevel(VOICE_LEVEL_COUNT));
int remainingTime = Math.round(RECORDER_MAX_TIME - mTime);
if (remainingTime <= 10) {
mStatusTv.setText(getContext().getString(R.string.mq_recorder_remaining_time, remainingTime));
}
}
}
});
代码示例来源:origin: zincPower/UI2018
@Override
public void onClick(View view) {
int i = view.getId();
if (i == R.id.btn_change) {
String levelString = getLevel().getText().toString();
try {
int level = Integer.parseInt(levelString);
if (level < 0 || level > 10000) {
Toast.makeText(this, "范围0-10000", Toast.LENGTH_SHORT).show();
return;
}
iv.setImageLevel(level);
} catch (Exception e) {
e.printStackTrace();
}
}
}
代码示例来源:origin: yangchong211/YCAudioPlayer
private void initPlayMode() {
int playMode = SPUtils.getInstance(Constant.SP_NAME).getInt(Constant.PLAY_MODE, 0);
ivMode.setImageLevel(playMode);
}
代码示例来源:origin: zincPower/UI2018
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.drawable_client_activity);
Drawable unselectedDrawable = ContextCompat.getDrawable(this, R.drawable.avft);
Drawable selectedDrawable = ContextCompat.getDrawable(this, R.drawable.avft_active);
ImageView imageview = findViewById(R.id.iv);
RevealDrawable revealDrawable = new RevealDrawable(unselectedDrawable,
selectedDrawable, RevealDrawable.HORIZONTAL);
imageview.setImageDrawable(revealDrawable);
imageview.setImageLevel(5000);
iv = (ImageView) findViewById(R.id.iv);
findViewById(R.id.btn_change).setOnClickListener(this);
}
内容来源于网络,如有侵权,请联系作者删除!