投稿時間:2021-11-07 05:18:04 RSSフィード2021-11-07 05:00 分まとめ(21件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) POSTの内容がうまく反映されない https://teratail.com/questions/368094?rss=all POSTの内容がうまく反映されない前提・実現したいこと掲示板を作成中です。 2021-11-07 04:14:21
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) BigqueryでTime型を秒に変換したい。 https://teratail.com/questions/368093?rss=all BigqueryでTime型を秒に変換したい。 2021-11-07 04:07:45
海外TECH MakeUseOf How Music Can Help in Boosting Your Productivity https://www.makeuseof.com/how-music-boost-your-productivity/ increases 2021-11-06 19:30:22
海外TECH DEV Community How to Support Multiple Fonts in an Android App https://dev.to/gouravkhunger/how-to-support-multiple-font-options-in-an-android-app-1j5e How to Support Multiple Fonts in an Android AppYou would hardly see any Android app that allows its users to be able to choose from a set of fonts to be used for the whole app based on the user s preference The major reason being it is hard to implement Why should you bother Accessibility is a major aspect that every app developer should focus on Imagine an app with an amazing utility but one that is barely usable You don t want to loose your user base I used to neglect this but here s why I am writing this post If you follow me on any social media or here on my blog you know that I built JekyllEx to be able to manage Jekyll blogs from my Android device Recently I a person reached out to discuss about their chronic headaches that are triggered by font and colours that don t go well on their eyes and it would be great if I allowed some settings to be able to customise it based on user preferences I quickly went to have a look at what the Android accessibility guidelines had to say But to my surprise I DIDN T FIND ANYTHING If you take a look at those guidelines you ll find Google actually emphasizes developers a lot to take measures and make their app accessible for all kind of users But such a common problem hasn t been addressed Believe me there are many a people with varied levels of such reading problems And I usually don t enable such settings in apps but I thought it would be a great challenge to overcome because mostly all the solutions that already exist are inefficient most stack overflow answers ask to traverse the ViewGroup s children and apply custom typeface as they find Text I had some other thoughts and it was obvious I would be making an Android library that somehow resolves this issue The ChallengeIn broad aspects an Android app is just a set of View s held together by ViewGroup s that perform certain actions when loaded clicked etc All that together makes the functional app But here s the catch each view has its own Context that gives access to the current state of the view and that makes it harder to think about how to implement the multiple font feature as each view needs separate handling to update its font Here is a typical example of how to update the font of a single TextView val typeface ResourcesCompat getFont this MainActivity R font source code pro get font from res font directorybinding helloWorld typeface typeface apply the font to the text viewImagine you have text views or rather a RecyclerView as in JekyllEx in which each of the items has a significantly large number of TextView s Here each RecyclerView item actually has TextViews Imagine updating the font manually for each view one by one It would be really inconvenient I had a look to some stack overflow questions and as told earlier most of them were old and in efficient The SolutionFrom the very beginning I knew I would store the default font in a SharedPreference For those who don t know about it it is Android s way to allow apps to store simple key value paired data that the app can use without write access to the disk For most of the cases it suffices to use SharedPreference instead of writing to disk and it was super handy in this case I would store the resource id an integer identifier that is given to all types of resources in any app in SharedPreference and retrieve that value to apply the font when the view is inflated rendered on screen This was the most efficient way I could come up with because SharedPreference is really optimised The values are cached and retrieving multiple values within a short time doesn t affect performance much There exists another way by changing the themes xml values at runtime and applying font directly from the styles itself but it requires minimum API level Android So it wouldn t be backward compatible and make the app crash on lower Android versions I didn t want to do so The ResultHere s the library that I built gouravkhunger Fontize Fontize is an Android library that enables multi font selection functionality to beautify your app Fontize Android Library Built with ︎by Gourav Khunger Fontize is an Android library written in kotlin that enables your android app have multiple fonts for your TextViewsand switch between them in a jiffy A quick demo Adding Fontize to your projectInclude jitpack in your root build gradle file allprojects repositories maven url And add it s dependency to your app level build gradle file dependencies implementation com github gouravkhunger Fontize Sync the project and you ll have imported Fontize successfully Start using FontizeMake sure you have all your fonts in the res font directory Support for font files in the assets folder will ship soon Rename all the TextViews or AppCompatTextViews in your project to com github gouravkhunger fontize FontizeTextView You don t have to change anything else and the view would still perform the same Before lt TextView… View on GitHubOnce you add fontize to your project you need to follow certain steps mentioned in the repositorie s README and your project will migrate to use intelligent Fontize views that can work united and can change fonts in a snap Here s a demo of what you can Achieve with Fontize To set the default font for the app you just have to add this line of code just below onCreate function in your app s launcher activity the one that is triggered when app icon is clicked only once Fontize this setDefaultFont R font exo replace with the font you desireInternally this function creates a SharedPreference value if it doesn t already exist fun setDefaultFont resourceId Int val sharedPref PreferenceManager getDefaultSharedPreferences context val fontId sharedPref getInt fontFamily ResourcesCompat ID NULL if fontId ResourcesCompat ID NULL sharedPref edit putInt fontFamily resourceId apply To update the font for the entire app you just need to run this code and Fontize will handle it automatically for you Fontize this updateFont R font zen old mincho updates fontFamily throughout appHere s the interesting part this function just updates the fontFamily value stored in SharedPreference for the app fun updateFont resourceId Int val sharedPref PreferenceManager getDefaultSharedPreferences context sharedPref edit putInt fontFamily resourceId apply The actual work happens in the view classes Let s take the example of FontizeTextView or any similar class It just extends the parent View and applies the font by picking its value from SharedPreference class FontizeTextView context Context attrs AttributeSet AppCompatTextView context attrs init val prefs PreferenceManager getDefaultSharedPreferences context val fontId prefs getInt fontFamily ResourcesCompat ID NULL if fontId ResourcesCompat ID NULL val typeface ResourcesCompat getFont context fontId this typeface typeface All this code does is to override the default view to apply the font family as soon as it inflates Similar classes for views that support texts within them like workarounds for MenuItem s and Toolbar s will be shipped soon If you need to look at a live project that uses Fontize in production checkout JekyllEx app on GitHub It doesn t use the initial version that was published on Jitpack but it uses a custom fork as per its needs and requirements but Fontize will soon evolve and be able to do a lot more than just TextViews ConclusionBelieve me or not starting this project to finishing the base version with a working FontizeTextView to publishing it on jitpack all just finished within hours Fontize deserves a star for that effort I hope you learnt something new out of this post If you want to keep reading quality Android development content consider joining my newsletter Genics Blog Do comment and let me know what topic should I pick to publish an article next week All kinds of feedbacks are appreciated Thanks and happy coding 2021-11-06 19:15:31
海外TECH DEV Community CodeSandbox Black, the best VSCode theme ever! https://dev.to/ziterz/codesandbox-black-the-best-vscode-theme-ever-3bdf CodeSandbox Black the best VSCode theme ever I launched it on Product Hunt too and it would be awesome if you checked it out and tried it out yourself CodeSandbox BlackDesign in detail based on codesandbox io hope you enjoy it Preview React Vue Icons Get Material Icons here Material Icon Theme  Fonts Get MonoLisa fonts here MonoLisa  Terminal Get Oh My Zsh for your terminal here Oh My Zsh 2021-11-06 19:13:16
Apple AppleInsider - Frontpage News Black Friday price war discounts Sony WH-1000XM4 Headphones to $248 ($100 off) https://appleinsider.com/articles/21/11/06/black-friday-price-war-discounts-sony-wh-1000xm4-headphones-to-248-100-off?utm_medium=rss Black Friday price war discounts Sony WH XM Headphones to off Black Friday pricing has hit Sony s popular WH XM noise canceling headphones knocking off the over ear headset at Amazon Best Buy and B amp H Sony resellers Amazon Best Buy and B amp H are currently offering the Sony WH XM headphones for during the early Black Friday price war Typically retailing for the WH XM have some of the best active noise cancellation available and they have high quality audio and extra features to boot like voice assist functionality compatible with Siri via the iPhone app We ve used this headset on a daily basis for most of in both a business and entertainment setting According to Best Buy Black Friday prices are guaranteed on the headphones for Best Buy Totaltech and My Best Buy members Read more 2021-11-06 19:13:33
Apple AppleInsider - Frontpage News Apple Music-streamed Astroworld crowd crush kills 8 https://appleinsider.com/articles/21/11/06/apple-music-streamed-astroworld-surges-leaves-8-dead?utm_medium=rss Apple Music streamed Astroworld crowd crush kills Tragedy struck at the Astroworld Festival on Friday after a crowd surge during the Apple Music streamed Travis Scott performance led to the deaths of people while also injuring over others Houston officials say that a surge that occurred at the time of Scott s on stage performance at the festival was a major problem that overwhelmed security forces outside of NRG Park Scott s performance commenced shortly after p m and was followed closely by crowd surges among the estimated attendees Houston Fire Chief Samuel Pena said during a press conference that the surges occurred due to a panic in the crowd with attendees running to safety reports Variety The show was paused by Scott multiple times as security attempted to help fans and the fire department rescued injured people from the crowd Read more 2021-11-06 19:25:56
ニュース BBC News - Home Travis Scott 'devastated' by Texas festival deaths https://www.bbc.co.uk/news/world-us-canada-59193150?at_medium=RSS&at_campaign=KARANGA astroworld 2021-11-06 19:23:23
ニュース BBC News - Home Sierra Leone explosion: Scores dead after Freetown oil tanker collision https://www.bbc.co.uk/news/world-africa-59188753?at_medium=RSS&at_campaign=KARANGA freetown 2021-11-06 19:45:50
ニュース BBC News - Home Cork: Gardaí arrest man over threats to kill UK MP https://www.bbc.co.uk/news/world-europe-59193243?at_medium=RSS&at_campaign=KARANGA england 2021-11-06 19:06:35
ニュース BBC News - Home Norwich coach Farke leaves after first win https://www.bbc.co.uk/sport/football/59194369?at_medium=RSS&at_campaign=KARANGA league 2021-11-06 19:49:59
ビジネス ダイヤモンド・オンライン - 新着記事 新日本酒紀行「華鳩」 - 新日本酒紀行 https://diamond.jp/articles/-/285789 広島県呉市 2021-11-07 04:50:00
ビジネス ダイヤモンド・オンライン - 新着記事 テレビ用スピーカー「サウンドバー」、ソニーやヤマハなどおすすめ10選 - 男のオフビジネス https://diamond.jp/articles/-/286359 選び方 2021-11-07 04:45:00
ビジネス ダイヤモンド・オンライン - 新着記事 「子どもの弱視」を早期発見できる最新鋭のスクリーニング装置とは? - ヘルスデーニュース https://diamond.jp/articles/-/286402 「子どもの弱視」を早期発見できる最新鋭のスクリーニング装置とはヘルスデーニュース持ち運び可能な小型のスキャナーで両目をスキャンし、網膜の中心部である「中心窩」できちんと対象を捉えているかどうかを調べることで、弱視についてより詳細な検査が必要な子どもと必要のない子どもをスクリーニングできる可能性が、新たな研究で示唆された。 2021-11-07 04:40:00
ビジネス ダイヤモンド・オンライン - 新着記事 ひろゆきが解説する究極のスキル「嫌なことを『嫌だ』と伝える方法」 - 1%の努力 https://diamond.jp/articles/-/286261 youtube 2021-11-07 04:35:00
ビジネス ダイヤモンド・オンライン - 新着記事 「自分らしさ」のゴリ押しは、「自分のラクな生き方」ではない - 生きづらいがラクになる ゆるメンタル練習帳 https://diamond.jp/articles/-/286650 2021-11-07 04:25:00
ビジネス ダイヤモンド・オンライン - 新着記事 血液はなぜ赤いのか?…「息を呑むほど美しい自然の摂理」から見えてくる納得の答え - すばらしい人体 https://diamond.jp/articles/-/286675 血液はなぜ赤いのか…「息を呑むほど美しい自然の摂理」から見えてくる納得の答えすばらしい人体唾液はどこから出ているのか、目の動きをコントロールする不思議な力、人が死ぬ最大の要因、おならはなにでできているか、「深部感覚」はすごい…。 2021-11-07 04:20:00
ビジネス ダイヤモンド・オンライン - 新着記事 グーグル広告と ヤフー広告では どっちが反応があるか? - 売上最小化、利益最大化の法則 https://diamond.jp/articles/-/283737 2021-11-07 04:15:00
ビジネス ダイヤモンド・オンライン - 新着記事 アクルーアル(会計発生高)で利益の質をチェックできる - たった10日で決算書がプロ並みに読めるようになる!会計の教室 https://diamond.jp/articles/-/285297 アクルーアル会計発生高で利益の質をチェックできるたった日で決算書がプロ並みに読めるようになる会計の教室万部超のベストセラー『餃子屋と高級フレンチ』シリーズでおなじみの会計士・林總氏の最新刊『たった日で決算書がプロ並みに読めるようになる会計の教室』がダイヤモンド社から発売に。 2021-11-07 04:10:00
ビジネス ダイヤモンド・オンライン - 新着記事 なにかを始めるとき 不安にならない たった1つの考え方 - 精神科医Tomyが教える 1秒で不安が吹き飛ぶ言葉 https://diamond.jp/articles/-/284387 voicy 2021-11-07 04:05:00
ビジネス 東洋経済オンライン 「おすそ分け」を始めた私が得た「思わぬ副産物」 物のやり取りがお互いの「空気」を変化させる | 買わない生活 | 東洋経済オンライン https://toyokeizai.net/articles/-/466778?utm_source=rss&utm_medium=http&utm_campaign=link_back 東洋経済オンライン 2021-11-07 04:30:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)