diff --git a/app/src/main/java/com/simplecity/amp_library/ui/views/SnowfallView.java b/app/src/main/java/com/simplecity/amp_library/ui/views/SnowfallView.java index fcd1c631b..949ad521d 100644 --- a/app/src/main/java/com/simplecity/amp_library/ui/views/SnowfallView.java +++ b/app/src/main/java/com/simplecity/amp_library/ui/views/SnowfallView.java @@ -75,18 +75,21 @@ public class SnowfallView extends View { final Handler snowHandler = new Handler(); /** Used to determine if we let it snow */ - final FirebaseRemoteConfig remoteConfig; + @Nullable + private FirebaseRemoteConfig remoteConfig = null; public SnowfallView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); snowPaint.setColor(Color.WHITE); snowPaint.setStyle(Paint.Style.FILL); - remoteConfig = FirebaseRemoteConfig.getInstance(); - remoteConfig.setDefaults(R.xml.remote_config_defaults); - remoteConfig.setConfigSettings(new FirebaseRemoteConfigSettings.Builder() - .setDeveloperModeEnabled(BuildConfig.DEBUG) - .build()); + if(!isInEditMode()) { + remoteConfig = FirebaseRemoteConfig.getInstance(); + remoteConfig.setDefaults(R.xml.remote_config_defaults); + remoteConfig.setConfigSettings(new FirebaseRemoteConfigSettings.Builder() + .setDeveloperModeEnabled(BuildConfig.DEBUG) + .build()); + } } @Override @@ -134,6 +137,9 @@ public void clear() { } private void fetchSnowConfig() { + if (isInEditMode()) { + return; + } remoteConfig.fetch().addOnCompleteListener((Activity) getContext(), task -> { if (task.isSuccessful()) { remoteConfig.activateFetched(); diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index 4c9c40e5a..1f4d1c329 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -121,11 +121,10 @@ android:layout_width="48dp" android:layout_height="48dp" android:layout_marginLeft="16dp" - android:layout_marginStart="16dp" android:tag=":aesthetic_ignore" - app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintBottom_toBottomOf="@+id/prev" app:layout_constraintLeft_toLeftOf="parent" - app:layout_constraintTop_toBottomOf="@+id/text2"/> + app:layout_constraintTop_toTopOf="@+id/prev"/> + app:layout_constraintTop_toTopOf="@+id/play"/> + app:layout_constraintTop_toTopOf="@+id/play"/> + app:layout_constraintTop_toTopOf="@+id/next"/> + android:layout_height="match_parent" + tools:visibility="gone"/>