From 39699e0677322115b44c0dae3e6c8e805950437b Mon Sep 17 00:00:00 2001 From: Armel Date: Thu, 20 May 2021 17:53:57 +0100 Subject: [PATCH] Moving to jitpack --- README.md | 19 ++++++++---- build.gradle | 12 -------- deploy.gradle | 29 ------------------- gradle.properties | 4 +-- .../opensi/kkiapay/uikit/CustomTabActivity.kt | 5 ++-- .../main/res/layout/custom_tab_activity.xml | 14 +++++---- 6 files changed, 25 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 3f0fa9d..b2eb031 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,19 @@ and create your account is free and without pain :sunglasses:. ### Android Studio ( or Gradle ) - To add kkiapay in your android app, just add the following line in your app's `build.gradle` -file inside `dependencies` section - -```groovy -implementation 'co.opensi.kkiapay:kkiapay:' - ``` + To add kkiapay in your android app: + + 1- add the following line in your root `build.gradle` file inside `repositories` sections + + ```groovy + maven { url 'https://jitpack.io' } + ``` + + 2- add the following line in your app's `build.gradle` file inside `dependencies` section + + ```groovy + implementation 'com.github.kkiapay:android-sdk:' + ``` ## Usage diff --git a/build.gradle b/build.gradle index 7ad7c66..75416ef 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. -//def githubProperties = new Properties() -//githubProperties.load(new FileInputStream(rootProject.file("local.properties"))) - buildscript { ext.kotlin_version = '1.3.50' repositories { @@ -24,15 +21,6 @@ allprojects { google() jcenter() mavenCentral() - mavenLocal() - maven { - name = "android-sdk" - url = uri("https://maven.pkg.github.com/kkiapay/android-sdk") - credentials { - username = System.getenv('GITHUB_USER') //?: project.properties['GITHUB_USER'] - password = System.getenv('GITHUB_PERSONAL_ACCESS_TOKEN') //?: project.properties['GITHUB_PERSONAL_ACCESS_TOKEN'] - } - } } } diff --git a/deploy.gradle b/deploy.gradle index 74e65c0..f8baa60 100644 --- a/deploy.gradle +++ b/deploy.gradle @@ -1,9 +1,5 @@ -//apply plugin: 'com.jfrog.bintray' apply plugin: 'maven-publish' -//def githubProperties = new Properties() -//githubProperties.load(new FileInputStream(rootProject.file("local.properties"))) - publishing { repositories { maven { @@ -38,28 +34,3 @@ publishing { } } } - -/* -bintray { - // Get Bintray credential from environment variable - user = System.getenv('BINTRAY_USER') // Get bintray User - key = System.getenv('BINTRAY_API_KEY') // Get bintray Secret API Key - dryRun = false - override = false - publish = true - pkg { - repo = 'KKIAPAY-ANDROID-SDK' // Bintray repo name - name = 'android-sdk' // library module name - userOrg = 'kkiapay' // Bintray user name - licenses = ['MIT'] - desc = 'Android SDK for kkiapay API' - websiteUrl = 'https://kkiapay.me' - vcsUrl = 'https://github.com/kkiapay/android-sdk' // repo url - - version { - name = VERSION_NAME //Bintray logical version name - vcsTag = VERSION_NAME - } - } - publications = ['Production'] -}*/ diff --git a/gradle.properties b/gradle.properties index 5ebeac5..0c37b76 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=1.2.16 -VERSION_CODE=43 +VERSION_NAME=1.2.17 +VERSION_CODE=44 org.gradle.jvmargs=-Xmx1536m android.useAndroidX=true android.enableJetifier=true diff --git a/lib/src/main/java/co/opensi/kkiapay/uikit/CustomTabActivity.kt b/lib/src/main/java/co/opensi/kkiapay/uikit/CustomTabActivity.kt index 6915467..d943261 100644 --- a/lib/src/main/java/co/opensi/kkiapay/uikit/CustomTabActivity.kt +++ b/lib/src/main/java/co/opensi/kkiapay/uikit/CustomTabActivity.kt @@ -33,12 +33,11 @@ internal class CustomTabActivity: Activity() { setContentView(R.layout.custom_tab_activity) kkiapay_web_view.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null) - kkiapay_web_view.setBackgroundColor(0x3EFFFFFF.toInt()) intent?.run { val url = getStringExtra(EXTRA_URL) - var theme = getIntExtra(EXTRA_THEME,R.color.pink ) + val theme = getIntExtra(EXTRA_THEME,R.color.pink ) tintIndeterminateProgress(progressbar, ContextCompat.getColor(applicationContext,theme)) kkiapay_web_view.run { settings.run { @@ -49,6 +48,7 @@ internal class CustomTabActivity: Activity() { layoutAlgorithm = WebSettings.LayoutAlgorithm.SINGLE_COLUMN scrollBarStyle = WebView.SCROLLBARS_OUTSIDE_OVERLAY } + webViewClient = object : WebViewClient(){ override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean { @@ -104,7 +104,6 @@ internal class CustomTabActivity: Activity() { } private fun shouldInterceptRequest(url: String){ - Log.i("CustomTabActivity", "shouldInterceptRequest") if (url.startsWith(Me.KKIAPAY_REDIRECT_URL)) { val transactionId = url.split("=")[1].trim() setResult(Activity.RESULT_OK, Intent().apply { diff --git a/lib/src/main/res/layout/custom_tab_activity.xml b/lib/src/main/res/layout/custom_tab_activity.xml index 81d6571..3e9e0e2 100644 --- a/lib/src/main/res/layout/custom_tab_activity.xml +++ b/lib/src/main/res/layout/custom_tab_activity.xml @@ -2,23 +2,25 @@ + android:background="@android:color/transparent"> - + android:paddingBottom="@dimen/activity_vertical_margin" />