- Now the import seed button sends the user to the import seed activity

- Fixed account seed kotlin viewmodel so it can be instantiated with the ViewModelProvider
This commit is contained in:
Javier Varona 2018-09-06 22:13:28 -04:00
parent e569986864
commit 4a34c3a8ae
3 changed files with 13 additions and 5 deletions

View file

@ -108,4 +108,6 @@ dependencies {
exclude group: 'org.json', module: 'json' exclude group: 'org.json', module: 'json'
} }
kapt "android.arch.lifecycle:compiler:1.1.1"
kapt "android.arch.persistence.room:compiler:1.1.0"
} }

View file

@ -22,6 +22,7 @@ import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.activities.ImportSeedActivity;
import cy.agorise.crystalwallet.activities.IntroActivity; import cy.agorise.crystalwallet.activities.IntroActivity;
import cy.agorise.crystalwallet.requestmanagers.FileServiceRequestListener; import cy.agorise.crystalwallet.requestmanagers.FileServiceRequestListener;
import cy.agorise.crystalwallet.requestmanagers.FileServiceRequests; import cy.agorise.crystalwallet.requestmanagers.FileServiceRequests;
@ -97,6 +98,12 @@ public class ImportAccountOptionsFragment extends DialogFragment {
} }
@OnClick (R.id.btnImportSeed)
public void importSeed(){
Intent intent = new Intent(this.getActivity(), ImportSeedActivity.class);
startActivity(intent);
}
@Override @Override
public void onActivityResult(int requestCode, int resultCode, final Intent data) { public void onActivityResult(int requestCode, int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);

View file

@ -6,15 +6,14 @@ import android.arch.lifecycle.LiveData
import cy.agorise.crystalwallet.dao.CrystalDatabase import cy.agorise.crystalwallet.dao.CrystalDatabase
import cy.agorise.crystalwallet.models.AccountSeed import cy.agorise.crystalwallet.models.AccountSeed
class AccountSeedViewModel : AndroidViewModel { class AccountSeedViewModel(application: Application) : AndroidViewModel(application) {
private var accountSeed: LiveData<AccountSeed>? = null private var accountSeed: LiveData<AccountSeed>? = null
private val db: CrystalDatabase private val db: CrystalDatabase
private val app: Application private val app: Application = application
constructor(application: Application,db:CrystalDatabase): super(application) { init{
this.app = application; this.db = CrystalDatabase.getAppDatabase(this.app.getApplicationContext());
this.db = db;
} }
fun loadSeed(seedId: Long) { fun loadSeed(seedId: Long) {