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

Commit 8163228d authored by Jin Seok Park's avatar Jin Seok Park
Browse files

MediaControlView2: Add Support for Embedded Size

   - Detect Orientation change and change to embedded size when portrait
   mode.
   - Make SettingsWindow size dynamic.
   - Make TransportControls location dynamic.

Bug: 74506210
Test: manually
Change-Id: Ia7ed9e33b4b27f5c7430f430b52ef5db4e64864d
parent fbf6b499
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -15,49 +15,49 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/MediaControlView2_settings_width"
    android:layout_height="@dimen/MediaControlView2_settings_height"
    android:layout_width="wrap_content"
    android:layout_height="@dimen/mcv2_embedded_settings_height"
    android:orientation="horizontal"
    android:background="@color/black_transparent_70">
    android:background="@color/black_opacity_70">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="@dimen/MediaControlView2_settings_height"
        android:paddingRight="2dp"
        android:layout_height="@dimen/mcv2_embedded_settings_height"
        android:gravity="center"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/icon"
            android:layout_width="@dimen/MediaControlView2_settings_icon_size"
            android:layout_height="@dimen/MediaControlView2_settings_icon_size"
            android:gravity="center"
            android:paddingLeft="2dp"/>
            android:layout_width="@dimen/mcv2_embedded_settings_icon_size"
            android:layout_height="@dimen/mcv2_embedded_settings_icon_size"
            android:layout_margin="8dp"
            android:gravity="center" />
    </LinearLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="@dimen/MediaControlView2_settings_height"
        android:layout_height="@dimen/mcv2_embedded_settings_height"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:id="@+id/main_text"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/MediaControlView2_text_width"
            android:layout_height="@dimen/mcv2_embedded_settings_text_height"
            android:gravity="center"
            android:paddingLeft="2dp"
            android:textColor="@color/white"
            android:textSize="@dimen/MediaControlView2_settings_main_text_size"/>
            android:textSize="@dimen/mcv2_embedded_settings_main_text_size"/>

        <TextView
            android:id="@+id/sub_text"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/MediaControlView2_text_width"
            android:layout_height="@dimen/mcv2_embedded_settings_text_height"
            android:layout_below="@id/main_text"
            android:gravity="center"
            android:paddingLeft="2dp"
            android:textColor="@color/white_transparent_70"
            android:textSize="@dimen/MediaControlView2_settings_sub_text_size"/>
            android:textColor="@color/white_opacity_70"
            android:textSize="@dimen/mcv2_embedded_settings_sub_text_size"/>
    </RelativeLayout>

</LinearLayout>
+11 −12
Original line number Diff line number Diff line
@@ -15,40 +15,39 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/MediaControlView2_settings_width"
    android:layout_height="@dimen/MediaControlView2_settings_height"
    android:layout_width="wrap_content"
    android:layout_height="@dimen/mcv2_embedded_settings_height"
    android:orientation="horizontal"
    android:background="@color/black_transparent_70">
    android:background="@color/black_opacity_70">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="@dimen/MediaControlView2_settings_height"
        android:paddingRight="2dp"
        android:layout_height="@dimen/mcv2_embedded_settings_height"
        android:gravity="center"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/check"
            android:layout_width="@dimen/MediaControlView2_settings_icon_size"
            android:layout_height="@dimen/MediaControlView2_settings_icon_size"
            android:layout_width="@dimen/mcv2_embedded_settings_icon_size"
            android:layout_height="@dimen/mcv2_embedded_settings_icon_size"
            android:layout_margin="8dp"
            android:gravity="center"
            android:paddingLeft="2dp"
            android:src="@drawable/ic_check"/>
    </LinearLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="@dimen/MediaControlView2_settings_height"
        android:layout_height="@dimen/mcv2_embedded_settings_height"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:id="@+id/text"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/MediaControlView2_text_width"
            android:layout_height="@dimen/mcv2_embedded_settings_text_height"
            android:gravity="center"
            android:paddingLeft="2dp"
            android:textColor="@color/white"
            android:textSize="@dimen/MediaControlView2_settings_main_text_size"/>
            android:textSize="@dimen/mcv2_embedded_settings_main_text_size"/>
    </RelativeLayout>

</LinearLayout>
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="horizontal"
    android:paddingLeft="@dimen/mcv2_transport_controls_padding"
    android:paddingRight="@dimen/mcv2_transport_controls_padding"
    android:visibility="visible">

    <ImageButton android:id="@+id/prev" style="@style/EmbeddedTransportControlsButton.Previous" />
    <ImageButton android:id="@+id/rew" style="@style/EmbeddedTransportControlsButton.Rew" />
    <ImageButton android:id="@+id/pause" style="@style/EmbeddedTransportControlsButton.Pause" />
    <ImageButton android:id="@+id/ffwd" style="@style/EmbeddedTransportControlsButton.Ffwd" />
    <ImageButton android:id="@+id/next" style="@style/EmbeddedTransportControlsButton.Next" />
</LinearLayout>
 No newline at end of file
+62 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="@dimen/mcv2_full_settings_height"
    android:orientation="horizontal"
    android:background="@color/black_opacity_70">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="@dimen/mcv2_full_settings_height"
        android:gravity="center"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/icon"
            android:layout_width="@dimen/mcv2_full_settings_icon_size"
            android:layout_height="@dimen/mcv2_full_settings_icon_size"
            android:layout_margin="8dp"
            android:gravity="center"/>
    </LinearLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="@dimen/mcv2_full_settings_height"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:id="@+id/main_text"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/mcv2_full_settings_text_height"
            android:paddingLeft="2dp"
            android:gravity="center"
            android:textColor="@color/white"
            android:textSize="@dimen/mcv2_full_settings_main_text_size"/>

        <TextView
            android:id="@+id/sub_text"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/mcv2_full_settings_text_height"
            android:layout_below="@id/main_text"
            android:gravity="center"
            android:paddingLeft="2dp"
            android:textColor="@color/white_opacity_70"
            android:textSize="@dimen/mcv2_full_settings_sub_text_size"/>
    </RelativeLayout>
</LinearLayout>
+53 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="@dimen/mcv2_full_settings_height"
    android:orientation="horizontal"
    android:background="@color/black_opacity_70">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="@dimen/mcv2_full_settings_height"
        android:gravity="center"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/check"
            android:layout_width="@dimen/mcv2_full_settings_icon_size"
            android:layout_height="@dimen/mcv2_full_settings_icon_size"
            android:layout_margin="8dp"
            android:gravity="center"
            android:src="@drawable/ic_check"/>
    </LinearLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="@dimen/mcv2_full_settings_height"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:id="@+id/text"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/mcv2_full_settings_text_height"
            android:gravity="center"
            android:paddingLeft="2dp"
            android:textColor="@color/white"
            android:textSize="@dimen/mcv2_full_settings_main_text_size"/>
    </RelativeLayout>
</LinearLayout>
 No newline at end of file
Loading