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

Finished implementation #9

Merged
merged 98 commits into from
May 21, 2022
Merged

Finished implementation #9

merged 98 commits into from
May 21, 2022

Conversation

TimPushkin
Copy link
Owner

First version of the project consisting of the library and a demo application.

@TimPushkin
Copy link
Owner Author

Текущее GUI приложения

image

@TimPushkin
Copy link
Owner Author

It the last commit some things appeared which I'm not so sure about:

  1. Some IllegalStateExceptions because ViewModel's properties are nullable, but there are surcumstances under which they cannot be null, so this cases have IllegalStateExceptions. It would be great to make them lateinit, but I can't, because these properties are delegated to mutableStateOf.
  2. I'm not sure if placing DepthEstimator to ViewModel is ok. On one hand, it is pretty convinient because it has to survive screen rotations, but on the other hand, it is not part of the UI.

class StorageUtils(private val context: Context) {
private val mFileSystem = AndroidFileSystem(context)

fun copyToCache(uri: Uri, filename: String): File? =
Copy link
Collaborator

@DmiitriyJarosh DmiitriyJarosh May 20, 2022

Choose a reason for hiding this comment

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

We already removed cache? is it useless?

Copy link
Owner Author

@TimPushkin TimPushkin May 21, 2022

Choose a reason for hiding this comment

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

No, this one is still required. I removed only caching of images, but caching of calibration parameters is still needed: I have to pass a raw file path to the native library, but in the recent versions of Android it is pretty hard (and not recommended) to work with raw paths outside of app-specific directories. That's why I copy the file with parameters to app's cache -- this way I have a safe way to get its path.

@TimPushkin TimPushkin merged commit ac09757 into main May 21, 2022
@TimPushkin TimPushkin deleted the dev branch July 25, 2022 08:24
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