[app] Fix a newyear header crash (#101)

This commit is contained in:
tehcneko 2021-02-09 00:09:00 +08:00 committed by GitHub
parent 75bd97607d
commit 3e11c276c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ public class HolidayHelper {
view.setEmissionRate(rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270 ? 8 : 4);
view.setFadeOutPercent(0.75f);
view.setAngle(0);
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) view.getLayoutParams();
CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) view.getLayoutParams();
lp.height = activity.getResources().getDisplayMetrics().heightPixels / (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270 ? 2 : 3);
view.setLayoutParams(lp);
setWeatherGenerator(new SnowGenerator(activity));