本文整理了Java中android.widget.ImageView.setClickable()
方法的一些代码示例,展示了ImageView.setClickable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setClickable()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setClickable
暂无
代码示例来源:origin: mancj/MaterialSearchBar
/**
* sets the speechMode for the search bar.
* If set to true, microphone icon will display instead of the search icon.
* Also clicking on this icon will trigger the callback method onButtonClicked()
*
* @param speechMode enable speech
* @see #BUTTON_SPEECH
* @see OnSearchActionListener#onButtonClicked(int)
*/
public void setSpeechMode(boolean speechMode) {
this.speechMode = speechMode;
if (speechMode) {
searchIcon.setImageResource(speechIconRes);
searchIcon.setClickable(true);
} else {
searchIcon.setImageResource(searchIconRes);
searchIcon.setClickable(false);
}
}
代码示例来源:origin: Yalantis/Side-Menu.Android
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
mImageView = (ImageView) rootView.findViewById(R.id.image_content);
mImageView.setClickable(true);
mImageView.setFocusable(true);
mImageView.setImageResource(res);
return rootView;
}
代码示例来源:origin: bingoogolapple/BGABanner-Android
public static ImageView getItemImageView(Context context, @DrawableRes int resId, BGALocalImageSize localImageSize, ImageView.ScaleType scaleType) {
ImageView imageView = new ImageView(context);
imageView.setImageBitmap(getScaledImageFromResource(context, resId, localImageSize.getMaxWidth(), localImageSize.getMaxHeight(), localImageSize.getMinWidth(), localImageSize.getMinHeight()));
imageView.setClickable(true);
imageView.setScaleType(scaleType);
return imageView;
}
代码示例来源:origin: mancj/MaterialSearchBar
/**
* Set navigation drawer menu icon enabled
*
* @param navButtonEnabled icon enabled
*/
public void setNavButtonEnabled(boolean navButtonEnabled) {
this.navButtonEnabled = navButtonEnabled;
if (navButtonEnabled) {
navIcon.setVisibility(VISIBLE);
navIcon.setClickable(true);
navIcon.getLayoutParams().width = (int) (50 * destiny);
((LayoutParams) inputContainer.getLayoutParams()).leftMargin = (int) (50 * destiny);
arrowIcon.setVisibility(GONE);
} else {
navIcon.getLayoutParams().width = 1;
navIcon.setVisibility(INVISIBLE);
navIcon.setClickable(false);
((LayoutParams) inputContainer.getLayoutParams()).leftMargin = (int) (0 * destiny);
arrowIcon.setVisibility(VISIBLE);
}
navIcon.requestLayout();
placeHolder.requestLayout();
arrowIcon.requestLayout();
}
代码示例来源:origin: multidots/android-app-common-tasks
private void sharedConstructing(Context context) {
super.setClickable(true);
this.context = context;
mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
mGestureDetector = new GestureDetector(context, new GestureListener());
matrix = new Matrix();
prevMatrix = new Matrix();
m = new float[9];
normalizedScale = 1;
if (mScaleType == null) {
mScaleType = ScaleType.FIT_CENTER;
}
minScale = 1;
maxScale = 3;
superMinScale = SUPER_MIN_MULTIPLIER * minScale;
superMaxScale = SUPER_MAX_MULTIPLIER * maxScale;
setImageMatrix(matrix);
setScaleType(ScaleType.MATRIX);
setState(State.NONE);
onDrawReady = false;
super.setOnTouchListener(new PrivateOnTouchListener());
}
代码示例来源:origin: multidots/android-app-common-tasks
private void sharedConstructing(Context context) {
super.setClickable(true);
this.context = context;
mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
mGestureDetector = new GestureDetector(context, new GestureListener());
matrix = new Matrix();
prevMatrix = new Matrix();
m = new float[9];
normalizedScale = 1;
if (mScaleType == null) {
mScaleType = ScaleType.FIT_CENTER;
}
minScale = 1;
maxScale = 3;
superMinScale = SUPER_MIN_MULTIPLIER * minScale;
superMaxScale = SUPER_MAX_MULTIPLIER * maxScale;
setImageMatrix(matrix);
setScaleType(ScaleType.MATRIX);
setState(State.NONE);
onDrawReady = false;
super.setOnTouchListener(new PrivateOnTouchListener());
}
代码示例来源:origin: heinrichreimer/material-drawer
@Override
public void onAnimationEnd(Animator animation) {
imageViewOpenProfileListIcon.setClickable(true);
profileListOpen = true;
updateListVisibility();
}
代码示例来源:origin: heinrichreimer/material-drawer
@Override
public void onAnimationEnd(Animator animation) {
imageViewOpenProfileListIcon.setClickable(true);
profileListOpen = false;
updateListVisibility();
}
代码示例来源:origin: stackoverflow.com
public class YourActivityName extends Activity
{
private ImageView mImageView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mImageView = (ImageView)findViewById(R.id.categories);
mImageView.setClickable(true);
}
}
代码示例来源:origin: stackoverflow.com
ImageView imgFavorite = (ImageView) findViewById(R.id.favorite_icon);
imgFavorite.setClickable(true);
imgFavorite.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//Change the image here.
}
});
代码示例来源:origin: hypeapps/FixMath
@Override
public void onAnimationEnd(Animator animation) {
pauseTextView.setVisibility(View.INVISIBLE);
pauseBTn.setClickable(true);
}
代码示例来源:origin: stackoverflow.com
gridView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
ImageView image = (ImageView) v.findViewById(R.id.image);;
image.setClickable(false);
image.setImageResource(R.drawable.skin_x);
TextView text = (TextView) v.findViewById(R.id.text)
Toast.makeText(getApplicationContext(), text.getText(), Toast.LENGTH_SHORT).show();
}
});
代码示例来源:origin: heinrichreimer/material-drawer
@Override
public void onAnimationStart(Animator animation) {
linearListView.setVisibility(VISIBLE);
imageViewOpenProfileListIcon.setClickable(false);
}
代码示例来源:origin: heinrichreimer/material-drawer
@Override
public void onAnimationStart(Animator animation) {
linearListViewProfileList.setVisibility(VISIBLE);
imageViewOpenProfileListIcon.setClickable(false);
}
代码示例来源:origin: stackoverflow.com
final ImageView img = (ImageView)findViewById(R.id.imageView1);
img.setClickable(true);
img.setFocusable(true);
img.setOnClickListener(new View.OnClickListener(){
...
代码示例来源:origin: SiberiaDante/TitleLayout
/**
* 设置右侧图片是否可以点击
*/
public void setRightImageClickable(boolean isClickable) {
mIvRight.setClickable(isClickable);
mIvRight.setFocusable(isClickable);
}
代码示例来源:origin: SiberiaDante/TitleLayout
/**
* 设置左侧图片是否可以点击
*/
public void setLeftImageClickable(boolean isClickable) {
mIvLeft.setClickable(isClickable);
mIvLeft.setFocusable(isClickable);
}
代码示例来源:origin: ddwhan0123/CuteEditTextGit
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
int valueLen = s.length();
if (valueLen < Default_MinLength || valueLen > Default_MaxLength) {
editText.setTextColor(getResources().getColor(R.color.OrangeRed));
imageView.setClickable(true);
} else {
editText.setTextColor(getResources().getColor(R.color.CornflowerBlue));
imageView.setImageResource(R.drawable.checkmark);
imageView.setClickable(false);
}
}
代码示例来源:origin: fennifith/Alarmio
@Override
public void onReset() {
lapsLayout.removeAllViews();
time.setMaxProgress(0);
time.setReferenceProgress(0);
reset.setClickable(false);
reset.setAlpha(0f);
lap.setVisibility(View.INVISIBLE);
share.setVisibility(View.GONE);
}
代码示例来源:origin: heinrichreimer/material-drawer
@Override
public void onAnimationStart(Animator animation) {
imageViewProfileBackground.setImageDrawable(oldProfile.getBackground());
imageViewProfileBackgroundOverlay.setImageDrawable(newProfile.getBackground());
imageViewProfileBackgroundOverlay.setColorFilter(filter.getColorFilter());
imageViewProfileBackgroundOverlay.setVisibility(VISIBLE);
imageViewProfileAvatarSecondary.setClickable(false);
}
内容来源于网络,如有侵权,请联系作者删除!