Commit 44120386 authored by Ricki Hirner's avatar Ricki Hirner

Use ShareCompat.IntentBuilder

parent c7c4818b
Pipeline #21950528 failed with stage
in 47 seconds
...@@ -41,15 +41,15 @@ android { ...@@ -41,15 +41,15 @@ android {
} }
dependencies { dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compile project(':cert4android') implementation project(':cert4android')
compile project(':ical4android') implementation project(':ical4android')
compile 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1' implementation 'com.android.support:cardview-v7:27.1.1'
compile 'com.android.support:design:27.1.1' implementation 'com.android.support:design:27.1.1'
compile 'com.github.yukuku:ambilwarna:2.0.1' implementation 'com.github.yukuku:ambilwarna:2.0.1'
compile 'commons-io:commons-io:2.6' implementation 'commons-io:commons-io:2.6'
} }
...@@ -10,7 +10,10 @@ package at.bitfire.icsdroid.ui ...@@ -10,7 +10,10 @@ package at.bitfire.icsdroid.ui
import android.Manifest import android.Manifest
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.* import android.content.ContentProviderClient
import android.content.ContentUris
import android.content.ContentValues
import android.content.Context
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.database.ContentObserver import android.database.ContentObserver
import android.net.Uri import android.net.Uri
...@@ -19,6 +22,7 @@ import android.provider.CalendarContract ...@@ -19,6 +22,7 @@ import android.provider.CalendarContract
import android.support.v4.app.DialogFragment import android.support.v4.app.DialogFragment
import android.support.v4.app.FragmentTransaction import android.support.v4.app.FragmentTransaction
import android.support.v4.app.LoaderManager import android.support.v4.app.LoaderManager
import android.support.v4.app.ShareCompat
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.support.v4.content.Loader import android.support.v4.content.Loader
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
...@@ -39,12 +43,6 @@ import java.net.URI ...@@ -39,12 +43,6 @@ import java.net.URI
class EditCalendarActivity: AppCompatActivity(), LoaderManager.LoaderCallbacks<LocalCalendar> { class EditCalendarActivity: AppCompatActivity(), LoaderManager.LoaderCallbacks<LocalCalendar> {
companion object { companion object {
private const val STATE_TITLE = "title"
private const val STATE_COLOR = "color"
private const val STATE_SYNC_THIS = "sync_this"
private const val STATE_REQUIRE_AUTH = "requires_auth"
private const val STATE_USERNAME = "legacyUsername"
private const val STATE_PASSWORD = "legacyPassword"
private const val STATE_DIRTY = "dirty" private const val STATE_DIRTY = "dirty"
} }
...@@ -175,11 +173,12 @@ class EditCalendarActivity: AppCompatActivity(), LoaderManager.LoaderCallbacks<L ...@@ -175,11 +173,12 @@ class EditCalendarActivity: AppCompatActivity(), LoaderManager.LoaderCallbacks<L
fun onShare(item: MenuItem) { fun onShare(item: MenuItem) {
calendar?.let { calendar?.let {
val intent = Intent(Intent.ACTION_SEND) ShareCompat.IntentBuilder.from(this)
intent.putExtra(Intent.EXTRA_SUBJECT, it.displayName) .setSubject(it.displayName)
intent.putExtra(Intent.EXTRA_TEXT, it.url) .setText(it.url)
intent.type = "text/plain" .setType("text/plain")
startActivity(Intent.createChooser(intent, getString(R.string.edit_calendar_send_url))) .setChooserTitle(R.string.edit_calendar_send_url)
.startChooser()
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment