Java Code Examples for android.view.View#refreshDrawableState()

The following examples show how to use android.view.View#refreshDrawableState() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: Hangar   File: Settings.java    License: GNU General Public License v3.0 6 votes vote down vote up
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);
}
 
Example 2
private void thumbNailScaleAnimation(View view) {
    view.setDrawingCacheEnabled(true);
    view.setPressed(false);
    view.refreshDrawableState();
    Bitmap bitmap = view.getDrawingCache();
    ActivityOptionsCompat opts = ActivityOptionsCompat.makeThumbnailScaleUpAnimation(
            view, bitmap, 0, 0);
    // Request the activity be started, using the custom animation options.
    startActivity(new Intent(MainNormalActivity.this, AppsPreferencesActivity.class),
            opts.toBundle());
    view.setDrawingCacheEnabled(false);
}
 
Example 3
private void thumbNailScaleAnimation(View view) {
    view.setDrawingCacheEnabled(true);
    view.setPressed(false);
    view.refreshDrawableState();
    Bitmap bitmap = view.getDrawingCache();
    ActivityOptionsCompat opts = ActivityOptionsCompat.makeThumbnailScaleUpAnimation(
            view, bitmap, 0, 0);
    // Request the activity be started, using the custom animation options.
    startActivity(new Intent(MainServiceActivity.this, AppsPreferencesActivity.class),
            opts.toBundle());
    view.setDrawingCacheEnabled(false);
}
 
Example 4
Source Project: MyBlogDemo   File: MainActivity.java    License: Apache License 2.0 5 votes vote down vote up
public void setOffset(View view, int offset, int minOffset) {

        offset = Math.max(minOffset, offset);
        if (offset > 105) {
            view.refreshDrawableState();
        }
        if (view.getTranslationY() != offset) {
            view.setTranslationY(offset);
            ViewCompat.postInvalidateOnAnimation(view);
        }
    }
 
Example 5
Source Project: Hangar   File: Settings.java    License: GNU General Public License v3.0 5 votes vote down vote up
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();
}
 
Example 6
Source Project: Hangar   File: Settings.java    License: GNU General Public License v3.0 5 votes vote down vote up
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();
}