Skip to content

Commit 6538699

Browse files
author
Anschutz1927
committed
create eos wallet screen
1 parent 237d20b commit 6538699

25 files changed

+1288
-13
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ dependencies {
9898
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
9999
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
100100
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
101+
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
101102
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
102103
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
103104
implementation 'com.google.code.gson:gson:2.8.2'

app/src/main/java/io/multy/api/ApiServiceInterface.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,7 @@ public interface ApiServiceInterface {
8484

8585
@GET("api/v1/wallets/verbose")
8686
Call<TestWalletResponse> testWalletVerbose();
87+
88+
@POST("api/v1/account/price")
89+
Call<ResponseBody> getAccountPrice(@Body Object body);
8790
}

app/src/main/java/io/multy/api/MultyApi.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,10 @@ public Call<ResponseBody> sendHdTransaction(HdTransactionRequestEntity transacti
178178
public Call<TestWalletResponse> testWalletVerbose() {
179179
return api.testWalletVerbose();
180180
}
181-
}
181+
182+
@Override
183+
public Call<ResponseBody> getAccountPrice(Object body) {
184+
return api.getAccountPrice(body);
185+
}
186+
};
182187
}

app/src/main/java/io/multy/api/MultyApiInterface.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ public interface MultyApiInterface {
6060

6161
Call<TestWalletResponse> testWalletVerbose();
6262

63+
Call<ResponseBody> getAccountPrice(Object body);
6364
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2018 Idealnaya rabota LLC
3+
* Licensed under Multy.io license.
4+
* See LICENSE for details
5+
*/
6+
7+
package io.multy.model.entities;
8+
9+
import com.google.gson.annotations.SerializedName;
10+
11+
/**
12+
* Created by [email protected] on 31.07.18.
13+
*/
14+
public class EosAccountPriceRequest {
15+
16+
@SerializedName("ram")
17+
private int ram;
18+
@SerializedName("cpu")
19+
private double cpu;
20+
@SerializedName("net")
21+
private double net;
22+
23+
public EosAccountPriceRequest() { }
24+
25+
public EosAccountPriceRequest(int ram, double cpu, double net) {
26+
this.ram = ram;
27+
this.cpu = cpu;
28+
this.net = net;
29+
}
30+
31+
public int getRam() {
32+
return ram;
33+
}
34+
35+
public void setRam(int ram) {
36+
this.ram = ram;
37+
}
38+
39+
public double getCpu() {
40+
return cpu;
41+
}
42+
43+
public void setCpu(double cpu) {
44+
this.cpu = cpu;
45+
}
46+
47+
public double getNet() {
48+
return net;
49+
}
50+
51+
public void setNet(double net) {
52+
this.net = net;
53+
}
54+
}

app/src/main/java/io/multy/ui/fragments/asset/AssetInfoFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ public void onClickWarn() {
428428
startActivity(new Intent(getActivity(), SeedActivity.class));
429429
}
430430

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

433434
public SharingBroadcastReceiver() {

app/src/main/java/io/multy/ui/fragments/asset/CreateAssetFragment.java

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,27 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
7676

7777
View v = inflater.inflate(R.layout.view_assets_action_add, container, false);
7878
ButterKnife.bind(this, v);
79-
initialize();
80-
subscribeToCurrencyUpdate();
81-
Analytics.getInstance(getActivity()).logCreateWalletLaunch();
79+
if (chainId == NativeDataHelper.Blockchain.EOS.getValue() && getFragmentManager() != null) {
80+
getActivity().getIntent().putExtra(Constants.CHAIN_ID, chainId);
81+
CreatePayableAssetFragment fragment = CreatePayableAssetFragment.getInstance();
82+
getFragmentManager().beginTransaction()
83+
.replace(R.id.container_main, fragment, CreatePayableAssetFragment.TAG)
84+
.commit();
85+
} else {
86+
initialize();
87+
subscribeToCurrencyUpdate();
88+
Analytics.getInstance(getActivity()).logCreateWalletLaunch();
8289

83-
editTextWalletName.requestFocus();
84-
editTextWalletName.postDelayed(() -> {
85-
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
86-
if (imm.isActive()) {
87-
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
88-
}
90+
editTextWalletName.requestFocus();
91+
editTextWalletName.postDelayed(() -> {
92+
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
93+
if (imm.isActive()) {
94+
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
95+
}
8996

90-
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
91-
}, 100);
97+
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0);
98+
}, 100);
99+
}
92100
return v;
93101
}
94102

0 commit comments

Comments
 (0)