I am trying to write my own full UI replacement (launcher/appdrawer/notifications) for android (4.0.4 primarily) however I have been having trouble finding a starting point to create a notification bar and panel. I know these feats are possible, as there are already some apps that do it. But I can't find any starter code.
Related
Attached screenshot of netflix app with left side menu I am able to develop a side menu with customized icon and header in it. I want, when the focus comes on header fragment it should expand on top of row fragment, that is not collapsing the row fragment, the same as Netflix and hotstar are doing. How can I achieve it?
unfortunately, the HeaderSupportFragment used in the BrowseSupportFragment is not configurable enough to achieve this kind of design. Leanback is great to build quickly and easily media browser app but when it comes to "complex" design, it's easier to use custom component.
The major difference also here, is that the left menu of the BrowseSupportFragment show each rows header name displayed in the screen (that's why it's called HeaderSupportFragment). Here you want to show different entries like search, home, settings, etc.
To make this kind of view, I would suggest creating your own custom view and use a basic Fragment. I followed this tutorial which can be useful to handle menu open/close animation (I mixed it with a ConstraintLayout to simplify the animation and I made the menu overlap the rest of the screen instead of moving everything.)
See the tutorial: https://medium.com/building-for-android-tv/building-for-android-tv-episode-3-381e041dfec7
I want to create a custom notification like inshorts as shown in Image below
And i am able to achieve that as well, shown in screenshot below :
But there are two problem cases:
When i install the app using Android Studio, initially it works fine i.e. Custom Notification layout is displayed for the notification(as shown in picture-3), but when i am killing the app from task manager and then i am sending the notification, it comes as default layout(as shown in picture-4).
When i install the app using the apk on any device, i am getting the notification style as default notification(as shown in picture-4).
I have been stuck in this for long and have changed the whole code of Notification, i am still facing the issue. I am not sure where i am doing wrong.
Picture-3
Picture-4
I was able to achieve what i was looking for i.e. I was looking forward to use the custom layout for showing Notifications eveytime, but the problem was that i was getting custom layout notification if the app used to be in the background and the default notification style when the app is not in the background.
"So what exactly the problem was, Push notifications behave differently in the cases where the app is in background or foreground."
When the app used to be in background the Notification builder code which i have written was being used and the notification with custom layout was displayed. Moreover, when the app used to be in foreground, the android system couldn't reach the notification builder code of my project, in that case notifications were being processed by the Google Service process, which uses the default notification layout.
Solution :
Earlier, the JSON object which i was getting from the server was named as "notification", which generally is used by almost every developer. Changing the name of that JSON object to "data" did the magic.
And the code inside the Notification builder used to be something like this:
String notTitle = remoteMessage.getData().get("title");
which ealier used to be:
String notTitle = remoteMessage.getNotification().getTitle();
This way, my notifications are always being handled by the app, by the NotificationService, and not by the Google Service process.
I hope this helps somebody. :)
I'm working on a German Learning app project, inspired by Duolingo app.
I need to make my app to be a little bit similar with this feature. It's like making the user to focus on the quiz, and ignore everything in status bar (notification bar). Now, what I need is i want to hide the icons on notification bar. Is there a way to do so?
This is what I want
And this is the fact
You can dim the status and navigation bars by setting the SYSTEM_UI_FLAG_LOW_PROFILE flag.
View decorView = getActivity().getWindow().getDecorView();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
https://developer.android.com/training/system-ui/dim.html
This decoration is reset whenever the keyboard is made visible, but you can watch for the keyboard being hidden (using an onGlobalLayoutListener) and resetting the flag.
You could just disable notifications for the offending apps in your device's settings menu. I'm looking for an option to hide them from the status bar while keeping notifications in the shade and on the lock screen. Apparently not on a Samsung device.
I'm developing an app for iOS and Android using Corona SDK and have problems with managing native textFields in Android.
I'm trying to achieve the following effects:
tapping on textfield will animate its sliding with keyboard so it will be always on top of it while moving up.
Tapping on back button will dismiss the keyboard and slide textfield back with it
My problems are:
To know the height of the keyboard in order to know where to stop moving the textfield.
To catch back button tap in order to eliminate the textfield
What I am doing:
I've looked over the Internet to find out how to check keyboard height on Android. All solutions assume we have Activities.
We have registered onKey listener to catch back press in corona code, but it is not fired if keyboard shown.
Ok so I made this Draw & Guess Online game and I used Native TextFields as well. What I did is just set my device resolution to lets say 600x1024. Then I just tested on a few different devices, and just eyeballed where the keyboard was located. I'm afraid this is what your going to have to do. Just use a for loop to make around 10 small rectangles and print the pixel values next to each of them. Then take your test devices, and see where the keyboard lyes on each device. Then just animate them up.
There is no easy way to do it in Corona unfortunately. Also people could have custom keyboards which would make your life even more difficult. All I can recommend is to over estimate and release.
I need to get started with it.
What I want to do is create a notification bar(like Omega, Status Bar).
I really have no idea from where to get started.
I don't need any code(I try to make my own new code,however long it take), but idea to do it.
I want bar to have many many more features hence I need to create one from scratch.
Also, I want that whenever application's(other) want to show a notification it should come on mine bar.