vnorderui / com.venuenext.vnorderui.ui.phonecollection / PhoneNumberCollectionViewModel

PhoneNumberCollectionViewModel

class PhoneNumberCollectionViewModel : AndroidViewModel

This ViewModel, along with its corresponding Fragment, handles phone number collection from the user.

The ViewModel handles the business logic.

Constructors

<init>

This ViewModel, along with its corresponding Fragment, handles phone number collection from the user.

PhoneNumberCollectionViewModel(application: Application)

Properties

phoneNumber

var phoneNumber: MutableLiveData<String>

Functions

isValidPhoneNumber

fun isValidPhoneNumber(countryCode: Int, phoneNumber: String): Boolean

prePopulateSavedPhoneNumber

If a number has been previously entered, prepopulate the input field. phoneNumber is bound to the input field, so the input field will automatically update if found.

fun prePopulateSavedPhoneNumber(context: Context): Unit

savePhoneNumberLocally

fun savePhoneNumberLocally(context: Context, phoneNumber: String): Unit