Merge "[Overlay] Adjust Media Controls button size and position" into tm-qpr-dev am: f536c32036
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22087075 Change-Id: I17c9ad655e711c663472cf24b487e30978c97747 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -14,22 +14,15 @@
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<FrameLayout
|
||||
<com.android.systemui.animation.view.LaunchableImageView
|
||||
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
|
||||
android:id="@+id/home_controls_chip"
|
||||
android:layout_height="@dimen/dream_overlay_bottom_affordance_height"
|
||||
android:layout_width="@dimen/dream_overlay_bottom_affordance_width"
|
||||
android:layout_gravity="bottom|start"
|
||||
android:padding="@dimen/dream_overlay_bottom_affordance_padding"
|
||||
android:background="@drawable/dream_overlay_bottom_affordance_bg"
|
||||
android:scaleType="fitCenter"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:src="@drawable/controls_icon"
|
||||
android:contentDescription="@string/quick_controls_title" />
|
||||
|
||||
</FrameLayout>
|
||||
android:id="@+id/home_controls_chip"
|
||||
android:layout_height="@dimen/dream_overlay_bottom_affordance_height"
|
||||
android:layout_width="@dimen/dream_overlay_bottom_affordance_width"
|
||||
android:layout_gravity="bottom|start"
|
||||
android:padding="@dimen/dream_overlay_bottom_affordance_padding"
|
||||
android:background="@drawable/dream_overlay_bottom_affordance_bg"
|
||||
android:scaleType="fitCenter"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:src="@drawable/controls_icon"
|
||||
android:contentDescription="@string/quick_controls_title" />
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ public interface RegisteredComplicationsModule {
|
||||
@Named(DREAM_MEDIA_ENTRY_LAYOUT_PARAMS)
|
||||
static ComplicationLayoutParams provideMediaEntryLayoutParams(@Main Resources res) {
|
||||
return new ComplicationLayoutParams(
|
||||
res.getDimensionPixelSize(R.dimen.keyguard_affordance_fixed_width),
|
||||
res.getDimensionPixelSize(R.dimen.keyguard_affordance_fixed_height),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ComplicationLayoutParams.POSITION_BOTTOM
|
||||
| ComplicationLayoutParams.POSITION_START,
|
||||
ComplicationLayoutParams.DIRECTION_END,
|
||||
|
||||
@@ -35,7 +35,6 @@ import android.view.View;
|
||||
import androidx.test.filters.SmallTest;
|
||||
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.animation.view.LaunchableImageView;
|
||||
import com.android.systemui.condition.SelfExecutingMonitor;
|
||||
@@ -88,9 +87,6 @@ public class DreamHomeControlsComplicationTest extends SysuiTestCase {
|
||||
@Captor
|
||||
private ArgumentCaptor<ControlsListingController.ControlsListingCallback> mCallbackCaptor;
|
||||
|
||||
@Mock
|
||||
private View mView;
|
||||
|
||||
@Mock
|
||||
private LaunchableImageView mHomeControlsView;
|
||||
|
||||
@@ -115,7 +111,6 @@ public class DreamHomeControlsComplicationTest extends SysuiTestCase {
|
||||
when(mControlsComponent.getControlsListingController()).thenReturn(
|
||||
Optional.of(mControlsListingController));
|
||||
when(mControlsComponent.getVisibility()).thenReturn(AVAILABLE);
|
||||
when(mView.findViewById(R.id.home_controls_chip)).thenReturn(mHomeControlsView);
|
||||
|
||||
mMonitor = SelfExecutingMonitor.createInstance();
|
||||
}
|
||||
@@ -223,7 +218,7 @@ public class DreamHomeControlsComplicationTest extends SysuiTestCase {
|
||||
public void testClick_logsUiEvent() {
|
||||
final DreamHomeControlsComplication.DreamHomeControlsChipViewController viewController =
|
||||
new DreamHomeControlsComplication.DreamHomeControlsChipViewController(
|
||||
mView,
|
||||
mHomeControlsView,
|
||||
mActivityStarter,
|
||||
mContext,
|
||||
mControlsComponent,
|
||||
|
||||
Reference in New Issue
Block a user