Попался любопытный пример работы со строками в Android. Дело в том, что при использовании строк в больших проектах может возникнуть архитектурная проблема с доступом к Context и получению строк с его использованием.
Автор предлагает использовать sealed-класс для обработки подобных кейсов.
sealed class TextResource { companion object { fun fromText(text : String) : TextResource = SimpleTextResource(text)
fun fromStringId(@StringRes id : Int) : TextResource = IdTextResource(id)
Попался любопытный пример работы со строками в Android. Дело в том, что при использовании строк в больших проектах может возникнуть архитектурная проблема с доступом к Context и получению строк с его использованием.
Автор предлагает использовать sealed-класс для обработки подобных кейсов.
sealed class TextResource { companion object { fun fromText(text : String) : TextResource = SimpleTextResource(text)
fun fromStringId(@StringRes id : Int) : TextResource = IdTextResource(id)
A few years ago, you had to use a special bot to run a poll on Telegram. Now you can easily do that yourself in two clicks. Hit the Menu icon and select “Create Poll.” Write your question and add up to 10 options. Running polls is a powerful strategy for getting feedback from your audience. If you’re considering the possibility of modifying your channel in any way, be sure to ask your subscribers’ opinions first. Each account can create up to 10 public channels Your posting frequency depends on the topic of your channel. If you have a news channel, it’s OK to publish new content every day (or even every hour). For other industries, stick with 2-3 large posts a week. For crypto enthusiasts, there was the “gm” app, a self-described “meme app” which only allowed users to greet each other with “gm,” or “good morning,” a common acronym thrown around on Crypto Twitter and Discord. But the gm app was shut down back in September after a hacker reportedly gained access to user data. Matt Hussey, editorial director at NEAR Protocol also responded to this news with “#meIRL”. Just as you search “Bear Market Screaming” in Telegram, you will see a Pepe frog yelling as the group’s featured image.
from us