From 65386999f99a821f8bcdcfe23fc72b4296742219 Mon Sep 17 00:00:00 2001 From: Anschutz1927 Date: Mon, 30 Jul 2018 16:52:14 +0300 Subject: [PATCH] create eos wallet screen --- app/build.gradle | 1 + .../io/multy/api/ApiServiceInterface.java | 3 + app/src/main/java/io/multy/api/MultyApi.java | 7 +- .../java/io/multy/api/MultyApiInterface.java | 1 + .../entities/EosAccountPriceRequest.java | 54 ++ .../ui/fragments/asset/AssetInfoFragment.java | 1 + .../fragments/asset/CreateAssetFragment.java | 30 +- .../asset/CreatePayableAssetFragment.java | 399 +++++++++++++ .../java/io/multy/util/NativeDataHelper.java | 3 +- .../res/drawable/button_white_left_round.xml | 25 + .../res/drawable/button_white_right_round.xml | 25 + app/src/main/res/drawable/ic_name_free.xml | 10 + app/src/main/res/drawable/ic_name_taken.xml | 10 + .../res/drawable/ic_operation_copy_grey.xml | 16 + .../drawable/ic_operation_exchange_grey.xml | 16 + .../drawable/ic_operation_receive_grey.xml | 20 + .../res/drawable/selector_background_blue.xml | 12 + .../drawable/selector_name_status_color.xml | 11 + .../selector_name_status_drawable.xml | 13 + .../layout/fragment_create_payable_asset.xml | 554 ++++++++++++++++++ app/src/main/res/values-ru/strings.xml | 6 + app/src/main/res/values-uk/strings.xml | 6 + app/src/main/res/values/arrays.xml | 5 + app/src/main/res/values/strings.xml | 6 + app/src/main/res/values/styles.xml | 67 +++ 25 files changed, 1288 insertions(+), 13 deletions(-) create mode 100644 app/src/main/java/io/multy/model/entities/EosAccountPriceRequest.java create mode 100644 app/src/main/java/io/multy/ui/fragments/asset/CreatePayableAssetFragment.java create mode 100644 app/src/main/res/drawable/button_white_left_round.xml create mode 100644 app/src/main/res/drawable/button_white_right_round.xml create mode 100644 app/src/main/res/drawable/ic_name_free.xml create mode 100644 app/src/main/res/drawable/ic_name_taken.xml create mode 100644 app/src/main/res/drawable/ic_operation_copy_grey.xml create mode 100644 app/src/main/res/drawable/ic_operation_exchange_grey.xml create mode 100644 app/src/main/res/drawable/ic_operation_receive_grey.xml create mode 100644 app/src/main/res/drawable/selector_background_blue.xml create mode 100644 app/src/main/res/drawable/selector_name_status_color.xml create mode 100644 app/src/main/res/drawable/selector_name_status_drawable.xml create mode 100644 app/src/main/res/layout/fragment_create_payable_asset.xml diff --git a/app/build.gradle b/app/build.gradle index 7d53b3ed..e3f24392 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' diff --git a/app/src/main/java/io/multy/api/ApiServiceInterface.java b/app/src/main/java/io/multy/api/ApiServiceInterface.java index c9537a12..91a35b2b 100644 --- a/app/src/main/java/io/multy/api/ApiServiceInterface.java +++ b/app/src/main/java/io/multy/api/ApiServiceInterface.java @@ -84,4 +84,7 @@ public interface ApiServiceInterface { @GET("api/v1/wallets/verbose") Call testWalletVerbose(); + + @POST("api/v1/account/price") + Call getAccountPrice(@Body Object body); } diff --git a/app/src/main/java/io/multy/api/MultyApi.java b/app/src/main/java/io/multy/api/MultyApi.java index df6b7480..f7ab3e33 100644 --- a/app/src/main/java/io/multy/api/MultyApi.java +++ b/app/src/main/java/io/multy/api/MultyApi.java @@ -178,5 +178,10 @@ public Call sendHdTransaction(HdTransactionRequestEntity transacti public Call testWalletVerbose() { return api.testWalletVerbose(); } - } + + @Override + public Call getAccountPrice(Object body) { + return api.getAccountPrice(body); + } + }; } diff --git a/app/src/main/java/io/multy/api/MultyApiInterface.java b/app/src/main/java/io/multy/api/MultyApiInterface.java index 14f6e172..40353699 100644 --- a/app/src/main/java/io/multy/api/MultyApiInterface.java +++ b/app/src/main/java/io/multy/api/MultyApiInterface.java @@ -60,4 +60,5 @@ public interface MultyApiInterface { Call testWalletVerbose(); + Call getAccountPrice(Object body); } diff --git a/app/src/main/java/io/multy/model/entities/EosAccountPriceRequest.java b/app/src/main/java/io/multy/model/entities/EosAccountPriceRequest.java new file mode 100644 index 00000000..b8cf05fd --- /dev/null +++ b/app/src/main/java/io/multy/model/entities/EosAccountPriceRequest.java @@ -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 anschutz1927@gmail.com 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; + } +} diff --git a/app/src/main/java/io/multy/ui/fragments/asset/AssetInfoFragment.java b/app/src/main/java/io/multy/ui/fragments/asset/AssetInfoFragment.java index 26b853bc..63dbe01b 100644 --- a/app/src/main/java/io/multy/ui/fragments/asset/AssetInfoFragment.java +++ b/app/src/main/java/io/multy/ui/fragments/asset/AssetInfoFragment.java @@ -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() { diff --git a/app/src/main/java/io/multy/ui/fragments/asset/CreateAssetFragment.java b/app/src/main/java/io/multy/ui/fragments/asset/CreateAssetFragment.java index 5eddbeb9..37e02c8d 100644 --- a/app/src/main/java/io/multy/ui/fragments/asset/CreateAssetFragment.java +++ b/app/src/main/java/io/multy/ui/fragments/asset/CreateAssetFragment.java @@ -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; } diff --git a/app/src/main/java/io/multy/ui/fragments/asset/CreatePayableAssetFragment.java b/app/src/main/java/io/multy/ui/fragments/asset/CreatePayableAssetFragment.java new file mode 100644 index 00000000..58856eba --- /dev/null +++ b/app/src/main/java/io/multy/ui/fragments/asset/CreatePayableAssetFragment.java @@ -0,0 +1,399 @@ +/* + * Copyright 2018 Idealnaya rabota LLC + * Licensed under Multy.io license. + * See LICENSE for details + */ + +package io.multy.ui.fragments.asset; + +import android.app.Activity; +import android.app.PendingIntent; +import android.arch.lifecycle.MutableLiveData; +import android.arch.lifecycle.ViewModelProviders; +import android.content.Context; +import android.content.Intent; +import android.content.IntentSender; +import android.os.Build; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.v4.widget.NestedScrollView; +import android.util.TypedValue; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +import com.jakewharton.rxbinding2.widget.RxTextView; + +import org.json.JSONObject; + +import java.math.BigDecimal; +import java.util.Locale; +import java.util.Random; +import java.util.concurrent.TimeUnit; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; +import io.multy.R; +import io.multy.api.MultyApi; +import io.multy.model.entities.EosAccountPriceRequest; +import io.multy.model.entities.wallet.Wallet; +import io.multy.storage.RealmManager; +import io.multy.ui.fragments.BaseFragment; +import io.multy.ui.fragments.dialogs.AddressActionsDialogFragment; +import io.multy.ui.fragments.dialogs.WalletChooserDialogFragment; +import io.multy.util.Constants; +import io.multy.util.CryptoFormatUtils; +import io.multy.util.NativeDataHelper; +import io.multy.util.analytics.Analytics; +import io.multy.viewmodels.WalletViewModel; +import io.reactivex.Observable; +import io.reactivex.ObservableOnSubscribe; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.disposables.Disposable; +import io.reactivex.schedulers.Schedulers; +import okhttp3.ResponseBody; +import retrofit2.Response; + +import static android.content.Intent.ACTION_SEND; + +/** + * Created by anschutz1927@gmail.com on 26.07.18. + */ +public class CreatePayableAssetFragment extends BaseFragment { + + public static final String TAG = CreatePayableAssetFragment.class.getSimpleName(); + + @BindView(R.id.text_status) + TextView textStatus; + @BindView(R.id.edit_name) + EditText inputName; + @BindView(R.id.text_chain) + TextView textChain; + @BindView(R.id.text_ram) + TextView textRam; + @BindView(R.id.text_cpu) + TextView textCpu; + @BindView(R.id.text_net) + TextView textNet; + @BindView(R.id.image_currency) + ImageView imageCurrency; + @BindView(R.id.text_wallet_name) + TextView textWalletName; + @BindView(R.id.text_address) + TextView textAddress; + @BindView(R.id.button_create) + TextView buttonCreate; + @BindView(R.id.notification_warning) + View notificationFounds; + @BindView(R.id.text_warning_address) + TextView textWarningAddress; + @BindView(R.id.scroll_view) + NestedScrollView scrollView; + + private WalletViewModel walletViewModel; + MutableLiveData ram = new MutableLiveData<>(); + MutableLiveData cpu = new MutableLiveData<>(); + MutableLiveData net = new MutableLiveData<>(); + MutableLiveData paymentWallet = new MutableLiveData<>(); + + public static CreatePayableAssetFragment getInstance() { + return new CreatePayableAssetFragment(); + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_create_payable_asset, container, false); + ButterKnife.bind(this, view); + if (getActivity() != null) { + int chainId = getActivity().getIntent().getIntExtra(Constants.CHAIN_ID, -1); + if (chainId != -1 && chainId != NativeDataHelper.Blockchain.EOS.getValue() && getFragmentManager() != null) { + CreateAssetFragment fragment = CreateAssetFragment.getInstance(); + getFragmentManager().beginTransaction() + .replace(R.id.container_main, fragment, CreateAssetFragment.TAG) + .commit(); + } else { + walletViewModel = ViewModelProviders.of(getActivity()).get(WalletViewModel.class); + initialize(); + } + } + return view; + } + + @Override + public void onResume() { + if (paymentWallet.getValue() != null && !paymentWallet.getValue().isValid() && getActivity() != null) { + Wallet wallet = RealmManager.getAssetsDao().getWalletById(getActivity().getIntent() + .getLongExtra(Constants.EXTRA_WALLET_ID, 0)); + paymentWallet.setValue(wallet); + } + super.onResume(); + } + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + if (resultCode == Activity.RESULT_OK && getActivity() != null) { + if (requestCode == WalletChooserDialogFragment.REQUEST_WALLET_ID) { + long walletId = data.getLongExtra(Constants.EXTRA_WALLET_ID, 0); + getActivity().getIntent().putExtra(Constants.EXTRA_WALLET_ID, walletId); + paymentWallet.setValue(RealmManager.getAssetsDao().getWalletById(walletId)); + } else if (requestCode == Constants.REQUEST_CODE_SET_CHAIN) { +// chainNet = data.getIntExtra(Constants.CHAIN_NET, 0); + getActivity().getIntent().putExtra(Constants.CHAIN_ID, data.getIntExtra(Constants.CHAIN_ID, 0)); + String chainCurrency = data.getStringExtra(Constants.CHAIN_NAME); + walletViewModel.chainCurrency.setValue(chainCurrency); + } + } + } + + private void initialize() { + Disposable disposable = RxTextView.textChanges(inputName) + .debounce(300, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()) + .filter(this::checkNameLength) + .observeOn(Schedulers.io()) + .map(this::createAccountAndWallet) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(this::setNameStatus, this::handleError); + walletViewModel.addDisposable(disposable); + buttonCreate.setText(R.string.create); + textStatus.setEnabled(false); + onChainName("EOS ∙ EOS"); + onWallet(null); + subscribeToObservers(); + } + + private void subscribeToObservers() { + walletViewModel.chainCurrency.observe(this, this::onChainName); + paymentWallet.observe(this, this::onWallet); + ram.setValue("150"); + cpu.setValue("36"); + net.setValue("224"); + ram.observe(this, this::onRamSet); + cpu.observe(this, this::onCpuSet); + net.observe(this, this::onNetSet); + } + + private void onWallet(Wallet wallet) { + if (wallet == null) { + textAddress.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f); + textAddress.setText(R.string.select_your_wallet); + textWalletName.setVisibility(View.GONE); + imageCurrency.setVisibility(View.GONE); + } else { + imageCurrency.setVisibility(View.VISIBLE); + textAddress.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12f); + textWalletName.setVisibility(View.VISIBLE); + textWalletName.setText(wallet.getWalletName()); + textAddress.setText(wallet.getActiveAddress().getAddress()); + imageCurrency.setImageResource(wallet.getIconResourceId()); + textWarningAddress.setText(wallet.getActiveAddress().getAddress()); + } + printAccountCost(); + } + + private void onRamSet(String ram) { + textRam.setText(ram); + } + + private void onCpuSet(String cpu) { + textCpu.setText(cpu); + } + + private void onNetSet(String net) { + textNet.setText(net); + } + + private void onChainName(String chainName) { + if (chainName != null) { + textChain.setText(chainName); + } + } + + private boolean checkNameLength(CharSequence name) { + if (name.length() == 12) { + inputName.setEnabled(false); + showProgressDialog(); + return true; + } + textStatus.setText("Please, input valid name"); + textStatus.setEnabled(false); + printAccountCost(); + return false; + } + + private boolean createAccountAndWallet(CharSequence name) throws InterruptedException { + Thread.sleep(1500); + return new Random().nextBoolean(); + } + + private void setNameStatus(Boolean nameStatus) { + textStatus.setEnabled(nameStatus); + textStatus.setText(nameStatus ? R.string.name_is_free : R.string.name_is_taken); + inputName.setEnabled(true); + dismissProgressDialog(); + printAccountCost(); + } + + private void printAccountCost() { + if (paymentWallet.getValue() != null && textStatus.isEnabled()) { + showProgressDialog(); + Disposable disposable = Observable.create((ObservableOnSubscribe) emitter -> { + EosAccountPriceRequest requestBody = new EosAccountPriceRequest(150, 36, 224); + Response response = MultyApi.INSTANCE.getAccountPrice(requestBody).execute(); + JSONObject body = new JSONObject(response.body().string()); + String eosToEth = "0.016783399"; //todo remove hardcode + BigDecimal precost = new BigDecimal(body.getString("price")).multiply(new BigDecimal(eosToEth)); + emitter.onNext(CryptoFormatUtils.FORMAT_ETH.format(precost)); + }).observeOn(AndroidSchedulers.mainThread()) + .subscribeOn(Schedulers.io()) + .subscribe(cost -> { + String costString = String.format(Locale.ENGLISH, getString(R.string.create_for_eth), cost); + buttonCreate.setText(costString); + if (paymentWallet.getValue().getAvailableBalanceNumeric().compareTo(new BigDecimal(cost)) < 0) { + buttonCreate.setEnabled(false); + notificationFounds.setVisibility(View.VISIBLE); + scrollPageDown(); + } else { + buttonCreate.setEnabled(true); + notificationFounds.setVisibility(View.GONE); + } + dismissProgressDialog(); + }, throwable -> { + throwable.printStackTrace(); + buttonCreate.setText(R.string.create); + buttonCreate.setEnabled(false); + dismissProgressDialog(); + }); + walletViewModel.addDisposable(disposable); + } else if (buttonCreate.isEnabled() || notificationFounds.getVisibility() == View.VISIBLE) { + buttonCreate.setEnabled(false); + buttonCreate.setText(R.string.create); + notificationFounds.setVisibility(View.GONE); + } + } + + private void scrollPageDown() { + scrollView.post(() -> scrollView.fullScroll(View.FOCUS_DOWN)); + } + + private void handleError(Throwable error) { + error.printStackTrace(); + inputName.setEnabled(true); + dismissProgressDialog(); + } + + private IntentSender getIntentSender(Context context) { + return PendingIntent.getBroadcast(context, 0, new Intent(context, + AssetInfoFragment.SharingBroadcastReceiver.class), PendingIntent.FLAG_CANCEL_CURRENT) + .getIntentSender(); + } + + private void handleClick(View view) { + view.setEnabled(false); + view.postDelayed(() -> view.setEnabled(true), 500); + } + + @OnClick(R.id.button_chain) + void onClickChain(View view) { + handleClick(view); + Analytics.getInstance(getActivity()).logCreateWalletChain(); + if (getActivity() != null) { + hideKeyboard(getActivity()); + ChainChooserFragment fragment = (ChainChooserFragment) getActivity().getSupportFragmentManager() + .findFragmentByTag(ChainChooserFragment.TAG); + if (fragment == null) { + fragment = ChainChooserFragment.getInstance(); + } + fragment.setTargetFragment(this, Constants.REQUEST_CODE_SET_CHAIN); + fragment.setSelectedChain(walletViewModel.chainCurrency.getValue(), 194); + getActivity().getSupportFragmentManager().beginTransaction() + .replace(R.id.container_main, fragment).addToBackStack(ChainChooserFragment.TAG) + .commit(); + } + } + + @OnClick(R.id.button_fiat) + void onClickFiat(View view) { + handleClick(view); + if (getActivity() != null) { + Analytics.getInstance(getActivity()).logCreateWalletFiatClick(); + hideKeyboard(getActivity()); + CurrencyChooserFragment fragment = (CurrencyChooserFragment) getActivity().getSupportFragmentManager() + .findFragmentByTag(CurrencyChooserFragment.TAG); + if (fragment == null) { + fragment = CurrencyChooserFragment.getInstance(); + } + getActivity().getSupportFragmentManager().beginTransaction() + .replace(R.id.container_main, fragment).addToBackStack(ChainChooserFragment.TAG) + .commit(); + } + } + + @OnClick(R.id.button_ram) + void onClickRam(View view) { + handleClick(view); + } + + @OnClick(R.id.button_cpu) + void onClickCpu(View view) { + handleClick(view); + } + + @OnClick(R.id.button_net) + void onClickNet(View view){ + handleClick(view); + } + + @OnClick(R.id.button_wallet) + void onClickWallet(View view) { + handleClick(view); + if (getFragmentManager() != null) { + WalletChooserDialogFragment dialog = WalletChooserDialogFragment.getInstance(NativeDataHelper.Blockchain.ETH.getValue()); + dialog.setTargetFragment(this, WalletChooserDialogFragment.REQUEST_WALLET_ID); + dialog.show(getFragmentManager(), WalletChooserDialogFragment.TAG); + } + } + + @OnClick(R.id.button_create) + void onClickCreate(View view) { + view.setEnabled(false); + } + + @SuppressWarnings("ConstantConditions, NewApi") + @OnClick(R.id.button_share) + void onClickShareAddress(View view) { + handleClick(view); + String address = paymentWallet.getValue().getActiveAddress().getAddress(); + Intent sharingIntent = new Intent(ACTION_SEND).setType("text/plain") + .putExtra(Intent.EXTRA_TEXT, address); + startActivity(Intent.createChooser(sharingIntent, getString(R.string.share), + Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1 ? null : getIntentSender(view.getContext()))); + view.post(view::invalidate); + } + + @SuppressWarnings("ConstantConditions") + @OnClick(R.id.button_receive) + void onClickAddressReceive(View view) { + handleClick(view); + Wallet wallet = paymentWallet.getValue(); + AddressActionsDialogFragment.getInstance(wallet.getActiveAddress().getAddress(), wallet.getCurrencyId(), wallet.getNetworkId(), + wallet.getIconResourceId(), false).show(getFragmentManager(), AddressActionsDialogFragment.TAG); + } + + @OnClick(R.id.button_exchange) + void onClickExchange(View view) { + handleClick(view); + } + + @OnClick(R.id.button_cancel) + void onClickCancel() { + if (getActivity() != null) { + getActivity().onBackPressed(); + } + } +} diff --git a/app/src/main/java/io/multy/util/NativeDataHelper.java b/app/src/main/java/io/multy/util/NativeDataHelper.java index 2457725e..4da2a2ea 100644 --- a/app/src/main/java/io/multy/util/NativeDataHelper.java +++ b/app/src/main/java/io/multy/util/NativeDataHelper.java @@ -30,7 +30,8 @@ public enum Blockchain { // BTC(0x80000000), // ETH(0x8000003c); BTC(0), - ETH(60); + ETH(60), + EOS(194); private final int value; diff --git a/app/src/main/res/drawable/button_white_left_round.xml b/app/src/main/res/drawable/button_white_left_round.xml new file mode 100644 index 00000000..7bd986cb --- /dev/null +++ b/app/src/main/res/drawable/button_white_left_round.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/button_white_right_round.xml b/app/src/main/res/drawable/button_white_right_round.xml new file mode 100644 index 00000000..ae03b569 --- /dev/null +++ b/app/src/main/res/drawable/button_white_right_round.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_name_free.xml b/app/src/main/res/drawable/ic_name_free.xml new file mode 100644 index 00000000..2dd2488d --- /dev/null +++ b/app/src/main/res/drawable/ic_name_free.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_name_taken.xml b/app/src/main/res/drawable/ic_name_taken.xml new file mode 100644 index 00000000..cd1bbf0f --- /dev/null +++ b/app/src/main/res/drawable/ic_name_taken.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_operation_copy_grey.xml b/app/src/main/res/drawable/ic_operation_copy_grey.xml new file mode 100644 index 00000000..e25820fc --- /dev/null +++ b/app/src/main/res/drawable/ic_operation_copy_grey.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_operation_exchange_grey.xml b/app/src/main/res/drawable/ic_operation_exchange_grey.xml new file mode 100644 index 00000000..8b918576 --- /dev/null +++ b/app/src/main/res/drawable/ic_operation_exchange_grey.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_operation_receive_grey.xml b/app/src/main/res/drawable/ic_operation_receive_grey.xml new file mode 100644 index 00000000..a4312051 --- /dev/null +++ b/app/src/main/res/drawable/ic_operation_receive_grey.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/app/src/main/res/drawable/selector_background_blue.xml b/app/src/main/res/drawable/selector_background_blue.xml new file mode 100644 index 00000000..de4c5be5 --- /dev/null +++ b/app/src/main/res/drawable/selector_background_blue.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_name_status_color.xml b/app/src/main/res/drawable/selector_name_status_color.xml new file mode 100644 index 00000000..0e391c54 --- /dev/null +++ b/app/src/main/res/drawable/selector_name_status_color.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_name_status_drawable.xml b/app/src/main/res/drawable/selector_name_status_drawable.xml new file mode 100644 index 00000000..4bded1d7 --- /dev/null +++ b/app/src/main/res/drawable/selector_name_status_drawable.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_create_payable_asset.xml b/app/src/main/res/layout/fragment_create_payable_asset.xml new file mode 100644 index 00000000..bde37022 --- /dev/null +++ b/app/src/main/res/layout/fragment_create_payable_asset.xml @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 4285179c..8d6bceb2 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -251,4 +251,10 @@ Присоединиться к MultiSig Введена неверная сумма Нет доступных средств для пожертвования. + Wallet parameters + You have to select wallet for payment creating EOS wallet transaction. Be sure that you have needed sum of funds. + Name is free + Name is taken + NET + Create for %s ETH \ No newline at end of file diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index e07770cb..0587b12d 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -252,4 +252,10 @@ Приєднатися до MultiSig Введена невірна сума Немає доступних засобів для пожертвування. + Wallet parameters + You have to select wallet for payment creating EOS wallet transaction. Be sure that you have needed sum of funds. + Name is free + Name is taken + NET + Create for %s ETH \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 99983439..f2e722fc 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -28,30 +28,35 @@ BTC Testnet ETH ETH Testnet + EOS Testnet Bitcoin Bitcoin Ethereum Ethereum + EOS @drawable/ic_btk_logo @drawable/ic_chain_btc_test @drawable/chain_eth @drawable/ic_chain_eth_test + @drawable/ic_chain_eth_test 0 1 1 4 + 1 0 0 60 60 + 194 ETH diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2c78e706..3b413b2e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -328,4 +328,10 @@ Join MultiSig Entered Invalid Sum There are no available funds for donation. + Wallet parameters + You have to select wallet for payment creating EOS wallet transaction. Be sure that you have needed sum of funds. + Name is free + Name is taken + NET + Create for %s ETH diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index d2f570b8..e43df7d3 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -433,6 +433,73 @@ wrap_content wrap_content ?android:attr/selectableItemBackground + @color/blue_light + + + + + + + + + + + + +