Android: how to show the user which view is active - android

I have an activity with a WebView. I would like to give the possibility to the user to scroll from one WebView to another WebView (as it's done to Android desktop):
with something in the bottom which shows which screen is actually viewed. I have think about the ScrollView but maybe something else exists which easier to use.

what you want to use is the ViewPager
http://android-developers.blogspot.de/2011/08/horizontal-view-swiping-with-viewpager.html
To get an indicator which shows on what page the user is use:
http://jakewharton.com/viewpagerindicator/
An example how to use it is here:
http://blog.stylingandroid.com/archives/537

Related

Gmail like registration layout in Android

I often put user registration on one xml file with scroll view.
I have learned when a user sees too many fields they opt out of the app so I am planning to upgrade the layout to look like the one for gmail when you sign up on android app. It appears to be using tabbed view but not tabs available and user navigates to the next view by clicking next (refer to attached images).
First page
second page
MY QUESTION
My question is how do I create this views, do I need many xml layout files or put all stuff on one file and use visibility as in once it is filled and user presses next hide the inputs and reveal the next inputs. Note: Gmail appears to be scrolling to another page the way it would appear when using tabs.
You can use one activity to host multiple fragments. The new Android Studio update has Navigation Editor which you can use to achieve similar results.
it is totally up to you how you want to design this but the best thing is you use Fragment and viewpager instead of using two separate layouts.
See Here how to use fragment with viewpager
There are many ways to do this, If you have less content then play with visibility otherwise ViewFipper ( https://abhiandroid.com/ui/viewflipper ) Or can use Fragments

Android: How do I create an overlay with a floating RecyclerView within a fragment

I am not quite sure what I should be searching for, so I thought I would ask if anyone could 1) Help me identify the NAME of what it is I am trying to create or 2) give me an idea of a library / how I would go about creating this.
See this (Poorly-drawn) picture:
What I am trying to do is to create a normal Fragment which has normal content in it, but when you press a button somewhere (IE action bar), it creates a recyclerview that is "floating" as a type of overlay on top of your fragment. Ideally if the user clicks elsewhere, it will close it (So it should simulate the behavior of a dismissible dialog box), but also allow clicking within the view itself.
Also, if possible, I want to make a connection between the + sign and the recyclerview (Like a line or something) just to indicate it is connected and is an overlay.
Anyone have any recommendations as to what I should do or what I should be looking for? Thanks!
-Sil
You can place your RecyclerView within a DialogFragment. That way you can get the overlay feel, and you can also dismiss it when user clicks anywhere outside of it.

Creating a menu like the new YouTube application

Any ideas how we can make a menu like the one that Google has implemented in their YouTube app. I've read this, but that solution differs from the behaviour of the YouTube application. Does anyone know a real way to go about this?
I'm talking about this:
I believe that they use a HorizontalScroll in a RelativeLayout.
Image that the menu is always there to the left. You make that first.
Then you place a HorizontalScrollView on top of that and then put your main content in that.
Set your horizontal scrolling properties to only scroll a certain max. Then you wire up your menu button to slide your horizontalscrollview to the max you set and that should be it.
You can always check the source to the People Application in ICS. They do something very similar.

In Android how can I design a view like the attached image?

I am new in android and I have a view which is in the attach image. I have to open this view after clicking on list item, but I am not finding any proper way to solve this please suggest me how can i open a dialog like in Image.
Check PopupWindow control in android developers, does exactly what you want. There are numerous tutorials on the web on how to customize, animate, have functionality etc. It has an onCreate method and in simple words it works just like an Activity with specific bounds. It can be attached and shown anywhere and anytime. It's actually quite useful. When you don't want to use dialogs this is the best option.

Orange rectangle around links in WebView

I have a web view that is loaded with an HTML that contains links.
when I switch to another activity (say to another tab in a tab
activity) and then switching back to it, the link is surrounded with
an orange rectangle. also happens in the GoogleAdView which really
makes it impossible to view.
Try this to prevent webview from drawing a focus rectangle when it is first focused
webView.getSettings().setNeedInitialFocus(false);
Try webView.setFocusableInTouchMode(false) - it worked for me. Also, read this link if you want to understand what drove me to this solution.
You should take into account though that this solution will make all text input boxes in your webpage unavailable...
Found another solution, but it requires access to the html itself. You need to set the following css property: -webkit-tap-highlight-color:rgba(0,0,0,0); This will not cause the problem with the input boxes.
It seems that the link in the WebView has the focus. Maybe you could avoid it by letting another view request the focus (anotherView.requestFocus();) in onResume() or onStart().

Categories

Resources