Commit c03782fc authored by Govind Dixit's avatar Govind Dixit

feat: rate app on playstore

parent 4b1f14a7
package chat.rocket.android.settings.ui package chat.rocket.android.settings.ui
import android.content.ActivityNotFoundException
import android.content.Intent import android.content.Intent
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
...@@ -75,6 +77,22 @@ class SettingsFragment : Fragment(), SettingsView, AdapterView.OnItemClickListen ...@@ -75,6 +77,22 @@ class SettingsFragment : Fragment(), SettingsView, AdapterView.OnItemClickListen
AboutFragment.newInstance() AboutFragment.newInstance()
} }
} }
resources.getString(R.string.title_rate_us) ->
startAppPlayStore()
}
}
fun getMarketAppLink(): String {
return "market://details?id=chat.rocket.android"
}
fun getMarketWebLink(): String {
return "https://play.google.com/store/apps/details?id=chat.rocket.android"
}
private fun startAppPlayStore() {
try {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getMarketAppLink())))
} catch (error: ActivityNotFoundException) {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getMarketWebLink())))
} }
} }
......
...@@ -27,6 +27,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin ...@@ -27,6 +27,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string name="title_settings">Settings</string> <string name="title_settings">Settings</string>
<string name="title_preferences">Preferences</string> <string name="title_preferences">Preferences</string>
<string name="title_change_password">Change Password</string> <string name="title_change_password">Change Password</string>
<string name="title_rate_us">Rate Us</string>
<string name="title_admin_panel">Admin panel</string> <string name="title_admin_panel">Admin panel</string>
<string name="title_password">Change Password</string> <string name="title_password">Change Password</string>
<string name="title_update_profile">Update profile</string> <string name="title_update_profile">Update profile</string>
...@@ -70,6 +71,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin ...@@ -70,6 +71,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<item name="item_preferences">Preferences</item> <item name="item_preferences">Preferences</item>
<item name="item_password">Change Password</item> <item name="item_password">Change Password</item>
<item name="item_password">About</item> <item name="item_password">About</item>
<item name="item_rate_us">Rate Us</item>
</string-array> </string-array>
<!-- Regular information messages --> <!-- Regular information messages -->
......
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