I came across NY Times for android tablet.
It introduce UI design for selecting which sections you want to read in a way similar to how you open notifications (press menu bar and swipe down to open it).
I wonder, what is it called and how do we mimic this functionality?
You can use a SlidingDrawer
Related
I have started working on making a simple launcher app. I have already gone through many posts and source code of various launchers but I am really stuck at the home screen thing. I just want to create a simple view pager and on long click of it I want it to behave like android stock launcher where user can drag and drop screens to rearrange it and may delete it by swiping down to the cross button.
I am really confused as there is no proper documentation of how things happening in android stock launcher
Please tell me how to achieve this properly. If anyone has extracted that code and give it to me it will be a great help. Links are appreciated.
Thanks!
The standard home screen is implemented as a single large view, with each screen being a child view. Each of those individual screens then lays out icons and app widgets according the grid appropriate for the device.
The way the swiping behavior works is by overriding onInterceptTouchEvent and onTouchEvent. It's tricky because there are so many things that a touch could be doing: the user could be tapping on an icon, swiping to the next screen, or starting a long-press. When you implement one of these behaviors, you have to make sure you don't get in the way of another one.
Once the user is doing a long-press, your launcher app enters a different mode, and the event processing behaves differently in this mode. That is, it implements the standard drag-and-drop behavior. This is tricky too.
I spent two years of my life working on the home screen app for a major device manufacturer. It's complicated, and I'd recommend that you have a good reason for diving into the project.
I'm working on an existing Android application for medical purposes.
The back button and home button should be disabled.
With the existing code, the back button is disabled.
For disabling the home button they used onAttachedWindow with LayoutParams TYPE KEYGUARD,
but this security hole is fixed since 4.0.
I tried a lot of similar questions, but none worked out for me.
What is the way to get this done these days?
Also, hiding the status bar on tablet (where the home & back button live) would do the trick,
so any suggestions there are equally helpful!
Update: also, free third party apps that do the hiding trick are okay!
This sounds like a kiosk or dedicated use kinda thing, yes? You want your app to "own" the tablet and prevent other usage? I did this for an app whose sole purpose was to act as a remote control for a custom device. Basically I created two apps, a "custom launcher" app and the app that did the remote control. It's probably possible to integrate the two, but I wanted to support both dedicated and non-dedicated use. Note that I gave the launcher app a password-protected way to access settings so that I could recover the tablet at any time.
You can find a number of tutorials that will guide you through creating a custom launcher, just strip out all the stuff that makes it a generic launcher and replace it with an image button or similar that launches the actual app, or replace the launcher activity with your main app activity. Warning: I never figured out how to remove the launcher except by going into the settings.
As for hiding the system bar (notifications and status icons at the top of the screen), you'll want to use a full-screen theme like #android:style/Theme.NoTitleBar.Fullscreen.
As for hiding the home button I took this approach:
View main_layout = this.findViewById(android.R.id.content).getRootView();
main_layout.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
Unfortunately the STATUS_BAR_HIDDEN flag is deprecated now, but I think some of the other options would have the same effect. Regardless, the best you can achieve within Android's intended use is to temporarily hide the navigation buttons (home and back). A tap on the screen will bring them back.
I am developing an interactive video application using AIR on Android. The application is for at-risk communities to encourage them to get common cancer screenings, and will be deployed in clinics. I am testing and eventually deploying on the ASUS TF300, a 1280x800 ICS tablet.
When I put the app in fullscreen mode through a variety of methods it looks great, except the bottom bar of buttons does not hide, and instead displays as a black bar with "stealth" dots where the buttons normally present. I need to completely hide this bar so that users will not inadvertently navigate to home or other Android views.
I am having trouble solving this problem because I am not sure - Is it possible to EVER hide this bottom bar in ICS? If so, is there a known method for achieving this in AIR?
Many thanks for any advice.
related - what is the official name for this bottom bar of buttons in ICS?
I had the same issue, where I had to hide the system bar in a digital signage app for Android sticks for TV. I used distriqt native extension called Application.
Then it was as simple as using UI_NAVIGATION_HIDE in ApplicationDisplayModes class along with FULLSCREEN in my init function.
Just so you know, it is a paid extension, but worth buying the package as you get a lot of other good stuff along with it. I wasn't sure on where to begin with building my own ANE, so I went with distinqt.
Yes, it should be possible. After a few days of beating my head against the wall, I have this working on a cheap, Chinese android stick running ICS. The gist is that you need to create an Adobe Native Extension that runs the follow lines of Java:
Window window = context.getActivity().getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Of course, you need about a dozen files of boilerplate to run those lines. Here's a good tutorial on building native extensions.
The name is system bar.
http://developer.android.com/design/get-started/ui-overview.html
Unless you are using a rooted device you can't really removed them as they are user navigation controls.
See this SO question:
Is there a way to hide the system/navigation bar in Android ICS
In the past I've kept my game's options behind the physical menu button for these reasons:
I don't have to have on-screen buttons in-game.
The menu action is consistent with the android user experience; it's not something unique to my app.
In some situations Android provides a soft menu button in the bottom system bar. Looking forward, though (e.g. with recent devices and targetSdkVersions), it seems there's no guaranteed way to have a menu button without implementing the new ActionBar.
If my understanding is correct, I see these options:
Use the ActionBar. Say goodbye to a big chunk of screen real-estate, especially in landscape orientation.
Implement my own on-screen menu button. I've seen this in other games, and it strikes me as inconsistent and terrible.
Target an old sdk version. I don't like this.
Is my understanding correct? Anyone have additional suggestions for my list?
relevant links:
http://developer.android.com/design/patterns/compatibility.html
Android Menu Button on 4.0 Devices
Android 3.0 statusbar & targetSdkVersion in manifest, menu button
android honeycomb menu button target
You could implement a tiny , transparent menu button of your own. Many games do that. That way you are not dependent on anyone and you don't loose any screen space.
Edit : Your menu button could then have follow your game's design.
Is my understanding correct?
Yes.
Anyone have additional suggestions for my list?
Your definition of "terrible" differs from mine. IMHO, any game that has its own stylized graphics and look (i.e., just about anything using the Canvas or OpenGL) should have implemented its own "menu" from the outset, and therefore largely would be oblivious to these changes.
I am porting an iPhone app to Android, and I can't find the Android equivalent of the UINavigationItem. These are buttons with a triangular side indicating movement between different screens. For an example of what I'm trying to accomplish, this is from the BeyondPod app:
http://mobiputing.wpengine.netdna-cdn.com/wp-content/uploads/2011/05/beyondpod.jpg
The buttons labeled "Categories" and Podcasts" are what I'd like to duplicate.
Android has a hardware back button. Forward is typically accomplished by some widget, such as a button or link, somewhere in the Activity.
I looked at the screenshot you posted again and noticed that your left and right buttons are to switch between categories and not to go to an earlier screen.(Im not sure if im right)
If that's the case using the left and right buttons are okay as they are to switch between categories and not the previous screen. But keeping a left button just to go to the previous screen isn't really necessary. Here we need to think in terms of an android user. They are hardwired to press the hardware back button to go to a previous screen. There are many examples of apps that have a bit of changes in their android and iPhone version. Eg Evernote.
It uses tabs on the iPhone but in android they sort of created a dashboard in combination with an action bar.
So main thing to consider when porting an iphone app is to make enough changes so that an android user will feel like it has a navigation they are used to. Most apps that look exactly the same as iphone apps are created with these cross mobile development tools(titanium, sencha touch).