mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Merge pull request #1188 from ujjwalagrawal17/feat5
Rate Us feature added
This commit is contained in:
commit
e207edc0e5
5 changed files with 49 additions and 26 deletions
|
|
@ -73,5 +73,4 @@ public class AboutActivity extends NavigationBaseActivity {
|
|||
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\\"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -165,6 +165,17 @@ public class Utils {
|
|||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
public static void rateApp(Context context) {
|
||||
final String appPackageName = context.getPackageName();
|
||||
try {
|
||||
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
|
||||
}
|
||||
catch (android.content.ActivityNotFoundException anfe) {
|
||||
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
public static void handleWebUrl(Context context,Uri url){
|
||||
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
|
||||
builder.setToolbarColor(ContextCompat.getColor(context, R.color.primaryColor));
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import fr.free.nrw.commons.AboutActivity;
|
|||
import fr.free.nrw.commons.BuildConfig;
|
||||
import fr.free.nrw.commons.CommonsApplication;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.Utils;
|
||||
import fr.free.nrw.commons.WelcomeActivity;
|
||||
import fr.free.nrw.commons.auth.AccountUtil;
|
||||
import fr.free.nrw.commons.auth.LoginActivity;
|
||||
|
|
|
|||
|
|
@ -104,34 +104,45 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
||||
android:id="@+id/about_privacy_policy"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/standard_gap"
|
||||
android:gravity="center"
|
||||
android:text="@string/about_privacy_policy" />
|
||||
<TextView
|
||||
android:id="@+id/about_rate_us"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/standard_gap"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:text="@string/about_rate_us" />
|
||||
|
||||
<fr.free.nrw.commons.ui.widget.HtmlTextView
|
||||
android:id="@+id/about_credits"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/standard_gap"
|
||||
android:gravity="center"
|
||||
android:text="@string/about_credits" />
|
||||
<TextView
|
||||
android:id="@+id/about_privacy_policy"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/standard_gap"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:gravity="center"
|
||||
android:text="@string/about_privacy_policy" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about_uploads_to"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/large_gap"
|
||||
android:alpha="0.2"
|
||||
android:gravity="center" />
|
||||
<TextView
|
||||
android:id="@+id/about_credits"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:layout_marginTop="@dimen/standard_gap"
|
||||
android:gravity="center"
|
||||
android:text="@string/about_credits" />
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/about_uploads_to"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/large_gap"
|
||||
android:alpha="0.2"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
|
|
|||
|
|
@ -237,4 +237,5 @@
|
|||
<string name="notifications_thank_you_edit">Thank you for making an edit</string>
|
||||
<string name="notifications_mention">%1$s mentioned you on %2$s.</string>
|
||||
<string name="toggle_view_button">Toggle view</string>
|
||||
<string name="about_rate_us"><u>Rate Us</u></string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue