In a ScrollView, can I make the scrollable edges glow constantly? - android

I have a help screen that comes up before my android game starts. It's a ScrollView. While playtesting, I found that almost without fail the players would tap on the screen at various points until they accidentally moved the screen a bit. Then they realized it was scrollable.
This isn't a good experience. I want the scrollable edge of the screen to glow constantly so that it's obvious that you need to scroll. Simply showing the scrollbar doesn't help because it's so minimalist. Even if it's wider I'm not sure it would attract the eye enough to clue people into the need to scroll.
Is this possible to do or do I need to derive my own version of ScrollView? If the latter, what do I need to do to make the edge glow?

One way, theoretically, is to use:
yourScrollView.setOverScrollMode(ScrollView.OVER_SCROLL_ALWAYS); // android:overScrollMode="always" in XML
However, I've had no luck with this feature (at least with vertical ScrollViews). Instead, I would recommend adding an arrow down the side of your page, or some text that says "scroll down". This way, it will blend in nicely with your app.
Alternately, you could make the scrollbars more visible (perhaps bright pink!) by employing this tactic (the article is on ListViews, but it should work for a ScrollView too), in addition to always showing scrollbars.

Related

Is it good practice to only use LinearLayout for a Layout that only plans on using one screen?

I have a screen in my Android Application that only takes up one screen. Because of this, I thought it would be really quick and easy to just use LinearLayout as my base layout:
I thought this would be good. However, I am thinking, what if someone uses a 2.7 inch screen on their smartphone? Or they do split view. They might not be able to see everything without scrolling. So, is it good practice to do the layout the way I am doing it or is it always good to allow the user to scroll to see everything?
Since many different devices exist, some with very tiny or otherwise abnormal screens, it is a good idea to make the layout scrollable when needed.
This is achieved by encapsulating your layout in a ScrollView.
Other popular methods to tackle this are using ConstraintLayouts, or the legacy Relativelayouts, which are placed relatively to each other, and relative to screen borders.
What if a layout gets partially off-screen? Maybe it is no big deal, but maybe it hides an essential part of the layout (e.g. a 'next' button, or some important information). So yes, your worry is justified.
As I believe it is good practice to make an app work on as many different phones as possible, I do believe it is good practice to make sure a layout does not appear partially off-screen.

Android: Scrollable and zoomable container

I'm looking for a way to display views (like buttons, checkboxes, images etc) in a container, which might be bigger than the actual screen size.
A ScrollView within a HorizontalScrollView is no option, since you're only able to scroll one direction at once, not diagonal.
I have yet to find a simple solution to this problem. A zoom function would be nice to have, but that's not as important as the ability to scroll diagonal.
Are there any components out there able to do things like these? Doesn't even have to be for free.

make main view of app larger than the phone's screen

working on an app and The way I want to set it up is different than what I have ever done before. I want the main activity when launched into the app to exceed past the boundaries of the physical phone screen, and for the user to be able to swipe out to parts of the app that they can't originally see.
I am not sure what the terminology is or what methods or classes etc to use. Any info that could point me in the right direction would be great! Thanks!
Just some clarification:
I think what I'm trying to say is the second thing you talked about. Imagine if you place a iPhone for example in the middle of a piece of computer paper. What I want to achieve is to have the whole view the size of the paper, but only be able to see the size of the iPhone's screen at a time. So you can go up a little bit and see what was above the screen, or left or right
If you want more screens and be able to switch between them, use ViewPager.
If you want one large view bigger than screen, you can either combine ScrollView for vertical scrolling and HorizontalScrollView for horizontal scrolling, or make some custom View, which will be able to scroll (you have to implement it on your own) in both direction.
If you want to have just some views outside of the screen and bring them to visible area on some event, you can use RelativeLayout and set to its views proper margin.
If you want something else, add more information, how it should look and act like.

Vertically long user interface

I made a UI with many UI elements such as button and it takes a lot of space vertically.
The UI fits on my phone (it's 16:9 like many), but on phones with a different screen ratio, the buttons on the bottom are cut off of the screen.
I'm using a linear layout. How do I fix this?
Instead of trying to create a UI that is like an image and displays at a fixed aspect ratio, start thinking about designing for resizing. To accomplish this, you need to make decisions about what in your layout must be fixed in size, and what can acceptably resize or scroll.
Importantly (and this is my own stylistic opinion), you should avoid layouts that clutter the screen or fill it with detail. Your layout sounds like an input form of some sort; one solution in your case might be to let the controls in the upper part of the menu scroll, while anchoring the buttons at the bottom of the screen, or to just place the whole layout in a scrolling view. But ask yourself: will this be user friendly? I suspect this solution will look dense and (on really small, resistive displays like that of the LG Vortex) become hard to interact with.
Try to separate your UI into easy to comprehend little "nuggets", omit unnecessary information, and if you must, split the UI into different activities or fragments.

Android TranslateAnimation after scrollTo() = undrawn view

This might be a "duh" question but I'm going to go ahead and ask it anyway.
I have an oversized (bigger than the screen) RelativeLayout, and I'm using swipes to start a TranslateAnimation from viewing one part of the layout to another. Say for instance the layout is two screen wide and two screens tall. After the nice animation to shift the screen, I was using View.scrollTo() to set the new position. This works fine going from the first screen (top left at 0,0) to one of the others. When I swipe to animate back to the first screen though, because the View.scrollTo() invalidated that part of the layout (I assume), that part of the layout is all black as I animate through it. I tried a couple things to get it to redraw itself after the scrollTo() but haven't had any luck, so I figured I'd ask here.
thanks!
joe d
I can't help with your specific problem since I've never tried working with a layout bigger than the screen, but there might be another way to achieve what you're trying to do. If you simply want to be able to finger-swipe from one View to another, without ever displaying part of one screen and part of another (i.e. you aren't smoothly panning around a large View but rather just jumping from one distinct section of the layout to another), then these tutorials might help, here and here. They show you how to use touch events and the ViewFlipper widget to change between Views using animations.

Categories

Resources