Skip to content

Commit

Permalink
Moving to jitpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Armel committed May 20, 2021
1 parent 28cfb0a commit 39699e0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 58 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<latestVersion>'
```
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:<latestVersion>'
```


## Usage
Expand Down
12 changes: 0 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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']
}
}
}
}

Expand Down
29 changes: 0 additions & 29 deletions deploy.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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']
}*/
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
14 changes: 8 additions & 6 deletions lib/src/main/res/layout/custom_tab_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:background="@android:color/transparent">

<WebView android:layout_width="match_parent"
android:layout_height="match_parent"
<WebView
android:id="@+id/kkiapay.web.view"
android:paddingBottom="@dimen/activity_vertical_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"/>
android:paddingBottom="@dimen/activity_vertical_margin" />

<ProgressBar
android:id="@+id/progressbar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:theme="@style/progressBarBlue"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:theme="@style/progressBarBlue"
android:visibility="visible" />

</RelativeLayout>
Expand Down

0 comments on commit 39699e0

Please sign in to comment.