add an option to show Donate button in the About section
This commit is contained in:
parent
a063ac507d
commit
58306d6b73
3 changed files with 48 additions and 0 deletions
|
@ -39,6 +39,7 @@ class AboutActivity : BaseSimpleActivity() {
|
|||
arrayOf(
|
||||
about_faq_icon,
|
||||
about_rate_us_icon,
|
||||
about_donate_icon,
|
||||
about_invite_icon,
|
||||
about_contributors_icon,
|
||||
about_more_apps_icon,
|
||||
|
@ -64,6 +65,7 @@ class AboutActivity : BaseSimpleActivity() {
|
|||
|
||||
setupEmail()
|
||||
setupFAQ()
|
||||
setupDonate()
|
||||
setupMoreApps()
|
||||
setupRateUs()
|
||||
setupInvite()
|
||||
|
@ -131,6 +133,18 @@ class AboutActivity : BaseSimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun setupDonate() {
|
||||
if (resources.getBoolean(R.bool.show_donate_in_about)) {
|
||||
about_donate_holder.beVisible()
|
||||
about_contributors_holder.background = resources.getDrawable(R.drawable.ripple_background, theme)
|
||||
about_donate_holder.setOnClickListener {
|
||||
launchViewIntent("https://simplemobiletools.com/donate")
|
||||
}
|
||||
} else {
|
||||
about_donate_holder.beGone()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupMoreApps() {
|
||||
about_more_apps_holder.setOnClickListener {
|
||||
launchViewIntent("https://play.google.com/store/apps/dev?id=9070296388022589266")
|
||||
|
|
3
commons/src/main/res/drawable/ic_dollar_vector.xml
Normal file
3
commons/src/main/res/drawable/ic_dollar_vector.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M11.8 10.9c-2.27-0.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44 0.85 2.5 2.1h2.21C16.14 7.28 15.09 5.7 13 5.19V3h-3v2.16C8.06 5.58 6.5 6.84 6.5 8.77c0 2.31 1.91 3.46 4.7 4.13 2.5 0.6 3 1.48 3 2.41 0 0.69-0.49 1.79-2.7 1.79-2.06 0-2.87-0.92-2.98-2.1h-2.2c0.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-0.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"/>
|
||||
</vector>
|
|
@ -197,6 +197,37 @@
|
|||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/about_donate_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_bottom_corners"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/about_donate_icon"
|
||||
android:layout_width="@dimen/normal_icon_size"
|
||||
android:layout_height="@dimen/normal_icon_size"
|
||||
android:contentDescription="@null"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_dollar_vector" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/about_donate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@+id/about_donate_icon"
|
||||
android:layout_alignBottom="@+id/about_donate_icon"
|
||||
android:layout_marginStart="@dimen/normal_margin"
|
||||
android:layout_marginEnd="@dimen/normal_margin"
|
||||
android:layout_toEndOf="@+id/about_donate_icon"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/donate"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
|
|
Loading…
Reference in a new issue