diff options
author | Mindy Pereira <mindyp@google.com> | 2012-05-16 11:23:52 -0700 |
---|---|---|
committer | Mindy Pereira <mindyp@google.com> | 2012-05-16 12:11:45 -0700 |
commit | a2f7065e22fafd666f9f2a6b681441ea01b1551a (patch) | |
tree | dc1bae6215e7a30e94096f39bf56f6745f9aa977 /src/com/android/mail/ui/TwoPaneLayout.java | |
parent | 2efb49ed4b3d5656ef2b6edcb72f4ff0bbdc0a50 (diff) | |
download | android_packages_apps_UnifiedEmail-a2f7065e22fafd666f9f2a6b681441ea01b1551a.tar.gz android_packages_apps_UnifiedEmail-a2f7065e22fafd666f9f2a6b681441ea01b1551a.tar.bz2 android_packages_apps_UnifiedEmail-a2f7065e22fafd666f9f2a6b681441ea01b1551a.zip |
Update pattern for port/landscape
Conv list hides in conv portrait view
Fix relative widths of folder list/ conv list/ conv
Change-Id: I47547c994748fdabf6ac590b7905863dc0ebefc2
Diffstat (limited to 'src/com/android/mail/ui/TwoPaneLayout.java')
-rw-r--r-- | src/com/android/mail/ui/TwoPaneLayout.java | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/com/android/mail/ui/TwoPaneLayout.java b/src/com/android/mail/ui/TwoPaneLayout.java index 93b603611..52fb40148 100644 --- a/src/com/android/mail/ui/TwoPaneLayout.java +++ b/src/com/android/mail/ui/TwoPaneLayout.java @@ -232,12 +232,7 @@ final class TwoPaneLayout extends RelativeLayout implements ModeChangeListener { * This is only relevant in a collapsible view, and will be 0 otherwise. */ private int computeConversationListLeft(int width) { - if (isConversationListCollapsible()) { - return mListCollapsed ? -width : 0; - - } else { - return 0; - } + return isConversationListCollapsed() ? -width : 0; } /** @@ -278,7 +273,7 @@ final class TwoPaneLayout extends RelativeLayout implements ModeChangeListener { case ViewMode.CONVERSATION: // Fallthrough case ViewMode.SEARCH_RESULTS_CONVERSATION: - if (isConversationListCollapsible()) { + if (isConversationListCollapsed()) { return totalWidth; } return totalWidth - (int) (totalWidth * sScaledConversationListWeight); @@ -312,7 +307,7 @@ final class TwoPaneLayout extends RelativeLayout implements ModeChangeListener { handler.post(new Runnable() { @Override public void run() { - mListener.onConversationListVisibilityChanged(isConversationListVisible()); + mListener.onConversationListVisibilityChanged(!isConversationListCollapsed()); } }); } @@ -413,7 +408,6 @@ final class TwoPaneLayout extends RelativeLayout implements ModeChangeListener { // On the initial call, measurements may not have been done (i.e. this Layout has never // been rendered), so no animation will be done. if (getMeasuredWidth() == 0) { - mListCollapsed = true; onFinishEnteringConversationMode(); return; } @@ -429,7 +423,6 @@ final class TwoPaneLayout extends RelativeLayout implements ModeChangeListener { // Shrink the conversation list to make room for the conversation, and default // it to collapsed in case it is collapsible. - mListCollapsed = true; int targetWidth = computeConversationListWidth(); setConversationListWidth(targetWidth); @@ -480,8 +473,6 @@ final class TwoPaneLayout extends RelativeLayout implements ModeChangeListener { mConversationView = findViewById(R.id.conversation_pane_container); mConversationViewOverlay = findViewById(R.id.conversation_overlay); - mConversationViewOverlay.setOnTouchListener(this); - sAnimationSlideLeftDuration = res.getInteger(R.integer.activity_slide_left_duration); sAnimationSlideRightDuration = res.getInteger(R.integer.activity_slide_right_duration); final int sFolderListWeight = res.getInteger(R.integer.folder_list_weight); @@ -507,28 +498,20 @@ final class TwoPaneLayout extends RelativeLayout implements ModeChangeListener { } /** - * @return whether the conversation list can be collapsed or not. This depends on orientation. - */ - public boolean isConversationListCollapsible() { - return mContext.getResources().getInteger(R.integer.conversation_list_collapsible) != 0; - } - - /** * @return Whether or not the conversation list is visible on screen. */ - public boolean isConversationListVisible() { + public boolean isConversationListCollapsed() { if (mListCollapsed == null) { mListCollapsed = new Boolean(mContext.getResources() .getBoolean(R.bool.list_collapsed)); } - return !mListCollapsed; + return mListCollapsed; } /** * Finalizes state after animations settle when entering the conversation list mode. */ private void onFinishEnteringConversationListMode() { - mListCollapsed = false; mConversationView.setVisibility(View.GONE); mConversationViewOverlay.setVisibility(View.GONE); mFoldersView.setVisibility(View.VISIBLE); |