Skip to content

Commit

Permalink
Update Share Icon & Add Preview title
Browse files Browse the repository at this point in the history
Signed-off-by: Sanju S <[email protected]>
  • Loading branch information
Spikeysanju committed Oct 14, 2020
1 parent 7cc3120 commit ad1efaa
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
38 changes: 29 additions & 9 deletions app/src/main/res/drawable/ic_share.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,41 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="23"
android:viewportHeight="23">
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#00000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"
android:strokeWidth="1.25"
android:strokeColor="@color/colorOnSecondary"
android:pathData="M6,15C7.6568,15 9,13.6569 9,12C9,10.3431 7.6568,9 6,9C4.3432,9 3,10.3431 3,12C3,13.6569 4.3432,15 6,15Z"
android:strokeWidth="1.5"
android:strokeColor="@android:color/black"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="#00000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"
android:strokeWidth="1.25"
android:strokeColor="@color/colorOnSecondary"
android:pathData="M18,9C19.6569,9 21,7.6568 21,6C21,4.3432 19.6569,3 18,3C16.3431,3 15,4.3432 15,6C15,7.6568 16.3431,9 18,9Z"
android:strokeWidth="1.5"
android:strokeColor="@android:color/black"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M18,21C19.6569,21 21,19.6569 21,18C21,16.3431 19.6569,15 18,15C16.3431,15 15,16.3431 15,18C15,19.6569 16.3431,21 18,21Z"
android:strokeWidth="1.5"
android:strokeColor="@android:color/black"
android:fillColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M8.7002,10.7L15.3002,7.3"
android:strokeWidth="1.5"
android:strokeColor="@android:color/black"
android:fillColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="#00000000"
android:pathData="M8.7002,13.3L15.3002,16.7"
android:strokeWidth="1.5"
android:strokeColor="@android:color/black"
android:strokeLineCap="round"
android:strokeLineJoin="round" />

</vector>

0 comments on commit ad1efaa

Please sign in to comment.