any idea how to implement something like the multiple desktops of the android?
I tried Gallery but it sucks I wansted something just like the desktop app
thanks
have you tried using <ScrollView>? I've never tried this so i dont know if its possible, but you might try sticking some layouts in a ScrollView and then listen for the scroll event. When the scroll event happens, you can then automatically scroll them from 1 view to the other so that they never end up half way between one or the other... if you try this, please post the code, i'd be interested in seeing how you do it...
In my case I used this tutorial :
http://developer.android.com/training/animation/screen-slide.html
It works very well but there is still the large background image sliding a bit at each page change to do.
Related
I'm trying to design an app with a layout that will roughly look like this (don't mind the color):
How can I achieve something like that? I'm thinking of using a CardView for that bottom panel (I don't know what it's really called).
Furthermore, I want to hide it (animating it) when the use scrolls on the content. I have tried many codes but they won't work so I won't put them here anyway (like what's suggested here). Thanks for the help.
Whenever I have a question along the lines of "How do I do this neat UI thing I saw once?", I always start by checking out wasabeef's amazing UI library collection. In your case I might start by looking at bottomsheet or AndroidSweetSheet.
I have a ScrollView with 20 WebViews inside (yes, I know it's heavy but right now it's the best solution I've found). The WebViews are used to display forum posts.
I'm getting a very weird behavior on my Nexus 4 (it doesn't happen on some other devices I've tested) which is driving me crazy.
I have the first post visible and just a little bit of the second one visible. Now I want to scroll and instead of starting scrolling by putting the finger in the first post I put the finger on the portion of the second post that is visible. The WebView of that second post immediately jumps to the bottom which is a very annoying behavior while scrolling.
If you feel appropriate I can record a video of this behavior and upload to YouTube or you can search for AndroidPIT in the Play Store and check the behavior yourself in the Forum section. I won't post the link to the Play Store to avoid being called a spammer.
Thanks in advance.
From comment: "Have you tried setting your webview to non focusable and non clickable as it appears as it's trying to display the entire content of the item you are pressing on as you scroll"
Apparently View#setFocusable (view.setFocusable(false)) worked.
Make sure that the scrolling is handled by the scrollview in stead of the webview. I believe setting the Webview.canscrollvertically to false might fix the problem, let me know if it helped.
When you have some clickable content like <a>, <input> or <area> and before this you have an absolutely positioned element with a bigger z-index, there is the wrong behavior of 'click-through'.
I click on the area where the clickable element is behind the front element. In other browsers there is the right behavior that the click does not go through the front element. But only in Android Browser you can click through the front element and activate the element behind. This is a known bug and you cannot avoid it. It's even in newer versions (I test on 2.3.3 in the official Android emulator).
There are some workarounds described in some forums but none of them worked for me.
I tried to put an <iframe> or an <a> between front and back
I tried to change the DOM so maybe the browsers state is refreshed
I tried to have the back elements be positioned as well
None worked
I'm especially having problems with the image map's area elements.
Has anyone had the same issue and managed to work around it?
I'm specifically interested in solutions which are tested against image maps.
I am wondering about a few things here. First, what is the purpose of having an overlaid image and using the image maps? I see you're including jQuery - can you use the hover event with jQuery to change the orientation of the images and do the swap? What about attaching to the click event for the image map, and checking to see if the lightbox is open. If it is, then return false;.
Just trying to think out loud. Sometimes another take on it can be helpful.
This is a quick blindfolded reply, so let me know if I should expand/fix it further. The general idea being a CSS class for both the hover and focus events that disables pointer interaction.
yourElementClass:focus, yourElementClass:hover {
pointer-events: none;
}
Actually I've managed to avoid it by moving the objects below to let them be not visible.
But in cases similar to yours the only workaround that actually works is to manage all the clicks in jquery (especially the ones on the background) and to bind/unbind the clicks events on needs.
there are also some things that could help on some version/mobiles (but do not solve the problem)
the above item has background:rgba(0,0,0,0.1);
you should put a gif or png as background of the above element (as well as the background color as point 1)
using thouchstart instead of click as bind event sometimes helps.
the actual version of android/browser are not affected with this bug (or at least it never happen to me) but it could be nice to know the affected versions. If someone has a list.
ok so here I have a difficult one. apparently no1 does know a thing about this issue but I did find some app implementing the behaviour so hopefully...
I'll keep this short as I am sure if you stumbled upon it too, then you'll recognize the issue straight aways.
I have a horizontal Gallery with SrollViews in it. The 2 onTouchEvents (the one of the gallery and the one of the scrollview being displaied) collide and you need to take a decision about who to dispatch the event to.
anyone!?
please if u have no idea what I am talking about please let the http alone ... it's already busy enough ;)
I have a horizontal Gallery with
SrollViews in it.
That is unlikely to work, for the reasons you discovered. Most likely, you will need to replace one or the other. For example, you could use a ViewSwitcher or ViewFlipper instead of a Gallery. I have also heard that ScrollView and HoriztonalScrollView actually work OK together, though I have not tried it.
Does anyone know how to achieve the "scroll past top" functionality that you see in some apps (like the HTC Sense email app for example) where when you scroll up to the top of the list and try to scroll up past that, it appears to pull down, and when you release it springs back up?
Take a look at this library: https://github.com/johannilsson/android-pulltorefresh. I think it implements the behavior you are looking for.
As far as I know, there is no built-in way to achieve this look with the default ListViews. Everyone who has done this implemented their own custom ListView widget that supports this functionality.