Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6502b75 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Use values-night to control the dark mode background color" into...

Merge "Use values-night to control the dark mode background color" into rvc-dev am: 89a6fafa am: 3f6c7230 am: 897eea3b

Change-Id: Ic01687809ab05464a514ffeb4bbfac0c78429829
parents 00ef0309 897eea3b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,5 +37,6 @@
    <color name="palette_list_color_cyan">@color/palette_list_dark_mode_color_cyan</color>
    <color name="palette_list_color_blue">@color/palette_list_dark_mode_color_blue</color>
    <color name="palette_list_color_purple">@color/palette_list_dark_mode_color_purple</color>
    <color name="gestures_setting_background_color">@android:color/black</color>
</resources>
+0 −17
Original line number Diff line number Diff line
@@ -39,17 +39,12 @@ import com.android.settings.R;
public class VideoPreference extends Preference {

    private static final String TAG = "VideoPreference";
    private static final int DEFAULT_BACKGROUND_RESOURCE_ID = -1;
    private final Context mContext;

    @VisibleForTesting
    AnimationController mAnimationController;
    @VisibleForTesting
    boolean mAnimationAvailable;
    @VisibleForTesting
    LinearLayout mAnimationView;
    @VisibleForTesting
    int mBackgroundResId = DEFAULT_BACKGROUND_RESOURCE_ID;

    private float mAspectRatio = 1.0f;
    private int mPreviewId;
@@ -120,7 +115,6 @@ public class VideoPreference extends Preference {
        mVideo = (TextureView) holder.findViewById(R.id.video_texture_view);
        mPreviewImage = (ImageView) holder.findViewById(R.id.video_preview_image);
        mPlayButton = (ImageView) holder.findViewById(R.id.video_play_button);
        mAnimationView = (LinearLayout) holder.itemView;
        final AspectRatioFrameLayout layout = (AspectRatioFrameLayout) holder.findViewById(
                R.id.video_container);

@@ -130,9 +124,6 @@ public class VideoPreference extends Preference {
            layout.setLayoutParams(new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.MATCH_PARENT, mHeight));
        }
        if (mBackgroundResId != DEFAULT_BACKGROUND_RESOURCE_ID) {
            mAnimationView.setBackgroundResource(mBackgroundResId);
        }
        if (mAnimationController != null) {
            mAnimationController.attachView(mVideo, mPreviewImage, mPlayButton);
        }
@@ -212,14 +203,6 @@ public class VideoPreference extends Preference {
                / (float) mAnimationController.getVideoHeight();
    }

    /**
     * Set the background color of the video preference
     * @param resId resource id of color
     */
    public void setBackgroundColor(int resId) {
        mBackgroundResId = resId;
    }

    /**
     * Handle animation operations.
     */
+0 −11
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.view.LayoutInflater;
import android.view.TextureView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceViewHolder;
@@ -61,8 +60,6 @@ public class VideoPreferenceTest {
    private ImageView fakePreview;
    @Mock
    private ImageView fakePlayButton;
    @Mock
    private LinearLayout mAnimationView;

    private Context mContext;
    private VideoPreference mVideoPreference;
@@ -77,7 +74,6 @@ public class VideoPreferenceTest {
                new MediaAnimationController(mContext, R.raw.accessibility_screen_magnification));
        mVideoPreference = new VideoPreference(mContext, null /* attrs */);
        mVideoPreference.mAnimationController = mAnimationController;
        mVideoPreference.mAnimationView = mAnimationView;
        when(mAnimationController.getVideoWidth()).thenReturn(VIDEO_WIDTH);
        when(mAnimationController.getVideoHeight()).thenReturn(VIDEO_HEIGHT);

@@ -162,13 +158,6 @@ public class VideoPreferenceTest {
        assertThat(vp2.mAnimationController instanceof VectorAnimationController).isTrue();
    }

    @Test
    public void setBackgroundColor_shouldBeCalled() {
        mVideoPreference.setBackgroundColor(1111);

        assertThat(mVideoPreference.mBackgroundResId).isEqualTo(1111);
    }

    public static class TestFragment extends PreferenceFragmentCompat {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {