Update spacing in suggestion/condition header and footer.
Adjust the top/bottom padding for the header and footer so that the content is center-aligned. Change-Id: I01c0baf770abf3a8767a016a758ee1794403598b Fix: 63670820 Test: Visual
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
style="@style/SuggestionConditionStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="end">
|
||||
|
||||
|
@@ -20,16 +20,13 @@
|
||||
style="@style/SuggestionConditionStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Space
|
||||
android:id="@+id/top_space"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="9dp"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<FrameLayout
|
||||
@@ -87,8 +84,4 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="12dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -329,4 +329,8 @@
|
||||
<dimen name="battery_meter_width">66dp</dimen>
|
||||
<dimen name="battery_meter_height">100dp</dimen>
|
||||
|
||||
<!-- Suggestion/condition header padding -->
|
||||
<dimen name="suggestion_condition_header_padding_collapsed">10dp</dimen>
|
||||
<dimen name="suggestion_condition_header_padding_expanded">5dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
@@ -17,6 +17,7 @@ package com.android.settings.dashboard;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -34,7 +35,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Space;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
@@ -417,11 +417,12 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
|
||||
holder.summary.setText(null);
|
||||
}
|
||||
|
||||
if (curMode == DashboardData.HEADER_MODE_COLLAPSED) {
|
||||
holder.topSpace.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.topSpace.setVisibility(View.GONE);
|
||||
}
|
||||
final Resources res = mContext.getResources();
|
||||
final int padding = res.getDimensionPixelOffset(
|
||||
curMode == DashboardData.HEADER_MODE_COLLAPSED
|
||||
? R.dimen.suggestion_condition_header_padding_collapsed
|
||||
: R.dimen.suggestion_condition_header_padding_expanded);
|
||||
holder.itemView.setPadding(0, padding, 0, padding);
|
||||
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
if (moreSuggestions ) {
|
||||
@@ -548,13 +549,11 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
|
||||
public static class SuggestionAndConditionHeaderHolder extends DashboardItemHolder {
|
||||
public final LinearLayout icons;
|
||||
public final ImageView expandIndicator;
|
||||
public final Space topSpace;
|
||||
|
||||
public SuggestionAndConditionHeaderHolder(View itemView) {
|
||||
super(itemView);
|
||||
icons = itemView.findViewById(id.additional_icons);
|
||||
expandIndicator = itemView.findViewById(id.expand_indicator);
|
||||
topSpace = itemView.findViewById(id.top_space);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user