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

Commit f536c320 authored by Coco Duan's avatar Coco Duan Committed by Android (Google) Code Review
Browse files

Merge "[Overlay] Adjust Media Controls button size and position" into tm-qpr-dev

parents 3def7dfc 84ac18ff
Loading
Loading
Loading
Loading
+11 −18
Original line number Diff line number Diff line
@@ -14,13 +14,8 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:paddingVertical="@dimen/dream_overlay_complication_home_controls_padding">

<com.android.systemui.animation.view.LaunchableImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/home_controls_chip"
    android:layout_height="@dimen/dream_overlay_bottom_affordance_height"
    android:layout_width="@dimen/dream_overlay_bottom_affordance_width"
@@ -31,5 +26,3 @@
    android:tint="?android:attr/textColorPrimary"
    android:src="@drawable/controls_icon"
    android:contentDescription="@string/quick_controls_title" />

</FrameLayout>
+5 −6
Original line number Diff line number Diff line
@@ -17,13 +17,12 @@
<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/media_entry_chip"
    android:layout_height="@dimen/keyguard_affordance_fixed_height"
    android:layout_width="@dimen/keyguard_affordance_fixed_width"
    android:layout_height="@dimen/dream_overlay_bottom_affordance_height"
    android:layout_width="@dimen/dream_overlay_bottom_affordance_width"
    android:layout_gravity="bottom|start"
    android:scaleType="center"
    android:scaleType="fitCenter"
    android:padding="@dimen/dream_overlay_bottom_affordance_padding"
    android:tint="?android:attr/textColorPrimary"
    android:src="@drawable/ic_music_note"
    android:background="@drawable/keyguard_bottom_affordance_bg"
    android:layout_marginStart="@dimen/keyguard_affordance_horizontal_offset"
    android:layout_marginBottom="@dimen/keyguard_affordance_vertical_offset"
    android:background="@drawable/dream_overlay_bottom_affordance_bg"
    android:contentDescription="@string/controls_media_title" />
+0 −1
Original line number Diff line number Diff line
@@ -1591,7 +1591,6 @@
    <dimen name="dream_overlay_bottom_affordance_padding">14dp</dimen>
    <dimen name="dream_overlay_complication_clock_time_text_size">86dp</dimen>
    <dimen name="dream_overlay_complication_clock_time_translation_y">28dp</dimen>
    <dimen name="dream_overlay_complication_home_controls_padding">28dp</dimen>
    <dimen name="dream_overlay_complication_clock_subtitle_text_size">24sp</dimen>
    <dimen name="dream_overlay_complication_preview_text_size">36sp</dimen>
    <dimen name="dream_overlay_complication_preview_icon_padding">28dp</dimen>
+8 −10
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.UiEvent;
import com.android.internal.logging.UiEventLogger;
import com.android.systemui.CoreStartable;
import com.android.systemui.R;
import com.android.systemui.animation.ActivityLaunchAnimator;
import com.android.systemui.controls.ControlsServiceInfo;
import com.android.systemui.controls.dagger.ControlsComponent;
@@ -157,14 +156,14 @@ public class DreamHomeControlsComplication implements Complication {
     * Contains values/logic associated with the dream complication view.
     */
    public static class DreamHomeControlsChipViewHolder implements ViewHolder {
        private final View mView;
        private final ImageView mView;
        private final ComplicationLayoutParams mLayoutParams;
        private final DreamHomeControlsChipViewController mViewController;

        @Inject
        DreamHomeControlsChipViewHolder(
                DreamHomeControlsChipViewController dreamHomeControlsChipViewController,
                @Named(DREAM_HOME_CONTROLS_CHIP_VIEW) View view,
                @Named(DREAM_HOME_CONTROLS_CHIP_VIEW) ImageView view,
                @Named(DREAM_HOME_CONTROLS_CHIP_LAYOUT_PARAMS) ComplicationLayoutParams layoutParams
        ) {
            mView = view;
@@ -174,7 +173,7 @@ public class DreamHomeControlsComplication implements Complication {
        }

        @Override
        public View getView() {
        public ImageView getView() {
            return mView;
        }

@@ -187,7 +186,7 @@ public class DreamHomeControlsComplication implements Complication {
    /**
     * Controls behavior of the dream complication.
     */
    static class DreamHomeControlsChipViewController extends ViewController<View> {
    static class DreamHomeControlsChipViewController extends ViewController<ImageView> {
        private static final String TAG = "DreamHomeControlsCtrl";
        private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);

@@ -216,7 +215,7 @@ public class DreamHomeControlsComplication implements Complication {

        @Inject
        DreamHomeControlsChipViewController(
                @Named(DREAM_HOME_CONTROLS_CHIP_VIEW) View view,
                @Named(DREAM_HOME_CONTROLS_CHIP_VIEW) ImageView view,
                ActivityStarter activityStarter,
                Context context,
                ControlsComponent controlsComponent,
@@ -231,10 +230,9 @@ public class DreamHomeControlsComplication implements Complication {

        @Override
        protected void onViewAttached() {
            final ImageView chip = mView.findViewById(R.id.home_controls_chip);
            chip.setImageResource(mControlsComponent.getTileImageId());
            chip.setContentDescription(mContext.getString(mControlsComponent.getTileTitleId()));
            chip.setOnClickListener(this::onClickHomeControls);
            mView.setImageResource(mControlsComponent.getTileImageId());
            mView.setContentDescription(mContext.getString(mControlsComponent.getTileTitleId()));
            mView.setOnClickListener(this::onClickHomeControls);
        }

        @Override
+3 −3
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ package com.android.systemui.dreams.complication.dagger;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

import com.android.systemui.R;
import com.android.systemui.dreams.complication.DreamHomeControlsComplication;
@@ -74,8 +74,8 @@ public interface DreamHomeControlsComplicationComponent {
        @Provides
        @DreamHomeControlsComplicationScope
        @Named(DREAM_HOME_CONTROLS_CHIP_VIEW)
        static View provideHomeControlsChipView(LayoutInflater layoutInflater) {
            return layoutInflater.inflate(R.layout.dream_overlay_home_controls_chip,
        static ImageView provideHomeControlsChipView(LayoutInflater layoutInflater) {
            return (ImageView) layoutInflater.inflate(R.layout.dream_overlay_home_controls_chip,
                    null, false);
        }
    }
Loading