Last active
April 4, 2018 07:06
-
-
Save bastami82/ef5987b79353978223b74257f42c09c9 to your computer and use it in GitHub Desktop.
set drwabale icon backward compatible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v7.content.res.AppCompatResources; | |
THE_VIEW.setBackgroundDrawable(AppCompatResources.getDrawable(ctx, R.drawable.ic_report_review); | |
//with drwable left | |
THE_VIEW.setCompoundDrawablesWithIntrinsicBounds(AppCompatResources.getDrawable(ctx, R.drawable.ic_report_review), null, null, null); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
drawableImage = AppCompatResources.getDrawable(context, R.drawable.image);
or
drawableImage = VectorDrawableCompat.create(context.getResources(), R.drawable.image, context.getTheme());