Update Kotlin version

pull/1127/head
Alex Baker 4 years ago
parent 7ff4c7ad2c
commit a4312a1d29

@ -21,6 +21,7 @@ import org.tasks.preferences.Preferences
import timber.log.Timber
import java.util.*
import javax.inject.Inject
import kotlin.math.min
/**
* @author joshuagross
@ -83,11 +84,13 @@ class ShareLinkActivity : InjectingAppCompatActivity() {
}
private fun copyAttachment(intent: Intent): ArrayList<Uri> {
val uri = intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)
val uri = intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM) ?: return ArrayList()
var filename = FileHelper.getFilename(context, uri)
if (isNullOrEmpty(filename)) {
val subject = intent.getStringExtra(Intent.EXTRA_SUBJECT)
filename = if (isNullOrEmpty(subject)) uri.lastPathSegment else subject.substring(0, Math.min(subject.length, FileHelper.MAX_FILENAME_LENGTH))
filename = intent.getStringExtra(Intent.EXTRA_SUBJECT)
?.takeIf { it.isNotBlank() }
?.let { it.substring(0, min(it.length, FileHelper.MAX_FILENAME_LENGTH)) }
?: uri.lastPathSegment
}
val basename = Files.getNameWithoutExtension(filename!!)
return Lists.newArrayList(FileHelper.copyToUri(context, preferences.attachmentsDirectory, uri, basename))

@ -526,10 +526,11 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
}
}
REQUEST_MOVE_TASKS -> if (resultCode == Activity.RESULT_OK) {
lifecycleScope.launch {
taskMover.move(
taskAdapter.getSelected(),
data!!.getParcelableExtra(ListPicker.EXTRA_SELECTED_FILTER))
data?.getParcelableExtra<Filter>(ListPicker.EXTRA_SELECTED_FILTER)?.let {
val selected = taskAdapter.getSelected()
lifecycleScope.launch {
taskMover.move(selected, it)
}
}
finishActionMode()
}

@ -46,9 +46,12 @@ class TagPickerActivity : ThemedInjectingAppCompatActivity() {
val intent = intent
taskIds = intent.getSerializableExtra(EXTRA_TASKS) as ArrayList<Long>?
if (savedInstanceState == null) {
viewModel.setSelected(
intent.getParcelableArrayListExtra(EXTRA_SELECTED),
intent.getParcelableArrayListExtra(EXTRA_PARTIALLY_SELECTED))
intent.getParcelableArrayListExtra<TagData>(EXTRA_SELECTED)?.let {
viewModel.setSelected(
it,
intent.getParcelableArrayListExtra(EXTRA_PARTIALLY_SELECTED)
)
}
}
setContentView(R.layout.activity_tag_picker)
ButterKnife.bind(this)

@ -1,5 +1,5 @@
object Versions {
const val kotlin = "1.4.0"
const val kotlin = "1.4.10"
const val targetSdk = 29
const val minSdk = 23
const val butterknife = "10.2.3"

Loading…
Cancel
Save