Scenario:
In Gmail app Android Lollipop , when user select a mail at mail list screen, it will go to detail and perform expand animation at selected item. At detail screen, user can swipe left or right to view next/previous mail and when user press back, it will reverse animation at selected item to position on mail list.
In case if user swipe to view mail that was visible at mail list screen, it will animate to bottom.
So, my question is "How to can do like that?"
It is functionality comes in lollipop called as shared element transition and you can achieve it by placing the same transition name on the component and share with next fragment.
Here is a good example for you:
http://www.raywenderlich.com/103367/material-design
Related
I'm trying to find out the best routing solution for this scenario here. I have screens with workflow as follows.
Items Screen(1) ===> Item Details Screen(2) ====> Edit Items Screen(3)
On the Edit Item screen, when I edit things and save, it should take the user back to the Item details screen with some objects and variables passed as routing arguments.
I used
pushReplacementNamed("/details", arguments: ItemDetailsArguments(item: item, variables: variables)); on a button click from the edit item screen.
This works fine, until I noticed when I click on the back button on the App bar (Item Details Screen(2)) it takes me all the way back to the Edit Item Screen(3) again instead of the Items Screen(1).
Is there a better way to pass data from screen 3 to 2 upon button click and then take the user all the way back to screen 1 when the back button is pressed from screen 2?
Instead of a pushReplacementNamed you can use pushNamedAndRemoveUntil with a predicate to remove the unwanted routes from the stack.
Read more about pushNamedAndRemoveUntil
pushNamedAndRemoveUntil(
"/details",
ModalRoute.withName("/items"), // screen one - route predicate
arguments: ItemDetailsArguments(item: item, variables: variables),
);
Route predicate will let you decide what needs to be removed from the stack.
In this case, after the button is clicked, push to the "details screen" and also remove all other routes that are in the stack til the main screen. Hope it helps!
I am adding a Navigation Drawer into my activity :
Things I want to do : Profile image which is up-loadable from mobile gallery and also from picture taken from camera instantly it should give option for cropping and fixing into circle transform I've to use glide that I know.
The Main part is to create an item name : INTERESTS(clickable and onClick its subItem(checkbox) scroll down) and if that's too much then just Item with INTEREST which is just a text and its subitem includes CHECKBOXES
One Button at the button of the drawer onClick of this button will save all responses into an array and feed it to api on drawer close.
https://material-design.storage.googleapis.com/publish/material_v_9/0Bx4BSt6jniD7YVdKQlF3TEo2S3M/patterns_navdrawer_behavior_persistent2.png
See this exactly the same but I don't want to navigate anywhere just list item should be chackboxes and save button at the buttom save store it in array so that I can feed it to the api onClick Button
I have one activity and two fragments
In one fragment I have created an AdapterView, and attached OnItemLongClickListener.
When item long click happens, I am creating another fragment and showing an image
Now what I want is, when I do touch up corresponding to Item long click, dismiss image display fragment
Its something similar to what snapchat does, hold on a list item and display an image, when touch up happens stop image display
I am getting OnItemLongClick and able to launch image display fragment. But not able to come out of it as I am not able to capture TOUCH UP either in activity or in any of fragments
Could you please tell us what is best approach to do this and any sample code?
I googled, but did not find good answer
I just learning android
Thanks
I am new to android programming. I have this problem that I created a listView with button and text. I wanted all of this object to be active. Meaning I can click or touch any of these 3. The main idea is, I will display a listview of products. When I select a list it will bring me to a details view. And when I click a button it will add the current selection + 1 to the current textbox. I also want the textbox to be editable.
Take a look at my WaddleAddressBook
The EfficientAdapter has code on how to implement each item.
The WaddleAddressBook shows an example of detecting gestures (swipe left and right in this case).
search.xml is the list item layout.
Each list item basically had a contact picture, contact name and 3 buttons under the contact name for call, sms and edit. You could swipe right to call and left to sms just like on Samsung phones... I never ended up finishing the address book but I hope it helps you.
Hello i have problem with button not updating,
I had used sample search , when user search any word ,
I had placed star button in right aligned in
I means to say suppose i search something and list view opens and at right star bookmark is there so on click it must show.
You can't get any useful replies without posting your source code.