Skip to content

Commit

Permalink
Add Play variant
Browse files Browse the repository at this point in the history
Apparently PayPal donation links aren't allowed
  • Loading branch information
kdrag0n committed Aug 19, 2018
1 parent 966efef commit 2327644
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
17 changes: 15 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.kdrag0n.tipatch"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
versionCode 1010
versionName "1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "en"

Expand All @@ -21,13 +21,26 @@ android {
}
}
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
shrinkResources true
}
}

flavorDimensions "flags"
productFlavors {
standard {
dimension "flags"
}

play {
dimension "flags"
}
}

externalNativeBuild {
cmake {
path 'CMakeLists.txt'
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/com/kdrag0n/tipatch/AboutActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.net.Uri
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.Toolbar
import android.view.View
import kotlinx.android.synthetic.main.activity_about.*

class AboutActivity : AppCompatActivity() {
Expand All @@ -26,8 +27,12 @@ class AboutActivity : AppCompatActivity() {
startActivity(intent)
}

about_donate.summary = R.string.about_donate_desc()
about_donate.uri = R.string.donate_uri
if (resources.getBoolean(R.bool.showPaypal)) {
about_donate.summary = R.string.about_donate_desc()
about_donate.uri = R.string.donate_uri
} else {
about_donate.visibility = View.GONE
}

about_author.summary = R.string.author_nick()
about_author.uri = R.string.website_uri
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/menu/actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
<item
android:id="@+id/donateOpt"
android:title="@string/donate"
android:visible="@bool/showPaypal"
app:showAsAction="never" />
</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values/attr.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="isPhone">true</bool>
<bool name="showPaypal">true</bool>

<declare-styleable name="AboutCardRow">
<attr name="icon" format="reference"/>
Expand Down
3 changes: 3 additions & 0 deletions app/src/play/res/values/attr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<bool name="showPaypal">false</bool>
</resources>

0 comments on commit 2327644

Please sign in to comment.