Loading res/layout/phone_favorites_fragment.xml +0 −1 Original line number Diff line number Diff line Loading @@ -58,5 +58,4 @@ android:layout_alignParentBottom="true" layout="@layout/phone_no_favorites" android:visibility="gone"/> </RelativeLayout> res/layout/phone_no_favorites.xml +4 −10 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:minHeight="?android:attr/listPreferredItemHeight"> <include Loading @@ -33,23 +32,18 @@ <LinearLayout android:id="@+id/nofavorite_frame" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center" android:gravity="center" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_above="@id/show_all_contact_button_in_nofav"> android:layout_centerInParent="true"> <ImageView android:id="@+id/nofavorite_image" android:layout_height="wrap_content" android:layout_width="match_parent" android:gravity="center_horizontal" android:src="@drawable/no_favorites_banner" android:layout_marginBottom="14dp"/> android:layout_marginBottom="14dp" android:contentDescription="@string/no_favorites"/> <TextView android:id="@+id/title" android:layout_width="match_parent" Loading src/com/android/dialer/DialtactsActivity.java +31 −2 Original line number Diff line number Diff line Loading @@ -49,11 +49,14 @@ import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.view.inputmethod.InputMethodManager; import android.view.Window; import android.view.WindowManager; import android.widget.AbsListView.OnScrollListener; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.PopupMenu; import android.widget.Toast; Loading Loading @@ -160,7 +163,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private PopupMenu mOverflowMenu; private PopupMenu mDialpadOverflowMenu; // Padding view used to shift the fragments up when the dialpad is shown. // Padding view used to shift the fragment frame up when the dialpad is shown so that // the contents of the fragment frame continue to exist in a layout of the same height private View mFragmentsSpacer; private View mFragmentsFrame; private boolean mInDialpadSearch; Loading Loading @@ -324,9 +329,25 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } mFragmentsFrame = findViewById(R.id.dialtacts_frame); mFragmentsSpacer = findViewById(R.id.contact_tile_frame_spacer); mRemoveViewContainer = (RemoveView) findViewById(R.id.remove_view_container); mSearchAndRemoveViewContainer = (View) findViewById(R.id.search_and_remove_view_container); mSearchAndRemoveViewContainer = findViewById(R.id.search_and_remove_view_container); // When the first global layout pass is completed (and mSearchAndRemoveViewContainer has // been assigned a valid height), assign that height to mFragmentsSpacer as well. mSearchAndRemoveViewContainer.getViewTreeObserver().addOnGlobalLayoutListener( new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { mSearchAndRemoveViewContainer.getViewTreeObserver() .removeOnGlobalLayoutListener(this); mFragmentsSpacer.setLayoutParams( new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, mSearchAndRemoveViewContainer.getHeight())); } }); setupFakeActionBarItems(); prepareSearchView(); Loading Loading @@ -614,6 +635,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O public void hideSearchBar() { final int height = mSearchAndRemoveViewContainer.getHeight(); mSearchAndRemoveViewContainer.animate().cancel(); mSearchAndRemoveViewContainer.setAlpha(1); mSearchAndRemoveViewContainer.setTranslationY(0); Loading @@ -627,6 +649,10 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onAnimationEnd(Animator animation) { mFragmentsFrame.setTranslationY(0); // Display the fragments spacer (which has the same height as the // search box) now that the search box is hidden, so that // mFragmentsFrame always retains the same height mFragmentsSpacer.setVisibility(View.VISIBLE); } }); Loading Loading @@ -656,6 +682,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { // Hide the fragment spacer now that the search box will // be displayed again mFragmentsSpacer.setVisibility(View.GONE); } }); } Loading Loading
res/layout/phone_favorites_fragment.xml +0 −1 Original line number Diff line number Diff line Loading @@ -58,5 +58,4 @@ android:layout_alignParentBottom="true" layout="@layout/phone_no_favorites" android:visibility="gone"/> </RelativeLayout>
res/layout/phone_no_favorites.xml +4 −10 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:minHeight="?android:attr/listPreferredItemHeight"> <include Loading @@ -33,23 +32,18 @@ <LinearLayout android:id="@+id/nofavorite_frame" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center" android:gravity="center" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_above="@id/show_all_contact_button_in_nofav"> android:layout_centerInParent="true"> <ImageView android:id="@+id/nofavorite_image" android:layout_height="wrap_content" android:layout_width="match_parent" android:gravity="center_horizontal" android:src="@drawable/no_favorites_banner" android:layout_marginBottom="14dp"/> android:layout_marginBottom="14dp" android:contentDescription="@string/no_favorites"/> <TextView android:id="@+id/title" android:layout_width="match_parent" Loading
src/com/android/dialer/DialtactsActivity.java +31 −2 Original line number Diff line number Diff line Loading @@ -49,11 +49,14 @@ import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.view.inputmethod.InputMethodManager; import android.view.Window; import android.view.WindowManager; import android.widget.AbsListView.OnScrollListener; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.PopupMenu; import android.widget.Toast; Loading Loading @@ -160,7 +163,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private PopupMenu mOverflowMenu; private PopupMenu mDialpadOverflowMenu; // Padding view used to shift the fragments up when the dialpad is shown. // Padding view used to shift the fragment frame up when the dialpad is shown so that // the contents of the fragment frame continue to exist in a layout of the same height private View mFragmentsSpacer; private View mFragmentsFrame; private boolean mInDialpadSearch; Loading Loading @@ -324,9 +329,25 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } mFragmentsFrame = findViewById(R.id.dialtacts_frame); mFragmentsSpacer = findViewById(R.id.contact_tile_frame_spacer); mRemoveViewContainer = (RemoveView) findViewById(R.id.remove_view_container); mSearchAndRemoveViewContainer = (View) findViewById(R.id.search_and_remove_view_container); mSearchAndRemoveViewContainer = findViewById(R.id.search_and_remove_view_container); // When the first global layout pass is completed (and mSearchAndRemoveViewContainer has // been assigned a valid height), assign that height to mFragmentsSpacer as well. mSearchAndRemoveViewContainer.getViewTreeObserver().addOnGlobalLayoutListener( new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { mSearchAndRemoveViewContainer.getViewTreeObserver() .removeOnGlobalLayoutListener(this); mFragmentsSpacer.setLayoutParams( new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, mSearchAndRemoveViewContainer.getHeight())); } }); setupFakeActionBarItems(); prepareSearchView(); Loading Loading @@ -614,6 +635,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O public void hideSearchBar() { final int height = mSearchAndRemoveViewContainer.getHeight(); mSearchAndRemoveViewContainer.animate().cancel(); mSearchAndRemoveViewContainer.setAlpha(1); mSearchAndRemoveViewContainer.setTranslationY(0); Loading @@ -627,6 +649,10 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onAnimationEnd(Animator animation) { mFragmentsFrame.setTranslationY(0); // Display the fragments spacer (which has the same height as the // search box) now that the search box is hidden, so that // mFragmentsFrame always retains the same height mFragmentsSpacer.setVisibility(View.VISIBLE); } }); Loading Loading @@ -656,6 +682,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { // Hide the fragment spacer now that the search box will // be displayed again mFragmentsSpacer.setVisibility(View.GONE); } }); } Loading