Merge "Fixing some small issues."
|
After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 899 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2009 The Android Open Source Project
|
||||
<!-- Copyright (C) 2011 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.
|
||||
@@ -15,8 +15,7 @@
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/preview_bg_press" />
|
||||
<item android:state_focused="true" android:state_window_focused="true" android:drawable="@drawable/preview_bg_focus" />
|
||||
<item android:state_focused="true" android:state_window_focused="false" android:drawable="@drawable/preview_bg" />
|
||||
<item android:drawable="@drawable/preview_bg" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/ic_allapps_pressed" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/ic_allapps_pressed" />
|
||||
<item android:drawable="@drawable/ic_allapps" />
|
||||
</selector>
|
||||
@@ -146,6 +146,8 @@
|
||||
<item name="android:paddingRight">25dp</item>
|
||||
<item name="android:textColor">#FFFFFFFF</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:shadowColor">#FF000000</item>
|
||||
<item name="android:shadowDx">0.0</item>
|
||||
<item name="android:shadowDy">1.0</item>
|
||||
|
||||
@@ -278,30 +278,36 @@ public class FocusHelper {
|
||||
final ViewGroup container = (ViewGroup) parentLayout.getParent();
|
||||
final TabHost tabHost = findTabHostParent(container);
|
||||
final TabWidget tabs = (TabWidget) tabHost.findViewById(com.android.internal.R.id.tabs);
|
||||
final int widgetIndex = parent.indexOfChild(v);
|
||||
final int iconIndex = parent.indexOfChild(v);
|
||||
final int widgetCount = parent.getChildCount();
|
||||
final int pageIndex = container.indexOfChild(parentLayout);
|
||||
final int pageCount = container.getChildCount();
|
||||
final int cellCountX = parentLayout.getCellCountX();
|
||||
final int cellCountY = parentLayout.getCellCountY();
|
||||
final int x = widgetIndex % cellCountX;
|
||||
final int y = widgetIndex / cellCountX;
|
||||
final int x = iconIndex % cellCountX;
|
||||
final int y = iconIndex / cellCountX;
|
||||
|
||||
final int action = e.getAction();
|
||||
final boolean handleKeyEvent = (action != KeyEvent.ACTION_UP);
|
||||
PagedViewCellLayoutChildren newParent = null;
|
||||
// Side pages do not always load synchronously, so check before focusing child siblings
|
||||
// willy-nilly
|
||||
View child = null;
|
||||
boolean wasHandled = false;
|
||||
switch (keyCode) {
|
||||
case KeyEvent.KEYCODE_DPAD_LEFT:
|
||||
if (handleKeyEvent) {
|
||||
// Select the previous icon or the last icon on the previous page
|
||||
if (widgetIndex > 0) {
|
||||
parent.getChildAt(widgetIndex - 1).requestFocus();
|
||||
if (iconIndex > 0) {
|
||||
parent.getChildAt(iconIndex - 1).requestFocus();
|
||||
} else {
|
||||
if (pageIndex > 0) {
|
||||
newParent = getPagedViewCellLayoutChildrenForIndex(container,
|
||||
pageIndex - 1);
|
||||
newParent.getChildAt(newParent.getChildCount() - 1).requestFocus();
|
||||
if (newParent != null) {
|
||||
child = newParent.getChildAt(newParent.getChildCount() - 1);
|
||||
if (child != null) child.requestFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,13 +316,16 @@ public class FocusHelper {
|
||||
case KeyEvent.KEYCODE_DPAD_RIGHT:
|
||||
if (handleKeyEvent) {
|
||||
// Select the next icon or the first icon on the next page
|
||||
if (widgetIndex < (widgetCount - 1)) {
|
||||
parent.getChildAt(widgetIndex + 1).requestFocus();
|
||||
if (iconIndex < (widgetCount - 1)) {
|
||||
parent.getChildAt(iconIndex + 1).requestFocus();
|
||||
} else {
|
||||
if (pageIndex < (pageCount - 1)) {
|
||||
newParent = getPagedViewCellLayoutChildrenForIndex(container,
|
||||
pageIndex + 1);
|
||||
newParent.getChildAt(0).requestFocus();
|
||||
if (newParent != null) {
|
||||
child = newParent.getChildAt(0);
|
||||
if (child != null) child.requestFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,8 +335,8 @@ public class FocusHelper {
|
||||
if (handleKeyEvent) {
|
||||
// Select the closest icon in the previous row, otherwise select the tab bar
|
||||
if (y > 0) {
|
||||
int newWidgetIndex = ((y - 1) * cellCountX) + x;
|
||||
parent.getChildAt(newWidgetIndex).requestFocus();
|
||||
int newiconIndex = ((y - 1) * cellCountX) + x;
|
||||
parent.getChildAt(newiconIndex).requestFocus();
|
||||
} else {
|
||||
tabs.requestFocus();
|
||||
}
|
||||
@@ -338,8 +347,8 @@ public class FocusHelper {
|
||||
if (handleKeyEvent) {
|
||||
// Select the closest icon in the previous row, otherwise do nothing
|
||||
if (y < (cellCountY - 1)) {
|
||||
int newWidgetIndex = Math.min(widgetCount - 1, ((y + 1) * cellCountX) + x);
|
||||
parent.getChildAt(newWidgetIndex).requestFocus();
|
||||
int newiconIndex = Math.min(widgetCount - 1, ((y + 1) * cellCountX) + x);
|
||||
parent.getChildAt(newiconIndex).requestFocus();
|
||||
}
|
||||
}
|
||||
wasHandled = true;
|
||||
@@ -360,7 +369,10 @@ public class FocusHelper {
|
||||
if (pageIndex > 0) {
|
||||
newParent = getPagedViewCellLayoutChildrenForIndex(container,
|
||||
pageIndex - 1);
|
||||
newParent.getChildAt(0).requestFocus();
|
||||
if (newParent != null) {
|
||||
child = newParent.getChildAt(0);
|
||||
if (child != null) child.requestFocus();
|
||||
}
|
||||
} else {
|
||||
parent.getChildAt(0).requestFocus();
|
||||
}
|
||||
@@ -374,7 +386,10 @@ public class FocusHelper {
|
||||
if (pageIndex < (pageCount - 1)) {
|
||||
newParent = getPagedViewCellLayoutChildrenForIndex(container,
|
||||
pageIndex + 1);
|
||||
newParent.getChildAt(0).requestFocus();
|
||||
if (newParent != null) {
|
||||
child = newParent.getChildAt(0);
|
||||
if (child != null) child.requestFocus();
|
||||
}
|
||||
} else {
|
||||
parent.getChildAt(widgetCount - 1).requestFocus();
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Hotseat extends FrameLayout {
|
||||
BubbleTextView allAppsButton = (BubbleTextView)
|
||||
inflater.inflate(R.layout.application, mContent, false);
|
||||
allAppsButton.setCompoundDrawablesWithIntrinsicBounds(null,
|
||||
context.getResources().getDrawable(R.drawable.ic_allapps), null, null);
|
||||
context.getResources().getDrawable(R.drawable.all_apps_button_icon), null, null);
|
||||
// allAppsButton.setText(context.getString(R.string.all_apps_button_label));
|
||||
allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
|
||||
allAppsButton.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@@ -1664,18 +1664,6 @@ public abstract class PagedView extends ViewGroup {
|
||||
*/
|
||||
public abstract void syncPageItems(int page, boolean immediate);
|
||||
|
||||
protected void postInvalidatePageData(final boolean clearViews) {
|
||||
post(new Runnable() {
|
||||
// post the call to avoid a call to requestLayout from a layout pass
|
||||
public void run() {
|
||||
if (clearViews) {
|
||||
removeAllViews();
|
||||
}
|
||||
invalidatePageData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void invalidatePageData() {
|
||||
invalidatePageData(-1, false);
|
||||
}
|
||||
|
||||