Is there a way to replace (or suppress and launch) with my own custom view or App?
Sure go full screen. If you want an example just create new activity and select "fullScreenActivity" then you can view the style and code to own the full screen. However, you can remove the timer delay and animation and just force it right away.
I feel obligated to mention though that building your own status bar sounds wildly out of place. Are you sure you didn't mean the Actionbar? Either way, that is how you accomplish removing the status bar if that really is what you want to do.
For another example of how to do it in XML or Manifest you can see styles here:
https://developer.android.com/training/system-ui/status.html
Related
I've been always curious to know how does lock screen notification view works on IMO messenger app?
So I did some research and some articles were saying it's custom notification layout and part of RemoteView class. So I went through some quick tutorial and gave it a try but still I am not really sure whether I'm going right way. So, finally I'm asking over here. Do you guys have any idea/suggestion to any library or any other way that I can come up with following outcome?
Desire
Result so far
Zip file- if you wanna take a look at the code
https://drive.google.com/file/d/0B9Y-jPBRm4zyTHZsT09kd3pUU0E/view?usp=sharing
What you see in the navigation bar (just a back and home buttons) indicates that this is an Activity, placed above the lock screen with usage of the FLAG_SHOW_WHEN_LOCKED:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
The styling where it looks like a dialog can be done by theming your Activity, probably using something like android:theme="#style/Theme.AppCompat.Dialog"
I'm developing an app that includes reviews of items and due to my design, I want to only show all the reviews in a popup window like in Google Play Store:
What should I use to create that white panel that appears over the current window and contains the necessary information? This should be simple but I'm a newbie and I can't seem to figure out what this "widget" is. Please help me if you are familiar with this so I can use this cool design pattern. Thanks.
It seems you want to display a layout as a popup in another activity.
If you want to do this using an Activity instead of a Dialog, you can do this by setting the activity's theme to android:theme="#android:style/Theme.Dialog" in the manifest - this will make the activity appear like a dialog (floating on top of whatever was underneath it).
A better way to do it would be using a DialogFragment. You can display information in the form of a popup and it will have its own lifecycle. That will be much better than displaying an activity like a dialog
Ram kiran's answer is a good one and one which I like to give also. But just so you have another option to look at you can consider PopupWindow
As stated in the docs, it is
A popup window that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity.
I've used this and it works out nicely in some situations. It really depends on what your exact needs are as to which will work best for you.
I have an AlertWindow that has input fields for registration purposes (looks similar to VPN settings in ICS). The form requires network input to be validated, so it can take a bit of time - and I'd like to add a progress meter (actual progress won't be known).
I'm not sure what is the best way to go about it. I can put one into the ActionBar, but the AlertWindow dims out the whole screen, including the ActionBar when it comes up. Other ways include making a giant progress spinner on top of the whole activity, but I don't like how that would look.
Perhaps I won't need one, and just disabling & changing the text on the register button to 'checking...' or some sort would do?
Any input is welcomed.
I've went ahead and gave the button a different text while it is doing its work.
There is usually an 'indeterminate' state for progressbar controls.
Check this MSDN guideline for different uses of progress bars.
I am playing around with controlling the UI Navigation buttons in ICS.
The current mechanism for suppressing the Nav Buttons is to call setSystemUiVisibility from a View using the SYSTEM_UI_FLAG_HIDE_NAVIGATION or SYSTEM_UI_FLAG_LOW_PROFILE flags. This seems like a strange place for setting these flags, as most other related settings (such as hiding the status bar) have been done through window LayoutParams properties.
My question is if any of you have ideas for a good way to do it from an Activity context. Currently my app is designed to start with a base activity class which contains any functionality I want throughout my entire application. Specific Activities are then derived from that base class. I would like to be able to set the UI nav flags from that base Activity so I don't have to do it in multiple spots throughout my source code... but my base Activity does not contain any View objects.
As a secondary statement, what I would really like to be able to do is completely remove the NAV buttons (such as using SYSTEM_UI_FLAG_HIDE_NAVIGATION) and not have them come back on user input (giving my app complete control over the UI). I know this is not something that any app from the market should be able to do... but I am not developing something that will available via the market. My current plan involves a custom build of the OS that will allow me to accomplish this, but it would be nice if there was some method of eliminating those soft buttons in the meantime.
Thanks!
This is what I put in onCreate of my activities:
View main_layout = dialog.findViewById(android.R.id.content).getRootView();
main_layout.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
It's almost like calling it from an activity context. At least it's not dependent on having a view defined at compile time. I know STATUS_BAR_HIDDEN is deprecated, but I can't get SYSTEM_UI_FLAG_LOW_PROFILE to compile at the moment...
But +1 on the "this seems like a strange place for these settings". Should be something you can define in the manifest once for the entire app.
You can't completely remove the ICS navigation buttons.
You can hide them completely, but they'll reappear as soon as you touch the screen:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
Unfortunately, some ICS UI layers like Samsung's TouchWiz won't recognize SYSTEM_UI_FLAG_HIDE_NAVIGATION.
Alternatively, you can minimize them and they'll only appear when the bar it tapped:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
You'll probably have to build your own ROM to eliminate them completely.
I want to create a custom OptionsMenu in my application. The default OptionsMenu display only three items in one row. Now i want to display five to six items having only icons. Also i want to change the background color of the OptionsMenu but not getting the appropriate way of doing this. If it is possible then please let me know about it.
Short answer
As an user it bothers me when the application changes my android's widgets. I wouldn't recommend changing that and android doesn't provide a way to do it.
Long answer
Even though Android doesn't provide a way to customize that you can always handle the key event and show a view from your own. Similar discussion in stackoverflow.