How can I add custom view in android status bar? - java

I am creating a chat app, and I want to add a view like textview or a progressbar in android system's status bar for the app like this
I don't know what to do for this. I also searched in google for a solution, but they giving result for Notification.
Here I mention that, I'm not asking for any notification or floating view! I just want to add a view in that status bar.
Can anyone help me to do this?
Thanks in advance!!

As an app developer, you have no permission to set a view inside the status bar. Only the Android OS itself can manage and change views in the status bar according to the current state of the device (what notifications it has, battery status etc.)
As a developer, you can only:
Hide it
Change its color
What are you trying to achieve? Surely Android has a better solution to your problem.

Related

Android chat, add new message showing

I'm working on chat activity with firebase and recyclerview. I've encountered little issue. When new message appears im using notifyItemInserted and then smoothScrollToPosition. When few first messages come (till screen is not full filled with messages) they are showing really smooth and it looks like same as in Facebook Messenger, but when it comes to scrolling to new message which is out of height our screen it pops up in blink of an eye which looks not good. I thought it has something to do with view recycling by recyclerview or with that smoothscrolling, but I dont know how to handle this.
Some asked code:
mMessagesList.add(message);
mChatRecyclerAdapter.notifyItemInserted(mChatRecyclerAdapter.getItemCount()-1);
rvChatMessages.smoothScrollToPosition(mChatRecyclerAdapter.getItemCount()-1);
Could You guys share some tips with me?
Thanks
There is lots of unknown in your question but generally speaking if you are using RecyclerView (as you mentioned), you could improve your UI experience by using reverseLayout set to "true" in your LinearLayoutManager (my guess). Doing so would make your messages appear at the bottom of the list. This still has its own issues if you do paging, depending on how you do paging etc.
An update (key points from chat below) :
Use reverse LinearLayoutManager (option of constructor) - not the same as stackFromBottom
Add data to beginning of data collection (.add(0, ...)
Call notifyItemInserted(0) on adapter

Why my emulator/device and design screen in AS show different layout ? I am concerned about the thing below 'BILL TOTAL'

Please click here to view the screenshot.Please tell me the reason. I can send you the codes if u require.
enter image description here
The design preview will not show any live running code or logic that the device or emulator will. You can override this by adding one of the tools references to the layout, but otherwise it will just use the default data set inside the XML layout attributes.

How to Apply Custom Filters in a Camera [Surfaceview Preview]...?

Guys i am developing Camera Application and this is my first android Application.
below i am Adding My App Screenshot for what i want.
First View :
Here , after Clicking on a Top-Right Corner Filter icon i want a below View.
Second View :
i don't know how can i get this type of a view. also how can i design this type of view into XML parts.
and i read more articles like how to Open a Multiple Surface-view Preview onto single screen but i did not get any much appreciate solution.
and Finally after selecting any of the Filter Preview i want a above Image type View.
means Selected Filter's is Preview apply onto Camera [Surfaceview Preview].
Please provide any type of Material link example.etc
guys please help me.any type of help will be appreciated..):
Thanks in advance
From the images, it's from a app called Geak Camera. Actually, I developed this app, and I used the GLSurfaceView not the surfaceview. And the app is not maintained now because I left that company. And I updated that app called "U camera".The scale animation was improved in "U camera".
All these manipulations can be performed with OpenCV. Download their basic Android example, and you can add your logic to onCameraFrame() callback.

How to create some thing like gmail compose in android app

How I can create some thing like this? Has it any specific name or view? Like red cycle image in below link:
You can create that view using a ListView like its explained there: https://developer.android.com/training/material/lists-cards.html.
You can create the floating button using an oval shape with an image inside and set some elevation. Click here for more info How to create a floating action button (FAB) in android, using AppCompat v21?
Have a look at general Android Material Design Guidelines to get some additional insight for these kind of ui. https://developer.android.com/design/material/index.html
This can be useful for you. I made a "dummy" Gmail UI for show a material activity transition. https://github.com/coyarzun89/FabTransitionActivity

Displaying Blackberry Push Notifications

I'm all setup in receiving push notifications. I am displaying a count with a icon on the top status bar. However I am unsure where to look next on how to display the message (possibly in the new Messages/Email view, like the twitter app).
I have all my messages persisted but no way to preview them when the status bar is clicked.
Have you looked at the Messaging guide from RIM? It describes how to set up a listener on the ApplicationMessageFolder that you can use to trigger your application.

Categories

Resources