本文整理了Java中android.view.View.refreshDrawableState()
方法的一些代码示例,展示了View.refreshDrawableState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.refreshDrawableState()
方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:refreshDrawableState
暂无
代码示例来源:origin: com.albedinsky.android/ui-base
/**
*/
@Override
public void clearError() {
if (mError != null) {
this.mError = null;
mWidget.refreshDrawableState();
mWidget.invalidate();
}
}
代码示例来源:origin: com.albedinsky.android/ui
/**
*/
@Override
public void clearError() {
if (mError != null) {
this.mError = null;
mWidget.refreshDrawableState();
mWidget.invalidate();
}
}
代码示例来源:origin: com.albedinsky.android/ui
/**
*/
@Override
public void setError(@NonNull CharSequence error) {
if (!TextUtils.equals(mError, error)) {
this.mError = error;
mWidget.refreshDrawableState();
mWidget.invalidate();
}
}
代码示例来源:origin: stackoverflow.com
View content = findViewById(R.id.myElementForScreenshoot);
View screenshot = content; // or content.getRootView() for fullscreen
screenshot.refreshDrawableState();
screenshot.setDrawingCacheEnabled(true);
Bitmap b = screenshot.getDrawingCache();
代码示例来源:origin: com.albedinsky.android/ui-base
/**
*/
@Override
public void setError(@NonNull CharSequence error) {
if (!TextUtils.equals(mError, error)) {
this.mError = error;
mWidget.refreshDrawableState();
mWidget.invalidate();
}
}
代码示例来源:origin: stackoverflow.com
class myMediaController extends MediaController{
private View anchorView = null; //this ref to videoview from setAnchorView(View view)
public myMediaController(Context context, boolean useFastForward) {
super(context, useFastForward);
}
@Override
public void setAnchorView(View view) {
super.setAnchorView(view);
anchorView = view;
}
@Override
public void hide() {
super.hide();
anchorView.invalidate(); //refresh with and height of video view on screen
anchorView.refreshDrawableState();
}
}
代码示例来源:origin: stackoverflow.com
public Bitmap getBitmapFromView(View view){
view.setDrawingCacheEnabled(true);
view.refreshDrawableState();
Bitmap bitmap = view.getDrawingCache();
view.setDrawingCacheEnabled(false);
return bitmap;
}
代码示例来源:origin: stackoverflow.com
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.rowlayout, parent, false);
if ((position % 2) == 0) {
rowView.setBackgroundResource(R.drawable.trapeze_down);
} else {
rowView.setBackgroundResource(R.drawable.trapeze_up);
}
rowView.refreshDrawableState();
return rowView;
}
代码示例来源:origin: tvbarthel/ChaseWhisplyProject
@Override
public void refreshDrawableState() {
super.refreshDrawableState();
if (isPressed()) {
ObjectAnimator fadeIn = ObjectAnimator.ofFloat(
this, "alpha", ALPHA_NORMAL_STATE, ALPHA_PRESSED_STATE);
fadeIn.setDuration(FADE_DURATION_IN_MILLI);
fadeIn.setInterpolator(new DecelerateInterpolator());
fadeIn.start();
} else {
ObjectAnimator fadeOut = ObjectAnimator.ofFloat(
this, "alpha", ALPHA_PRESSED_STATE, ALPHA_NORMAL_STATE);
fadeOut.setDuration(FADE_DURATION_IN_MILLI);
fadeOut.setInterpolator(new DecelerateInterpolator());
fadeOut.start();
}
}
代码示例来源:origin: corcoran/Hangar
protected void launchLicense() {
License license = new License(this);
View mLicense = license.getView();
mLicense.refreshDrawableState();
new AlertDialog.Builder(Settings.this)
.setTitle(R.string.license_title)
.setIcon(R.drawable.ic_logo)
.setView(mLicense)
.setPositiveButton(R.string.license_accept_button, null)
.show();
}
代码示例来源:origin: corcoran/Hangar
static protected void launchContribute(Context context) {
Contribute contribute = new Contribute(context);
View mContribute = contribute.getView();
mContribute.refreshDrawableState();
new AlertDialog.Builder(context)
.setTitle(R.string.contribute_title)
.setIcon(R.drawable.ic_logo)
.setView(mContribute)
.setPositiveButton(R.string.contribute_accept_button, null)
.show();
}
代码示例来源:origin: qiubiteme/android_api_demos
public void onClick(View v) {
Log.i(TAG, "Starting thumbnail-zoom animation...");
// Create a thumbnail animation. We are going to build our thumbnail
// just from the view that was pressed. We make sure the view is
// not selected, because by the time the animation starts we will
// have finished with the selection of the tap.
v.setDrawingCacheEnabled(true);
v.setPressed(false);
v.refreshDrawableState();
Bitmap bm = v.getDrawingCache();
Canvas c = new Canvas(bm);
//c.drawARGB(255, 255, 0, 0);
ActivityOptions opts = ActivityOptions.makeThumbnailScaleUpAnimation(
v, bm, 0, 0);
// Request the activity be started, using the custom animation options.
startActivity(new Intent(Animation.this, AlertDialogSamples.class), opts.toBundle());
v.setDrawingCacheEnabled(false);
}
};
代码示例来源:origin: li2/learning-android-open-source
public void onClick(View v) {
// Create a thumbnail animation. We are going to build our thumbnail
// just from the view that was pressed. We make sure the view is
// not selected, because by the time the animation starts we will
// have finished with the selection of the tap.
v.setDrawingCacheEnabled(true);
v.setPressed(false);
v.refreshDrawableState();
Bitmap bm = v.getDrawingCache();
Canvas c = new Canvas(bm);
//c.drawARGB(255, 255, 0, 0);
ActivityOptions opts = ActivityOptions.makeThumbnailScaleUpAnimation(
v, bm, 0, 0);
// Request the activity be started, using the custom animation options.
startActivity(new Intent(Animation.this, AlertDialogSamples.class), opts.toBundle());
v.setDrawingCacheEnabled(false);
}
};
代码示例来源:origin: corcoran/Hangar
@TargetApi(21)
static protected void launchUsPermission(Context context) {
UsPermission usPermission = new UsPermission(context);
View mUsPermission = usPermission.getView();
mUsPermission.refreshDrawableState();
new AlertDialog.Builder(context)
.setTitle(R.string.us_permission_title)
.setIcon(R.drawable.ic_logo)
.setView(mUsPermission)
.setPositiveButton(R.string.us_permission_settings_button,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mContext.startActivity(new Intent(
android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS));
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
mContext.startActivity(new Intent(
android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS));
}
})
.show();
}
代码示例来源:origin: corcoran/Hangar
protected void launchDonate() {
final Donate donate = new Donate(this);
donate.bindServiceConn();
View mDonate = donate.getView(mContext);
mDonate.refreshDrawableState();
AlertDialog.Builder builder = new AlertDialog.Builder(Settings.this)
.setTitle(R.string.donate_title)
.setIcon(R.drawable.ic_logo)
.setView(mDonate)
.setPositiveButton(R.string.donate_accept_button, null);
AlertDialog alert = builder.show();
alert.setOnDismissListener(new AlertDialog.OnDismissListener() {
public void onDismiss(DialogInterface dialog) {
donate.unbindServiceConn();
}
});
donate.setAlert(alert);
}
代码示例来源:origin: corcoran/Hangar
protected void launchChangelog() {
ChangeLog changelog = new ChangeLog(this);
View mChg = changelog.getView();
mChg.refreshDrawableState();
AlertDialog.Builder builder = new AlertDialog.Builder(Settings.this)
.setTitle(R.string.changelog_title)
内容来源于网络,如有侵权,请联系作者删除!