summaryrefslogtreecommitdiff
path: root/src/com/android/mail/ui/TwoPaneController.java
Commit message (Collapse)AuthorAgeFilesLines
* Revert "UnifiedEmail: Supported Email search function"Danny Baumann2016-12-301-1/+1
| | | | | | This reverts commit ad4f76791d5306f6046150cefd7de07d9d15aa33. Change-Id: I396973b7f27a5df483a7845b16b1db804bb8916b
* UnifiedEmail: Supported Email search functionweitan2016-08-241-1/+1
| | | | | | | | | | | | | | | | | | | 1. Use the search function to search the local mail. 2. Search results interface: Filters All, Subject, Sender, Receiver click on the different filter, and search the corresponding results. All for the default selection filter. 3. Search results interface: slide switch filter, remove "sliding removing a single mail" effect. 4. Search results interface: alternative condition, slide switch filter, cancel the multiselect state. 5. Search results interface: UI-filters layout, sliding effect, search, according to the number of search results highlighted. Change-Id: I2af40a386de55e221878bd346cda3ea1cff8f2fa CRs-Fixed: 1023498
* Merge "Save the focused conversation via id instead of position" into ↵Jin Cao2014-10-181-2/+2
|\ | | | | | | ub-gmail-ur14-dev
| * Save the focused conversation via id instead of positionJin Cao2014-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't rely on saving the position in the adapter because the position might change as the adapter's data set changes (e.g. new mails via sync), and we have no way of modifying the focused position accordingly. Instead, save the focused conversation with its id (tried using the uri, but the uri might change when the conversation gets cached). This way, no matter what happens to the items in the adapter, the focused item remains consistent. b/18027602 Change-Id: I51aa68bc15c5892c3b34bde5c199de281390ce7b
* | Navigate up if up is pressed for nested foldersJin Cao2014-10-171-1/+8
|/ | | | | | b/18022259 Change-Id: Ia93e1af3684dd11362bc2608691375f351ccba3d
* Merge "Programmatically set selected state to correspond to peeking conv" ↵Andy Huang2014-10-171-2/+2
|\ | | | | | | into ub-gmail-ur14-dev
| * Programmatically set selected state to correspond to peeking convJin Cao2014-10-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I can't simply rely on ListView#setSelection to programmatically set the selected item because setSelection only caches the selection internally if the view is currently in touch mode. Thus, in touch modes, isSelected() will *always* return false for an item in listview. In order to know what's the current selected item, I keep track of the selected position that corresponds EXACTLY to the listview's selected position. Again, I can't use ListView#getSelectedItemPosition because it will always return INVALID_POSITION in touch mode. I change the selected position whenever a child calls setSelected() or we programmatically call setSelected. I tried using onItemSelectedListener. However, the listener's callback is called after the selected state is changed AND the re-draw happened, so the UI gets inconsistent since the selected state didn't properly update during the re-draw. When we programmatically select an item that's visible on the screen, we have to use ListView#setSelectionFromTop and pass in the current y value since the default behavior is to scroll such that the selected item is at the very top. Also, another caveat is that I am now saving the ConversationItemView's position in the adapter when the adapter binds data to it. I find that this approach is much more dependable than using ListView#getPositionForView because sometimes (for reasons beyond me) in ConversationItemView#setSelected the listview ONLY HAS ONE CHILD (even though on the device I can see a full list), thus getPositionForView will return index 0 since it thinks it's the only child.. I have no clue, so I'm saving the position myself instead. b/18015875 Change-Id: I11897056fc9fa630eb4019532b1fd4cf41c7486a
* | restore peeking stateAndy Huang2014-10-161-3/+4
| | | | | | | | | | Bug: 18024070 Change-Id: I0f4379e92fa1a9c67b76264ae0baa581399f5ab3
* | only auto-close the drawer when selecting from the listAndy Huang2014-10-161-5/+4
|/ | | | | | | | | | | | Previously tablet UI would close the drawer any time any conversation would open. With peek mode, this happens a lot even when the user didn't trigger it. Restrict the auto-close to cases where the user actually taps/keyboard- Enter a list item. Bug: 18020565 Change-Id: Ia4c15c70f99619874fdd1bea760ceeb6bd2a8345
* Use guava Objects.equalJin Cao2014-10-161-2/+2
| | | | | | b/18014334 Change-Id: I95e85c484942364f004c0f4d65b7fa23bf0e1250
* fix occasional blank CV panes on activity startupAndy Huang2014-10-151-0/+2
| | | | | | | | | | | | The condition in onViewModeChanged made it impossible to get out of UNKNOWN view mode if onLayout had been called before the view mode was first set. Fix this by looking for something a layout would definitely have set (a non-zero width). Added some debugging toString() for TPL. Bug: 18009285 Change-Id: Ibacaa1f6473edeefceccfd270c2a761113c6e530
* Cleanup of drawer dragJin Cao2014-10-151-1/+8
| | | | | | | | | - Don't do anything in enableHardwareLayer if it's already enabled - Add onDrawerDragEnded in TPC for consistency so it has access to all 3 drawer events. - Change ObjectAnimator back into ViewPropertyAnimator Change-Id: If78b833d35f0c37f6b9e4d8c644c8a6714bfc7b7
* Merge "Enable hardware acceleration for drawer drag" into ub-gmail-ur14-devJin Cao2014-10-161-0/+10
|\
| * Enable hardware acceleration for drawer dragJin Cao2014-10-151-0/+10
| | | | | | | | | | | | b/17936591 Change-Id: Ie9b435a1c0af457a0524b95a20ece3f3cb829011
* | Merge "treat taps in CV in peek mode as marking the convo seen" into ↵Andy Huang2014-10-161-4/+28
|\ \ | | | | | | | | | ub-gmail-ur14-dev
| * | treat taps in CV in peek mode as marking the convo seenAndy Huang2014-10-151-4/+28
| | | | | | | | | | | | | | | Bug: 17291366 Change-Id: I7e6841013514496f7e2ce6da9e538f949c69c65d
* | | fix crash when rotating an Ad on tabletAndy Huang2014-10-151-2/+2
|/ / | | | | | | | | | | | | Don't auto-peek at the first conversation when in ad mode. Bug: 18007774 Change-Id: Ic838d8362addec6899c12c8ea0dde124e88a02d9
* / Peek mode for 2-pane landscapeAndy Huang2014-10-151-29/+234
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Peek mode allows CV fragments to be visible but not marked viewed and read. TPC keeps a global flag for whether the current conversation should be peeked vs marked read. I have tried to manually reset the flag in the 6 cases that cause the current conversation to change: 1. tap another conversation (don't peek) 2. swipe to another conversation (don't peek) 3. keyboard-advance to another conversation (peek) 4. auto-advance=newer|older (don't peek) 5. auto-advance=list (go older & peek) 6. empty CV and a list cursor has loaded (peek at i=0) Swipe, in particular, required a new onConversationViewSwitched() call in CPA because onPageSelected() is triggered both when swiping around in the view pager AND when simply setting the initial page as part of constructing a view pager. Thankfully, there is only ever one copy of this peek flag in the app, in TPC, since AAC/TPC is where all the work is done both to mark conversations seen and to switch to new conversations. Rotation to portrait on tablets now requires tearing down a ViewPager; this code and thought process is documented here: http://go/xqaxk TODO: selected indicator for transition from peek->read state in-place TODO: touches in CVF should mark it read Bug: 17291366 Change-Id: I24f71a2b7985773814d8caad9f3ab3fe5c3609c8
* Allow dragging the drawer close from CVJin Cao2014-10-151-4/+7
| | | | | | | | | | When the drawer is open, tapping on the CV pane will auto close the drawer, and dragging on the CV has the same effect as dragging on the TL. b/17922832 Change-Id: Ib518ed58cee9752dd8c8713f2bdcb5c65f4afac0
* Cross-fade the drawer on toggle/dragJin Cao2014-10-141-1/+11
| | | | | | b/17936591 Change-Id: I7720b5091d22d3361fd3660976674a725d9563c7
* Fade in/out the search barJin Cao2014-10-131-4/+3
| | | | | | | | | | | | | | | | When showing/hiding the search bar, fade it in/out instead of simply setting the visibility. Other changes: - remove the check for state change inside showSearchActionBar because we previously assumed that a given state will always look the same. However, this is no longer true as ONLY_ACTIONBAR looks different on tablet landscape verses portrait (landscape shows the transparent background while portrait always shows the white search bar). b/17546831 Change-Id: I9120afd3ff89a4c6611b3b4510c2d8427285f3d8
* Support finger tracking for tablet drawer/minidrawerJin Cao2014-10-101-3/+14
| | | | | | | | | | | - Supports dragging the mini drawer open - Supports dragging the full drawer close by dragging along the list pane (not the drawer pane) - Supports RTL mode b/17206080 Change-Id: I8ac8933ed30ca92f162cc6a75865fa1fdc1b2cb1
* Add Vector Drawables (UnifiedEmail)Rohan Shah2014-10-091-1/+1
| | | | | | | | Had to rename a couple resources to be consistent with what UX has in drive. Bug: 17936539 Change-Id: I9ca2c0ec870afcdea52c1fbf1e55468b930301ae
* Fix TL flicker before CV shows upon opening notificationRohan Shah2014-10-031-3/+3
| | | | | | | | | Pager no longer animates in unless we've selected a conversation from the TL (In all other cases, it will now directly appear). Bug: 17808571 Change-Id: Iadabdfa6ec913b1f5f9979dfe50c74eaeb51d326
* Merge "New assets for the various empty icons" into ub-gmail-ur14-devJin Cao2014-10-021-1/+1
|\
| * New assets for the various empty iconsJin Cao2014-10-021-1/+1
| | | | | | | | | | | | b/16876067 Change-Id: Icb65dd69b3ffc34ca31d0c7e997cb58e384ee0df
* | Add fade in transition from TL to CVRohan Shah2014-10-011-1/+1
|/ | | | | | | | | | | | | | | | Added a fade in animation for the conversation pager to ease in the transition from TL to CV and allow for feedback on the TL. In OPC, wait to remove TL fragment until after the pager is done animating in (Also addressed edge cases such as the user hitting back rapidly after selecting an email or, in the case of long animation durations, multiple actions occuring - did this by checking view mode in the listener and cancelling animation on pager hide). Bug: 17304654 Change-Id: I24e977eb6bd335f4f6764fef58b549e7cf0edfe3
* Merge "New empty states for tablet landscape" into ub-gmail-ur14-devJin Cao2014-10-011-0/+24
|\
| * New empty states for tablet landscapeJin Cao2014-09-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For tablet landscape, the empty icon should be shown in the CV pane while the empty text (if the folder is empty) should be shown in the list pane. Added a new empty icon for not having any selected conversation, this state does not have text associated with it since the list pane still showed the available items. b/16876067 Change-Id: I27b7b9ae8ce739f23829afc292df083e8399a118
* | Fix ad mode for two pane layoutJin Cao2014-09-301-4/+5
|/ | | | | | | | | | Positions the panes properly when the view is in ad mode. Also fixes the bug where twopanecontroller only checks conversation mode for setting up action bar icon. b/16821877 Change-Id: I07191d67f8e4c395063f89dc3d037c1eaf2a14e7
* Reset action bar icon on showing conversationRohan Shah2014-09-261-2/+1
| | | | | | | | | | | There's situations where view mode is changed to CONVERSATION, but the current conversation has not yet been assigned. As a result, it does not show the back button. Fixed this by adding resetActionBarIcon() to showConversation. Bug: 17360232 Change-Id: I0fe1fbaf1251b9104c9822efb2cf6884998540df
* Use the rtl version of ic_arrow_back for back buttonJin Cao2014-09-251-1/+1
| | | | | | b/17653878 Change-Id: If5f649df0a8da998983625985e8e81e478c2e8e8
* Merge "More keyboard polish" into ub-gmail-ur14-devJin Cao2014-09-241-3/+5
|\
| * More keyboard polishJin Cao2014-09-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Weird condition where user presses right to go into a conversation, we load the conversation then set mConversationToShow = null. But then our posted runnable for "peeking" the conversation completes, and we show a null conversation which defaults to the first conv. - Don't focus if the pager can't find anything to focus. This prevents the focus from being put to default location (top left) if onRequestFocusInDescendants fail. - When the user taps a conversation, the list loses selectedItem. Use checked item as fallback for navigation. However, sometimes the listview loses focus when the user taps a conversation, thus it wont receive any onKey events. I'll try to figure that out later. - Check target size before commiting the undo action for toast bar. b/17570560 b/17567978 Change-Id: I3d471dc1c1d956957463198086112d5a352fb775
* | Move FAB inside TL in 2-pane layoutRay Chen2014-09-221-2/+2
| | | | | | | | | | | | b/17136827 Change-Id: I76a4a0a1dfabd45d4bdbec6aa0beaae3476fcf91
* | disable focus/click on current account in mini-drawerAndy Huang2014-09-181-4/+4
|/ | | | | | | | | And clean up some mini-drawer (the stub current-account view was just tossed in Gmail) focus shenanigans (assumed 0th mini-drawer child was focusable). Bug: 17536935 Change-Id: I5246afd650da728601cece4339357557dac3de37
* Fix navigation to mini drawerJin Cao2014-09-181-1/+1
| | | | | | | | | | | | | | | Soemthing changed for current_account_avatar (I see it in xml, but the id is never referenced in code and I couldn't find it in hierarchy viewer) which broke navigation since that was the default navigation id I was using for mini drawer. I changed the default id to the mini drawer itself and auto-passing the focus to its first child. Also remove focusableInTouchMode for FAB. b/17555177 Change-Id: I79f27850efdcc06497a042d1e5b155a6755fdbed
* [Quantum search] new two-pane land search result listJin Cao2014-09-171-8/+11
| | | | | | | | | | In two-pane landscape, change the search bar accordingly when we are in conversation mode (so the menu items are visible). b/17361017 Change-Id: Icb07fff91f0533681478d866430fbaa82bc5850c
* fix slow 2-pane transitions; fix 2-pane animations in portraitAndy Huang2014-09-161-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The instant visibility changes on layout after mode changes were preventing the animations from running. Defer any cases when moving to invisible state until after the transition is complete. Move FAB reveal earlier when going CV->TL on 2-pane portrait by triggering list-visibility-changed manually when entering TL mode. TL- >CV hides the FAB after transition complete as usual. Position and animate 2-pane elements after normal layout, since some size calculations depend on having performed a layout already. Fixes some FAB-related race conditions I started seeing with the animations working again. b/17514925 tracks the fact that FAB shouldn't need to move about in this way in the first place (since it's pretty much always tethered to TL). Also short-circuit an infinite loop that triggered continuous relayouts when an Ad is present. This change reverts to the older logic of only positioning/animating panels on known layout change events, which also has the side effect of smoothing out the animation. Bug: 17477114 Bug: 16818991 Change-Id: Ice1f6b896b9d7dc434debb3c2cf15aec87551ebc
* Merge "Remove unnecessary calls to setCheckedItem" into ub-gmail-ur14-devJin Cao2014-09-151-1/+1
|\
| * Remove unnecessary calls to setCheckedItemJin Cao2014-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | We have multiple places where we call setCheckedItem, and it seems that there can be discrepancy among what indices are checked, so we get weird behavior when we are in CAB mode. b/17441959 Change-Id: Ia5ad6f17288b76b5fe4b5a4d64ef856f77c13616
* | Fix keyboard RTL navigationJin Cao2014-09-101-3/+3
|/ | | | | | | | | | | | | | Main issue is that we no longer need the focus changes in onViewModeChanged because we handle left/right navigation individually. Furthermore, changed isRtl check to using the ViewCompat version instead of the locale version so it's easier to test (locale version doesn't work for force rtl in dev options). b/17234283 Change-Id: I3f87e67ed1c7457370f8cdb63cc3abaa57211db9
* Update "New message" toast bar in CVJames Lemieux2014-09-031-1/+2
| | | | | | | | | | | | | | b/17373672 The bar in conversation view prompting the user to update the thread with newly arrived messages has been changed to use the ActionableToastBar to look consistent with conventional snackbar messages. In two pane layout it is now possible to have a conventional snackbar message showing over the TL and "new message" snackbar showing over the CV simultaneously. All snackbar messages have had their trailing punctuation (period) removed. Change-Id: Iaf7d5d9afc38360d07a7b6602d6bc5626ecc3de2
* Add a delay to loading peeked conversationsJin Cao2014-09-021-7/+33
| | | | | | | | | | | | | Don't instantly start loading a peeked conversation when the user is navigating with the keyboard. This prevents the app from freaking out when the user is trying to quickly scroll down the TL. Current delay is 500ms. b/3304236 Change-Id: I5bbdafc5187a7f2b96e28aed1b60b694d4565db1
* Merge "Keyboard support for focused state" into ub-gmail-ur14-devJin Cao2014-09-031-5/+11
|\
| * Keyboard support for focused stateJin Cao2014-09-021-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove focusable from FAB so keyboard won't navigate to it. - rename selectionSet to checkedSet - selected is a state for listview to focus one of its elements - what we really want is checked state for checked items in CAB mode. - show the blue focus bar when isSelected returns true - this is auto-set by the framework as we navigate using the keyboard. - remove blue background color for selected state b/17258708 Change-Id: Ic9739c9b349403942f64fafa26500c08d1f1cc4c
* | Merge "Support keyboard navigation for RTL" into ub-gmail-ur14-devJin Cao2014-09-031-2/+2
|\ \ | |/ |/|
| * Support keyboard navigation for RTLJin Cao2014-09-021-2/+2
| | | | | | | | | | | | | | In two-pane landscape mode support our custom navigation for RTL mode (left/right reversed). Change-Id: I8d3afe1362fc935f8b6140ce37bcfd6a9ba88bb2
* | TwoPaneLayout changes position of FAB as wellJin Cao2014-08-291-1/+1
|/ | | | | | | | | | In two pane mode the FAB positioning will follow the position of the list/conv view. This way, the FAB button is always by the bottom right corner of the list view. b/17136827 Change-Id: If5e9fea2bd177132042fd26547c437b20a005e7f
* Show current folder on tablet landscapeRohan Shah2014-08-271-1/+1
| | | | | | | | | | | When in conversation view mode, we were not showing any text on the title bar (setEmptyMode). Changed it to be visible if in landscape by checking the is_tablet_landscape boolean (renamed), which we currently use with TwoPaneController. Bug: 16985409 Change-Id: I9a35b3b46f024584e1c47936def5aa854c52813d