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

推荐订阅源

美团技术团队
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
宝玉的分享
宝玉的分享
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
博客园 - 司徒正美
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - Franky
B
Blog
V
V2EX
J
Java Code Geeks
D
Docker
博客园 - 叶小钗
The Cloudflare Blog
量子位
博客园_首页
MongoDB | Blog
MongoDB | Blog

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.