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

The following examples show how to use android.view.View#refreshDrawableState() . 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 check out the related API usage on the sidebar.
Example 1
Source File: Settings.java    From Hangar with 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
Source File: MainNormalActivity.java    From Mi-Band with GNU General Public License v2.0 5 votes vote down vote up
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
Source File: MainServiceActivity.java    From Mi-Band with GNU General Public License v2.0 5 votes vote down vote up
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 File: MainActivity.java    From MyBlogDemo with 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 File: Settings.java    From Hangar with 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 File: Settings.java    From Hangar with 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();
}