I was recently looking at apps like Blinkfeed and My Magazine that run as fully functional apps but live right next to the Android home screen. Given that widget can only take up a certain amount of space of the home screen and have limited functionality,I could conclude that they aren't widgets.
I would be interested to know how companies like HTC and Samsung implement these full screen apps that live to the left of the screen. I tried googling it but perhaps I am not googling the right thing as I couldn't find a word about how both of these things were implemented. Hence I decided to turn to the wisdom of the internet !! :D
Consider homescreen as the Activity that has floating buttons (those that are at the bottom).
This activity (fragmentactivity to be precise) contains ViewPager of fragments on each page.
And the leftmost page/fragment is the ListView (Blinkfeed).
(*) are the floating buttons , probably LinearLayout that has transparent background and contains buttons.
Related
On Twitter for Android there is a bar at the top of the display where the user can swipe left and right between three different screens: Home, Discover and Activity (see image 1).
As they do so, the small blue line moves in real time to underneath the name of the screen that has been selected (see image 2).
When the user scrolls downwards, the entire bar collapses to the size of the blue line and it remains that way until the user scrolls up again.
Can this be achieved in xCode, ideally in Storyboard? If not, what is the best alternative?
Apologies for the massive images...
I have built this as an ios feature before (also an android dev so I know where you are coming from).
Here is the DIY way;
Use a UIScrollView and with the pagingEnabled property set to YES. Typically a UIPageControl is used along with it.
Here is a Library that does it for you;
https://github.com/monsieurje/ICViewPager
Hope this has answered all your problems.
I want the widget which is used in Samsung Touchwiz UX, in file manager, Music player, and some other apps, that two ListViews are in left and right side of the tablet, and there is a separator in middle of them which can change the widths of the left and right side ListViews when touched.
Where can I get this View, or, is there any suggested way to implement that?
thanks a lot.
This is made with Fragments and Fragment Activity! You can start reading Android documentation about "Building a Flexible UI" http://developer.android.com/training/basics/fragments/fragment-ui.html and "Combining Multiple Views Into One" http://developer.android.com/design/patterns/multi-pane-layouts.html#combining-views
It's good practic to always use fragments.
I have an app on iPhone with cascading design like on the picture, and I'd like to port it to Android. Is there a simple and recommended way to do this?
The section menu on the left (Section A, B,C,D) is the first that the user needs to select, then the user needs to pick a category in the middle (all, popular, pc, xbox,...), then he is presented with a list of articles for chosen category.
I could imagine doing it with three ListViews, but then the app could also listen to a swipe gesture to make the rightmost ListView "full screen", and hide the first two listviews. I could implement a swipe listener for the whole activity and set first two listviews' visibility to hidden, right?
Are my assumptions correct and would this be the right way to do this?
It could definetly work the way you explain it - if the design is good is another discussion. Personally I'm not a fan of throwing in endless amounts of data in one screen, when the space is as limited as it is on most mobile phones (I would probably do it with 3 different screens with a ListView on each)
Implementing the mentioned swipe gesture is doable and you could certainly just hide the two other ListViews with the function setVisibility( View.GONE ).
Hope it helps.
You might want to use the new fragments API, it's specifically built for this kind of thing (and it's compatible all the way down to Android 1.6). Also, as KasperMoerch says, putting all that info on a small screen can get ugly. Using fragments will make it easier for you to gradually increase the amount of information displayed as the screen size increases.
I'm not sure you can just listen for a swipe gesture over an entire activity like that. I think you have to wrap the fragments in a custom view (for example an extended LinearLayout) and do the swipe listening there. However, achieving a finger-tracking animation (i.e. where the rightmost pane follows the finger precisely as it swipes across) is a pretty daunting task (I wouldn't really know where to begin, probably in the custom view though). The best way (I think) to do it is to make a compromise and just start an animation (right-to-left slide) when you detect a swipe. However, the simplest solution is to not animate at all.
You can also take into consideration dropping the swipe gesture altogether and just providing an "expand" button.
I have a tab-based Android app. Currently, it does not support landscape mode - the one and only activity swallows all orientation changes. Now, a user asks that I support landscape for the sake of the hardware keyboard convenience.
On one hand, it makes sense. On the other, the default behavior of a tab host is rotating the tab strip; when it does, it takes a good one third of the precious screen space for the tabs alone. So I lose a lot of real estate.
Are there any common ways out of this conundrum? As far as as I can see, a vertical tab strip is not an option.
I suggest following the technique discussed in Timores's answer to android:orientation="vertical" does not work for TabWidget, where he describes how to set up the TabHost to display the tabs on the left of the screen, with tabs vertically stacked.
Don't use tabs. That's probably the best suggestion anyone can give. Tabs on a mobile devices are a great way to display quick information, and a lot of information. But when it comes to handling user inputs, it doesn't really help considering that it's a mobile device with limited real estate.
While this has already been answered (and I like the one you accepted--will probably implement it myself), there is another option.
Use buttons instead of tabs to navigate between Activities. Each Activity has the same series of buttons in the same locations, much like a navigation bar on web pages.
You can place your buttons however you like, depending on the orientation or however your design sees fit.
For examples, just look at any of the millions of websites with navbars, such at StackOverflow.com at the top of this page.
I noticed that when I swipe my finger from left to right across a home screen widget, in simulator on a AVD, Android switch to the left home screen.
I was wondering if its possible to prevent this behavior and allow home screen gadgets to listen and react to finger gestures (like swipe)? Its very critical for my widget UI design.
Sorry I am posting this reply as a separate answer because it wouldn't fit as a comment. :)
So interaction with widgets is very limited.
The thing is, widgets aren't "mini applications," they are... widgets. They live in the world of, and are dependent upon, the real application containing them.
There is a continual demand for widgets to support more and more complicated interactions, but every time we start down that path it ends up making the interaction with the containing application much more complicated as well, and seems likely to negatively impact overall usability.
For example, if widgets can process swipes, then the user is now very uncertain about how they can swipe between screens because they will get different behavior depending where they swipe. They could even get stuck in a state where it is nearly impossible to swipe between screens because of the widgets covering the touchable area.
So the way I would recommend thinking of widgets is as a window into the key information associated with your app, to jump into more details of that information by tapping on the widget and switching to the app, and possibly some additional buttons to perform key operations.
Also as of 2.0, with the new wallpaper themes, you can make the UI of the activity that the user visits from your widget sit on top of the same wallpaper as home. This makes the switch between it and home feel much more like an interaction inside of home rather than with another application.
Starting with API level 11 (Android 3.0.x) you can use "android.widget.RemoteViewsService.RemoteViewsFactory" and and assign a widget to use (from docs):
ListView: A view that shows items in a vertically scrolling list. For an example, see the Gmail app widget.
GridView: A view that shows items in two-dimensional scrolling grid. For an example, see the Bookmarks app widget.
StackView: A stacked card view (kind of like a rolodex), where the user can flick the front card up/down to see the previous/next card, respectively. Examples include the YouTube and Books app widgets.
See http://developer.android.com/guide/topics/appwidgets/index.html section Using App Widgets with Collections.
So yes - if you use one of the above layouts your widget will accept gestures.
One more is:
AdapterViewFlipper: An adapter-backed simple ViewAnimator that animates between two or more views. Only one child is shown at a time.
Doc: https://developer.android.com/reference/android/widget/AdapterViewFlipper
Example: https://github.com/sunphiz/adapterviewflipper-widget