Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API urls #629

Merged
merged 4 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
compileSdkVersion 29
namespace 'io.horizontalsystems.bitcoinkit.demo'
compileSdk 34

defaultConfig {
applicationId "io.horizontalsystems.bitcoinkit.demo"
minSdkVersion 23
targetSdkVersion 29
targetSdkVersion 34
versionCode 1
versionName "0.3.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -19,37 +22,37 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions { jvmTarget = '17' }
packagingOptions {
pickFirst("META-INF/atomicfu.kotlin_module")
resources {
pickFirsts += ['META-INF/atomicfu.kotlin_module']
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.10.0'

implementation 'io.reactivex.rxjava2:rxjava:2.2.19'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

// ViewModel and LiveData
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

// For debug
implementation 'com.facebook.stetho:stetho:1.5.1'

//LeakCanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'

testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation project(':bitcoinkit')
implementation project(':dashkit')
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.horizontalsystems.bitcoinkit.demo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

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

Expand All @@ -12,7 +11,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="io.horizontalsystems.bitcoinkit.demo.MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/io/horizontalsystems/bitcoinkit/demo/App.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package io.horizontalsystems.bitcoinkit.demo

import android.app.Application
import com.facebook.stetho.Stetho

class App : Application() {

override fun onCreate() {
super.onCreate()

// Enable debug bridge
Stetho.initializeWithDefaults(this)

instance = this
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.lifecycle.ViewModelProvider
import io.horizontalsystems.bitcoincore.BitcoinCore
import kotlinx.android.synthetic.main.fragment_balance.*
import java.text.SimpleDateFormat
import java.util.*

Expand All @@ -27,6 +26,7 @@ class BalanceFragment : Fragment() {
lateinit var startButton: Button
lateinit var clearButton: Button
lateinit var buttonDebug: Button
lateinit var buttonStatus: Button

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down Expand Up @@ -113,6 +113,7 @@ class BalanceFragment : Fragment() {
startButton = view.findViewById(R.id.buttonStart)
clearButton = view.findViewById(R.id.buttonClear)
buttonDebug = view.findViewById(R.id.buttonDebug)
buttonStatus = view.findViewById(R.id.buttonStatus)

startButton.setOnClickListener {
viewModel.start()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
package io.horizontalsystems.bitcoinkit.demo

import androidx.lifecycle.Observer
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.text.Editable
import android.text.SpannableStringBuilder
import android.text.TextWatcher
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.Button
import android.widget.EditText
import android.widget.RadioGroup
import android.widget.Spinner
import android.widget.TextView
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import io.horizontalsystems.bitcoincore.exceptions.AddressFormatException
import io.horizontalsystems.bitcoincore.managers.SendValueErrors
import io.horizontalsystems.hodler.LockTimeInterval
import kotlinx.android.synthetic.main.fragment_send_receive.*

class SendReceiveFragment : Fragment() {
private lateinit var viewModel: MainViewModel

lateinit var receiveAddressText: TextView
lateinit var receiveAddressButton: Button
lateinit var sendAmount: EditText
lateinit var sendAddress: EditText
lateinit var txFeeValue: TextView
lateinit var sendButton: Button
lateinit var maxButton: Button
lateinit var radioGroup: RadioGroup
lateinit var lockTimePeriodValue: Spinner

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_send_receive, container, false)
}
Expand Down Expand Up @@ -60,6 +71,16 @@ class SendReceiveFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

receiveAddressText = view.findViewById(R.id.receiveAddressText)
receiveAddressButton = view.findViewById(R.id.receiveAddressButton)
sendAmount = view.findViewById(R.id.sendAmount)
sendAddress = view.findViewById(R.id.sendAddress)
txFeeValue = view.findViewById(R.id.txFeeValue)
sendButton = view.findViewById(R.id.sendButton)
maxButton = view.findViewById(R.id.maxButton)
radioGroup = view.findViewById(R.id.radioGroup)
lockTimePeriodValue = view.findViewById(R.id.lockTimePeriodValue)

receiveAddressButton.setOnClickListener {
viewModel.onReceiveClick()
}
Expand All @@ -71,7 +92,7 @@ class SendReceiveFragment : Fragment() {
maxButton.setOnClickListener {


viewModel.onMaxClick()
viewModel.onMaxClick()

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import io.horizontalsystems.bitcoincore.models.TransactionOutputInfo
import io.horizontalsystems.dashkit.models.DashTransactionInfo
import io.horizontalsystems.hodler.HodlerOutputData
import io.horizontalsystems.hodler.HodlerPlugin
import kotlinx.android.synthetic.main.fragment_transactions.*
import java.text.DateFormat
import java.util.*

Expand All @@ -31,6 +30,8 @@ class TransactionsFragment : Fragment(), ViewHolderTransaction.Listener {
private lateinit var transactionsRecyclerView: RecyclerView
private val transactionsAdapter = TransactionsAdapter(this)

lateinit var tabs: TabLayout

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand Down Expand Up @@ -62,6 +63,8 @@ class TransactionsFragment : Fragment(), ViewHolderTransaction.Listener {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

tabs = view.findViewById(R.id.tabs)

transactionsRecyclerView = view.findViewById(R.id.transactions)
transactionsRecyclerView.adapter = transactionsAdapter
transactionsRecyclerView.layoutManager = LinearLayoutManager(context)
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/res/layout/fragment_balance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:padding="8dp">

<TextView
Expand Down Expand Up @@ -53,8 +54,7 @@
android:text="Balance Unspendable:"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/balanceTitle"
/>
app:layout_constraintTop_toBottomOf="@+id/balanceTitle" />

<TextView
android:id="@+id/balanceUnspendableValue"
Expand All @@ -64,8 +64,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintStart_toEndOf="@+id/balanceUnspendableTitle"
app:layout_constraintTop_toTopOf="@+id/balanceUnspendableTitle"
tools:text="100.0"
/>
tools:text="100.0" />

<TextView
android:id="@+id/stateTitle"
Expand Down
Loading
Loading