Skip to content

Commit

Permalink
fix share chooser
Browse files Browse the repository at this point in the history
  • Loading branch information
hariimurti committed May 14, 2020
1 parent 87c8af9 commit 65a03fb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
android:theme="@style/AppTheme.Transparent"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity">
<intent-filter android:label="@string/app_share">
<intent-filter android:label="@string/title_share">
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/net/harimurti/babesharer/ShareActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ class ShareActivity : AppCompatActivity() {
}

val shareIntent = Intent.createChooser(sendIntent, getString(R.string.title_share))
runOnUiThread { startActivity(shareIntent) }
runOnUiThread { startActivityForResult(shareIntent, 0) }
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
this.finish()
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_share_full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:text="@string/title_share_article"
android:text="@string/title_share"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/color_primary" />

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/sample_layout_with.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:text="@string/title_share_article"
android:text="@string/title_share"
android:textColor="@color/color_primary"
android:textSize="8sp"
tools:ignore="SmallSp" />
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_share">Bagikan Artikel dari BABE</string>
<string name="title_share">Bagikan</string>
<string name="title_share_article">Bagikan Artikel</string>
<string name="title_share">Bagikan Artikel</string>
<string name="label_article">Artikel :</string>
<string name="label_link">Tautan :</string>
<string name="toast_request_failure">Permintaan Gagal</string>
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<resources>
<string name="app_name" translatable="false">BABE Sharer</string>
<string name="app_share">Share Original Article</string>
<string name="title_share">Share</string>
<string name="title_share_article">Share Article</string>
<string name="title_share">Share Article</string>
<string name="label_article">Article :</string>
<string name="label_link">Link :</string>
<string name="toast_request_failure">Request Failure</string>
Expand Down
4 changes: 2 additions & 2 deletions app/version.prop
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Thu May 14 21:40:48 ICT 2020
VERSION_CODE=32
#Fri May 15 01:27:57 ICT 2020
VERSION_CODE=37

0 comments on commit 65a03fb

Please sign in to comment.