I have a custom LinearLayout class that I use to give a framed look to my views. When I want to add something to a frame, I add my views inside that custom LinearLayout.
Now my problem is, in one of my frames, I use MapView. And this MapView causes the frame's background to be erased/removed randomly. The background is usually gone for a second and then it comes back. Sometimes only a part of the background is removed, but usually all of it. In the first screenshot, the frame is as it should be. And in the second screenshot, it is the case that background is disappeared.
Has anyone experienced something like this? Any help is appreciated. Thank you.
You can bring your header to front by adding bringToFront();
More details : http://developer.android.com/reference/android/view/View.html#bringToFront()
Related
I am trying to make an animation with a layout which contains a background and some text (TextViews) inside it. The animation should make the whole layout crack in the middle and then move slightly like a paper tearing. So not along a straight line but a random zig-zag pattern along the middle of the layout from top to bottom.
I've been trying to find something like this so can I get an idea how to do this but have not been able to so far. Does anyone know how something like this can be done on Android?
TIA
You can try Brokenview Or ExplosionField.
Brokenview(https://github.com/zhanyongsheng/BrokenView).
ExplosionField(https://github.com/tyrantgit/ExplosionField).
Have you tried with this example? In the blog you have an explanation of how to achieve this behavior.
The idea behind is basically:
Save your Activity's screen as a bitmap.
Split it into two parts.
Animate the bitmaps outwards.
I want to make popup dialog like in facebook app with pointing marker to the selection area.
here is an example how it should look like.
http://imageshack.us/photo/my-images/9/facebookandroid.png/
please help if you know something about it.
Thanks in advance..
May be your question would get solved from this
https://github.com/lorensiuswlt/NewQuickAction
There are multiple strategies that can solve this problem, but each solution has to deal with the placement of the triangle/pointer at the top of the dialog since it has to be positioned to indicate the user's selection.
I think the easiest way to solve this problem is:
Start an activity that has a transparent theme. So, apply something like android:theme="#android:style/Theme.Translucent.NoTitleBar" to the Activity in the manifest. If you want a Title Bar, do some searching for the right android-style.
Pass an extra to the activity that represents the navigation element chosen by the user. this will be used by the activity to position the triangle pointer.
Handle this extra in the activity's onCreate() method by drawing the triangle/pointer in code. This means you will want to call setContentView(...) in onCreate(), then get a reference to the ViewGroup (i.e. RelativeLayout, AbsoluteLayout, etc.). Once you have that you can call ViewGroup#addView(View child, int index) to add the ImageView that represents the triangle. You probably want to use index = 0.
Ensure that whatever View(s) you add programatically is/are not covered (i.e. hidden) by elements in the XML.
Adding the triangle is relatively easy, but positioning can get tricky. First of all, the screenshot you posted assumes a fixed-width device, and that's just not true for an Android app in the market that needs to work on 1000s of screen sizes. The Y-coordinate of the triangle/pointer is not a problem, since the height of the top-nav is probably hardcoded. It's the X-coordinate that can get tricky. What if the top-nav elements stretch? Let's assume we have a robust/decent way to get the X-position where the center of the triangle/pointer should be. Given that, I'd try using a vertical LinearLayout in my Activity and use an ImageView with a left-margin for the triangle/pointer. That's just a guess and you'll probably have to tinker with this to get the right View elements and positioning strategy for your specific implementation.
I am trying to make an application for android that is based on IPAD app. I want to keep the same look to the app, but I am not a very good designer. So I was wondering if it was possible to for me to crop say the entire header and then have an invisible button or something on top of portions of it. so the design would become a little bit easier. Also if that is possible how would I get the what ever the event item is going to be to overlap with a portion of the image if it has stranger orientation. (I think I could fake this by just moving it closest orientation and extending the size untill it fits, but it would be nice to find a better way.)
How would I go about that?
I tried making the button invisible, but that did not seem to work.
Thanks in advance
I got lost on your description. But if you want to make a button invisible, calling setVisibility(View.INVISIBLE); will not work, because it will not receive click events. You may want to set its color to transparent instead. try using:
button.setBackgroundColor(Color.TRANSPARENT);
First off, I'm a beginner. If this is way beyond the scope of a beginner's first application, just tell me.
The best way to explain what I want is as an example: In Robo Defense, when you kill something, a little $10 pops up, animate translates/fades up about 5% of the screen and disappears. (almost like a toast, appears on top of canvas)
I'm looking for something similar to that same effect. As a like, top-layer drawable that ignores the underlying defined XML layout. I can handle the animation part of the code, but I'm curious as to how to create and inflate that view without wreaking chaos on my current layout. If it would be easier as a drawable instead of text, thats really not a big problem for my project. It is simply imformative, no interactivity at all, it will just be a quick little 500ms artifact to show that an action has occurred.
I could use a pointer in the right direction, or some similar code examples please.
I think you would create the TextView within your Java code, and then use an animation to make it rise and fade, once the animation has finished, destroy the TextView.
I've never done this before, but I think that should work!
To anyone else who is wondering, I ended up accomplishing this via wrapping my entire layout in RelativeLayout, making the appropriate changes necessary, then creating a TextView programmatically with layout_above, and then calling an Animation on it.
I am currently working on an Android app, I have completed all the 'hard stuff', such as getting my database working, and so on. Now I need to make the UI look decent.
I would like to make something that has a 'frame' layout that is clickable. You would click on a 'frame' to find out more information, a bit like the Amazon app.
If anyone has any ideas, tutorials or good links, I would be very grateful.
Thanks in advance.
Take a look at Gallery. It's built in to Android and does what I think you're looking for (at least, it describes the Amazon app's UI; since FrameLayout has a very explicit meaning in Android that is not at all what you're talking about, I ignored that part).
EDIT: A screenshot would have been helpful but I think you're actually talking about a simple list-like view.
Oh. That's either a ListView, or more likely just a vertical LinearLayout inside a ScrollView. I can tell you what I'd do: Each item in the LinearLayout would have a background set, with a width of match_parent and a height of wrap_content, using a 9patch with the right-pointing arrow inside it. I'd also define an identical but blue-highlighted version of the image for the pressed state and use a state drawable XML to let it know which to use. Then I'd just bind an onClick listener for each item I wanted to fire off a click action on.