Skip to content

Commit

Permalink
Merge pull request #27 from Qase/FIX/HIPMC-2783
Browse files Browse the repository at this point in the history
Fix/hipmc 2783
  • Loading branch information
zelenmi6 committed Mar 17, 2022
2 parents ef747ed + 45ad0a8 commit 70d266d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion kotlinlog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdkVersion 16
targetSdkVersion 28
versionCode 3
versionName "2.2.7"
versionName "2.2.8"
buildConfigField 'int', 'VERSION_CODE', "$versionCode"
buildConfigField 'String', 'VERSION_NAME', "\"$versionName\""
consumerProguardFile('proguard-rules.pro')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import android.os.Bundle
import android.widget.Toast
import androidx.fragment.app.DialogFragment
import java.io.File
import kotlinx.coroutines.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.runBlocking
import quanti.com.kotlinlog.R
import quanti.com.kotlinlog.utils.copyLogsTOSDCard
import quanti.com.kotlinlog.utils.getFormattedFileNameDayNow
Expand Down Expand Up @@ -121,19 +125,16 @@ class SendLogDialogFragment : DialogFragment() {
*/
@Suppress("UNUSED_PARAMETER")
private fun positiveButtonClick(dialog: DialogInterface, which: Int) =
CoroutineScope(Dispatchers.Main).launch {
runBlocking {
val appContext = this@SendLogDialogFragment.requireContext().applicationContext

val addresses = requireArguments().getStringArray(SEND_EMAIL_ADDRESSES)
val subject =
getString(R.string.logs_email_subject) + " " + getFormattedFileNameDayNow()
val bodyText = getString(R.string.logs_email_text)

// await non block's current thread
val zipFileUri = zipFile?.await()?.getUriForFile(appContext)

val intent = Intent(Intent.ACTION_SEND).apply {
type = "message/rfc822" // email
type = "message/rfc822" // email
flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
putExtra(Intent.EXTRA_EMAIL, addresses)
Expand All @@ -159,7 +160,7 @@ class SendLogDialogFragment : DialogFragment() {
*/
@Suppress("UNUSED_PARAMETER")
private fun neutralButtonClick(dialog: DialogInterface, which: Int) =
CoroutineScope(Dispatchers.Main).launch {
runBlocking {
val appContext = this@SendLogDialogFragment.requireContext().applicationContext

val file = zipFile?.await()?.copyLogsTOSDCard(requireContext())
Expand Down

0 comments on commit 70d266d

Please sign in to comment.