This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
etName_firestore_update.text.append(personExtra.name) | |
etEmail_firestore_update.text.append(personExtra.email) | |
etPhone_firestore_update.text.append(personExtra.phone) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val person = Person( | |
null, | |
etName_firestore_update.text.toString(), | |
etEmail_firestore_update.text.toString(), | |
etPhone_firestore_update.text.toString()) | |
db.collection("Person").document(personExtra.id!!).set(person) | |
.addOnSuccessListener { | |
"Updated Successful.".toast(this@UpdateFirestoreActivity) | |
finish() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.collection("Person").document(personExtra.id!!) | |
.update("name",etName_firestore_update.text) | |
.addOnSuccessListener { | |
"Updated Successful.".toast(this@UpdateFirestoreActivity) | |
finish() | |
startActivity(Intent(this, FirestoreListActivity::class.java)) | |
progressBarStyle.visibility = ProgressBar.INVISIBLE | |
}.addOnFailureListener { exception -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<TextView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style name="AppTheme" parent="Theme.AppCompat.DayNight"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun chooseThemeDialog() { | |
val builder = AlertDialog.Builder(this) | |
builder.setTitle(getString(R.string.choose_theme_text)) | |
val styles = arrayOf("Light","Dark","System default") | |
val checkedItem = 0 | |
builder.setSingleChoiceItems(styles, checkedItem) { dialog, which -> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun chooseThemeDialog() { | |
val builder = AlertDialog.Builder(this) | |
builder.setTitle(getString(R.string.choose_theme_text)) | |
val styles = arrayOf("Light","Dark","System default") | |
val checkedItem = 0 | |
builder.setSingleChoiceItems(styles, checkedItem) { dialog, which -> | |
when (which) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implementation "androidx.preference:preference-ktx:1.1.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyPreferences(context: Context?) { | |
companion object { | |
private const val DARK_STATUS = "io.github.manuelernesto.DARK_STATUS" | |
} | |
private val preferences = PreferenceManager.getDefaultSharedPreferences(context) | |
var darkMode = preferences.getInt(DARK_STATUS, 0) | |
set(value) = preferences.edit().putInt(DARK_STATUS, value).apply() |