summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-10-03 13:23:05 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-03 13:23:05 -0700
commite593b80f3a2a6c4434762add89c22e97bb3d5d71 (patch)
tree460ec7f1e6488ef29794691695ca2161e8057a49
parenta028ca2cc2e0c33b1c26c8e29f9db64c41a392a6 (diff)
parent6da93994e24403f67276195bd94f03c9380b0a13 (diff)
am 6da93994: Merge "Dynamically change layout params to avoid hiding no favorites view" into klp-dev
* commit '6da93994e24403f67276195bd94f03c9380b0a13': Dynamically change layout params to avoid hiding no favorites view
-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);
}
}