From ad1efaa0bcc96728e032a95344f9c1065d431e71 Mon Sep 17 00:00:00 2001 From: Sanju S Date: Wed, 14 Oct 2020 22:43:40 +0530 Subject: [PATCH] Update Share Icon & Add Preview title Signed-off-by: Sanju S --- .idea/compiler.xml | 2 +- .idea/misc.xml | 2 +- .../ui/details/ArticleDetailsFragment.kt | 12 +++--- app/src/main/res/drawable/ic_share.xml | 38 ++++++++++++++----- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 61a9130..fb7f4a8 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index d5d35ec..4700283 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/app/src/main/java/www/thecodemonks/techbytes/ui/details/ArticleDetailsFragment.kt b/app/src/main/java/www/thecodemonks/techbytes/ui/details/ArticleDetailsFragment.kt index 24303f9..909997f 100644 --- a/app/src/main/java/www/thecodemonks/techbytes/ui/details/ArticleDetailsFragment.kt +++ b/app/src/main/java/www/thecodemonks/techbytes/ui/details/ArticleDetailsFragment.kt @@ -35,12 +35,8 @@ import android.view.MenuItem import android.view.View import android.widget.Toast import androidx.fragment.app.Fragment -import androidx.lifecycle.lifecycleScope -import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.navArgs import kotlinx.android.synthetic.main.fragment_article_details.* -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.launch import www.thecodemonks.techbytes.R import www.thecodemonks.techbytes.model.Article import www.thecodemonks.techbytes.ui.base.BaseActivity @@ -50,8 +46,8 @@ import www.thecodemonks.techbytes.utils.Constants class ArticleDetailsFragment : Fragment(R.layout.fragment_article_details) { private lateinit var viewModel: ArticleViewModel - val args: ArticleDetailsFragmentArgs by navArgs() - private var completeUrl:String? = null + private val args: ArticleDetailsFragmentArgs by navArgs() + private var completeUrl: String? = null override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) @@ -99,7 +95,9 @@ class ArticleDetailsFragment : Fragment(R.layout.fragment_article_details) { R.id.action_share -> { val sendIntent: Intent = Intent().apply { action = Intent.ACTION_SEND - putExtra(Intent.EXTRA_TEXT,completeUrl) + putExtra(Intent.EXTRA_TEXT, completeUrl) + putExtra(Intent.EXTRA_TITLE, "NYTimes Article") + type = "text/plain" } val shareIntent = Intent.createChooser(sendIntent, null) diff --git a/app/src/main/res/drawable/ic_share.xml b/app/src/main/res/drawable/ic_share.xml index e114845..eb16832 100644 --- a/app/src/main/res/drawable/ic_share.xml +++ b/app/src/main/res/drawable/ic_share.xml @@ -27,21 +27,41 @@ + android:viewportWidth="24" + android:viewportHeight="24"> + + + -