Skip to content
Permalink
Browse files

Modify the '+' shortcut & Other things/fixes

While a neat function, the feature didn't quite fit in with our usages.
We've reamoved that and added the same function to longpressing settings
quick-tile. There's more to come with these ideas

To-Do:
    Add first time use notificatioand pop-up guide

PS1: What am I doing?
PS2: fix the terrible formatting.
PS4: whitespace
PS5: manual rebase
PS6: derp --sorry

Change-Id: I79eeb060deb1e6e19e557d4fcd3b96464602ac39
  • Loading branch information
mallardduck committed Aug 7, 2014
1 parent b6ff137 commit 0844f298e5a8d7b98ff0fb5590f625968cd04b07
@@ -106,16 +106,6 @@
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>

<ImageView android:id="@+id/add_tile_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_menu_add"
android:background="@drawable/ic_notify_button_bg"
android:visibility="gone"
android:contentDescription="@string/accessibility_desc_add_quick_settings"
/>
</FrameLayout>

<FrameLayout android:id="@+id/settings_button_holder"
@@ -1,8 +1,12 @@
package com.android.systemui.quicksettings;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;

import com.android.systemui.R;
import com.android.systemui.statusbar.phone.QuickSettingsContainerView;
@@ -20,6 +24,18 @@ public void onClick(View v) {
startSettingsActivity(android.provider.Settings.ACTION_SETTINGS);
}
};

mOnLongClick = new View.OnLongClickListener() {

@Override
public boolean onLongClick(View v) {
Intent intent = new Intent();
intent.setClassName("com.android.settings",
"com.android.settings.Settings$QuickSettingsConfigActivity");
startSettingsActivity(intent);
return true;
}
};
}

@Override
@@ -63,7 +63,7 @@ public QuickSettingsTile(Context context, QuickSettingsController qsc, int layou
}

