I have a button which on clicking opens another activity which comes up from below and covers half the screen. I searched about it but did not get any useful approach except the overridePendingTransition function which is useful in getting the animation on activity transition, but this didn't solve my problem. I know this is done in google hangout as shown in the images but can't find any useful solution.
When we press the button this activity comes up and covers half the screen size
when we scroll up the activity becomes our main activity
Any idea how this can be done?
Thanks
you can use bottom sheet for this type of UI.
here is first sample.
another sample
here is code
After some searching i got exactly what i wanted with all the codes, but still the profile picture animation is remaining, rest the SlidingPanelLayout code can be seen here . It contains some detailed information with all the classes implemented which you can use directly. I think this will surely help you. :D
Edit: As said by #MrsEd i would like to add some code that helped me. This is the custom built DraggableLayout which you can use directly, the code can be found here. Then the activity must implement the onStopVerticalDragDown() of the DraggableLayoutCallbackListener inteface and set the content view as this xml file.
Hope this clears all the doubt and makes it easier for anyone to implement their own custom built DraggableLayout without using any third party library. :D
Please. Don't redo this.
And instead, use Flipboard's BottomSheet.
Related
I am creating android apps by self learning. I have tried searching for this everywhere but have not found it.
My exact question is how do I create the layout shown below. I want the Activity2 to slide up and down with up and down swipes respectively.
You can use BottomSheet to perform this.
Go Launcher have a nice first-time tutorial. it is very similar to Stock ICS first time run. I want to learn how to make the similar tutorial display at the first launch of my app. How can I implement this Transparent view (which interacts with screen objects) in my android app?
I was trying to do something similar using a transparent activity with a viewpager inside it. I wanted static 'tutorial' images that users could swipe through.
One of the answers to my question mentioned an interesting library (called ShowcaseView). It seems like it may be a good fit for your requirements as well.
https://github.com/Espiandev/ShowcaseView
You can either use a FrameLayout or RelativeLayout as root of your Activity/Fragment, and put your "first time" View upon content with a (almost) transparent background, or use another Activity/Fragment themed with a transluscent window. (like this)
I'd rather use an Activity/Fragment, but this is up to you!
I wrote little library That contains a simple component for making a app tour. It`s very restricted to my case but maybe could be your case . Single LessonCardView Showed onstartactivity for the first time or on button click Any criticism ,help or advice will be appreciated. thanks https://github.com/dnocode/DnoLib
You can implement a first-time user guide with the Spotlight library by TakuSemba.
It is similar to the one shared above and it is still well-maintained (as of 2021).
https://github.com/TakuSemba/Spotlight
I am developing an application in android. I have an Activity where I have a couple of buttons. Among them when I click on one button, I want to get dropdown like iPhone default picker.
To achieve that, I am using Android wheel concept. I have implemented like this, when I click on the button, it is calling another activity where my required custom layout is shown. Problem is custom layout should come from bottom of the screen in the same activity where the button I am clicking exists.
I have attached a screenshot. I want to achieve as shown in the screenshot (missing).
Please help me providing the required solution. Pardon me if there any mistakes in my question. This is the first time to ask a question.
Since the lack of a screenshot that helps to understand your issue, this is more some kind of guess: Are you known to the concept of Spinners in Android? They provide a dropdown mechanism and are easily implemented.
After seeing the last screenshots of new foursquare application and their balloon like cartoon instructions, I'd like to create some of these in my application.
I found a similar question for iPhone
Small popup for instructions... How?
Here is another screenshot of foursquare app:
I'd like to know how I could achieve that with Android.
Thanks in advance for any help.
UPDATE: This is what I could get so far but adding some buttons with a custom drawn background and layering them with a FrameLayout:
But I still couldn't get the triangle effect. Maybe there is something I can do with my custom background shape?
UPDATE2
After checking your suggestions, I decided to go with Aaron C idea and added an image with an arrow on it. This is my current result:
Thank you Snailer, QuickAction API project seems very much promissing. I'll check it out when implementing more features in my app.
Now, I just need to get the right color or maybe I could just let it this way. It seems nice too.
And, so, to summarize what I did:
Got my initial xml layout inside a FrameView.
As I'm using a frameview, everything I put in here will be piled one over the other. That's how I could add things to the layout.
In that framelayout, I put 2 relativelayouts whith an image with the triangle and a button to create the two upper popups. In the bottom I put a button only.
That's it. I hope it helps somebody.
Thank you very much again for all your help!
That sounds like a neat thing to implement. There might be a built-in Android variation on AlertDialog that achieves this, but if not here is how I would go about implementing it:
Create a new Activity whose background is black with a very high (low?) alpha color value. This will allow you to see through it to the previous Activity in the stack. Then, add your alert at whatever coordinates you like using a relative layout with padding values.
You might also want to add a touch listener that exits the Activity if the user touches the balloon (or maybe anywhere in the screen).
If you want to be fancy with coordinate placement of the balloon, you can pass this information into the new Activity using the Activity's launch Intent with the putExtra() methods.
It's probably achieved through skinning a toast.
The developer documentation shows a skinned toast in "Creating a custom toast view" at http://developer.android.com/guide/topics/ui/notifiers/toasts.html
You may want to look at the QuickAction API. It acheives this by using PopupWindow, skinned, positioned, and animated.
i have 4 activities in which i have to swipe them right, left and if i am in last activity and swipe to the left then again first activity should be shown.
can anybody have any idea how i can achieve this? or some sample code?
thanks a lot.
you can achieve it by animaton..
But it will show as a Gallery view and you can swipe as well...
OnTouchEvent on every activity you can call another activity using intents by
overridePendingTransition(R.anim.act_back_slide_enter, R.anim.act_back_slide_leave);
//overridePendingTransition("animation for activity which enters", "animation for activity which leaves");
I have not yet tried this... but we can make it in this form.. If you get success let me know.
#sajjoo Here goes your answer in deezapps widget with the questions below pointing at it
How to show multiple screens with right/left slide Gesture
How to create a slider screen (As in Tweetdeck) in Android?
and many more linked questions..
I recently posted a question that covers a lot of this (my question is about using Swipe together with ScrollView, the Swipe gesture by itself works just fine):
Swipe/Fling tab-changing in conjunction with ScrollView?
If you read the sources I have listed and use the code I've provided then you should be able to do it.
It's work fine... just must to delete the redundant R.java file...!
http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/