Sifr
A modernized, deeply customizable Material 3 calculator for Android, live on Google Play — basic and scientific modes, built-in converters, five hand-crafted palettes, and full RTL across 11 languages.
- Year
- 2026
- Type
- Personal Project
The Overview
Sifr (Arabic for "zero" — the root of the English word "cipher") is a Material 3 calculator for Android, published on the Google Play Store. It pairs a hand-written expression engine with deep personalization: basic and scientific modes, four built-in converters, five custom palettes plus Material You, and a live in-app language switch across 11 locales with full right-to-left support.
The Challenge
A calculator looks trivial until you parse real input. 5sin(30), 2(3+1), right-associative powers, factorials and unary minus all have to evaluate the way a person expects — and floating-point noise like sin(π) = 0.0000001 has to disappear without faking the math.
On top of correctness, the app is heavily themeable and fully localized. Five palettes, four keypad layouts, light / dark / system modes and 11 languages with RTL all have to stay consistent — and switch live, without an app restart.
Architecture & Technical Decisions
Sifr is a single Gradle module under dev.gaddal.sifr, split into core/ primitives and self-contained feature/ packages — calculator, history and settings — each with its own domain and UI layers on an MVI (State · Action · Event) loop.
The calculation pipeline is one-shot per =: an ExpressionWriter mutates the raw string (cursor, range selection, implicit multiplication and smart delete), an ExpressionParser tokenizes it, and a hand-written recursive-descent ExpressionEvaluator resolves operator precedence, parentheses and unary minus. Room backs the calculation history, DataStore persists every preference, Koin wires the graph, and Jetpack Navigation 3 drives routing.
Theming & localization
Five hand-crafted palettes plus Material You, four keypad layouts and 11 languages with full RTL are all swappable live — no restart — with typed, localized error states for division-by-zero, domain, overflow and syntax failures.
Impact & Results
- Published and live on the Google Play Store (v1.3.0), with a full v2.0 redesign batched in-repo.
- A hand-written recursive-descent evaluator with IEEE-754 cleanup —
sin(30°) = 0.5,sin(π) = 0, no trailing noise. - Localized to 11 languages with full RTL and a live, restart-free language switch.
- Five hand-crafted palettes plus Material You, four keypad layouts, and offline-first currency conversion.