Loading res/layout/dialtacts_activity.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ <FrameLayout <FrameLayout android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:id="@+id/search_and_remove_view_container" > > <LinearLayout <LinearLayout android:layout_width="match_parent" android:layout_width="match_parent" Loading src/com/android/dialer/DialtactsActivity.java +31 −32 Original line number Original line Diff line number Diff line Loading @@ -168,6 +168,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private boolean mFirstLaunch; private boolean mFirstLaunch; private View mSearchViewContainer; private View mSearchViewContainer; private RemoveView mRemoveViewContainer; private RemoveView mRemoveViewContainer; // This view points to the Framelayout that houses both the search view and remove view // containers. private View mSearchAndRemoveViewContainer; private View mSearchViewCloseButton; private View mSearchViewCloseButton; private View mVoiceSearchButton; private View mVoiceSearchButton; private EditText mSearchView; private EditText mSearchView; Loading Loading @@ -310,6 +313,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mFragmentsFrame = findViewById(R.id.dialtacts_frame); mFragmentsFrame = findViewById(R.id.dialtacts_frame); mRemoveViewContainer = (RemoveView) findViewById(R.id.remove_view_container); mRemoveViewContainer = (RemoveView) findViewById(R.id.remove_view_container); mSearchAndRemoveViewContainer = (View) findViewById(R.id.search_and_remove_view_container); prepareSearchView(); prepareSearchView(); if (UI.FILTER_CONTACTS_ACTION.equals(intent.getAction()) if (UI.FILTER_CONTACTS_ACTION.equals(intent.getAction()) Loading Loading @@ -564,7 +568,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O final AnimatorListener mHideListener = new AnimatorListenerAdapter() { final AnimatorListener mHideListener = new AnimatorListenerAdapter() { @Override @Override public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) { mSearchViewContainer.setVisibility(View.GONE); mSearchAndRemoveViewContainer.setVisibility(View.GONE); } } }; }; Loading @@ -583,43 +587,38 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } } public void hideSearchBar() { public void hideSearchBar() { hideSearchBar(true); final int height = mSearchAndRemoveViewContainer.getHeight(); } mSearchAndRemoveViewContainer.animate().cancel(); mSearchAndRemoveViewContainer.setAlpha(1); public void hideSearchBar(boolean shiftView) { mSearchAndRemoveViewContainer.setTranslationY(0); if (shiftView) { mSearchAndRemoveViewContainer.animate().withLayer().alpha(0) mSearchViewContainer.animate().cancel(); .translationY(-height).setDuration(200) mSearchViewContainer.setAlpha(1); .setListener(mHideListener); mSearchViewContainer.setTranslationY(0); mSearchViewContainer.animate().withLayer().alpha(0).translationY(-mSearchView.getHeight()) .setDuration(200).setListener(mHideListener); mFragmentsFrame.animate().withLayer() mFragmentsFrame.animate().withLayer() .translationY(-mSearchViewContainer.getHeight()).setDuration(200).setListener( .translationY(-height).setDuration(200).setListener( new AnimatorListenerAdapter() { new AnimatorListenerAdapter() { @Override @Override public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) { mFragmentsFrame.setTranslationY(0); mFragmentsFrame.setTranslationY(0); } } }); }); } else { mSearchViewContainer.setTranslationY(-mSearchView.getHeight()); } } } public void showSearchBar() { public void showSearchBar() { mSearchViewContainer.animate().cancel(); final int height = mSearchAndRemoveViewContainer.getHeight(); mSearchViewContainer.setAlpha(0); mSearchAndRemoveViewContainer.animate().cancel(); mSearchViewContainer.setTranslationY(-mSearchViewContainer.getHeight()); mSearchAndRemoveViewContainer.setAlpha(0); mSearchViewContainer.animate().withLayer().alpha(1).translationY(0).setDuration(200) mSearchAndRemoveViewContainer.setTranslationY(-height); .setListener(new AnimatorListenerAdapter() { mSearchAndRemoveViewContainer.animate().withLayer().alpha(1).translationY(0) .setDuration(200).setListener(new AnimatorListenerAdapter() { @Override @Override public void onAnimationStart(Animator animation) { public void onAnimationStart(Animator animation) { mSearchViewContainer.setVisibility(View.VISIBLE); mSearchAndRemoveViewContainer.setVisibility(View.VISIBLE); } } }); }); mFragmentsFrame.setTranslationY(-mSearchViewContainer.getHeight()); mFragmentsFrame.setTranslationY(-height); mFragmentsFrame.animate().withLayer().translationY(0).setDuration(200) mFragmentsFrame.animate().withLayer().translationY(0).setDuration(200) .setListener( .setListener( new AnimatorListenerAdapter() { new AnimatorListenerAdapter() { Loading Loading
res/layout/dialtacts_activity.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ <FrameLayout <FrameLayout android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:id="@+id/search_and_remove_view_container" > > <LinearLayout <LinearLayout android:layout_width="match_parent" android:layout_width="match_parent" Loading
src/com/android/dialer/DialtactsActivity.java +31 −32 Original line number Original line Diff line number Diff line Loading @@ -168,6 +168,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private boolean mFirstLaunch; private boolean mFirstLaunch; private View mSearchViewContainer; private View mSearchViewContainer; private RemoveView mRemoveViewContainer; private RemoveView mRemoveViewContainer; // This view points to the Framelayout that houses both the search view and remove view // containers. private View mSearchAndRemoveViewContainer; private View mSearchViewCloseButton; private View mSearchViewCloseButton; private View mVoiceSearchButton; private View mVoiceSearchButton; private EditText mSearchView; private EditText mSearchView; Loading Loading @@ -310,6 +313,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mFragmentsFrame = findViewById(R.id.dialtacts_frame); mFragmentsFrame = findViewById(R.id.dialtacts_frame); mRemoveViewContainer = (RemoveView) findViewById(R.id.remove_view_container); mRemoveViewContainer = (RemoveView) findViewById(R.id.remove_view_container); mSearchAndRemoveViewContainer = (View) findViewById(R.id.search_and_remove_view_container); prepareSearchView(); prepareSearchView(); if (UI.FILTER_CONTACTS_ACTION.equals(intent.getAction()) if (UI.FILTER_CONTACTS_ACTION.equals(intent.getAction()) Loading Loading @@ -564,7 +568,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O final AnimatorListener mHideListener = new AnimatorListenerAdapter() { final AnimatorListener mHideListener = new AnimatorListenerAdapter() { @Override @Override public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) { mSearchViewContainer.setVisibility(View.GONE); mSearchAndRemoveViewContainer.setVisibility(View.GONE); } } }; }; Loading @@ -583,43 +587,38 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } } public void hideSearchBar() { public void hideSearchBar() { hideSearchBar(true); final int height = mSearchAndRemoveViewContainer.getHeight(); } mSearchAndRemoveViewContainer.animate().cancel(); mSearchAndRemoveViewContainer.setAlpha(1); public void hideSearchBar(boolean shiftView) { mSearchAndRemoveViewContainer.setTranslationY(0); if (shiftView) { mSearchAndRemoveViewContainer.animate().withLayer().alpha(0) mSearchViewContainer.animate().cancel(); .translationY(-height).setDuration(200) mSearchViewContainer.setAlpha(1); .setListener(mHideListener); mSearchViewContainer.setTranslationY(0); mSearchViewContainer.animate().withLayer().alpha(0).translationY(-mSearchView.getHeight()) .setDuration(200).setListener(mHideListener); mFragmentsFrame.animate().withLayer() mFragmentsFrame.animate().withLayer() .translationY(-mSearchViewContainer.getHeight()).setDuration(200).setListener( .translationY(-height).setDuration(200).setListener( new AnimatorListenerAdapter() { new AnimatorListenerAdapter() { @Override @Override public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) { mFragmentsFrame.setTranslationY(0); mFragmentsFrame.setTranslationY(0); } } }); }); } else { mSearchViewContainer.setTranslationY(-mSearchView.getHeight()); } } } public void showSearchBar() { public void showSearchBar() { mSearchViewContainer.animate().cancel(); final int height = mSearchAndRemoveViewContainer.getHeight(); mSearchViewContainer.setAlpha(0); mSearchAndRemoveViewContainer.animate().cancel(); mSearchViewContainer.setTranslationY(-mSearchViewContainer.getHeight()); mSearchAndRemoveViewContainer.setAlpha(0); mSearchViewContainer.animate().withLayer().alpha(1).translationY(0).setDuration(200) mSearchAndRemoveViewContainer.setTranslationY(-height); .setListener(new AnimatorListenerAdapter() { mSearchAndRemoveViewContainer.animate().withLayer().alpha(1).translationY(0) .setDuration(200).setListener(new AnimatorListenerAdapter() { @Override @Override public void onAnimationStart(Animator animation) { public void onAnimationStart(Animator animation) { mSearchViewContainer.setVisibility(View.VISIBLE); mSearchAndRemoveViewContainer.setVisibility(View.VISIBLE); } } }); }); mFragmentsFrame.setTranslationY(-mSearchViewContainer.getHeight()); mFragmentsFrame.setTranslationY(-height); mFragmentsFrame.animate().withLayer().translationY(0).setDuration(200) mFragmentsFrame.animate().withLayer().translationY(0).setDuration(200) .setListener( .setListener( new AnimatorListenerAdapter() { new AnimatorListenerAdapter() { Loading