惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
月光博客
月光博客
F
Fortinet All Blogs
Stack Overflow Blog
Stack Overflow Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
博客园 - 司徒正美
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题
博客园_首页
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
L
LangChain Blog
博客园 - 聂微东
G
Google Developers Blog
博客园 - Franky

ashishb.net

A day in Luxembourg - the richest country in the world I was asked to install malware during a fake interview Book summary: Breakneck - China's quest to engineer the future by Dan Wang Book summary: How to Teach Your Baby to Read Book Summary: The Discontented Little Baby Book by Pamela Douglas Introducing Amazing Sandbox - run third-party tools and AI agents securely on your machine Why software outsourcing gets a bad reputation? Book summary: The Natural Baby Sleep Solution by Polly Moore A day in Antwerp, Belgium Journey of online influencers Two days in Brussels, Belgium Shortcuts - when we love them and when we don't A visit to Rakhigarhi Three days in overhyped Paris Empty Japan, crowded Tokyo The real lock-in in GitHub is not the code, but the stars 11-day Norwegian Breakaway East Caribbean cruise Sanskrit and Sri Lankan Air Force Use REST with Open API The Achilles heel of American capitalism Costa Rica in 4 days At a juice stall in Sri Lanka A short stay at Warsaw, Poland Best practices for using Python & uv inside Docker Two days in Vilnius, Lithuania How IntelliJ IDEs waste disk space Pregnancy Why there aren't many digital nomads from India Two days in Riga, Latvia To keep your machine secure, run third-party tools inside Docker
Android Navigation: Up vs Back
Ashish Bhatia · 2024-04-21 · via ashishb.net

Android has two distinct navigation guidelines as opposed to iOS. Getting them right is nuanced.

A smartphone screen displaying MusicSync (https://musicsync.ashishb.net), the best music player on Android

Apps on iOS usually have a back button. Apps on Android can have a back or an up button. The back button takes you back to where you came from. While the up button takes you one level up.

Confused?

Let me give an example. Consider a simple directory explorer app showing the following folder structure

1
2
3
4
5
Songs
|
|__Pop
|__Rock
|__Rap

Let’s say the user is in the “Rock” folder right now. The up button will always take you back to “Songs”. Now, let’s say there is a way to jump from the “Rock” -> “Pop” folder directly. In that case, the up button will still take you to “Songs” while the back will take you back to “Rock”.

How to implement this?

For back, implement a back stack, for example, the back stack in the above case looks like this.

Songs -> Rock -> Pop

For up, come up with a logical way to show the parent folder, if any. So, the parent folder of “Pop”, “Rock”, and “Rap” will be “Songs”. And since “Songs” is the top-most folder, hide the up navigation in that case.