|
@@ -6,7 +6,6 @@ import android.arch.lifecycle.Observer
|
|
import android.arch.lifecycle.ViewModelProviders
|
|
import android.arch.lifecycle.ViewModelProviders
|
|
import android.content.DialogInterface
|
|
import android.content.DialogInterface
|
|
import android.content.Intent
|
|
import android.content.Intent
|
|
-import android.net.Uri
|
|
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
import android.os.Environment
|
|
import android.os.Environment
|
|
import android.os.Handler
|
|
import android.os.Handler
|
|
@@ -32,6 +31,7 @@ import com.bomostory.sceneeditmodule.share.ExportPdfDialog
|
|
import com.bomostory.sceneeditmodule.share.ShareDialog
|
|
import com.bomostory.sceneeditmodule.share.ShareDialog
|
|
import com.bomostory.sceneeditmodule.utils.MoviePlayerV2
|
|
import com.bomostory.sceneeditmodule.utils.MoviePlayerV2
|
|
import com.bomostory.sceneeditmodule.utils.MusicPlayerV2
|
|
import com.bomostory.sceneeditmodule.utils.MusicPlayerV2
|
|
|
|
+import com.bomostory.sceneeditmodule.utils.Utils
|
|
import com.example.exportmedia.MediaHelper
|
|
import com.example.exportmedia.MediaHelper
|
|
import com.example.tfat.myapplication.R
|
|
import com.example.tfat.myapplication.R
|
|
import com.google.gson.Gson
|
|
import com.google.gson.Gson
|
|
@@ -457,7 +457,10 @@ class MovieEditActivity : AppCompatActivity(),
|
|
exportPdfFile(second, Runnable {
|
|
exportPdfFile(second, Runnable {
|
|
exportPdfDialog.dismiss()
|
|
exportPdfDialog.dismiss()
|
|
}, Runnable {
|
|
}, Runnable {
|
|
- showPdfExportCompleteDialog(first)
|
|
|
|
|
|
+ val context = this@MovieEditActivity
|
|
|
|
+ val file = first
|
|
|
|
+ val authority = "com.bomostory.android"
|
|
|
|
+ Utils.showExportPdfCompleteThenViewDialog(context, authority, file)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -537,22 +540,4 @@ class MovieEditActivity : AppCompatActivity(),
|
|
onComplete.run()
|
|
onComplete.run()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
- private fun showPdfExportCompleteDialog(file: File) {
|
|
|
|
- AlertDialog.Builder(this@MovieEditActivity)
|
|
|
|
- .setMessage("Complete")
|
|
|
|
- .setPositiveButton("View") { _, _ ->
|
|
|
|
- val uri = Uri.parse(file.absolutePath)
|
|
|
|
- val intent = Intent(Intent.ACTION_VIEW, uri).apply {
|
|
|
|
- setDataAndType(uri, "application/pdf")
|
|
|
|
- }
|
|
|
|
- if (intent.resolveActivity(packageManager) != null) {
|
|
|
|
- Intent.createChooser(intent, "").apply {
|
|
|
|
- startActivity(this)
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- Toast.makeText(this@MovieEditActivity, "No app can view pdf", Toast.LENGTH_SHORT).show()
|
|
|
|
- }
|
|
|
|
- }.show()
|
|
|
|
- }
|
|
|
|
}
|
|
}
|