169 похожих чатов

Hi guys, How are you !? I hope you all good. How can

I build this feature in my Android app.
If any resources tell me plz.
Thank for your time.

6 ответов

26 просмотров

You can probably use DP multiplier coefficient, but I am more about Jetpack Compose

you should break your task down to smaller, actionable steps and if you'll encounter problems - post your question (right after googling and implementing solutions you've found there) some of these "actionable steps" would be: increasing text size, changing textview's parent size accordingly and of course remember to always include some context: are you building a chat? or a telegram clone? does this screen in the video look exactly like one in your app? etc

Steps that include actual UI writing are marked with (UI), which means that it depends on what you use - Compose or Views. I'll describe Compose steps but you can adapt it for Views Set up Datastore Preferences: - Add function for updating SP (text size unit) multiplier written in Datastore - Function for getting it - Use those functions in use cases layer to create TextSizeUsecase singleton which saves multiplier in memory on init and provides us with function for updating this value, and saves SP multiplier in Datastore on the end of app activity lifecycle - (UI) Update dependencies in ViewModels to inject text sizing use case - (UI) Every time you shall change text size, you can use multiplier right in code to multiply the text size as following: @Composable fun SizedTextScreen(viewModel: SizedTextViewModel = viewModel()) { val uiState = viewModel.uiState Text("This text uses size multiplier", size = (15 * uiState.textMultiplier)) }

Ĥᾄmmoď 🇵🇸- Автор вопроса

Thanks for your suggestion. But is it logical in every view to check text size -> if large/medium/small then change all texts in the views.

Ĥᾄmmoď 🇵🇸
Thanks for your suggestion. But is it logical in e...

You can just use multiplier wherever you want. This is the most popular practice to implement custom text scaling in particular places

Похожие вопросы

Обсуждают сегодня

30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
14
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
Ребят в СИ можно реализовать ООП?
Николай
33
Как передать управляющий символ в открытую через CreateProcess консоль? Собсна, есть процедура: procedure TRedirectThread.WriteData(Data: OEMString); var Written: Cardinal;...
Serjone
6
в JclConsole объявлено так: function CtrlHandler(CtrlType: DWORD): BOOL; stdcall; - где ваше объявление с stdcall? у вас на картинке нет stdcall
Karagy
8
https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_h_common.erl#L174 https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_olp.erl#L76 15 лет назад...
Maksim Lapshin
20
~ 2m21s  nix shell github:nixos/nixpkgs#stack ~  stack ghc -- --version error: … while calling the 'derivationStrict' builtin at /builtin/derivation.nix:...
Rebuild your mind.
6
Карта сайта