Android Tweetdeck-like UI - android

I'm getting started with Android development, and I would like to have an interface similar to that of tweetdeck: there are several workspaces (activities) that are laid out left to right, and the user can switch between them with a horizontal gesture. The same way the Android desktops are switched.
In tweetdeck there are also dots in the titlebar, that indicate on which side and how many workspaces there are.
Is it a standard Android interface, or something custom built? How do I do something like this?

How you go about this is going to be partially dependent on the content you want to present. If there are going to be many heavyweight pages you'll want to look into doing something like a custom AdapterView. If there are only a few fixed pages such as in the stock home screen you can treat it like a scrollable view with some custom logic to handle snapping to pages.
Here's a link to the custom view that implements this in the stock Android launcher. The bits you're interested in will mostly be in onTouchEvent, onInterceptTouchEvent, and computeScroll.
https://android.googlesource.com/platform/packages/apps/Launcher2/+/master/src/com/android/launcher2/Workspace.java

Take a look at ViewFlipper: http://developer.android.com/reference/android/widget/ViewFlipper.html

In addition to studying the actual Android code (referenced in another answer), some folks have extracted and isolated the workspace (Launcher2) code into a re-usable view group. You can find the work in github here https://github.com/olibye/AndroViews

Related

How to make side-scrollable screens in Android?

I am trying to practice different functionalities in Android using Android Studio.
Right now I wish to make it so I can swipe left/right between various components.
A good example of this is the app called Simple Workout Log. The top bar is scrollable (in a more localized way) whereas the bottom of the screen scrolls over entirely with each swipe.
I did notice something called HorizontalScrollView in Android Studio but couldn't figure out how to mimic the functionality.
How is something like this made?
Create tabbed activity and it will automatically implement view pager and FragmentPagerAdapter for you.
After that you can look up for tutorials on creating tabs using frgments such as this one

Is there a library for Floating Action Buttons (FAB) with Labels?

Is there a library for creating Floating Action Buttons with labels (similar to the Evernote app)?
Evernote Screenshot
The popular libraries seem to be
https://github.com/futuresimple/android-floating-action-button (closest to what I want... ability to expand hide "sub" actions)
https://github.com/makovkastar/FloatingActionButton (Primary function is to hide/show with a scrollview, recyclerview, or listview)
https://github.com/oguzbilgener/CircularFloatingActionMenu (library which has been around pre-lollipop)
Neither of these, to my knowledge, have this capability. Before re-inventing the wheel, has somebody already done this?
This feature request ended up being implemented in https://github.com/futuresimple/android-floating-action-button. This includes labels on both the left and right sides.
If you're interested, see the discussion here: https://github.com/futuresimple/android-floating-action-button/issues/22#issuecomment-66155108
Disclaimer: I haven't used this (yet).
I'd recommend this library over others that I've seen.
Nowadays there are available techniques of manipulating behaviour of the view that enable you to program FloatinActionButton as you want and to have joy that you have made it by yourself!
Fade in/out FloatingActionButton while scrolling RecyclerView . DETAILS
Slide down/up , beside it blog says how to:
Expand floatingActionButton and show subFloatingButtons. DETAILS HERE
There is to much details, "how to do". Therefore I've attached just links to blogs. Anyway I encourage you guys to take a look at those blogs. You will have total control over your application. Currenty I use all solutions from both blog's. Enjoy!
Especially the last library you mentioned looks quite sophisticated. To my knowledge, you can set any kind of View you want to be shown as a Button.
This View could simply be a custom-view of yours that shows an image as well as a label.
In case anyone is still looking for this functionality: I made an Android library that has this ability and much more, called ExpandableFab (https://github.com/nambicompany/expandable-fab).
The Material Design spec refers to this functionality as 'Speed Dial' and ExpandableFab implements it along with many additional features.
Nearly everything is customizable (colors, text, size, placement, margins, animations and more) and optional (don't need an Overlay, or FabOptions, or Labels, or icons, etc). Every property can be accessed or set through XML layouts or programmatically - whatever you prefer.
Written 100% in Kotlin but comes with full JavaDoc and KDoc (published API is well documented). Also comes with an example app so you can see different use cases with 0 coding.
Github: https://github.com/nambicompany/expandable-fab
Library website (w/ links to full documentation): https://nambicompany.github.io/expandable-fab/

How to create an info overlay in Android

I am looking for a way to create a short overlay intro of an app to display to first time users. These posts gave me some understanding of how it can be done, but not entirely:
How do I create a help overlay like you see in a few Android apps and ICS?
How to use LayoutInflater / ViewStub for an overlay
I do not understand how to access my elements correctly, since my root layout element is a LinearLayout that includes an Actionbar and a ViewPager instead of containing actual elements.
Are there any frameworks that does this for you?
I think that this library : ShowcaseView is your best option.
As its name implies, it allows you to recreate the Android 4.x showcase view; ie :
.
The documentation of the project explains how to implement it.
Word of advice though : this kind of explanation view is viewed as bad design most of the time : if your application is well designed, you don't need to provide a tutorial to the user, it is supposed to be intuitive.
It can be totally justified in some cases of course, just be sure that :
-your users really need a tutorial.
-it is not because you are doing something opposite to the Android convetions.
Have a look at MaterialShowcaseView. It inherits from ShowcaseView and is up-to-date.

Dragging and Dropping a button from one Linear Layout to another Linear Layout

I have a linear linear layout with 10 buttons in it. I need to drag these buttons and add it into another linear layout(Horizontal) in the order they are dropped. Please help me in doing this?
I have some suggestions on how to do drag-drop in apps running on API level 8 up and beyond. I studied the source code for the Android Launcher module and learned about the drag-drop framework they put in place for that. I have found that is a good foundation on which to build. I have written up the details of the key classes (DragSource, DropTarget, DragLayer, DragController) in a series of articles on my blog. A solution is too long to post here, so I refer you to those notes:
(a) Moving Views In Android - Part 2, Drag and Drop - this describes the basic framework and includes a demo app. Since I was primarily concerned with learning about drag-drop, I used the now deprecated AbsoluteLayout class. The follow-on to this one (Part 3) is worth looking at too because it develops further the notion of DropTarget.
(b) Drag-Drop for an Android GridView - a demo app that shows how to use the drag-drop framework for grid views. Even better, it illustrates how to get by without AbsoluteLayout. In this case, the DragLayer and other classes know more about the kind of layouts they are working with.
The demo apps illustrate images and text views being dragged. The underlying code is perfectly general: any view can be dragged. A problem you will face with dragging buttons is making sure that the start of a drag operation will not be confused with the normal click handling that buttons do. Consider using a long click to initiate a drag sequence.

Android sidebar

I've been using firefox for Android and really like the use of the sidebar to hold shortcut icons and the like. How would I go about creating a similar bar myself with the following attributes:
progressively revealed as I swipe in one direction
progressively hides as I swipe in the other direction
can be a custom width
I can dynamically inject layout in to it or it can hold static content
Is there any open source code available? If not, what approach would I use to create this?
Sound like you're describing a Gallery control. There are some examples in the ApiDemos project here.
The first part can be solved by using a ListView. The second part I don't know yet. I'm looking for such a component as well.

Categories

Resources