Skip to content

Commit

Permalink
create eos wallet screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Anschutz1927 committed Jul 31, 2018
1 parent 237d20b commit 6538699
Show file tree
Hide file tree
Showing 25 changed files with 1,288 additions and 13 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ dependencies {
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
implementation 'com.google.code.gson:gson:2.8.2'
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/io/multy/api/ApiServiceInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,7 @@ public interface ApiServiceInterface {

@GET("api/v1/wallets/verbose")
Call<TestWalletResponse> testWalletVerbose();

@POST("api/v1/account/price")
Call<ResponseBody> getAccountPrice(@Body Object body);
}
7 changes: 6 additions & 1 deletion app/src/main/java/io/multy/api/MultyApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,10 @@ public Call<ResponseBody> sendHdTransaction(HdTransactionRequestEntity transacti
public Call<TestWalletResponse> testWalletVerbose() {
return api.testWalletVerbose();
}
}

@Override
public Call<ResponseBody> getAccountPrice(Object body) {
return api.getAccountPrice(body);
}
};
}
1 change: 1 addition & 0 deletions app/src/main/java/io/multy/api/MultyApiInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ public interface MultyApiInterface {

Call<TestWalletResponse> testWalletVerbose();

Call<ResponseBody> getAccountPrice(Object body);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2018 Idealnaya rabota LLC
* Licensed under Multy.io license.
* See LICENSE for details
*/

package io.multy.model.entities;

import com.google.gson.annotations.SerializedName;

/**
* Created by [email protected] on 31.07.18.
*/
public class EosAccountPriceRequest {

@SerializedName("ram")
private int ram;
@SerializedName("cpu")
private double cpu;
@SerializedName("net")
private double net;

public EosAccountPriceRequest() { }

public EosAccountPriceRequest(int ram, double cpu, double net) {
this.ram = ram;
this.cpu = cpu;
this.net = net;
}

public int getRam() {
return ram;
}

public void setRam(int ram) {
this.ram = ram;
}

public double getCpu() {
return cpu;
}

public void setCpu(double cpu) {
this.cpu = cpu;
}

public double getNet() {
return net;
}

public void setNet(double net) {
this.net = net;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ public void onClickWarn() {
startActivity(new Intent(getActivity(), SeedActivity.class));
}

//todo need to move in a common activity
public static class SharingBroadcastReceiver extends BroadcastReceiver {

public SharingBroadcastReceiver() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,27 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,

View v = inflater.inflate(R.layout.view_assets_action_add, container, false);
ButterKnife.bind(this, v);
initialize();
subscribeToCurrencyUpdate();
Analytics.getInstance(getActivity()).logCreateWalletLaunch();
if (chainId == NativeDataHelper.Blockchain.EOS.getValue() && getFragmentManager() != null) {
getActivity().getIntent().putExtra(Constants.CHAIN_ID, chainId);
CreatePayableAssetFragment fragment = CreatePayableAssetFragment.getInstance();
getFragmentManager().beginTransaction()
.replace(R.id.container_main, fragment, CreatePayableAssetFragment.TAG)
.commit();
} else {
initialize();
subscribeToCurrencyUpdate();
Analytics.getInstance(getActivity()).logCreateWalletLaunch();

editTextWalletName.requestFocus();
editTextWalletName.postDelayed(() -> {
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isActive()) {
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
}
editTextWalletName.requestFocus();
editTextWalletName.postDelayed(() -> {
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isActive()) {
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
}

imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
}, 100);
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
}, 100);
}
return v;
}

Expand Down
Loading

0 comments on commit 6538699

Please sign in to comment.