D
D
Dmitry2018-08-09 19:24:08
Android
Dmitry, 2018-08-09 19:24:08

Android OS: how to display the time of messages like in Telegram and WhatsApp?

My fellow programmer claims that it is impossible to display the time in messages like in Telegram and WhatsApp without some kind of string calculations, they say, this is a big problem. It is on the phone that you need to calculate the length of the line on the screen, measure the text and calculate which words do not fit on the clock. Then implement an algorithm for wrapping words, etc. Is it really true? Or are there some hacks like in HTML layout, like a dev-analogue of a separate div and padding: -10px ?
Now we have time always on a separate line in the message area, which does not save space on the chat screen. As I want:
5b6c6a3bda7ea233626838.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alterEgoChaos, 2018-08-10
@alterEgoChaos

in this case, the easiest way is to lay out through relativeLayout, all the salt is in the relativity of the location of the element relative to each other

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question