|
| 1 | +# AndroQuake-SDK |
| 2 | +AndroQuake-SDK to show donation page easily in your app. |
| 3 | + |
| 4 | +## Requirements |
| 5 | +* Android Api 21+ |
| 6 | +* MaterialComponents Theme |
| 7 | + |
| 8 | +# Download |
| 9 | + |
| 10 | +### Step 1. Add the JitPack repository to your build file |
| 11 | + |
| 12 | +``` |
| 13 | +allprojects { |
| 14 | + repositories { |
| 15 | + ... |
| 16 | + maven { url 'https://jitpack.io' } |
| 17 | + } |
| 18 | +} |
| 19 | +
|
| 20 | +``` |
| 21 | + |
| 22 | +### Step 2. Add the dependency |
| 23 | + |
| 24 | +``` |
| 25 | +dependencies { |
| 26 | + implementation 'com.github.mobven:androquake:1.0.0' |
| 27 | + } |
| 28 | +``` |
| 29 | + |
| 30 | +## Usage |
| 31 | +### Default Donation |
| 32 | +AndroQuake can be initialized through, which has default title and message those are presented in the screenshot above. |
| 33 | +```kotlin |
| 34 | +// call this constructor wherever you want providing context |
| 35 | +Donation.Builder(this).build() |
| 36 | +``` |
| 37 | + |
| 38 | +### Custom title, message and logo |
| 39 | +If you want to use custom logo, title and description, you can use below builder. |
| 40 | +```kotlin |
| 41 | +Donation.Builder(this@MainActivity) |
| 42 | + .logo(R.drawable.my_custom_logo) |
| 43 | + .title("Donate") |
| 44 | + .description("Donation lorem impsum...") |
| 45 | + .build() |
| 46 | +``` |
| 47 | + |
| 48 | + |
| 49 | +### Spanned title and message, and custom logo |
| 50 | +If you want to show fancy title and description, you can use our *DonationText wrapper to make a spannable string. |
| 51 | +```kotlin |
| 52 | +Donation.Builder(this@MainActivity) |
| 53 | + .logo(R.drawable.my_custom_logo) |
| 54 | + .titleSpan(DonationText(SpannableString.valueOf("Donate"))) |
| 55 | + .descriptionSpan(DonationText(SpannableString.valueOf("Donation lorem impsum..."))) |
| 56 | + .build() |
| 57 | +``` |
| 58 | + |
| 59 | +### Custom Action Buttons |
| 60 | +By default it has, AHBAP, AFAD and Turk Kizilayi buttons. If you want to add custom buttons, you can use our *DonateButton to make a your button. |
| 61 | +```kotlin |
| 62 | +Donation.Builder(this@MainActivity) |
| 63 | + .logo(R.drawable.my_custom_logo) |
| 64 | + .titleSpan(DonationText(SpannableString.valueOf("Donate"))) |
| 65 | + .descriptionSpan(DonationText(SpannableString.valueOf("Donation lorem impsum..."))) |
| 66 | + .donationButtons( |
| 67 | + mutableListOf( |
| 68 | + DonateButton( |
| 69 | + icon = R.drawable.logo, |
| 70 | + link = "https://ahbap.org/bagisci-ol", |
| 71 | + strokeColor = R.color.color_green_ahbap, |
| 72 | + backgroundColor = R.color.color_bg_ahbap |
| 73 | + ), |
| 74 | + DonateButton( |
| 75 | + icon = R.drawable.logo, |
| 76 | + link = "https://www.afad.gov.tr/depremkampanyasi2", |
| 77 | + strokeColor = R.color.color_green_afad, |
| 78 | + backgroundColor = R.color.color_bg_afad |
| 79 | + ), |
| 80 | + DonateButton( |
| 81 | + label = "BİREYSEL BAĞIŞ", |
| 82 | + link = "#bagisyap" |
| 83 | + ) |
| 84 | + ) |
| 85 | +).build() |
| 86 | +``` |
0 commit comments