Last active
August 16, 2020 00:28
-
-
Save yuriyskulskiy/41ae1839e3919e03e4f787ecf67fda61 to your computer and use it in GitHub Desktop.
AnimatedLayout part 2: add additional view into the layout class.
This file contains 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
public class AnimatedLayout extends ConstraintLayout { | |
... | |
private CircleImageView mWeatherIcon; | |
... | |
@Override | |
protected void onFinishInflate() { | |
super.onFinishInflate(); | |
... | |
mWeatherIcon = findViewById(R.id.weatherIconIV); | |
} | |
... | |
private void applySummerIcon() { | |
mWeatherIcon.setImageResource(R.drawable.ic_sun); | |
mWeatherIcon.setCircleBackgroundColorResource(R.color.weather_icon_background_summer); | |
mWeatherIcon.setBorderColor(Color.WHITE); | |
} | |
private void applyWinterIcon() { | |
mWeatherIcon.setCircleBackgroundColorResource(R.color.snowflake_background); | |
mWeatherIcon.setImageResource(R.drawable.ic_snow); | |
mWeatherIcon.setBorderColor(Color.BLACK); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment