Skip to content
Permalink
Browse files

New activity in example

  • Loading branch information...
MolarMak committed Mar 25, 2019
1 parent 470825e commit e14b9e673ff22eb8513299ae6b3ab7d590c9e6b7
@@ -1,6 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>
@@ -24,7 +24,7 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.github.xcompanies:xBit-Android-SDK:1.0.3'
@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xbitcrypto.example">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:allowBackup="true"
@@ -11,14 +11,16 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:screenOrientation="portrait">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".PaymentActivity"
android:screenOrientation="portrait"/>
</application>

</manifest>
@@ -1,19 +1,17 @@
package com.xbitcrypto.example

import android.os.Bundle
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import com.xbitcrypto.sdk.PaymentFormCreator
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
PaymentFormCreator.runPaymentForm(
this,
"API KEY", //todo put your api key here
"API SECRET", //todo put your api secret here
1.0, // Amount of xBits to pay
"order ID", // Id of the order to pay for
"http://google.com") // Url of the service that will handle your payment
setContentView(R.layout.activity_main)
payButton.setOnClickListener {
startActivity(Intent(applicationContext, PaymentActivity::class.java))
}
}
}
@@ -0,0 +1,25 @@
package com.xbitcrypto.example

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.xbitcrypto.sdk.PaymentFormCreator

class PaymentActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
PaymentFormCreator.runPaymentForm(
this,
"API KEY", //todo put your api key here
"API SECRET", //todo put your api secret here
1.0, // Amount of xBits to pay
"order ID", // Id of the order to pay for
"http://google.com") // Url of the service that will handle your payment
}

override fun onSupportNavigateUp(): Boolean {
finish()
return true
}
}
@@ -1,7 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<Button
android:id="@+id/payButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Pay"/>

</LinearLayout>
</RelativeLayout>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#011F3E</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
</resources>
@@ -1,7 +1,7 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>

0 comments on commit e14b9e6

Please sign in to comment.
You can’t perform that action at this time.