Skip to content

Commit

Permalink
Fix openMF#63 Add option to share the app easily
Browse files Browse the repository at this point in the history
  • Loading branch information
yashk2000 committed Apr 11, 2020
1 parent d443b2f commit 3bbdc7d
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
val intent = Intent(applicationContext, MainActivity::class.java)
startActivity(intent)
}
R.id.share -> {
val sendIntent = Intent()
sendIntent.action = Intent.ACTION_SEND
sendIntent.putExtra(
Intent.EXTRA_TEXT,
getString(R.string.install_vision).toString() + "\n" + getString(R.string.download_link)
)
sendIntent.type = "text/plain"
startActivity(sendIntent)
}
}

drawer_layout.closeDrawer(GravityCompat.START)
Expand Down
11 changes: 11 additions & 0 deletions visionppi/app/src/main/res/drawable-anydpi/ic_share.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
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"/>
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions visionppi/app/src/main/res/menu/activity_main_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
android:icon="@drawable/outline_home_black_18dp"
android:title="@string/home"/>

<item
android:id="@+id/share"
android:icon="@drawable/ic_share"
android:title="@string/share"/>

</group>

</menu>
3 changes: 3 additions & 0 deletions visionppi/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<string name="profile">Profile</string>
<string name="title_activity_main2">Main2Activity</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="install_vision">Download the Vision PPI to ease the process of filing PPI Surveys by automating the process.</string>
<string name="download_link">Download Now: https://github.com/openMF/ppi-vision</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">Android Studio</string>
<string name="nav_header_subtitle">android.studio@android.com</string>
Expand All @@ -23,6 +25,7 @@
<string name="title_activity_main">MainActivity</string>
<string name="my_profile">My Profile</string>
<string name="home">Home</string>
<string name="share">Share App</string>
<string name="user_profile">user_profile</string>
<string name="username_key">Username:</string>
<string name="user_id">User ID:</string>
Expand Down

0 comments on commit 3bbdc7d

Please sign in to comment.