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"
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
I'm creating an app, that loads 2 xmls in listView (second one is loading when first scrolled down to the bottom).
So I want to show loading bar when 2nd xml is loading and parsing inside listView like on the second pic;
Is this even possible? :)
Because I have to put it on the layout and move my listView (thats not looking good).
Thanks
For first time loading you want progress bar to be loaded in screen center. so you make in your layout two element. one listview that covers whole screen and after that put progressview ... put them in master layout as Relative, so they will automatically adjust like listeview will be behind and progressview will be on top of it. in activity code set progressview visible on your server request. after first load when items are all loaded in adapter, hide progressview ...
for on scroll and infinite scrolling/loading here is a decent library that does that easily https://github.com/pwittchen/InfiniteScroll
I would like to make a Fragment show up just like a Fragment Drawer would, but not only to a list of intents.
(If you don't know what I mean by Fragment Drawer):
Google products such as Gmail, "Google app", Google Play... utilize them frequently.
The Fragment Drawer is a menu on one of these apps created by swiping from left to right or clicking the "Hamburger" button.
I would like to highlight the distinction between what I want and the Fragment Drawer is: I would like to be able to place TextViews, ImageViews, and Buttons inside of it as if it were a normal fragment in which I could just inflate a layout in it and I would rather it come from the right instead.
If a visual representation is needed I would be happy to try my hand at making one.
I have a simple soundboard which uses Buttons to represent the sounds. When a sound button is clicked. The background image is changed using the view.
Button butt = (Button)view;
butt.setBackgroundResource(buttons_on[media]);
buttons_on is a int[] representing the drawables of the buttons.
This all works perfect, but I also use a FragmentActivity to create a paged App. The App has 4 different pages which you can swipe through. When I change a button using the above code and swipe two pages to the right and than swipe back. The image of the button has changed back to it's default defined in the page.xml.
How can I prevent this behavior?
change the Buttons to ImageButtons and setting the src?
somehow prevent the page from reloading
Instead of doing that you should look at how to use a StateListDrawable. It will simplify your approach.
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