Apr 7 | 8:50 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 7 | 9:00 AM |
wuqiang | has entered the room |
wuqiang |
hi
|
Mark M. |
hello, wuquiang!
|
Mark M. |
how can I help you today?
|
wuqiang |
yes
|
wuqiang |
i’m still coding a chat app
|
wuqiang |
Today I saw WeChat’s solution (WeChat is China most populay Chat App)
|
Mark M. |
I have heard of WeChat, but I have never used it myself
|
Apr 7 | 9:05 AM |
wuqiang |
it almost include every function in our daily life
|
wuqiang |
of course , BottomSheetDialog is great
|
wuqiang | |
wuqiang |
click a icon on the bottom , whole content will be pushed up ,(EXCEPT Tool Bar)
|
wuqiang |
Just like this
|
wuqiang | |
Mark M. |
perhaps they are hiding and showing some view that is below that icon bar at the bottom
|
wuqiang |
let me try it
|
wuqiang |
i have another question
|
Apr 7 | 9:10 AM |
wuqiang |
View paste
|
wuqiang |
in any chatting app nowadays it could send text message , image message ,voice message ,video message …
|
wuqiang |
and as you know : different messages need different views to display it . so how could I achieve this ?
|
Mark M. |
if you are asking how to display these items in the chat transcript, use a RecyclerView and a vertical LinearLayoutManager, with different row types for different chat message types
|
wuqiang | |
wuqiang |
now , I have made a token in my sent message to indicate the message type
|
wuqiang |
my point is how to use different view to display different message
|
Mark M. |
as I said, use a RecyclerView, with different row types for different message types
|
Mark M. |
use one row type for plain text
|
Mark M. |
use another row type for photos
|
Mark M. |
use another row type for videos
|
Mark M. |
and so on
|
wuqiang |
great idea
|
wuqiang |
thinks
|
Apr 7 | 9:15 AM |
wuqiang |
but sometimes it could display image along with some texts like this
|
wuqiang | |
Apr 7 | 9:20 AM |
Mark M. |
you are welcome to create a row type for that too, and decide when to use it
|
wuqiang |
in you book have a method : android:windowSoftInputMode="adjustPan" ,it let the whole Activity page (include ToolBar) push up
|
Apr 7 | 9:25 AM |
Mark M. |
yes
|
Mark M. |
but only for when the user opens the soft keyboard
|
wuqiang |
but if i don't want the ToolBar push up ,how could I do that ?
|
Mark M. |
that should already be working
|
Mark M. |
you have a scrollable view (the RecyclerView)
|
Mark M. |
so, if the user opens the soft keyboard, Android should shrink the height of the RecyclerView
|
Mark M. |
in terms of hiding and showing that grid of emoji, have your RecyclerView fill the space below the toolbar and above the chat entry EditText
|
Mark M. |
then, as you hide and show that grid, the RecyclerView will change height
|
Mark M. |
you can do this via RelativeLayout or ConstraintLayout, with appropriate anchoring rules
|
Mark M. |
or, you can do this with a LinearLayout and android:layout_weight
|
wuqiang |
thank u very much
|
wuqiang |
i'll try all you ideas
|
Apr 7 | 9:30 AM |
Paul R. | has entered the room |
Paul R. |
Greetings.
|
Mark M. |
hello, Paul!
|
Mark M. |
wuqiang: OK, that sounds good -- let me take a question from Paul, and I will return to you in a bit
|
Mark M. |
Paul: your turn! do you have a question?
|
Paul R. |
I do.
|
Paul R. |
As you may remember I was struggling to come up with a solution to notifications for my app.
|
Paul R. |
I eventually decided upon using the device as both a client and a server.
|
Paul R. |
In client mode it receives messages pushed out from FCM (GCM).
|
Paul R. |
In server mode it pushes notifications to the FCM Google servers which then get pushed to clients.
|
Paul R. |
Now I want to write this up and post it somewhere to get feedback from critics.
|
Paul R. |
Would you recommend anyplace other than Stack Overflow for this?
|
Mark M. |
um
|
Apr 7 | 9:35 AM |
Mark M. |
there's a code review Stack Exchange, though I think it is for shorter things than this
|
Mark M. |
if you're a Reddit guy, you could write up your plan as a blog post or something and link to it from Reddit, I guess
|
Paul R. |
Hmm. Didn't know that.
|
Mark M. | |
Mark M. | |
Paul R. |
Am aware of Reddit but hardly ever use it.
|
Paul R. |
Do you mind if I "tag" you on Stack * when I post it.
|
Paul R. |
And would that be "commonsguy"?
|
Mark M. |
yes, insofar as I don't think that works :-)
|
Mark M. |
I don't think you can @ somebody who has not commented on the question or answer
|
Paul R. |
You could be correct.
|
Mark M. |
and I'm probably not on Code Review anyway
|
Paul R. |
What tags would get your attention?
|
Mark M. |
if you post it on the regular Stack Overflow, and you do not get any love, you can use the Stack Overflow "bump" service for Warescription members
|
Paul R. |
Other than "android".
|
Paul R. |
Refresh my memory on how "bump" works. (reference is ok)
|
Apr 7 | 9:40 AM |
Mark M. |
log into the Warescription site, choose Other > Stack Overflow Bump from the nav bar, and paste in the URL to the question
|
Mark M. |
if it is in the android tag and is older than 24 hours, I'll get an email
|
Mark M. |
and I'll take a look at it
|
Mark M. |
you are limited to one bump per week
|
Paul R. |
Excellent. I have one more question but I'll go to the end of the line if need be.
|
Mark M. |
OK
|
Mark M. |
wuqiang: your turn! do you have another question?
|
wuqiang |
yes
|
wuqiang | |
wuqiang | |
Paul R. |
Good question!
|
wuqiang |
when key board pushed up ,I want the message will be pushed too,u konw my means .... i pool english ....
|
Mark M. |
if you are using RecyclerView for the chat transcript, you can see if using app:reverseLayout="true" and app:stackFromEnd="true" handle that automatically
|
Mark M. | |
Paul R. |
It strikes me that I am using RecyclerView for a chat app and I get the desired behavior. Not sure if I had to do anything special though.
|
Apr 7 | 9:45 AM |
Mark M. |
otherwise, you can call scrollToPosition() on the RecyclerView to scroll to the last position, though I forget the recipe for finding out when you would need to call that
|
Paul R. |
fwiw, my code is at github.com/pajato/GameChat/...
|
wuqiang |
thanks
|
wuqiang |
let me try it later
|
Mark M. |
OK, let me take another question from Paul, and if there is time I will be back with you before the end of the chat
|
Mark M. |
Paul: back to you! do you have another question?
|
Paul R. |
Sorry, I just checked my code. It uses scrollToPosition so grep for that if you want to see the code.
|
Paul R. |
My question:
|
wuqiang |
thanks Paul R too
|
Apr 7 | 9:50 AM |
Paul R. |
I want to present my app, focusing on Firebase and the app features. Where would you recommend I look to present it?
|
Mark M. |
present, as in like a meetup or conference?
|
Paul R. |
Yes.
|
Paul R. |
As in what conferences do you consider high quality.
|
Mark M. |
well, my first criterion is: where is it located?
|
Mark M. |
so, in this case: what continent are you on?
|
Paul R. |
The hub of the Universe, Boston. :-)
|
Mark M. |
well, you just missed your local droidcon
|
Mark M. |
(at least in terms of presenting)
|
Paul R. |
Yes, I did much to my chagrin. And my son (same name) is presenting.
|
Paul R. |
fwiw, he is doing a talk on Play Store automation.
|
Mark M. |
that might have been the first father-son pair of presentations at any Android conference :-)
|
Mark M. |
I'm sure that there are 1+ meetups in Boston that you could try
|
Paul R. |
We'll work on that.
|
Mark M. |
droidcon NYC will probably run again in the fall
|
Paul R. |
I'll talk to Steve Patterson / Beth Mezias in Boston. NYC is a good suggestion.
|
Mark M. |
AnDevCon moved to DC (from Boston) for this year, and their call for presenters long since closed
|
Mark M. |
I cannot think of other regional ones in the Northeast off the top of my head
|
Apr 7 | 9:55 AM |
Mark M. |
I keep tabs on the Boston/Pittsburgh/DC triangle, as my Secret Mountain Lair is in eastern Pennsylvania
|
Paul R. |
Would you recommend contacting a Google Firebase product manager?
|
Mark M. |
I wouldn't know how to contact a Firebase product manager
|
Mark M. |
you might see if there is a local GDE with Firebase expertise
|
Paul R. |
GDE?
|
Mark M. |
Google Development Engineer
|
Paul R. |
Like in the Boston office? Good idean.
|
Mark M. |
it's their equivalent of the old Microsoft MVP program for community leaders
|
Mark M. |
oh, sorry, Google Development Expert
|
Mark M. | |
Paul R. |
Very cool.
|
Paul R. |
Good answers to both question. Thanks, and talk to you soon.
|
Mark M. |
you're welcome!
|
Mark M. |
wuqiang: any last questions?
|
wuqiang |
thanks
|
wuqiang |
today i have no question
|
Mark M. |
OK
|
wuqiang |
let my try all of these
|
Apr 7 | 10:00 AM |
Mark M. |
OK, that's a wrap for this morning's chat
|
Mark M. |
the next one is in six hours, at 4pm US Eastern
|
Mark M. |
the transcript for this chat will be posted to https://commonsware.com/office-hours/ shortly
|
Mark M. |
have a pleasant, um, six hours!
|
wuqiang | has left the room |
Paul R. | has left the room |
Mark M. | turned off guest access |
Apr 7 | 10:20 AM |
Mark M. | has left the room |
Apr 7 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 7 | 4:00 PM |
wuqiang | has entered the room |
wuqiang |
Hi
|
Mark M. |
hello, wuquiang!
|
Mark M. |
how can I help you?
|
wuqiang |
In china now is midnight
|
wuqiang |
first i want to say thanks ,without your help i can’t go so far
|
Mark M. |
I am happy to be useful!
|
wuqiang |
below is my job after our last conversation
|
Apr 7 | 4:05 PM |
wuqiang | |
wuqiang | |
wuqiang |
then i have another question
|
wuqiang |
How to check weather the KeyBoard is Pop-up ?
|
wuqiang |
I use the event below :
|
wuqiang |
view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
Mark M. |
I do not know of a good way to detect when the soft keyboard appears or disappears
|
Mark M. |
usually, we try not to do anything different in our apps when the keyboard appears or disappears
|
wuqiang |
o
|
Apr 7 | 4:10 PM |
wuqiang | |
Mark M. |
that is strange behavior
|
Mark M. |
what are you using for that grid of emoji?
|
wuqiang |
in fact ,now, it is noly a mimc picture
|
Mark M. |
ah, OK
|
Mark M. |
ImageView is trying to maintain the aspect ratio of the image
|
Mark M. |
and the height of the ImageView is being reduced due to something in your layout
|
wuqiang |
when the mimic picture is open then open KeyBoard , bad thing is happing like that ....
|
wuqiang |
so I need a good way to detect weather KeyBoard is open .....
|
Apr 7 | 4:15 PM |
Mark M. |
sorry, I do not have an answer for that
|
wuqiang |
in fact I have tryed PageView within the part of mimic picture, But it will take whole screen
|
Mark M. |
a ViewPager can be sized however you want
|
wuqiang |
How can we accommodate a PageView within a half Fragment ?
|
Mark M. |
I am not certain what "a half Fragment" means, exactly
|
Mark M. |
but a ViewPager is just like a Button, or a FrameLayout, or any other View/ViewGroup
|
Apr 7 | 4:20 PM |
Mark M. |
so, you can make a ViewPager take up half the space of a vertical LinearLayout using weights
|
Mark M. |
or, you can make a ViewPager take up half the space of a ConstraintLayout using a guideline
|
wuqiang |
That explains a lot ,thanks
|
Apr 7 | 5:00 PM |
Mark M. |
that is a wrap for this afternoon's chat
|
Mark M. |
the next office hours will be 9am US Eastern on Tuesday
|
Mark M. |
have a pleasant evening!
|
wuqiang | has left the room |
Mark M. | turned off guest access |