summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-06-11 10:24:19 -0700
committerYorke Lee <yorkelee@google.com>2014-06-11 10:49:54 -0700
commit28aab271e57a4966496b5d2ef2b067e8ace34679 (patch)
treebfb3d353c66df094fbd96d7dcfbc796fc857096c
parent8466615413eb7d0feb23ab33288caac104dfd41e (diff)
Use Framelayout instead of RelativeLayout in DialtactsActivity
Switch to FrameLayout instead of RelativeLayout since we don't need the more complicated and expensive layout abilities of RelativeLayout. This improves startup time (on hammerhead-eng, interpreted ART mode) to about 1150ms on average from 1300ms originally. Change-Id: I94400dcc58cc74497c71a7432a06a4dffe3b078d
-rw-r--r--res/layout/dialtacts_activity.xml11
-rw-r--r--src/com/android/dialer/DialtactsActivity.java5
2 files changed, 8 insertions, 8 deletions
diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml
index 71e58cb48..5727d8a00 100644
--- a/res/layout/dialtacts_activity.xml
+++ b/res/layout/dialtacts_activity.xml
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<RelativeLayout
+<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialtacts_mainlayout"
android:layout_width="match_parent"
@@ -25,7 +25,7 @@
android:animateLayoutChanges="true"
android:background="@color/background_dialer_light"
>
- <RelativeLayout
+ <FrameLayout
android:id="@+id/dialtacts_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -36,15 +36,14 @@
android:layout_width="match_parent"
android:id="@+id/dialtacts_frame"
android:clipChildren="false" />
- </RelativeLayout>
+ </FrameLayout>
<FrameLayout
android:id="@+id/floating_action_button_container"
android:layout_width="@dimen/floating_action_button_width"
android:layout_height="@dimen/floating_action_button_height"
android:layout_marginRight="@dimen/floating_action_button_margin_right"
android:layout_marginBottom="@dimen/floating_action_button_margin_bottom"
- android:layout_centerHorizontal="true"
- android:layout_alignParentBottom="true">
+ android:layout_gravity="center_horizontal|bottom" >
<ImageButton
android:id="@+id/floating_action_button"
@@ -67,4 +66,4 @@
android:visibility="gone"
android:importantForAccessibility="no" />
</FrameLayout>
-</RelativeLayout>
+</FrameLayout>
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index a5b69997b..414569031 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -56,6 +56,7 @@ import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView.OnScrollListener;
import android.widget.EditText;
+import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.PopupMenu;
import android.widget.RelativeLayout;
@@ -139,7 +140,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
private static final int ACTIVITY_REQUEST_CODE_VOICE_SEARCH = 1;
- private RelativeLayout parentLayout;
+ private FrameLayout parentLayout;
/**
* Fragment containing the dialpad that slides into view
@@ -419,7 +420,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
mSlideOut.setAnimationListener(mSlideOutListener);
- parentLayout = (RelativeLayout) findViewById(R.id.dialtacts_mainlayout);
+ parentLayout = (FrameLayout) findViewById(R.id.dialtacts_mainlayout);
parentLayout.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
parentLayout.setOnDragListener(new LayoutOnDragListener());
floatingActionButtonContainer.getViewTreeObserver().addOnGlobalLayoutListener(