Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Glide cache pettern
Search
FujiKinaga
November 06, 2017
Technology
78
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Glide cache pettern
v3とv4で比較してみた
FujiKinaga
November 06, 2017
More Decks by FujiKinaga
See All by FujiKinaga
Flutterで実装する実践的な攻撃対策とセキュリティ向上
fujikinaga
2
1.3k
最新のCompose Multiplatform を使うとiOSとAndroidアプリはどれくらい作れるのか
fujikinaga
2
710
Androidのテストの理解を深めてみた
fujikinaga
0
74
開発案件の進み方
fujikinaga
0
120
深いい勉強会 vol.10
fujikinaga
0
100
深いい勉強会 vol.9
fujikinaga
0
120
Understanding Dagger2 Part1
fujikinaga
0
69
Mater of Subscription
fujikinaga
0
85
深いい勉強会
fujikinaga
2
88
Other Decks in Technology
See All in Technology
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
0
210
protovalidate-es を導入してみた
bengo4com
0
160
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
230
10倍の生産性を実現するAI駆動並列エージェントのすべて
kumaiu
4
1.1k
中期計画、2回作ってみた ~業務委託と正社員、両方の視点から~
demaecan
1
460
機械学習を「社会実装」するということ 2026年夏版 / Social Implementation of Machine Learning June 2026 Version
moepy_stats
2
440
ポケモンの型をTypeScriptの型システムで表現してみた
subroh0508
0
360
Agentic ERPをどう設計するか ー 受発注エージェントを動かす、現場の知見と設計思想ー
recerqainc
1
2k
AIにフローを作らせようとして挫折した話
hamatsutaichi
0
240
Databricks における 生成AIガバナンスの実践
taka_aki
1
360
生成 AI × MCP で切り拓く次世代 SRE!自律型運用への挑戦と開発者体験の進化
_awache
0
170
ITエンジニアを取り巻く環境とキャリアパス / A career path for Japanese IT engineers
takatama
4
1.8k
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
400
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Building the Perfect Custom Keyboard
takai
2
790
Visualization
eitanlees
152
17k
Leo the Paperboy
mayatellez
7
1.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
460
Why Our Code Smells
bkeepers
PRO
340
58k
Ruling the World: When Life Gets Gamed
codingconduct
0
250
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Transcript
Glide Cache Difference between v3 and v4
User action pattern
Seattle : v3
None
ProfilePic in Feed CollabIcon in Player BG with blur in
Player ProfilePic in Player
Stockholm : v3
None
ProfilePic in Player BG with blur in Player NotificationIcon CollabIcon
in Player CommentPic in Player ProfilePic in Feed
When reopen
What’s changed?
- ProfilePic in Feed int scaledPix = AppUtils.dpToPx(128, contactViewHolder.mImgProfilePic.getResources()); Glide.with(contactViewHolder.mImgProfilePic.getContext())
.load(AppUtils.getFeedProfilePicUrl(feed)) .override(scaledPix, scaledPix) .placeholder(R.drawable.ic_feed_placeholder) .into(contactViewHolder.mImgProfilePic); - ProfilePic in Player int scaledPixImgRound = getResources().getDimensionPixelSize(R.dimen.player_user_image_size); ← 100dp Glide.with(getContext()) .load(AppUtils.getFeedProfilePicUrl(feed)) .bitmapTransform(new CropCircleTransformation(getContext())) .override(scaledPixImgRound, scaledPixImgRound) .into(mUserImg); - CollaborationIcon in Feed int scaledPix = AppUtils.dpToPx(32, NanaApplication.getContext().getResources()); Glide.with(NanaApplication.getContext()) .load(url) .asBitmap() .override(scaledPix, scaledPix) .centerCrop() .into(new BitmapImageViewTarget(contactViewHolder.mLstCollabImages.get(currentIndex)) { @Override protected void setResource(Bitmap resource) { if (contactViewHolder.mLstCollabImages != null && contactViewHolder.mLstCollabImages.get(currentIndex) != null) { RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(contactViewHolder.mLstCollabImages.get(currentIndex).getResources(), resource); circularBitmapDrawable.setCircular(true); - CollaborationIcon in Player int scaleRatioCollab = getResources().getDimensionPixelSize(R.dimen.player_collab_user_size); ← 36dp Glide.with(getContext()) .load(picUrl) .bitmapTransform(new CropCircleTransformation(getContext())) .override(scaleRatioCollab, scaleRatioCollab) .into(mCollabImage);
- ProfilePic in Feed int scaledPix = AppUtils.dpToPx(128, contactViewHolder.mImgProfilePic.getResources()); Glide.with(contactViewHolder.mImgProfilePic.getContext())
.load(AppUtils.getFeedProfilePicUrl(feed)) .asBitmap() .override(scaledPix, scaledPix) .centerCrop() - ProfilePic in Player int scaledPix = AppUtils.dpToPx(128, getResources()); Glide.with(getContext()) .load(description.getIconUri().toString()) .asBitmap() .override(scaledPix, scaledPix) .centerCrop() .transform(new CropCircleTransformation(getContext())) .into(mUserImg); - CollaborationIcon in Feed int scaledPix = AppUtils.dpToPx(48, contactViewHolder.mLstCollabImages.get(currentIndex).getResources()); Glide.with(contactViewHolder.mLstCollabImages.get(currentIndex).getContext()) .load(url) .asBitmap() .override(scaledPix, scaledPix) .centerCrop() .transform(new CropCircleTransformation(contactViewHolder.mLstCollabImages.get(currentIndex).getContext())) - CollaborationIcon in Player int scaledPix = AppUtils.dpToPx(48, getResources()); Glide.with(getContext()) .load(picUrl) .asBitmap() .override(scaledPix, scaledPix) .centerCrop() .transform(new CropCircleTransformation(getContext()))
Notice • Cache format (Drawable, Bitmap, Gif…) • Load url
• .override (int width, int height) • .transform (Blur, Brightness, Color, Circle…) • DiskCacheStrategy
??? : v4
RESOURCE : v4
Change diskCacheStrategy easily!!! ~In NanaGlideModule.class~ builder.setDefaultRequestOptions( new RequestOptions() .format(DecodeFormat.PREFER_RGB_565) .diskCacheStrategy(DiskCacheStrategy.RESOURCE));
Same with Seattle : v3
AUTOMATIC : v4
AUTOMATIC is default setting in v4 builder.setDefaultRequestOptions( new RequestOptions() .format(DecodeFormat.PREFER_RGB_565)
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC));
Perfectly reuse
Reference • https://qiita.com/ronnnnn/items/ 9d82130985b5f1f6b77e • https://qiita.com/ryugoo/items/ df3ff453897379cc1bd0