summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-10-03 20:20:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-03 20:20:37 +0000
commit6da93994e24403f67276195bd94f03c9380b0a13 (patch)
tree6d85b2183242bf59ead580ef1ff729d634dcd781 /src
parent50893bea01f3a05c60664066fc4f5dc7ce43ebd5 (diff)
parent3eb8ab2ab09a9e742cde17e36381a6dde058c4be (diff)
Merge "Dynamically change layout params to avoid hiding no favorites view" into klp-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteFragment.java9
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);
}
}