diff --git a/LICENSE b/LICENSE index b4d32f9..43b97f9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 AGORISE, LTD. +Copyright (c) 2018 AGORISE, LTD. An International Business Company, Cyprus Reg# ΗΕ375959 Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/app/build.gradle b/app/build.gradle index 812d19b..f2aeceb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 - buildToolsVersion '26.0.2' + compileSdkVersion 27 defaultConfig { applicationId "cy.agorise.crystalwallet" - minSdkVersion 19 - targetSdkVersion 26 - versionCode 1 - versionName "1.0" + minSdkVersion 21 + targetSdkVersion 27 + versionCode 2 + versionName "0.2t.alpha" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" javaCompileOptions { annotationProcessorOptions { @@ -26,47 +25,62 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + + productFlavors { + } + + lintOptions { + disable 'MissingTranslation','ExtraTranslation' + checkReleaseBuilds false + abortOnError false + } + + android.packagingOptions { + exclude 'lib/x86_64/darwin/libscrypt.dylib' + exclude 'lib/x86_64/freebsd/libscrypt.so' + exclude 'lib/x86_64/linux/libscrypt.so' + } } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) + implementation fileTree(dir: 'libs', include: ['*.jar']) //androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { - androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', { + androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', { exclude group: 'com.android.support', module: 'support-annotations' }) //testCompile 'com.android.support.test:runner:1.0.1' - compile 'com.android.support:appcompat-v7:26.1.0' - compile 'com.android.support:support-v4:26.1.0' - compile 'com.android.support:design:26.1.0' - compile 'com.android.support.constraint:constraint-layout:1.0.2' - compile 'android.arch.lifecycle:runtime:1.0.3' - compile 'android.arch.lifecycle:extensions:1.0.0' - compile 'android.arch.persistence.room:runtime:1.0.0' - compile 'android.arch.paging:runtime:1.0.0-alpha3' - compile 'com.idescout.sql:sqlscout-server:2.0' - compile 'com.google.code.gson:gson:2.8.0' - compile 'com.squareup.retrofit2:retrofit:2.2.0' - compile 'com.squareup.retrofit2:converter-gson:2.1.0' - compile 'org.bitcoinj:bitcoinj-core:0.14.3' - compile 'com.neovisionaries:nv-websocket-client:1.30' - compile 'org.tukaani:xz:1.6' - compile 'com.jakewharton:butterknife:8.8.1' - compile 'com.github.bilthon:graphenej:0.4.6' - compile 'com.google.zxing:core:3.3.1' - compile 'me.dm7.barcodescanner:zxing:1.9.8' + implementation 'com.android.support:appcompat-v7:27.1.1' + implementation 'com.android.support:support-v4:27.1.1' + implementation 'com.android.support:design:27.1.1' + implementation 'com.android.support.constraint:constraint-layout:1.1.1' + implementation 'android.arch.lifecycle:runtime:1.1.1' + implementation 'android.arch.lifecycle:extensions:1.1.1' + implementation 'android.arch.persistence.room:runtime:1.1.0' + implementation 'android.arch.paging:runtime:1.0.0' + implementation 'com.idescout.sql:sqlscout-server:2.0' + implementation 'com.google.code.gson:gson:2.8.0' + implementation 'com.squareup.retrofit2:retrofit:2.2.0' + implementation 'com.squareup.retrofit2:converter-gson:2.1.0' + implementation 'org.bitcoinj:bitcoinj-core:0.14.3' + implementation 'com.neovisionaries:nv-websocket-client:1.30' + implementation 'org.tukaani:xz:1.6' + implementation 'com.jakewharton:butterknife:8.8.1' + implementation 'com.github.bilthon:graphenej:0.4.6' + implementation 'com.google.zxing:core:3.3.1' + implementation 'me.dm7.barcodescanner:zxing:1.9.8' - compile 'com.squareup.okhttp3:logging-interceptor:3.5.0' - compile 'de.hdodenhof:circleimageview:2.2.0' + implementation 'com.squareup.okhttp3:logging-interceptor:3.5.0' + implementation 'de.hdodenhof:circleimageview:2.2.0' // TODO check x86_64 //testCompile 'junit:junit: 4.12' - testCompile 'org.mockito:mockito-core:1.10.19' - annotationProcessor 'android.arch.lifecycle:compiler:1.0.0' - annotationProcessor 'android.arch.persistence.room:compiler:1.0.0' + testImplementation 'org.mockito:mockito-core:1.10.19' + annotationProcessor 'android.arch.lifecycle:compiler:1.1.1' + annotationProcessor 'android.arch.persistence.room:compiler:1.1.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' - compile 'com.squareup.picasso:picasso:2.5.2' + implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.github.esafirm.android-image-picker:imagepicker:1.11.1' - compile 'id.zelory:compressor:2.1.0' - compile 'com.vincent.filepicker:MultiTypeFilePicker:1.0.7' - compile 'com.andrognito.patternlockview:patternlockview:1.0.0' + implementation 'id.zelory:compressor:2.1.0' + implementation 'com.vincent.filepicker:MultiTypeFilePicker:1.0.7' + implementation 'com.andrognito.patternlockview:patternlockview:1.0.0' } diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png index 435710e..e13b27c 100644 Binary files a/app/src/main/ic_launcher-web.png and b/app/src/main/ic_launcher-web.png differ diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateContactActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateContactActivity.java index 8db5e8d..0791d40 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateContactActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateContactActivity.java @@ -97,7 +97,7 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida @Override public void onChanged(@Nullable List contactAddresses) { contactAddressList = contactAddresses; - listAdapter.setList(contactAddressList); + listAdapter.submitList(contactAddressList); listAdapter.notifyDataSetChanged(); } }); @@ -113,7 +113,7 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida }); } else { contactAddressList = new ArrayList(); - listAdapter.setList(contactAddressList); + listAdapter.submitList(contactAddressList); createContactValidator = new CreateContactValidator(this.getApplicationContext(),etName,etEmail); createContactValidator.setListener(this); diff --git a/app/src/main/java/cy/agorise/crystalwallet/dao/ContactDao.java b/app/src/main/java/cy/agorise/crystalwallet/dao/ContactDao.java index 97d1e51..48726d6 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/dao/ContactDao.java +++ b/app/src/main/java/cy/agorise/crystalwallet/dao/ContactDao.java @@ -1,6 +1,7 @@ package cy.agorise.crystalwallet.dao; import android.arch.lifecycle.LiveData; +import android.arch.paging.DataSource; import android.arch.paging.LivePagedListProvider; import android.arch.persistence.room.Dao; import android.arch.persistence.room.Delete; @@ -25,10 +26,10 @@ public interface ContactDao { LiveData> getAll(); @Query("SELECT * FROM contact ORDER BY name ASC") - LivePagedListProvider contactsByName(); + DataSource.Factory contactsByName(); @Query("SELECT c.* FROM contact c WHERE c.id IN (SELECT DISTINCT(ca.contact_id) FROM contact_address ca WHERE ca.crypto_net == :cryptoNet) ORDER BY name ASC, email ASC") - LivePagedListProvider contactsByNameAndCryptoNet(String cryptoNet); + DataSource.Factory contactsByNameAndCryptoNet(String cryptoNet); @Query("SELECT * FROM contact WHERE id = :id") LiveData getById(long id); diff --git a/app/src/main/java/cy/agorise/crystalwallet/dao/TransactionDao.java b/app/src/main/java/cy/agorise/crystalwallet/dao/TransactionDao.java index ce435fc..bcdca57 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/dao/TransactionDao.java +++ b/app/src/main/java/cy/agorise/crystalwallet/dao/TransactionDao.java @@ -1,6 +1,7 @@ package cy.agorise.crystalwallet.dao; import android.arch.lifecycle.LiveData; +import android.arch.paging.DataSource; import android.arch.paging.LivePagedListProvider; import android.arch.persistence.room.Dao; import android.arch.persistence.room.Insert; @@ -28,19 +29,19 @@ public interface TransactionDao { LiveData> getAll(); @Query(transactionsQuery + " ORDER BY date DESC") - LivePagedListProvider transactionsByDate(String search); + DataSource.Factory transactionsByDate(String search); @Query(transactionsQuery + " ORDER BY amount DESC") - LivePagedListProvider transactionsByAmount(String search); + DataSource.Factory transactionsByAmount(String search); @Query(transactionsQuery + " ORDER BY is_input DESC") - LivePagedListProvider transactionsByIsInput(String search); + DataSource.Factory transactionsByIsInput(String search); @Query(transactionsQuery + " ORDER BY `from` DESC") - LivePagedListProvider transactionsByFrom(String search); + DataSource.Factory transactionsByFrom(String search); @Query(transactionsQuery + " ORDER BY `to` DESC") - LivePagedListProvider transactionsByTo(String search); + DataSource.Factory transactionsByTo(String search); @Query("SELECT * FROM crypto_coin_transaction WHERE account_id = :idAccount ORDER BY date DESC") LiveData> getByIdAccountLiveData(long idAccount); diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/ContactSelectionFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/ContactSelectionFragment.java index 5f6f483..d3763ad 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/ContactSelectionFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/ContactSelectionFragment.java @@ -77,7 +77,7 @@ public class ContactSelectionFragment extends DialogFragment implements ContactS contactsLiveData.observe(this, new Observer>() { @Override public void onChanged(@Nullable PagedList contacts) { - contactSelectionListAdapter.setList(contacts); + contactSelectionListAdapter.submitList(contacts); } }); } diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/AccountSeed.java b/app/src/main/java/cy/agorise/crystalwallet/models/AccountSeed.java index 59d0b30..9485654 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/AccountSeed.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/AccountSeed.java @@ -7,7 +7,7 @@ import android.arch.persistence.room.Entity; import android.arch.persistence.room.PrimaryKey; import android.content.Context; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; import org.bitcoinj.core.ECKey; import org.bitcoinj.crypto.HDKeyDerivation; @@ -86,7 +86,7 @@ public class AccountSeed { this.type = type; } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull AccountSeed oldAccountSeed, @NonNull AccountSeed newAccountSeed) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/Contact.java b/app/src/main/java/cy/agorise/crystalwallet/models/Contact.java index be43fb9..0bc16a6 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/Contact.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/Contact.java @@ -8,7 +8,7 @@ import android.arch.persistence.room.Ignore; import android.arch.persistence.room.Index; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; import java.util.ArrayList; import java.util.List; @@ -110,7 +110,7 @@ public class Contact { return null; } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull Contact oldContact, @NonNull Contact newContact) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/ContactAddress.java b/app/src/main/java/cy/agorise/crystalwallet/models/ContactAddress.java index 85d9930..83d1f2d 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/ContactAddress.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/ContactAddress.java @@ -6,7 +6,7 @@ import android.arch.persistence.room.Entity; import android.arch.persistence.room.Index; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; import cy.agorise.crystalwallet.enums.CryptoNet; @@ -72,7 +72,7 @@ public class ContactAddress { this.mAddress = address; } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull ContactAddress oldContactAddress, @NonNull ContactAddress newContactAddress) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinBalance.java b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinBalance.java index 10a868b..025e6df 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinBalance.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinBalance.java @@ -7,7 +7,7 @@ import android.arch.persistence.room.ForeignKey; import android.arch.persistence.room.Index; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; import cy.agorise.crystalwallet.enums.CryptoCoin; @@ -72,7 +72,7 @@ public class CryptoCoinBalance { this.mBalance = balance; } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull CryptoCoinBalance oldBalance, @NonNull CryptoCoinBalance newBalance) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinTransaction.java b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinTransaction.java index d2e9756..7ac7236 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinTransaction.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinTransaction.java @@ -7,7 +7,7 @@ import android.arch.persistence.room.Ignore; import android.arch.persistence.room.Index; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; import java.util.Date; @@ -157,7 +157,7 @@ public class CryptoCoinTransaction { public void setIdCurrency(int idCurrency) { this.idCurrency = idCurrency; } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull CryptoCoinTransaction oldTransaction, @NonNull CryptoCoinTransaction newTransaction) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinTransactionExtended.java b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinTransactionExtended.java index d41a55e..00ae487 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinTransactionExtended.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCoinTransactionExtended.java @@ -8,7 +8,7 @@ import android.arch.persistence.room.Ignore; import android.arch.persistence.room.Index; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; import java.util.Date; @@ -67,7 +67,7 @@ public class CryptoCoinTransactionExtended { public int getIdCurrency() { return this.cryptoCoinTransaction.getIdCurrency(); } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull CryptoCoinTransactionExtended oldTransaction, @NonNull CryptoCoinTransactionExtended newTransaction) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoNetAccount.java b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoNetAccount.java index beea120..1b3bd0c 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoNetAccount.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoNetAccount.java @@ -8,7 +8,8 @@ import android.arch.persistence.room.Ignore; import android.arch.persistence.room.Index; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; + import cy.agorise.crystalwallet.enums.CryptoNet; @@ -111,7 +112,7 @@ public class CryptoNetAccount { return this.getName(); } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull CryptoNetAccount oldAccount, @NonNull CryptoNetAccount newAccount) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoNetBalance.java b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoNetBalance.java index 9e4cb02..d90d6be 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/CryptoNetBalance.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/CryptoNetBalance.java @@ -8,7 +8,8 @@ import android.arch.persistence.room.Ignore; import android.arch.persistence.room.Index; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; + import cy.agorise.crystalwallet.enums.CryptoCoin; import cy.agorise.crystalwallet.enums.CryptoNet; @@ -52,7 +53,7 @@ public class CryptoNetBalance { this.mCryptoNet = cryptoNet; } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull CryptoNetBalance oldBalance, @NonNull CryptoNetBalance newBalance) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/GeneralSetting.java b/app/src/main/java/cy/agorise/crystalwallet/models/GeneralSetting.java index 5410cbb..33e4b8e 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/GeneralSetting.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/GeneralSetting.java @@ -5,7 +5,7 @@ import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.Entity; import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -import android.support.v7.recyclerview.extensions.DiffCallback; +import android.support.v7.util.DiffUtil; import cy.agorise.crystalwallet.enums.SeedType; @@ -67,7 +67,7 @@ public class GeneralSetting { this.mValue = mValue; } - public static final DiffCallback DIFF_CALLBACK = new DiffCallback() { + public static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { @Override public boolean areItemsTheSame( @NonNull GeneralSetting oldSetting, @NonNull GeneralSetting newSetting) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/viewmodels/ContactListViewModel.java b/app/src/main/java/cy/agorise/crystalwallet/viewmodels/ContactListViewModel.java index 8a3258b..51c3836 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/viewmodels/ContactListViewModel.java +++ b/app/src/main/java/cy/agorise/crystalwallet/viewmodels/ContactListViewModel.java @@ -3,6 +3,7 @@ package cy.agorise.crystalwallet.viewmodels; import android.app.Application; import android.arch.lifecycle.AndroidViewModel; import android.arch.lifecycle.LiveData; +import android.arch.paging.LivePagedListBuilder; import android.arch.paging.PagedList; import cy.agorise.crystalwallet.dao.CrystalDatabase; @@ -22,33 +23,33 @@ public class ContactListViewModel extends AndroidViewModel { public ContactListViewModel(Application application) { super(application); this.db = CrystalDatabase.getAppDatabase(application.getApplicationContext()); - contactList = this.db.contactDao().contactsByName().create(0, + contactList = new LivePagedListBuilder(this.db.contactDao().contactsByName(), new PagedList.Config.Builder() .setEnablePlaceholders(true) .setPageSize(10) .setPrefetchDistance(10) .build() - ); + ).build(); } public void init(){ - contactList = this.db.contactDao().contactsByName().create(0, + contactList = new LivePagedListBuilder(this.db.contactDao().contactsByName(), new PagedList.Config.Builder() .setEnablePlaceholders(true) .setPageSize(10) .setPrefetchDistance(10) .build() - ); + ).build(); } public void init(CryptoNet cryptoNet){ - contactList = this.db.contactDao().contactsByNameAndCryptoNet(cryptoNet.name()).create(0, + contactList = new LivePagedListBuilder(this.db.contactDao().contactsByNameAndCryptoNet(cryptoNet.name()), new PagedList.Config.Builder() .setEnablePlaceholders(true) .setPageSize(10) .setPrefetchDistance(10) .build() - ); + ).build(); } public LiveData> getContactList(){ diff --git a/app/src/main/java/cy/agorise/crystalwallet/viewmodels/TransactionListViewModel.java b/app/src/main/java/cy/agorise/crystalwallet/viewmodels/TransactionListViewModel.java index 4ea9600..95fc64a 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/viewmodels/TransactionListViewModel.java +++ b/app/src/main/java/cy/agorise/crystalwallet/viewmodels/TransactionListViewModel.java @@ -4,6 +4,8 @@ import android.app.Application; import android.arch.lifecycle.AndroidViewModel; import android.arch.lifecycle.LiveData; import android.arch.lifecycle.ViewModel; +import android.arch.paging.DataSource; +import android.arch.paging.LivePagedListBuilder; import android.arch.paging.LivePagedListProvider; import android.arch.paging.PagedList; import android.content.Context; @@ -37,35 +39,35 @@ public class TransactionListViewModel extends AndroidViewModel { } public void initTransactionList(String orderField, String search){ - LivePagedListProvider livePagedListProvider = null; + DataSource.Factory dataSource = null; switch (orderField){ case "date": - livePagedListProvider = this.db.transactionDao().transactionsByDate(search); + dataSource = this.db.transactionDao().transactionsByDate(search); break; case "amount": - livePagedListProvider = this.db.transactionDao().transactionsByAmount(search); + dataSource = this.db.transactionDao().transactionsByAmount(search); break; case "is_input": - livePagedListProvider = this.db.transactionDao().transactionsByIsInput(search); + dataSource = this.db.transactionDao().transactionsByIsInput(search); break; case "from": - livePagedListProvider = this.db.transactionDao().transactionsByFrom(search); + dataSource = this.db.transactionDao().transactionsByFrom(search); break; case "to": - livePagedListProvider = this.db.transactionDao().transactionsByTo(search); + dataSource = this.db.transactionDao().transactionsByTo(search); break; default: - livePagedListProvider = this.db.transactionDao().transactionsByDate(search); + dataSource = this.db.transactionDao().transactionsByDate(search); } - if (livePagedListProvider != null) { - this.transactionList = livePagedListProvider.create(0, + if (dataSource != null) { + this.transactionList = new LivePagedListBuilder(dataSource, new PagedList.Config.Builder() .setEnablePlaceholders(true) .setPageSize(10) .setPrefetchDistance(10) .build() - ); + ).build(); } else { this.transactionList = null; } diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/AccountSeedListView.java b/app/src/main/java/cy/agorise/crystalwallet/views/AccountSeedListView.java index 2e8ea55..4cbf669 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/AccountSeedListView.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/AccountSeedListView.java @@ -65,7 +65,7 @@ public class AccountSeedListView extends RelativeLayout { } if (data != null) { - this.listAdapter.setList(data); + this.listAdapter.submitList(data); } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/ContactListView.java b/app/src/main/java/cy/agorise/crystalwallet/views/ContactListView.java index 854be6b..bfa7c6e 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/ContactListView.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/ContactListView.java @@ -103,7 +103,7 @@ public class ContactListView extends RelativeLayout { //Sets the data of the transaction list if (data != null) { - this.listAdapter.setList(data); + this.listAdapter.submitList(data); } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoCoinBalanceListView.java b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoCoinBalanceListView.java index df4958f..f087fc5 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoCoinBalanceListView.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoCoinBalanceListView.java @@ -93,7 +93,7 @@ public class CryptoCoinBalanceListView extends RelativeLayout { //sets the data of the list adapter if (data != null) { this.listAdapter.setCryptoNetBalanceViewHolder(cryptoNetBalanceViewHolder); - this.listAdapter.setList(data); + this.listAdapter.submitList(data); } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetAccountListView.java b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetAccountListView.java index 4a57e9f..3e61f08 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetAccountListView.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetAccountListView.java @@ -64,7 +64,7 @@ public class CryptoNetAccountListView extends RelativeLayout { } if (data != null) { - this.listAdapter.setList(data); + this.listAdapter.submitList(data); } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceListView.java b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceListView.java index be10ebb..f876a16 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceListView.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceListView.java @@ -99,7 +99,7 @@ public class CryptoNetBalanceListView extends RelativeLayout { //sets the data of the list adapter if (data != null) { - this.listAdapter.setList(data); + this.listAdapter.submitList(data); } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/TransactionListView.java b/app/src/main/java/cy/agorise/crystalwallet/views/TransactionListView.java index 4d2ab0f..f021fe6 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/TransactionListView.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/TransactionListView.java @@ -120,7 +120,7 @@ public class TransactionListView extends RelativeLayout { //Sets the data of the transaction list if (data != null) { - this.listAdapter.setList(data); + this.listAdapter.submitList(data); } } diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index ab7fb25..65293aa 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png index 19060e6..078ae58 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index 6702852..838afce 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index 5429e53..990c8f1 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png index 5d5a41d..1039e24 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index 08e024a..dabe340 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 0edd510..aed84cc 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png index 1db7d1f..2bfd5c7 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 7b17394..c8cf845 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index cd396ff..83de844 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png index 93668c1..42a16a3 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index 79473fa..e75c0fd 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index b7490d1..09d0fe5 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png index c41a6d3..8ce490e 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index edc19c1..44606ef 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index a0e81d7..38af09f 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -44,4 +44,6 @@ #FF9269 #52CE84 #4EBB7F + + diff --git a/build.gradle b/build.gradle index 1062dac..217e861 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa80552..8163bd9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Nov 13 18:37:27 VET 2017 +#Thu Jun 07 09:09:01 CDT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip