diff options
author | Yorke Lee <yorkelee@google.com> | 2013-10-03 15:41:12 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-03 15:41:12 -0700 |
commit | 1a995a5f53c0aaf0d58b6a86ff13b00df1a3e86e (patch) | |
tree | fdaaafe8415cbd52c98c6a207855660c5687cc68 | |
parent | 1e1d34534f36be66a27ae03d03de6dcea271edad (diff) | |
parent | e593b80f3a2a6c4434762add89c22e97bb3d5d71 (diff) |
am e593b80f: am 6da93994: Merge "Dynamically change layout params to avoid hiding no favorites view" into klp-dev
* commit 'e593b80f3a2a6c4434762add89c22e97bb3d5d71':
Dynamically change layout params to avoid hiding no favorites view
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteFragment.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteFragment.java b/src/com/android/dialer/list/PhoneFavoriteFragment.java index 8ff9766e9..7e8ff0f59 100644 --- a/src/com/android/dialer/list/PhoneFavoriteFragment.java +++ b/src/com/android/dialer/list/PhoneFavoriteFragment.java @@ -43,6 +43,8 @@ import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ImageView; import android.widget.ListView; +import android.widget.RelativeLayout; +import android.widget.RelativeLayout.LayoutParams; import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.ContactTileLoaderFactory; @@ -195,6 +197,7 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen private View mShowAllContactsButton; private View mShowAllContactsInEmptyViewButton; + private View mContactTileFrame; private final HashMap<Long, Integer> mItemIdTopMap = new HashMap<Long, Integer>(); private final HashMap<Long, Integer> mItemIdLeftMap = new HashMap<Long, Integer>(); @@ -301,6 +304,8 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen } }); + mContactTileFrame = mParentView.findViewById(R.id.contact_tile_frame); + mAdapter = new PhoneFavoriteMergedAdapter(getActivity(), this, mContactTileAdapter, mCallLogAdapter, mShowAllContactsButton); @@ -323,6 +328,10 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen final int newVisibility = visible ? View.VISIBLE : View.GONE; if (previousVisibility != newVisibility) { + final RelativeLayout.LayoutParams params = (LayoutParams) mContactTileFrame + .getLayoutParams(); + params.height = visible ? LayoutParams.WRAP_CONTENT : LayoutParams.MATCH_PARENT; + mContactTileFrame.setLayoutParams(params); mEmptyView.setVisibility(newVisibility); } } |