Skip to content

Commit

Permalink
feat: udate application file + progress
Browse files Browse the repository at this point in the history
  • Loading branch information
motionman committed Aug 3, 2022
1 parent cfe9a91 commit 5a560eb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 24 deletions.
17 changes: 0 additions & 17 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

4 changes: 2 additions & 2 deletions app/src/main/java/ua/motionman/ssfilestack/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class MainActivity : AppCompatActivity() {
putExtra(FilestackActivity.API_KEY, "AEHrSDUikTDqTbYuRTesYz")
putExtra(
FilestackActivity.POLICY_KEY,
"eyJjYWxsIjogWyJyZWFkIiwgImNvbnZlcnQiLCAicGljayIsICJzdG9yZSJdLCAiZXhwaXJ5IjogMTY1OTQ3MDg5OC4wMDE5MzEsICJtYXhTaXplIjogNTM2ODcwOTEyMH0="
"eyJjYWxsIjogWyJyZWFkIiwgImNvbnZlcnQiLCAicGljayIsICJzdG9yZSJdLCAiZXhwaXJ5IjogMTY1OTU5ODE3NS42NTA5NzgsICJtYXhTaXplIjogNTM2ODcwOTEyMH0="
)
putExtra(
FilestackActivity.SIGNATURE_KEY,
"64e949a2a83639977d966a3cf66e5e1a02490afbacc8222f81c9be8e36be9184"
"a552aa7e6e29a6d34f9e70151ab3a1b9ad6ad633c7d280c345d7769e5ecd0a00"
)
startActivityForResult(this, 662)
}
Expand Down
2 changes: 2 additions & 0 deletions filestack/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

<application
android:allowBackup="true"
android:hardwareAccelerated="false"
android:largeHeap="true"
android:supportsRtl="true">
<activity
android:name=".ui.FilestackActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ class UploadingProgressViewModel(
}

private fun updateProgress(currentProgress: Progress<FileLink>) {
updateViewState(
_viewState.value.copy(
progress = calculateProgress(currentFile, currentProgress.percent),
)
)
val currentPercent = calculateProgress(currentFile, currentProgress.percent)
val progress =
if (currentPercent < _viewState.value.progress) _viewState.value.progress else currentPercent

updateViewState(_viewState.value.copy(progress = progress))
}

private fun calculateProgress(file: Int, percent: Double): Int {
Expand Down

0 comments on commit 5a560eb

Please sign in to comment.