Update a bunch of libraries.
- Updated a bunch of libraries, fixed a couple of issues, and tested everything else worked correctly. - Updated both compileSdkVersion and targetSdkVersion to 29 (Android 10).
This commit is contained in:
parent
97e7167e17
commit
f6d00053db
7 changed files with 36 additions and 26 deletions
|
@ -12,11 +12,11 @@ androidExtensions {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 29
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "cy.agorise.bitsybitshareswallet"
|
applicationId "cy.agorise.bitsybitshareswallet"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 29
|
||||||
versionCode 9
|
versionCode 9
|
||||||
versionName "0.13.1-beta"
|
versionName "0.13.1-beta"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
@ -55,6 +55,9 @@ android {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "1.8"
|
||||||
|
}
|
||||||
// Gradle automatically adds 'android.test.runner' as a dependency.
|
// Gradle automatically adds 'android.test.runner' as a dependency.
|
||||||
useLibrary 'android.test.runner'
|
useLibrary 'android.test.runner'
|
||||||
useLibrary 'android.test.base'
|
useLibrary 'android.test.base'
|
||||||
|
@ -65,16 +68,16 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
def lifecycle_version = "2.1.0"
|
def lifecycle_version = "2.1.0"
|
||||||
def room_version = "2.1.0"
|
def room_version = "2.1.0"
|
||||||
def rx_bindings_version = "3.0.0-alpha2"
|
def rx_bindings_version = '3.0.0'
|
||||||
|
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation project(':graphenejlib:graphenej')
|
implementation project(':graphenejlib:graphenej')
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
// AndroidX
|
// AndroidX
|
||||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
|
||||||
// Google
|
// Google
|
||||||
implementation 'com.google.zxing:core:3.3.3'
|
implementation 'com.google.zxing:core:3.4.0'
|
||||||
implementation 'com.google.code.gson:gson:2.8.5'
|
implementation 'com.google.code.gson:gson:2.8.5'
|
||||||
implementation 'com.google.android.material:material:1.1.0-alpha04'
|
implementation 'com.google.android.material:material:1.1.0-alpha04'
|
||||||
implementation 'com.google.android.gms:play-services-maps:17.0.0'
|
implementation 'com.google.android.gms:play-services-maps:17.0.0'
|
||||||
|
@ -99,13 +102,13 @@ dependencies {
|
||||||
implementation "com.jakewharton.rxbinding3:rxbinding-material:$rx_bindings_version" // Material Components widgets
|
implementation "com.jakewharton.rxbinding3:rxbinding-material:$rx_bindings_version" // Material Components widgets
|
||||||
implementation "com.jakewharton.rxbinding3:rxbinding-appcompat:$rx_bindings_version" // AndroidX appcompat widgets
|
implementation "com.jakewharton.rxbinding3:rxbinding-appcompat:$rx_bindings_version" // AndroidX appcompat widgets
|
||||||
// Retrofit & OkHttp
|
// Retrofit & OkHttp
|
||||||
implementation 'com.squareup.okhttp3:okhttp:3.12.2'
|
implementation 'com.squareup.okhttp3:okhttp:4.2.0'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.2'
|
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.0'
|
||||||
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
|
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
|
||||||
//Firebase
|
//Firebase
|
||||||
implementation 'com.google.firebase:firebase-core:17.1.0'
|
implementation 'com.google.firebase:firebase-core:17.2.0'
|
||||||
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
|
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
|
||||||
// PDF and CSV generation
|
// PDF and CSV generation
|
||||||
implementation 'com.itextpdf:itextpdf:5.5.13'
|
implementation 'com.itextpdf:itextpdf:5.5.13'
|
||||||
|
|
|
@ -275,10 +275,10 @@ class CreateAccountFragment : BaseAccountFragment() {
|
||||||
val sg = ServiceGenerator(Constants.FAUCET_URL)
|
val sg = ServiceGenerator(Constants.FAUCET_URL)
|
||||||
val faucetService = sg.getService(FaucetService::class.java)
|
val faucetService = sg.getService(FaucetService::class.java)
|
||||||
|
|
||||||
val call = faucetService.registerPrivateAccount(faucetRequest)
|
val call = faucetService?.registerPrivateAccount(faucetRequest)
|
||||||
|
|
||||||
// Execute the call asynchronously. Get a positive or negative callback.
|
// Execute the call asynchronously. Get a positive or negative callback.
|
||||||
call.enqueue(object : Callback<FaucetResponse> {
|
call?.enqueue(object : Callback<FaucetResponse> {
|
||||||
override fun onResponse(call: Call<FaucetResponse>, response: Response<FaucetResponse>) {
|
override fun onResponse(call: Call<FaucetResponse>, response: Response<FaucetResponse>) {
|
||||||
// The network call was a success and we got a response, obtain the info of the newly created account
|
// The network call was a success and we got a response, obtain the info of the newly created account
|
||||||
// with a delay to let the nodes update their information
|
// with a delay to let the nodes update their information
|
||||||
|
|
|
@ -21,7 +21,11 @@ class ServiceGenerator private constructor(apiBaseUrl: String, gson: Gson) {
|
||||||
private val services = HashMap<Class<*>, Any>()
|
private val services = HashMap<Class<*>, Any>()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val logging = HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
|
val httpLoggingInterceptor = HttpLoggingInterceptor()
|
||||||
|
val logging =
|
||||||
|
httpLoggingInterceptor.apply {
|
||||||
|
httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
|
||||||
|
}
|
||||||
httpClient = OkHttpClient.Builder().addInterceptor(logging)
|
httpClient = OkHttpClient.Builder().addInterceptor(logging)
|
||||||
builder = Retrofit.Builder()
|
builder = Retrofit.Builder()
|
||||||
.baseUrl(apiBaseUrl)
|
.baseUrl(apiBaseUrl)
|
||||||
|
@ -31,7 +35,7 @@ class ServiceGenerator private constructor(apiBaseUrl: String, gson: Gson) {
|
||||||
|
|
||||||
constructor(apiBaseUrl: String) : this(apiBaseUrl, Gson())
|
constructor(apiBaseUrl: String) : this(apiBaseUrl, Gson())
|
||||||
|
|
||||||
fun <T> getService(serviceClass: Class<T>): T {
|
fun <T> getService(serviceClass: Class<T>): T? {
|
||||||
|
|
||||||
var service = serviceClass.cast(services[serviceClass])
|
var service = serviceClass.cast(services[serviceClass])
|
||||||
if (service == null) {
|
if (service == null) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ class NodeRepository(private val nodeDao: NodeDao) {
|
||||||
"wss://api.bts.ai")
|
"wss://api.bts.ai")
|
||||||
}
|
}
|
||||||
|
|
||||||
private val mBitsyWebservice: BitsyWebservice
|
private val mBitsyWebservice: BitsyWebservice?
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val sg = ServiceGenerator(Constants.BITSY_WEBSERVICE_URL)
|
val sg = ServiceGenerator(Constants.BITSY_WEBSERVICE_URL)
|
||||||
|
@ -86,10 +86,10 @@ class NodeRepository(private val nodeDao: NodeDao) {
|
||||||
val updatePeriod = Constants.NODES_UPDATE_PERIOD
|
val updatePeriod = Constants.NODES_UPDATE_PERIOD
|
||||||
// Verify if nodes list should be updated
|
// Verify if nodes list should be updated
|
||||||
if (now - updatePeriod > lastUpdate) {
|
if (now - updatePeriod > lastUpdate) {
|
||||||
val response = mBitsyWebservice.getNodes()
|
val response = mBitsyWebservice?.getNodes()
|
||||||
try {
|
try {
|
||||||
// Update the list of nodes only if we got at least MIN_NODES_SIZE nodes
|
// Update the list of nodes only if we got at least MIN_NODES_SIZE nodes
|
||||||
if (response.isSuccessful && (response.body()?.size ?: 0) >= MIN_NODES_SIZE) {
|
if (response?.isSuccessful == true && (response.body()?.size ?: 0) >= MIN_NODES_SIZE) {
|
||||||
val nodesWS = response.body() ?: return
|
val nodesWS = response.body() ?: return
|
||||||
|
|
||||||
val nodesDB = nodesWS.map {
|
val nodesDB = nodesWS.map {
|
||||||
|
|
|
@ -19,7 +19,10 @@ import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class TransferRepository internal constructor(context: Context) {
|
class TransferRepository internal constructor(context: Context) {
|
||||||
private val TAG = "TransferRepository"
|
companion object {
|
||||||
|
private const val TAG = "TransferRepository"
|
||||||
|
}
|
||||||
|
|
||||||
private val mTransferDao: TransferDao
|
private val mTransferDao: TransferDao
|
||||||
private val mEquivalentValuesDao: EquivalentValueDao
|
private val mEquivalentValuesDao: EquivalentValueDao
|
||||||
private val compositeDisposable = CompositeDisposable()
|
private val compositeDisposable = CompositeDisposable()
|
||||||
|
@ -103,10 +106,10 @@ class TransferRepository internal constructor(context: Context) {
|
||||||
val dateFormat = SimpleDateFormat("dd-MM-yyyy", Locale.ROOT)
|
val dateFormat = SimpleDateFormat("dd-MM-yyyy", Locale.ROOT)
|
||||||
val date = Date(transfer.timestamp * 1000)
|
val date = Date(transfer.timestamp * 1000)
|
||||||
val response = sg.getService(CoingeckoService::class.java)
|
val response = sg.getService(CoingeckoService::class.java)
|
||||||
.getHistoricalValueSync("bitshares", dateFormat.format(date), false)
|
?.getHistoricalValueSync("bitshares", dateFormat.format(date), false)
|
||||||
.execute()
|
?.execute()
|
||||||
var equivalentFiatValue = -1L
|
var equivalentFiatValue = -1L
|
||||||
if(response.isSuccessful){
|
if(response?.isSuccessful == true){
|
||||||
val price: Double = response.body()?.market_data?.current_price?.get(symbol) ?: -1.0
|
val price: Double = response.body()?.market_data?.current_price?.get(symbol) ?: -1.0
|
||||||
// The equivalent value is obtained by:
|
// The equivalent value is obtained by:
|
||||||
// 1- Dividing the base value by 100000 (BTS native precision)
|
// 1- Dividing the base value by 100000 (BTS native precision)
|
||||||
|
@ -114,7 +117,7 @@ class TransferRepository internal constructor(context: Context) {
|
||||||
// 3- Multiplying the resulting value by 100 in order to express it in cents
|
// 3- Multiplying the resulting value by 100 in order to express it in cents
|
||||||
equivalentFiatValue = Math.round(transfer.btsValue?.div(1e5)?.times(price)?.times(100) ?: -1.0)
|
equivalentFiatValue = Math.round(transfer.btsValue?.div(1e5)?.times(price)?.times(100) ?: -1.0)
|
||||||
}else{
|
}else{
|
||||||
Log.w(TAG,"Request was not successful. code: ${response.code()}")
|
Log.w(TAG,"Request was not successful. code: ${response?.code()}")
|
||||||
}
|
}
|
||||||
return EquivalentValue(transfer.id, equivalentFiatValue, symbol)
|
return EquivalentValue(transfer.id, equivalentFiatValue, symbol)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import cy.agorise.bitsybitshareswallet.utils.hideKeyboard
|
||||||
*/
|
*/
|
||||||
class MyTextInputEditText(context: Context?, attrs: AttributeSet?) : TextInputEditText(context, attrs){
|
class MyTextInputEditText(context: Context?, attrs: AttributeSet?) : TextInputEditText(context, attrs){
|
||||||
|
|
||||||
override fun onCreateInputConnection(outAttrs: EditorInfo): InputConnection {
|
override fun onCreateInputConnection(outAttrs: EditorInfo): InputConnection? {
|
||||||
val connection = super.onCreateInputConnection(outAttrs)
|
val connection = super.onCreateInputConnection(outAttrs)
|
||||||
val imeActions = outAttrs.imeOptions and EditorInfo.IME_MASK_ACTION
|
val imeActions = outAttrs.imeOptions and EditorInfo.IME_MASK_ACTION
|
||||||
if (imeActions and EditorInfo.IME_ACTION_DONE != 0) {
|
if (imeActions and EditorInfo.IME_ACTION_DONE != 0) {
|
||||||
|
|
|
@ -4,8 +4,8 @@ buildscript {
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.3.50'
|
kotlin_version = '1.3.50'
|
||||||
nav_version = '2.0.0'
|
nav_version = '2.1.0'
|
||||||
version_coroutine = "1.1.0"
|
version_coroutine = '1.3.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -20,7 +20,7 @@ buildscript {
|
||||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
|
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
|
||||||
classpath 'com.google.gms:google-services:4.3.0'
|
classpath 'com.google.gms:google-services:4.3.2'
|
||||||
classpath 'io.fabric.tools:gradle:1.29.0'
|
classpath 'io.fabric.tools:gradle:1.29.0'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
|
Loading…
Reference in a new issue