diff options
author | Selim Cinek <cinek@google.com> | 2014-08-20 23:50:41 +0200 |
---|---|---|
committer | Selim Cinek <cinek@google.com> | 2014-08-22 17:13:36 +0200 |
commit | e32010ac6120278fea41e49b9832af79b1b5463e (patch) | |
tree | ae042423502e488be9d094d16d67ae9b85afe8a5 /packages/SystemUI/src/com/android/systemui/statusbar/DismissViewImageButton.java | |
parent | 414b15285602bb21b9865eeeb6980e9e917afaf2 (diff) | |
download | frameworks_base-e32010ac6120278fea41e49b9832af79b1b5463e.zip frameworks_base-e32010ac6120278fea41e49b9832af79b1b5463e.tar.gz frameworks_base-e32010ac6120278fea41e49b9832af79b1b5463e.tar.bz2 |
Fixed focusing order for the notification panel and QS
Also fixed multiple bugs regarding focusability, where
some elements were focusable even though invisible.
The buttons, QS-tiles, QS-detail buttons, QS Header
icons and other elements now have the correct focusability
state.
The rect indicating accessibility focus is now also
correct for dual label tiles, instead of just the whole
button.
Also fixes an ordering issue where notifications were above
the camera circle when launching.
In addition the focus order of the notifications now work
correctly.
Bug: 15569922
Bug: 15682123
Bug: 17159249
Bug: 15690386
Change-Id: Ie9f7ae73397b41ce2e9a4060699301fdef3a0d01
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/DismissViewImageButton.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/DismissViewImageButton.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DismissViewImageButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/DismissViewImageButton.java new file mode 100644 index 0000000..d55b0b3 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/DismissViewImageButton.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2014 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 + */ + +package com.android.systemui.statusbar; + +import android.content.Context; +import android.graphics.Rect; +import android.util.AttributeSet; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageButton; +import com.android.systemui.R; +import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; + +public class DismissViewImageButton extends ImageButton { + public DismissViewImageButton(Context context) { + super(context); + } + + public DismissViewImageButton(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public DismissViewImageButton(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public DismissViewImageButton(Context context, AttributeSet attrs, int defStyleAttr, + int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + /** + * This method returns the drawing rect for the view which is different from the regular + * drawing rect, since we layout all children in the {@link NotificationStackScrollLayout} at + * position 0 and usually the translation is neglected. The standard implementation doesn't + * account for translation. + * + * @param outRect The (scrolled) drawing bounds of the view. + */ + @Override + public void getDrawingRect(Rect outRect) { + super.getDrawingRect(outRect); + float translationX = ((ViewGroup) mParent).getTranslationX(); + float translationY = ((ViewGroup) mParent).getTranslationY(); + outRect.left += translationX; + outRect.right += translationX; + outRect.top += translationY; + outRect.bottom += translationY; + } +} |