I have a Activity on top of a MapView that only covers a small portion at the top to display additional data.This Activity is called when a Polygon is touched on the map. The issue that I am faced with is that the first activity gets disable when the second Activity is in view. Is there a way to still interact with the first activity when the second one is being displayed? Or is there a better way of accomplishing what I am trying to achieve which is displaying a custom view at the top of the MapView. Thanks
Related
I'm trying to make this effect but has no idea, how to achieve it:
My idea is to have a Frame Layout which wraps the video fragment, and the Video fragment has motion Layout as its root layout. So, Frame Layout is in main Activity, but motion Layout is inside a .xml file, which will soon be inflated as the Video fragment's layout. It looks something like this (The frag container will match parent in its width and height):
My questions are:
Is this a good idea to make this transition?
How to make the dimming effects that YouTube has? I'm planning to use this Listener for tracking the transition but has no idea how to make the slowly dimming effect :(. MotionLayout.TransitionListener
Any idea?
One way I can think of cover the screen with a a View that is
#000000 and transition the views color to #FF000000 using a custom Attribute.
The View would need to be gone, Invisible, or translationZ = -1 at the start
Some context.
I have a RelativeLayout that is added with a WindowManager the type is TYPE_SISTEM_ALERT with the flags FLAG_NOT_TOUCH_MODAL FLAG_WATCH_OUTSIDE_TOUCH.
I'm able to get touch events either on this RelativeLayout or in the Activity "behind" it, but as long as it's not part of the "RelativeLayout window" added.
* The black bars are the Views on my RelativeLayout;
* the red rectangle is the whole container of this RelativeLayout;
* the yellow stars are the spots of space that is created from the black views;
* the white space is the Activity behind this RelativeLayout window on top.
Imagine there is a Button on the yellow stars spots that are from the Activity A, BUT are VISIBLE to the user and if he clicks there.
the Button of the Activity A should be able to respond, even though its "behind" this RelativeLayout Window.
My references, but unfortunately without success so far are :
Android overlay to grab ALL touch, and pass them on?
Android : Multi touch and TYPE_SYSTEM_OVERLAY
Is there a workaround to this?
Is there a workaround to this?
If the activity in question is your own activity, get rid of the system-level overlay and implement the overlay in your activity's own view hierarchy.
If the activity in question is not your own activity, then AFAIK what you want is not possible. Windows in Android, at the moment at least, are purely rectangular; I know of no way that you can set up your window to be non-rectangular and have the activity truly be the top-most item in those transparent areas. And, passing touch events along has been blocked since Android 4.0, for security reasons (tapjacking attacks).
So right now I have it so I can swipe and it changes views or activitys
but how can I do it so it just changed the middle box only? With the sound clips in it
Im making this app to learn
this is the source i used
http://www.easyway2in.blogspot.ae/2014/07/android-swipe-views-example.html
and my video
https://www.youtube.com/watch?v=qD039kXYPLM
instead of having the ViewPager the only item inside activity_main
you should put the header and footer you want to remain unchanged inside activity_main,
so that the fragments in the viewpager only contains your "middle box"
I am currently making a game, the game has a start screen and the main game screen.
My question is what is the best way to switch between the two views.
The start screen consists of just a couple of buttons one being "start game", when this is clicked GLsurface view to be created.
If i create the GLsurface view at the begining and bind the renderer here then anything from the GL surface view is displayed on top of the start up screen.
I thought i could create a viewflipper which would default to the start screen and then just create the glsurface view within the onclick method for the start button, but this doesnt seem to like having the GLsurface view in it.
Does viewFlipper support Glsurface view or is there a better way round this.
Thanks.
The easiest way is to use two activities, and just switch between them.
The trouble here is that ViewFlipper can only affect the "view" part of the GLSurfaceView, which is just a transparent hole. The surface where the GL rendering happens is composited separately, behind the layer with the view content, so it cannot be animated this way.
An example of using two activities in a GL game can be found in Android Breakout, which uses one activity for configuration and "start", and another for the game itself.
If you really want the ViewFlipper animation you could render into a TextureView, but your app would have to handle a number of things that GLSurfaceView does for you. TextureView is also less efficient than SurfaceView.
I implemented the Sliding Menu library in my app but I have an issue with the navigation.
In the behind view, I've set some buttons which when pressed change the Fragment of my current Activity. Normally, when the fragment is changed, the Activity slides back in it's place.
But I encountered a problem and I am forced to use a new Activity on button click. The thing is that, when I start the new Activity, it opens a new "screen" (as expected). What I want to do is to slide the screen back to it's original position with the new Activity in. Any way I could do that?
Basically, I want to launch an Activity with Drop-Down navigation and 2 normal activities.