Merge "QS: Update layout to show gear all the time" into nyc-mr1-dev
am: cb9446453c
* commit 'cb9446453cee802819498348d265d0217878e47f':
QS: Update layout to show gear all the time
Change-Id: Icda1fccca3583004f3f58b86e844e7f39b355763
This commit is contained in:
24
packages/SystemUI/res/drawable/ic_mode_edit.xml
Normal file
24
packages/SystemUI/res/drawable/ic_mode_edit.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2016 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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="20.0dp"
|
||||||
|
android:height="20.0dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFF"
|
||||||
|
android:pathData="M3.0,17.25L3.0,21.0l3.75,0.0L17.81,9.94l-3.75,-3.75L3.0,17.25zM20.71,7.04c0.39,-0.3 0.39,-1.02 0.0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0.0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
|
||||||
|
</vector>
|
||||||
24
packages/SystemUI/res/drawable/ic_settings_20dp.xml
Normal file
24
packages/SystemUI/res/drawable/ic_settings_20dp.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2016 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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="20dp"
|
||||||
|
android:height="20dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:pathData="M19.4,13.0c0.0,-0.3 0.1,-0.6 0.1,-1.0s0.0,-0.7 -0.1,-1.0l2.1,-1.7c0.2,-0.2 0.2,-0.4 0.1,-0.6l-2.0,-3.5C19.5,5.1 19.3,5.0 19.0,5.1l-2.5,1.0c-0.5,-0.4 -1.1,-0.7 -1.7,-1.0l-0.4,-2.6C14.5,2.2 14.2,2.0 14.0,2.0l-4.0,0.0C9.8,2.0 9.5,2.2 9.5,2.4L9.1,5.1C8.5,5.3 8.0,5.7 7.4,6.1L5.0,5.1C4.7,5.0 4.5,5.1 4.3,5.3l-2.0,3.5C2.2,8.9 2.3,9.2 2.5,9.4L4.6,11.0c0.0,0.3 -0.1,0.6 -0.1,1.0s0.0,0.7 0.1,1.0l-2.1,1.7c-0.2,0.2 -0.2,0.4 -0.1,0.6l2.0,3.5C4.5,18.9 4.7,19.0 5.0,18.9l2.5,-1.0c0.5,0.4 1.1,0.7 1.7,1.0l0.4,2.6c0.0,0.2 0.2,0.4 0.5,0.4l4.0,0.0c0.2,0.0 0.5,-0.2 0.5,-0.4l0.4,-2.6c0.6,-0.3 1.2,-0.6 1.7,-1.0l2.5,1.0c0.2,0.1 0.5,0.0 0.6,-0.2l2.0,-3.5c0.1,-0.2 0.1,-0.5 -0.1,-0.6L19.4,13.0zM12.0,15.5c-1.9,0.0 -3.5,-1.6 -3.5,-3.5s1.6,-3.5 3.5,-3.5s3.5,1.6 3.5,3.5S13.9,15.5 12.0,15.5z"
|
||||||
|
android:fillColor="#ffffffff" />
|
||||||
|
</vector>
|
||||||
@@ -37,19 +37,6 @@
|
|||||||
android:importantForAccessibility="yes"
|
android:importantForAccessibility="yes"
|
||||||
android:focusable="true" />
|
android:focusable="true" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@android:id/edit"
|
|
||||||
style="@style/QSBorderlessButton"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:minWidth="88dp"
|
|
||||||
android:textAppearance="@style/TextAppearance.QS.DetailButton"
|
|
||||||
android:textColor="#64FFFFFF"
|
|
||||||
android:focusable="true"
|
|
||||||
android:text="@string/qs_edit"
|
|
||||||
android:contentDescription="@string/accessibility_quick_settings_edit"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</com.android.systemui.qs.PagedTileLayout>
|
</com.android.systemui.qs.PagedTileLayout>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<com.android.systemui.qs.QSPanel
|
<com.android.systemui.qs.QSPanel
|
||||||
android:id="@+id/quick_settings_panel"
|
android:id="@+id/quick_settings_panel"
|
||||||
android:background="#0000"
|
android:background="#0000"
|
||||||
android:layout_marginTop="@dimen/status_bar_header_height"
|
android:layout_marginTop="80dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingBottom="8dp" />
|
android:paddingBottom="8dp" />
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_marginTop="28dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginEnd="12dp">
|
android:layout_marginEnd="12dp">
|
||||||
|
|
||||||
<com.android.systemui.statusbar.phone.MultiUserSwitch android:id="@+id/multi_user_switch"
|
<com.android.systemui.statusbar.phone.MultiUserSwitch android:id="@+id/multi_user_switch"
|
||||||
@@ -52,6 +52,18 @@
|
|||||||
android:scaleType="centerInside"/>
|
android:scaleType="centerInside"/>
|
||||||
</com.android.systemui.statusbar.phone.MultiUserSwitch>
|
</com.android.systemui.statusbar.phone.MultiUserSwitch>
|
||||||
|
|
||||||
|
<com.android.systemui.statusbar.AlphaOptimizedImageView
|
||||||
|
android:id="@android:id/edit"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:src="@drawable/ic_mode_edit"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
|
android:contentDescription="@string/accessibility_quick_settings_edit"
|
||||||
|
android:padding="14dp" />
|
||||||
|
|
||||||
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
||||||
android:id="@+id/settings_button_container"
|
android:id="@+id/settings_button_container"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
@@ -64,7 +76,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/ripple_drawable"
|
android:background="@drawable/ripple_drawable"
|
||||||
android:src="@drawable/ic_settings"
|
android:src="@drawable/ic_settings_20dp"
|
||||||
android:contentDescription="@string/accessibility_quick_settings_settings" />
|
android:contentDescription="@string/accessibility_quick_settings_settings" />
|
||||||
<com.android.systemui.statusbar.AlphaOptimizedImageView android:id="@+id/tuner_icon"
|
<com.android.systemui.statusbar.AlphaOptimizedImageView android:id="@+id/tuner_icon"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -98,7 +110,7 @@
|
|||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="2dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.EmergencyCallsOnly"
|
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.EmergencyCallsOnly"
|
||||||
android:text="@*android:string/emergency_calls_only"
|
android:text="@*android:string/emergency_calls_only"
|
||||||
@@ -112,7 +124,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@@ -169,7 +181,7 @@
|
|||||||
android:id="@+id/quick_qs_panel"
|
android:id="@+id/quick_qs_panel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="28dp"
|
android:layout_marginTop="52dp"
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
|
|||||||
@@ -94,8 +94,6 @@
|
|||||||
<dimen name="navigation_key_width">128dp</dimen>
|
<dimen name="navigation_key_width">128dp</dimen>
|
||||||
<dimen name="navigation_key_padding">25dp</dimen>
|
<dimen name="navigation_key_padding">25dp</dimen>
|
||||||
|
|
||||||
<dimen name="qs_expand_margin">0dp</dimen>
|
|
||||||
|
|
||||||
<!-- Keyboard shortcuts helper -->
|
<!-- Keyboard shortcuts helper -->
|
||||||
<dimen name="ksh_layout_width">488dp</dimen>
|
<dimen name="ksh_layout_width">488dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,4 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<!-- Standard notification width + gravity -->
|
<!-- Standard notification width + gravity -->
|
||||||
<dimen name="notification_panel_width">544dp</dimen>
|
<dimen name="notification_panel_width">544dp</dimen>
|
||||||
|
|
||||||
<dimen name="qs_expand_margin">32dp</dimen>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
<dimen name="close_handle_underlap">32dp</dimen>
|
<dimen name="close_handle_underlap">32dp</dimen>
|
||||||
|
|
||||||
<!-- Height of the status bar header bar -->
|
<!-- Height of the status bar header bar -->
|
||||||
<dimen name="status_bar_header_height">80dp</dimen>
|
<dimen name="status_bar_header_height">104dp</dimen>
|
||||||
|
|
||||||
<!-- Height of the status bar header bar when expanded -->
|
<!-- Height of the status bar header bar when expanded -->
|
||||||
<dimen name="status_bar_header_height_expanded">116dp</dimen>
|
<dimen name="status_bar_header_height_expanded">116dp</dimen>
|
||||||
@@ -169,8 +169,6 @@
|
|||||||
<dimen name="qs_tile_margin_top">16dp</dimen>
|
<dimen name="qs_tile_margin_top">16dp</dimen>
|
||||||
<dimen name="qs_quick_tile_size">48dp</dimen>
|
<dimen name="qs_quick_tile_size">48dp</dimen>
|
||||||
<dimen name="qs_quick_tile_padding">12dp</dimen>
|
<dimen name="qs_quick_tile_padding">12dp</dimen>
|
||||||
<dimen name="qs_date_anim_translation">32dp</dimen>
|
|
||||||
<dimen name="qs_date_alarm_anim_translation">22dp</dimen>
|
|
||||||
<dimen name="qs_date_collapsed_text_size">14sp</dimen>
|
<dimen name="qs_date_collapsed_text_size">14sp</dimen>
|
||||||
<dimen name="qs_date_text_size">16sp</dimen>
|
<dimen name="qs_date_text_size">16sp</dimen>
|
||||||
<dimen name="qs_header_gear_translation">16dp</dimen>
|
<dimen name="qs_header_gear_translation">16dp</dimen>
|
||||||
@@ -199,7 +197,6 @@
|
|||||||
<dimen name="qs_detail_margin_top">28dp</dimen>
|
<dimen name="qs_detail_margin_top">28dp</dimen>
|
||||||
<dimen name="qs_data_usage_text_size">14sp</dimen>
|
<dimen name="qs_data_usage_text_size">14sp</dimen>
|
||||||
<dimen name="qs_data_usage_usage_text_size">36sp</dimen>
|
<dimen name="qs_data_usage_usage_text_size">36sp</dimen>
|
||||||
<dimen name="qs_expand_margin">0dp</dimen>
|
|
||||||
<dimen name="qs_battery_padding">2dp</dimen>
|
<dimen name="qs_battery_padding">2dp</dimen>
|
||||||
<dimen name="qs_detail_items_padding_top">4dp</dimen>
|
<dimen name="qs_detail_items_padding_top">4dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -103,8 +103,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
|
|||||||
mTileLayout = (QSTileLayout) LayoutInflater.from(mContext).inflate(
|
mTileLayout = (QSTileLayout) LayoutInflater.from(mContext).inflate(
|
||||||
R.layout.qs_paged_tile_layout, this, false);
|
R.layout.qs_paged_tile_layout, this, false);
|
||||||
addView((View) mTileLayout);
|
addView((View) mTileLayout);
|
||||||
findViewById(android.R.id.edit).setOnClickListener(view ->
|
|
||||||
mHost.startRunnableDismissingKeyguard(() -> showEdit(view)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isShowingCustomize() {
|
public boolean isShowingCustomize() {
|
||||||
@@ -354,7 +352,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void showEdit(final View v) {
|
public void showEdit(final View v) {
|
||||||
v.post(new Runnable() {
|
v.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -362,8 +360,8 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
|
|||||||
if (!mCustomizePanel.isCustomizing()) {
|
if (!mCustomizePanel.isCustomizing()) {
|
||||||
int[] loc = new int[2];
|
int[] loc = new int[2];
|
||||||
v.getLocationInWindow(loc);
|
v.getLocationInWindow(loc);
|
||||||
int x = loc[0];
|
int x = loc[0] + v.getWidth() / 2;
|
||||||
int y = loc[1];
|
int y = loc[1] + v.getHeight() / 2;
|
||||||
mCustomizePanel.show(x, y);
|
mCustomizePanel.show(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,12 +140,11 @@ public class QuickQSPanel extends QSPanel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public int getNumQuickTiles(Context context) {
|
public int getNumQuickTiles(Context context) {
|
||||||
return TunerService.get(context).getValue(NUM_QUICK_TILES, 5);
|
return TunerService.get(context).getValue(NUM_QUICK_TILES, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class HeaderTileLayout extends LinearLayout implements QSTileLayout {
|
private static class HeaderTileLayout extends LinearLayout implements QSTileLayout {
|
||||||
|
|
||||||
private final Space mEndSpacer;
|
|
||||||
protected final ArrayList<TileRecord> mRecords = new ArrayList<>();
|
protected final ArrayList<TileRecord> mRecords = new ArrayList<>();
|
||||||
|
|
||||||
public HeaderTileLayout(Context context) {
|
public HeaderTileLayout(Context context) {
|
||||||
@@ -154,34 +153,15 @@ public class QuickQSPanel extends QSPanel {
|
|||||||
setClipToPadding(false);
|
setClipToPadding(false);
|
||||||
setGravity(Gravity.CENTER_VERTICAL);
|
setGravity(Gravity.CENTER_VERTICAL);
|
||||||
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
||||||
|
|
||||||
mEndSpacer = new Space(context);
|
|
||||||
mEndSpacer.setLayoutParams(generateLayoutParams());
|
|
||||||
updateDownArrowMargin();
|
|
||||||
addView(mEndSpacer);
|
|
||||||
setOrientation(LinearLayout.HORIZONTAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onConfigurationChanged(Configuration newConfig) {
|
|
||||||
super.onConfigurationChanged(newConfig);
|
|
||||||
updateDownArrowMargin();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateDownArrowMargin() {
|
|
||||||
LayoutParams params = (LayoutParams) mEndSpacer.getLayoutParams();
|
|
||||||
params.setMarginStart(mContext.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.qs_expand_margin));
|
|
||||||
mEndSpacer.setLayoutParams(params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addTile(TileRecord tile) {
|
public void addTile(TileRecord tile) {
|
||||||
addView(tile.tileView, getChildCount() - 1 /* Leave icon at end */,
|
if (getChildCount() != 0) {
|
||||||
generateLayoutParams());
|
|
||||||
// Add a spacer.
|
// Add a spacer.
|
||||||
addView(new Space(mContext), getChildCount() - 1 /* Leave icon at end */,
|
addView(new Space(mContext), getChildCount(), generateSpaceParams());
|
||||||
generateSpaceParams());
|
}
|
||||||
|
addView(tile.tileView, getChildCount(), generateLayoutParams());
|
||||||
mRecords.add(tile);
|
mRecords.add(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,8 +185,10 @@ public class QuickQSPanel extends QSPanel {
|
|||||||
int childIndex = getChildIndex(tile.tileView);
|
int childIndex = getChildIndex(tile.tileView);
|
||||||
// Remove the tile.
|
// Remove the tile.
|
||||||
removeViewAt(childIndex);
|
removeViewAt(childIndex);
|
||||||
|
if (getChildCount() != 0) {
|
||||||
// Remove its spacer as well.
|
// Remove its spacer as well.
|
||||||
removeViewAt(childIndex);
|
removeViewAt(childIndex);
|
||||||
|
}
|
||||||
mRecords.remove(tile);
|
mRecords.remove(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,18 +81,16 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
protected MultiUserSwitch mMultiUserSwitch;
|
protected MultiUserSwitch mMultiUserSwitch;
|
||||||
private ImageView mMultiUserAvatar;
|
private ImageView mMultiUserAvatar;
|
||||||
|
|
||||||
private float mDateTimeTranslation;
|
|
||||||
private float mDateTimeAlarmTranslation;
|
|
||||||
private float mDateScaleFactor;
|
private float mDateScaleFactor;
|
||||||
protected float mGearTranslation;
|
protected float mGearTranslation;
|
||||||
|
|
||||||
private TouchAnimator mSecondHalfAnimator;
|
private TouchAnimator mSecondHalfAnimator;
|
||||||
private TouchAnimator mFirstHalfAnimator;
|
private TouchAnimator mFirstHalfAnimator;
|
||||||
private TouchAnimator mDateSizeAnimator;
|
private TouchAnimator mDateSizeAnimator;
|
||||||
private TouchAnimator mAlarmTranslation;
|
|
||||||
protected TouchAnimator mSettingsAlpha;
|
protected TouchAnimator mSettingsAlpha;
|
||||||
private float mExpansionAmount;
|
private float mExpansionAmount;
|
||||||
private QSTileHost mHost;
|
private QSTileHost mHost;
|
||||||
|
private View mEdit;
|
||||||
|
|
||||||
public QuickStatusBarHeader(Context context, AttributeSet attrs) {
|
public QuickStatusBarHeader(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -104,6 +102,10 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
|
|
||||||
mEmergencyOnly = (TextView) findViewById(R.id.header_emergency_calls_only);
|
mEmergencyOnly = (TextView) findViewById(R.id.header_emergency_calls_only);
|
||||||
|
|
||||||
|
mEdit = findViewById(android.R.id.edit);
|
||||||
|
findViewById(android.R.id.edit).setOnClickListener(view ->
|
||||||
|
mHost.startRunnableDismissingKeyguard(() -> mQsPanel.showEdit(view)));
|
||||||
|
|
||||||
mDateTimeAlarmGroup = (ViewGroup) findViewById(R.id.date_time_alarm_group);
|
mDateTimeAlarmGroup = (ViewGroup) findViewById(R.id.date_time_alarm_group);
|
||||||
mDateTimeAlarmGroup.findViewById(R.id.empty_time_view).setVisibility(View.GONE);
|
mDateTimeAlarmGroup.findViewById(R.id.empty_time_view).setVisibility(View.GONE);
|
||||||
mDateTimeGroup = (ViewGroup) findViewById(R.id.date_time_group);
|
mDateTimeGroup = (ViewGroup) findViewById(R.id.date_time_group);
|
||||||
@@ -153,16 +155,11 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
|
|
||||||
mGearTranslation = mContext.getResources().getDimension(R.dimen.qs_header_gear_translation);
|
mGearTranslation = mContext.getResources().getDimension(R.dimen.qs_header_gear_translation);
|
||||||
|
|
||||||
mDateTimeTranslation = mContext.getResources().getDimension(
|
|
||||||
R.dimen.qs_date_anim_translation);
|
|
||||||
mDateTimeAlarmTranslation = mContext.getResources().getDimension(
|
|
||||||
R.dimen.qs_date_alarm_anim_translation);
|
|
||||||
float dateCollapsedSize = mContext.getResources().getDimension(
|
float dateCollapsedSize = mContext.getResources().getDimension(
|
||||||
R.dimen.qs_date_collapsed_text_size);
|
R.dimen.qs_date_collapsed_text_size);
|
||||||
float dateExpandedSize = mContext.getResources().getDimension(
|
float dateExpandedSize = mContext.getResources().getDimension(
|
||||||
R.dimen.qs_date_text_size);
|
R.dimen.qs_date_text_size);
|
||||||
mDateScaleFactor = dateExpandedSize / dateCollapsedSize;
|
mDateScaleFactor = dateExpandedSize / dateCollapsedSize;
|
||||||
updateDateTimePosition();
|
|
||||||
|
|
||||||
mSecondHalfAnimator = new TouchAnimator.Builder()
|
mSecondHalfAnimator = new TouchAnimator.Builder()
|
||||||
.addFloat(mAlarmStatus, "alpha", 0, 1)
|
.addFloat(mAlarmStatus, "alpha", 0, 1)
|
||||||
@@ -184,10 +181,9 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
|
|
||||||
protected void updateSettingsAnimator() {
|
protected void updateSettingsAnimator() {
|
||||||
mSettingsAlpha = new TouchAnimator.Builder()
|
mSettingsAlpha = new TouchAnimator.Builder()
|
||||||
.addFloat(mSettingsContainer, "translationY", -mGearTranslation, 0)
|
.addFloat(mEdit, "translationY", -mGearTranslation, 0)
|
||||||
.addFloat(mMultiUserSwitch, "translationY", -mGearTranslation, 0)
|
.addFloat(mMultiUserSwitch, "translationY", -mGearTranslation, 0)
|
||||||
.addFloat(mSettingsButton, "rotation", -90, 0)
|
.addFloat(mEdit, "alpha", 0, 1)
|
||||||
.addFloat(mSettingsContainer, "alpha", 0, 1)
|
|
||||||
.addFloat(mMultiUserSwitch, "alpha", 0, 1)
|
.addFloat(mMultiUserSwitch, "alpha", 0, 1)
|
||||||
.setStartDelay(QSAnimator.EXPANDED_TILE_DELAY)
|
.setStartDelay(QSAnimator.EXPANDED_TILE_DELAY)
|
||||||
.build();
|
.build();
|
||||||
@@ -246,7 +242,6 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
mSecondHalfAnimator.setPosition(headerExpansionFraction);
|
mSecondHalfAnimator.setPosition(headerExpansionFraction);
|
||||||
mFirstHalfAnimator.setPosition(headerExpansionFraction);
|
mFirstHalfAnimator.setPosition(headerExpansionFraction);
|
||||||
mDateSizeAnimator.setPosition(headerExpansionFraction);
|
mDateSizeAnimator.setPosition(headerExpansionFraction);
|
||||||
mAlarmTranslation.setPosition(headerExpansionFraction);
|
|
||||||
mSettingsAlpha.setPosition(headerExpansionFraction);
|
mSettingsAlpha.setPosition(headerExpansionFraction);
|
||||||
|
|
||||||
updateAlarmVisibilities();
|
updateAlarmVisibilities();
|
||||||
@@ -267,15 +262,6 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
mAlarmStatusCollapsed.setVisibility(mAlarmShowing ? View.VISIBLE : View.INVISIBLE);
|
mAlarmStatusCollapsed.setVisibility(mAlarmShowing ? View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDateTimePosition() {
|
|
||||||
// This one has its own because we have to rebuild it every time the alarm state changes.
|
|
||||||
mAlarmTranslation = new TouchAnimator.Builder()
|
|
||||||
.addFloat(mDateTimeAlarmGroup, "translationY", 0, mAlarmShowing
|
|
||||||
? mDateTimeAlarmTranslation : mDateTimeTranslation)
|
|
||||||
.build();
|
|
||||||
mAlarmTranslation.setPosition(mExpansionAmount);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setListening(boolean listening) {
|
public void setListening(boolean listening) {
|
||||||
if (listening == mListening) {
|
if (listening == mListening) {
|
||||||
return;
|
return;
|
||||||
@@ -287,7 +273,6 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEverything() {
|
public void updateEverything() {
|
||||||
updateDateTimePosition();
|
|
||||||
updateVisibilities();
|
updateVisibilities();
|
||||||
setClickable(false);
|
setClickable(false);
|
||||||
}
|
}
|
||||||
@@ -296,7 +281,6 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
|||||||
updateAlarmVisibilities();
|
updateAlarmVisibilities();
|
||||||
mEmergencyOnly.setVisibility(mExpanded && mShowEmergencyCallsOnly
|
mEmergencyOnly.setVisibility(mExpanded && mShowEmergencyCallsOnly
|
||||||
? View.VISIBLE : View.INVISIBLE);
|
? View.VISIBLE : View.INVISIBLE);
|
||||||
mSettingsContainer.setVisibility(mExpanded ? View.VISIBLE : View.INVISIBLE);
|
|
||||||
mSettingsContainer.findViewById(R.id.tuner_icon).setVisibility(
|
mSettingsContainer.findViewById(R.id.tuner_icon).setVisibility(
|
||||||
TunerService.isTunerEnabled(mContext) ? View.VISIBLE : View.INVISIBLE);
|
TunerService.isTunerEnabled(mContext) ? View.VISIBLE : View.INVISIBLE);
|
||||||
mMultiUserSwitch.setVisibility(mExpanded && mMultiUserSwitch.hasMultipleUsers()
|
mMultiUserSwitch.setVisibility(mExpanded && mMultiUserSwitch.hasMultipleUsers()
|
||||||
|
|||||||
Reference in New Issue
Block a user