Skip to content

Conversation

@omsurase
Copy link
Contributor

@omsurase omsurase commented Oct 7, 2022

Pull Request Template

Description

Programmed add person floating action button, on clicking add person button new activity is launched on which the user has to upload all the details of the person. A person's info is written in the database only when all the fields are filled. only function for inserting a person's information into the database is implemented.

I tried to record the screen of the app working on my phone but then there was no option to see the database on the phone.
and recording of my windows screen resulted in a suttery and large file that couldn't be uploaded.

image

image

Fixes #7

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@noobshubham
Copy link
Contributor

Hey @omsurase, your code looks clean. Do you use GitHub Copilot?

@omsurase
Copy link
Contributor Author

omsurase commented Oct 8, 2022

@noobshubham thanks a lot mate! and I don't use GitHub copilot, I used official rooms documentation for the most part (more like copy pasted from there XD) and the rest of the stuff was pretty much function callings

@noobshubham
Copy link
Contributor

@noobshubham thanks a lot mate! and I don't use GitHub copilot, I used official rooms documentation for the most part (more like copy pasted from there XD) and the rest of the stuff was pretty much function callings

ooho, cool!

@AryanShinde AryanShinde requested a review from neil0504 October 8, 2022 04:46
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

class AddPeopleInfoActivity : AppCompatActivity() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plz implement the view model for insertion into the database and make use of View model coroutine scope instead of global scope. Also include a circular progress bar which will be displayed while the entry is inserted into the database.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you elaborate about circular progress bar? i didn't get it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

U display the progress bar before u start the transaction to database and hide it as u complete the transaction

fun insertPerson(person : Person)

@Query("SELECT * FROM person")
fun getPerson() : LiveData<List<Person>>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here u can use Flow and get it as Live data in your View model


}

private fun addPerson() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put in error messages if any fields are missing.

app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<EditText
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to Material 3 implementation of Edit text.
https://m3.material.io/components/text-fields/overview

also put in input type for the type of input ur expecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Program the ADD PEOPLE floating action button to add a Persons Inf

3 participants