/dob_calculator

An app that calculates the age in the user in different units of time

Primary LanguageKotlin

DOB CALCULATOR

Introduction

An Android app that allows the user to select or input a date and calculate their age in various time units such as years, months, days, hours, minutes and seconds.

Features

  • User can select a date from a date picker.
  • User can input a date in a edited text
  • User can calculate their age in years, months, days, hours, minutes and seconds
  • The button is disabled if the user has not selected a date or input an invalid date
  • Relevant error messages are displayed if the user has not selected a date or input an invalid date

Technologies

  • Kotlin
  • Android Studio
  • XML

Demo

Animation.gif

What I Learned

  • How to use the date picker
  • How to validate date input and deactivate the button if the input is invalid
  • Using the SAM (Single Abstract Method) conversion to set the onClickListener for the button