Merge "Fix janky swiping with RemoteInputViews" into nyc-dev
am: a9c0d3ff19
* commit 'a9c0d3ff19461b0384ac4a586cd67e2084193604':
Fix janky swiping with RemoteInputViews
Change-Id: I3d89c5c0bcb4701335af0f18791e993a50501863
This commit is contained in:
@@ -702,8 +702,13 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
|||||||
return mRemoved;
|
return mRemoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemoved(boolean removed) {
|
public void setRemoved() {
|
||||||
mRemoved = removed;
|
mRemoved = true;
|
||||||
|
|
||||||
|
mPrivateLayout.setRemoved();
|
||||||
|
if (mChildrenContainer != null) {
|
||||||
|
mChildrenContainer.setRemoved();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public NotificationChildrenContainer getChildrenContainer() {
|
public NotificationChildrenContainer getChildrenContainer() {
|
||||||
|
|||||||
@@ -1053,4 +1053,13 @@ public class NotificationContentView extends FrameLayout {
|
|||||||
public HybridNotificationView getSingleLineView() {
|
public HybridNotificationView getSingleLineView() {
|
||||||
return mSingleLineView;
|
return mSingleLineView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRemoved() {
|
||||||
|
if (mExpandedRemoteInput != null) {
|
||||||
|
mExpandedRemoteInput.setRemoved();
|
||||||
|
}
|
||||||
|
if (mHeadsUpRemoteInput != null) {
|
||||||
|
mHeadsUpRemoteInput.setRemoved();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1508,7 +1508,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
}
|
}
|
||||||
Entry entry = mNotificationData.get(key);
|
Entry entry = mNotificationData.get(key);
|
||||||
if (entry != null && entry.row != null) {
|
if (entry != null && entry.row != null) {
|
||||||
entry.row.setRemoved(true);
|
entry.row.setRemoved();
|
||||||
}
|
}
|
||||||
// Let's remove the children if this was a summary
|
// Let's remove the children if this was a summary
|
||||||
handleGroupSummaryRemoved(key, ranking);
|
handleGroupSummaryRemoved(key, ranking);
|
||||||
@@ -1556,7 +1556,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
toRemove.get(i).setKeepInParent(true);
|
toRemove.get(i).setKeepInParent(true);
|
||||||
// we need to set this state earlier as otherwise we might generate some weird
|
// we need to set this state earlier as otherwise we might generate some weird
|
||||||
// animations
|
// animations
|
||||||
toRemove.get(i).setRemoved(true);
|
toRemove.get(i).setRemoved();
|
||||||
}
|
}
|
||||||
for (int i = 0; i < toRemove.size(); i++) {
|
for (int i = 0; i < toRemove.size(); i++) {
|
||||||
removeNotification(toRemove.get(i).getStatusBarNotification().getKey(), ranking);
|
removeNotification(toRemove.get(i).getStatusBarNotification().getKey(), ranking);
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
|
|
||||||
private ScrollContainer mScrollContainer;
|
private ScrollContainer mScrollContainer;
|
||||||
private View mScrollContainerChild;
|
private View mScrollContainerChild;
|
||||||
|
private boolean mRemoved;
|
||||||
|
|
||||||
public RemoteInputView(Context context, AttributeSet attrs) {
|
public RemoteInputView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -171,7 +172,12 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
public void onDefocus() {
|
public void onDefocus() {
|
||||||
mController.removeRemoteInput(mEntry);
|
mController.removeRemoteInput(mEntry);
|
||||||
mEntry.remoteInputText = mEditText.getText();
|
mEntry.remoteInputText = mEditText.getText();
|
||||||
setVisibility(INVISIBLE);
|
|
||||||
|
// During removal, we get reattached and lose focus. Not hiding in that
|
||||||
|
// case to prevent flicker.
|
||||||
|
if (!mRemoved) {
|
||||||
|
setVisibility(INVISIBLE);
|
||||||
|
}
|
||||||
MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_CLOSE,
|
MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_CLOSE,
|
||||||
mEntry.notification.getPackageName());
|
mEntry.notification.getPackageName());
|
||||||
}
|
}
|
||||||
@@ -347,6 +353,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
return mPendingIntent;
|
return mPendingIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRemoved() {
|
||||||
|
mRemoved = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An EditText that changes appearance based on whether it's focusable and becomes
|
* An EditText that changes appearance based on whether it's focusable and becomes
|
||||||
* un-focusable whenever the user navigates away from it or it becomes invisible.
|
* un-focusable whenever the user navigates away from it or it becomes invisible.
|
||||||
@@ -415,6 +425,15 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
return super.onKeyPreIme(keyCode, event);
|
return super.onKeyPreIme(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCheckIsTextEditor() {
|
||||||
|
// Stop being editable while we're being removed. During removal, we get reattached,
|
||||||
|
// and editable views get their spellchecking state re-evaluated which is too costly
|
||||||
|
// during the removal animation.
|
||||||
|
boolean flyingOut = mRemoteInputView != null && mRemoteInputView.mRemoved;
|
||||||
|
return !flyingOut && super.onCheckIsTextEditor();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
||||||
final InputConnection inputConnection = super.onCreateInputConnection(outAttrs);
|
final InputConnection inputConnection = super.onCreateInputConnection(outAttrs);
|
||||||
|
|||||||
@@ -846,4 +846,12 @@ public class NotificationChildrenContainer extends ViewGroup {
|
|||||||
mHybridGroupManager.setOverflowNumberColor(mOverflowNumber,
|
mHybridGroupManager.setOverflowNumberColor(mOverflowNumber,
|
||||||
mNotificationParent.getNotificationColor());
|
mNotificationParent.getNotificationColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRemoved() {
|
||||||
|
int childCount = mChildren.size();
|
||||||
|
for (int i = 0; i < childCount; i++) {
|
||||||
|
ExpandableNotificationRow child = mChildren.get(i);
|
||||||
|
child.setRemoved();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user