Skip to content

Affirmations to firm you up! Uses TextToSpeech to say quotes and autoscrolls using tail recursion. Kotlin source available.

Notifications You must be signed in to change notification settings

PabloDino/myfirmations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MyFirmations FAQ

What is MyFirmations?

Myfirmations is an app that presents "firm affirmations"(quotes to keep you grounded). You are able to customize it's content, as well as behaviour such as if and how it speaks to you, and how fast it automatically scrolls. Check out the user manual and the source Kotlin code!!!.

Why did you create it?

This was a practice app to exlore capabilities and behaviours of Kotlin, as the tool is a viable candidate to build components of some mission critical projects. The idea was born out of the Affirmations app example from the Android Basics in Kotlin Course. That project displayed a list of 10 affirmations with images, each of which is on a material card in a recycler view. I saw the opportunity to get a real feel of Kotlin, while compiling some sayings that were useful for me to hear when going through tough times.

What does the app do?

The resulting app is initialized with 50 quotes that I call "Firmations". On starting the app, the quotes are displayed, one at a time, in a random order with a pre-set scroll speed.The app also speaks the quotes by default, although you can tell the app not to speak, and it will remember your settings. You can tell the app not to speak out a particular quote, or to snooze a quote for 5 minutes, a day, a week or forever. You can also edit a quote to say exactly what you want to hear, as well as make a copy of a quote (so you can store your own quotes). The settings screen allows you to manage the scroll speed (from 5 seconds to 60 seconds), control whether the system is speaking the quotes, and select the voice used to speak the quotes. Currently, 4 voices are available(all english), that represent US female and male voices, as well as British female and male voices.

How did you do it (High level overview)?

The app employs a SQLite data store, a text to speech library, a recycler view, and other widgets to present screen elements using data binding. On initial startup the SQLite store is initialized from the resources to populate quote and setting data. A single activity was employed with three fragments for the screens. One fragment, which hosts a recycler view, manages the scrolling with the aid of a tail recursive function that invokes the navigation of the under a delay stored in the app settings. The fragment that manages scrolling allows navigation to the setup activity as well as the edit activity. While away from the fragment that manages scrolling, automatic scrolling is paused. Note that data binding is fully implemented for the edit screen - Other binding methods are used on other screens

What if I want to build on it and distribute?

Currently, this is a practice app, so you should consider the code free to use for non-commercial purposes. All I ask is a mention. I claim no rights over the images used, or the app icon. Images were obtained from https://unsplash.com/ with a search of "Jamaica". The app icon was obtained from https://www.dreamstime.com/. You may recognize a few of the quotes as common sayings- a few others are out of my head. Enjoy, and if you re-use, all I ask is a mention (if applicable).

Are there any known issues?

1. There is a problem on initial install - the app seems to not properly read the settings data the first time it is run, and it needs to be re-loaded
2. There is no need for the recycler view to load (the default) 5 view holders. Code inserted to specify only one view holder to initialize has had no effect to date - will revisit.
3. The app icon is skewed on the device screen.

There could also be some refactoring in order - all in all this was a quick knockout of something that is at version 0.9, but is functional.

About

Affirmations to firm you up! Uses TextToSpeech to say quotes and autoscrolls using tail recursion. Kotlin source available.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages