Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take pictures with camera #1043

Merged
merged 8 commits into from
Sep 10, 2024
Merged

Conversation

greenart7c3
Copy link
Contributor

No description provided.

@KotlinGeekDev
Copy link
Contributor

NIce PR!

val timeStamp: String = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US).format(Date())
val storageDir: File? = context.getExternalFilesDir(Environment.DIRECTORY_PICTURES)
File
.createTempFile(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I wonder if it's a good idea to do this here, since it will run on the UI thread. Please have you observed any performance issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't test the performance yet. I had to stop working on this to fix a few bugs in amber and citrine.
I'll start working on this again tomorrow

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't test the performance yet. I had to stop working on this to fix a few bugs in amber and citrine. I'll start working on this again tomorrow

Got it. 👍

@greenart7c3
Copy link
Contributor Author

Should I use different buttons for camera and gallery or show a dialog?

@vitorpamplona
Copy link
Owner

Hum... I think it depends on the screen. On the new post, a new button is better. On chat, a popup is better. I am not sure what to do on the stories/media feed though..

@greenart7c3
Copy link
Contributor Author

I think we can do an animated button like this in the stories feed

image

@vitorpamplona
Copy link
Owner

vitorpamplona commented Sep 6, 2024 via email

@greenart7c3 greenart7c3 marked this pull request as ready for review September 9, 2024 18:41
Copy link
Contributor

@KotlinGeekDev KotlinGeekDev left a comment

Choose a reason for hiding this comment

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

Nice changes made!

amethyst/build.gradle Outdated Show resolved Hide resolved
)

if (cameraPermissionState.status.isGranted) {
LaunchedEffect(key1 = accountViewModel) {
Copy link
Contributor

Choose a reason for hiding this comment

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

accountViewModel as key, interesting. Please, did you have better reliability using it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just copied from the other button

Copy link
Owner

Choose a reason for hiding this comment

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

FYI, I am moving most of the Singleton classes (LocalCache, etc) to be variables inside the AccountViewModel. This will make it massive in the short term, but once everything is in one spot with lifecycle support, we can start to move some of these actions to helper classes. We should then be able to build dynamic flows based on the LocalCache's state.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just copied from the other button

Got it. 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, I am moving most of the Singleton classes (LocalCache, etc) to be variables inside the AccountViewModel. This will make it massive in the short term, but once everything is in one spot with lifecycle support, we can start to move some of these actions to helper classes. We should then be able to build dynamic flows based on the LocalCache's state.

I guess @greenart7c3 could to do a follow-up PR once the migration is done(unless you do it in the meantime :)).

Copy link
Contributor

@KotlinGeekDev KotlinGeekDev left a comment

Choose a reason for hiding this comment

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

Nice!

@greenart7c3 greenart7c3 changed the title wip: Take pictures with camera Take pictures with camera Sep 9, 2024
@vitorpamplona
Copy link
Owner

Super nice! Is this ready to merge?

@greenart7c3
Copy link
Contributor Author

Yes, you can merge this. Unless you want videos too, for videos I think there's no intent for videos and we need to build a camera ui inside the app

@vitorpamplona
Copy link
Owner

Unless you want videos too, for videos I think there's no intent for videos and we need to build a camera ui inside the app

Yeah, I hate how Android doesn't provide a simple feed from the phone's main camera app.

@vitorpamplona vitorpamplona merged commit f086c0f into vitorpamplona:main Sep 10, 2024
1 check passed
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.

3 participants