public void setupQuickSettingsTile(LayoutInflater inflater,
QuickSettingsContainerView container) {
QuickSettingsContainerView container) {
container.updateResources();
mTileTextSize = container.getTileTextSize();
mTileTextPadding = container.getTileTextPadding();
@@ -204,9 +204,9 @@ public void onClick(View v) {
if (mOnClick != null) {
mOnClick.onClick(v);
}
if (isFlipTilesEnabled()) {
flipTile(0);
}
if (isFlipTilesEnabled()) {
flipTile(0);
}

ContentResolver resolver = mContext.getContentResolver();
boolean shouldCollapse = Settings.System.getIntForUser(resolver,
@@ -277,7 +277,6 @@
View mNotificationPanelHeader;
View mDateTimeView;
View mClearButton;
ImageView mAddTileButton;
ImageView mSettingsButton, mNotificationButton;

// Weatherpanel
@@ -983,13 +982,9 @@ public boolean onTouch(View v, MotionEvent event) {

if (mHasFlipSettings) {
mNotificationButton = (ImageView) mStatusBarWindow.findViewById(R.id.notification_button);
mAddTileButton = (ImageView) mStatusBarWindow.findViewById(R.id.add_tile_button);
if (mNotificationButton != null) {
mNotificationButton.setOnClickListener(mNotificationButtonListener);
}
if (mAddTileButton != null) {
mAddTileButton.setOnClickListener(mAddTileButtonListener);
}
}

mScrollView = (ScrollView)mStatusBarWindow.findViewById(R.id.scroll);
@@ -1750,12 +1745,6 @@ protected void refreshLayout(int layoutDirection) {
mNotificationButton.setImageResource(R.drawable.ic_notifications);
}

if (mAddTileButton != null) {
// Force asset reloading
mAddTileButton.setImageDrawable(null);
mAddTileButton.setImageResource(R.drawable.ic_menu_add);
}

refreshAllStatusBarIcons();
}

@@ -2329,7 +2318,7 @@ public Animator start(Animator a) {
final int FLIP_DURATION = (FLIP_DURATION_IN + FLIP_DURATION_OUT);

Animator mScrollViewAnim, mFlipSettingsViewAnim, mNotificationButtonAnim,
mSettingsButtonAnim, mClearButtonAnim, mRibbonViewAnim, mAddTileButtonAnim;
mSettingsButtonAnim, mClearButtonAnim, mRibbonViewAnim;

@Override
public void animateExpandNotificationsPanel() {
@@ -2356,7 +2345,6 @@ public void flipToNotifications() {
if (mSettingsButtonAnim != null) mSettingsButtonAnim.cancel();
if (mNotificationButtonAnim != null) mNotificationButtonAnim.cancel();
if (mClearButtonAnim != null) mClearButtonAnim.cancel();
if (mAddTileButtonAnim != null) mAddTileButtonAnim.cancel();

final boolean halfWayDone = mScrollView.getVisibility() == View.VISIBLE;
final int zeroOutDelays = halfWayDone ? 0 : 1;
@@ -2395,11 +2383,6 @@ public void flipToNotifications() {
ObjectAnimator.ofFloat(mNotificationButton, View.ALPHA, 0f)
.setDuration(FLIP_DURATION),
mNotificationButton, View.INVISIBLE));
mAddTileButtonAnim = start(
setVisibilityWhenDone(
ObjectAnimator.ofFloat(mAddTileButton, View.ALPHA, 0f)
.setDuration(FLIP_DURATION),
mAddTileButton, View.INVISIBLE));
mSettingsButton.setVisibility(View.VISIBLE);
mSettingsButtonAnim = start(
ObjectAnimator.ofFloat(mSettingsButton, View.ALPHA, 1f)
@@ -2461,8 +2444,6 @@ public void switchToSettings() {
}
mNotificationButton.setVisibility(View.VISIBLE);
mNotificationButton.setAlpha(1f);
mAddTileButton.setVisibility(View.VISIBLE);
mAddTileButton.setAlpha(1f);
mClearButton.setVisibility(View.GONE);
}

@@ -2486,7 +2467,6 @@ public void partialFlip(float progress) {
if (mSettingsButtonAnim != null) mSettingsButtonAnim.cancel();
if (mNotificationButtonAnim != null) mNotificationButtonAnim.cancel();
if (mClearButtonAnim != null) mClearButtonAnim.cancel();
if (mAddTileButtonAnim != null) mAddTileButtonAnim.cancel();

progress = Math.min(Math.max(progress, -1f), 1f);
if (progress < 0f) { // notifications side
@@ -2501,7 +2481,6 @@ public void partialFlip(float progress) {
mRibbonView.setScaleX(-progress);
}
mNotificationButton.setVisibility(View.GONE);
mAddTileButton.setVisibility(View.GONE);
} else { // settings side
mFlipSettingsView.setScaleX(progress);
mFlipSettingsView.setVisibility(View.VISIBLE);
@@ -2514,8 +2493,6 @@ public void partialFlip(float progress) {
}
mNotificationButton.setVisibility(View.VISIBLE);
mNotificationButton.setAlpha(progress);
mAddTileButton.setVisibility(View.VISIBLE);
mAddTileButton.setAlpha(progress);
}
mClearButton.setVisibility(View.GONE);

@@ -2533,7 +2510,6 @@ public void flipToSettings() {
if (mSettingsButtonAnim != null) mSettingsButtonAnim.cancel();
if (mNotificationButtonAnim != null) mNotificationButtonAnim.cancel();
if (mClearButtonAnim != null) mClearButtonAnim.cancel();
if (mAddTileButtonAnim != null) mAddTileButtonAnim.cancel();

final boolean halfWayDone = mFlipSettingsView.getVisibility() == View.VISIBLE;
final int zeroOutDelays = halfWayDone ? 0 : 1;
@@ -2579,10 +2555,6 @@ public void flipToSettings() {
mNotificationButtonAnim = start(
ObjectAnimator.ofFloat(mNotificationButton, View.ALPHA, 1f)
.setDuration(FLIP_DURATION));
mAddTileButton.setVisibility(View.VISIBLE);
mAddTileButtonAnim = start(
ObjectAnimator.ofFloat(mAddTileButton, View.ALPHA, 1f)
.setDuration(FLIP_DURATION));
mClearButtonAnim = start(
setVisibilityWhenDone(
ObjectAnimator.ofFloat(mClearButton, View.ALPHA, 0f)
@@ -2636,7 +2608,6 @@ void makeExpandedInvisible() {
if (mSettingsButtonAnim != null) mSettingsButtonAnim.cancel();
if (mNotificationButtonAnim != null) mNotificationButtonAnim.cancel();
if (mClearButtonAnim != null) mClearButtonAnim.cancel();
if (mAddTileButtonAnim != null) mAddTileButtonAnim.cancel();

mScrollView.setScaleX(1f);
mScrollView.setVisibility(View.VISIBLE);
@@ -2649,7 +2620,6 @@ void makeExpandedInvisible() {
mNotificationPanel.setVisibility(View.GONE);
mFlipSettingsView.setVisibility(View.GONE);
mNotificationButton.setVisibility(View.GONE);
mAddTileButton.setVisibility(View.GONE);
setAreThereNotifications(); // show the clear button
}

@@ -3615,15 +3585,6 @@ public void onClick(View v) {
}
};

private View.OnClickListener mAddTileButtonListener = new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent();
intent.setClassName("com.android.settings",
"com.android.settings.Settings$QuickSettingsConfigActivity");
startActivityDismissingKeyguard(intent, true);
}
};

private View.OnClickListener mNotificationButtonListener = new View.OnClickListener() {
public void onClick(View v) {
animateExpandNotificationsPanel();

0 comments on commit 0844f29

Please sign in to comment.
You can’t perform that action at this time.