Move QuickContact to Activity instead of Window.
QuickContact has traditionally used a Window to show a bubble with
callout centered around a target area. This change moves away from
private Window APIs, and instead creates FloatingChildLayout to layout
the bubble. Using onLayout() is more flexible than a PopupWindow or
Dialog, since it gives us access to getWindowVisibleDisplayFrame() to
correctly handle system windows. (Similar to FLAG_LAYOUT_INSET_DECOR.)
Changes background Drawable to use state_first and state_last to select
above/below callout arrow. Also moves to using setLevel() to set arrow
horizontal location.
Removes recycling chiclet code, and brings in Guava library.
Bug: 3362647
Change-Id: Iae953bae71db76e91e05996fe4c0dcea38bb446f
diff --git a/res/layout/quickcontact_activity.xml b/res/layout/quickcontact_activity.xml
new file mode 100644
index 0000000..aced4a8
--- /dev/null
+++ b/res/layout/quickcontact_activity.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+ 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.
+-->
+<view
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ class="com.android.contacts.quickcontact.FloatingChildLayout"
+ android:id="@+id/floating_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
+ android:descendantFocusability="afterDescendants">
+
+ <include layout="@layout/quickcontact" />
+
+</view>