mirror of
https://github.com/m2049r/xmrwallet
synced 2025-09-20 13:10:49 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
24fc27b09e | ||
![]() |
cf4ff856d5 |
@@ -7,8 +7,8 @@ android {
|
|||||||
applicationId "com.m2049r.xmrwallet"
|
applicationId "com.m2049r.xmrwallet"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 713
|
versionCode 801
|
||||||
versionName "1.17.13 'Druk'"
|
versionName "1.18.1 'ChAdOx1'"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
|
@@ -31,10 +31,11 @@ import android.os.Bundle;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.CallSuper;
|
import androidx.annotation.CallSuper;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.data.BarcodeData;
|
import com.m2049r.xmrwallet.data.BarcodeData;
|
||||||
import com.m2049r.xmrwallet.dialog.ProgressDialog;
|
import com.m2049r.xmrwallet.dialog.ProgressDialog;
|
||||||
@@ -46,7 +47,8 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class BaseActivity extends SecureActivity implements GenerateReviewFragment.ProgressListener {
|
public class BaseActivity extends SecureActivity
|
||||||
|
implements GenerateReviewFragment.ProgressListener, SubaddressFragment.ProgressListener {
|
||||||
|
|
||||||
ProgressDialog progressDialog = null;
|
ProgressDialog progressDialog = null;
|
||||||
|
|
||||||
|
@@ -307,7 +307,6 @@ public class GenerateReviewFragment extends Fragment {
|
|||||||
void dismissProgressDialog();
|
void dismissProgressDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface AcceptListener {
|
public interface AcceptListener {
|
||||||
void onAccept(String name, String password);
|
void onAccept(String name, String password);
|
||||||
}
|
}
|
||||||
|
@@ -59,13 +59,13 @@ import com.m2049r.xmrwallet.model.NetworkType;
|
|||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.xmrwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.model.WalletManager;
|
import com.m2049r.xmrwallet.model.WalletManager;
|
||||||
import com.m2049r.xmrwallet.service.WalletService;
|
import com.m2049r.xmrwallet.service.WalletService;
|
||||||
import com.m2049r.xmrwallet.util.ThemeHelper;
|
|
||||||
import com.m2049r.xmrwallet.util.DayNightMode;
|
import com.m2049r.xmrwallet.util.DayNightMode;
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.xmrwallet.util.Helper;
|
||||||
import com.m2049r.xmrwallet.util.KeyStoreHelper;
|
import com.m2049r.xmrwallet.util.KeyStoreHelper;
|
||||||
import com.m2049r.xmrwallet.util.LocaleHelper;
|
import com.m2049r.xmrwallet.util.LocaleHelper;
|
||||||
import com.m2049r.xmrwallet.util.MoneroThreadPoolExecutor;
|
import com.m2049r.xmrwallet.util.MoneroThreadPoolExecutor;
|
||||||
import com.m2049r.xmrwallet.util.NightmodeHelper;
|
import com.m2049r.xmrwallet.util.NightmodeHelper;
|
||||||
|
import com.m2049r.xmrwallet.util.ThemeHelper;
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
import com.m2049r.xmrwallet.widget.Toolbar;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -86,8 +86,7 @@ import timber.log.Timber;
|
|||||||
|
|
||||||
public class LoginActivity extends BaseActivity
|
public class LoginActivity extends BaseActivity
|
||||||
implements LoginFragment.Listener, GenerateFragment.Listener,
|
implements LoginFragment.Listener, GenerateFragment.Listener,
|
||||||
GenerateReviewFragment.Listener, GenerateReviewFragment.AcceptListener,
|
GenerateReviewFragment.Listener, GenerateReviewFragment.AcceptListener, NodeFragment.Listener {
|
||||||
ReceiveFragment.Listener, NodeFragment.Listener {
|
|
||||||
private static final String GENERATE_STACK = "gen";
|
private static final String GENERATE_STACK = "gen";
|
||||||
|
|
||||||
private static final String NODES_PREFS_NAME = "nodes";
|
private static final String NODES_PREFS_NAME = "nodes";
|
||||||
@@ -397,28 +396,6 @@ public class LoginActivity extends BaseActivity
|
|||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onWalletReceive(String walletName) {
|
|
||||||
Timber.d("receive for wallet .%s.", walletName);
|
|
||||||
if (checkServiceRunning()) return;
|
|
||||||
final File walletFile = Helper.getWalletFile(this, walletName);
|
|
||||||
if (WalletManager.getInstance().walletExists(walletFile)) {
|
|
||||||
Helper.promptPassword(LoginActivity.this, walletName, false, new Helper.PasswordAction() {
|
|
||||||
@Override
|
|
||||||
public void act(String walletName, String password, boolean fingerprintUsed) {
|
|
||||||
if (checkDevice(walletName, password))
|
|
||||||
startReceive(walletFile, password);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void fail(String walletName) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else { // this cannot really happen as we prefilter choices
|
|
||||||
Toast.makeText(this, getString(R.string.bad_wallet), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class AsyncRename extends AsyncTask<String, Void, Boolean> {
|
private class AsyncRename extends AsyncTask<String, Void, Boolean> {
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
@@ -797,14 +774,6 @@ public class LoginActivity extends BaseActivity
|
|||||||
startReviewFragment(b);
|
startReviewFragment(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void startReceive(File walletFile, String password) {
|
|
||||||
Timber.d("startReceive()");
|
|
||||||
Bundle b = new Bundle();
|
|
||||||
b.putString("path", walletFile.getAbsolutePath());
|
|
||||||
b.putString("password", password);
|
|
||||||
startReceiveFragment(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[],
|
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[],
|
||||||
@NonNull int[] grantResults) {
|
@NonNull int[] grantResults) {
|
||||||
@@ -863,11 +832,6 @@ public class LoginActivity extends BaseActivity
|
|||||||
Timber.d("NodeFragment placed");
|
Timber.d("NodeFragment placed");
|
||||||
}
|
}
|
||||||
|
|
||||||
void startReceiveFragment(Bundle extras) {
|
|
||||||
replaceFragment(new ReceiveFragment(), null, extras);
|
|
||||||
Timber.d("ReceiveFragment placed");
|
|
||||||
}
|
|
||||||
|
|
||||||
void replaceFragment(Fragment newFragment, String stackName, Bundle extras) {
|
void replaceFragment(Fragment newFragment, String stackName, Bundle extras) {
|
||||||
if (extras != null) {
|
if (extras != null) {
|
||||||
newFragment.setArguments(extras);
|
newFragment.setArguments(extras);
|
||||||
|
@@ -82,8 +82,6 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter
|
|||||||
|
|
||||||
void onWalletDetails(String wallet);
|
void onWalletDetails(String wallet);
|
||||||
|
|
||||||
void onWalletReceive(String wallet);
|
|
||||||
|
|
||||||
void onWalletRename(String name);
|
void onWalletRename(String name);
|
||||||
|
|
||||||
void onWalletBackup(String name);
|
void onWalletBackup(String name);
|
||||||
@@ -223,9 +221,6 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter
|
|||||||
case R.id.action_info:
|
case R.id.action_info:
|
||||||
showInfo(listItem.name);
|
showInfo(listItem.name);
|
||||||
break;
|
break;
|
||||||
case R.id.action_receive:
|
|
||||||
showReceive(listItem.name);
|
|
||||||
break;
|
|
||||||
case R.id.action_rename:
|
case R.id.action_rename:
|
||||||
activityCallback.onWalletRename(listItem.name);
|
activityCallback.onWalletRename(listItem.name);
|
||||||
break;
|
break;
|
||||||
@@ -290,10 +285,6 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter
|
|||||||
activityCallback.onWalletDetails(name);
|
activityCallback.onWalletDetails(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showReceive(@NonNull String name) {
|
|
||||||
activityCallback.onWalletReceive(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@@ -228,24 +228,23 @@ public class NodeFragment extends Fragment
|
|||||||
|
|
||||||
// open up edit dialog
|
// open up edit dialog
|
||||||
@Override
|
@Override
|
||||||
public void onLongInteraction(final View view, final NodeInfo nodeItem) {
|
public boolean onLongInteraction(final View view, final NodeInfo nodeItem) {
|
||||||
Timber.d("onLongInteraction");
|
Timber.d("onLongInteraction");
|
||||||
EditDialog diag = createEditDialog(nodeItem);
|
EditDialog diag = createEditDialog(nodeItem);
|
||||||
if (diag != null) {
|
if (diag != null) {
|
||||||
diag.show();
|
diag.show();
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
switch (id) {
|
if (id == R.id.fab) {
|
||||||
case R.id.fab:
|
EditDialog diag = createEditDialog(null);
|
||||||
EditDialog diag = createEditDialog(null);
|
if (diag != null) {
|
||||||
if (diag != null) {
|
diag.show();
|
||||||
diag.show();
|
}
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 m2049r
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.m2049r.xmrwallet;
|
||||||
|
|
||||||
|
import com.m2049r.xmrwallet.model.Wallet;
|
||||||
|
|
||||||
|
public interface OnBlockUpdateListener {
|
||||||
|
void onBlockUpdate(final Wallet wallet);
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
246
app/src/main/java/com/m2049r/xmrwallet/SubaddressFragment.java
Normal file
246
app/src/main/java/com/m2049r/xmrwallet/SubaddressFragment.java
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 m2049r
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.m2049r.xmrwallet;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.material.transition.MaterialElevationScale;
|
||||||
|
import com.m2049r.xmrwallet.data.Subaddress;
|
||||||
|
import com.m2049r.xmrwallet.layout.SubaddressInfoAdapter;
|
||||||
|
import com.m2049r.xmrwallet.ledger.LedgerProgressDialog;
|
||||||
|
import com.m2049r.xmrwallet.model.TransactionInfo;
|
||||||
|
import com.m2049r.xmrwallet.model.Wallet;
|
||||||
|
import com.m2049r.xmrwallet.model.WalletManager;
|
||||||
|
import com.m2049r.xmrwallet.util.Helper;
|
||||||
|
import com.m2049r.xmrwallet.util.MoneroThreadPoolExecutor;
|
||||||
|
import com.m2049r.xmrwallet.widget.Toolbar;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import timber.log.Timber;
|
||||||
|
|
||||||
|
public class SubaddressFragment extends Fragment implements SubaddressInfoAdapter.OnInteractionListener,
|
||||||
|
View.OnClickListener {
|
||||||
|
static public final String KEY_MODE = "mode";
|
||||||
|
static public final String MODE_MANAGER = "manager";
|
||||||
|
|
||||||
|
private SubaddressInfoAdapter adapter;
|
||||||
|
|
||||||
|
private Listener activityCallback;
|
||||||
|
|
||||||
|
private Wallet wallet;
|
||||||
|
|
||||||
|
// Container Activity must implement this interface
|
||||||
|
public interface Listener {
|
||||||
|
void onSubaddressSelected(Subaddress subaddress);
|
||||||
|
|
||||||
|
void setSubtitle(String title);
|
||||||
|
|
||||||
|
void setToolbarButton(int type);
|
||||||
|
|
||||||
|
void showSubaddress(View view, final int subaddressIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ProgressListener {
|
||||||
|
void showProgressDialog(int msgId);
|
||||||
|
|
||||||
|
void showLedgerProgressDialog(int mode);
|
||||||
|
|
||||||
|
void dismissProgressDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ProgressListener progressCallback = null;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttach(@NonNull Context context) {
|
||||||
|
super.onAttach(context);
|
||||||
|
if (context instanceof ProgressListener) {
|
||||||
|
progressCallback = (ProgressListener) context;
|
||||||
|
}
|
||||||
|
if (context instanceof Listener) {
|
||||||
|
activityCallback = (Listener) context;
|
||||||
|
} else {
|
||||||
|
throw new ClassCastException(context.toString()
|
||||||
|
+ " must implement Listener");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
Timber.d("onPause()");
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
activityCallback.setSubtitle(getString(R.string.subbaddress_title));
|
||||||
|
activityCallback.setToolbarButton(Toolbar.BUTTON_BACK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
Timber.d("onCreateView");
|
||||||
|
|
||||||
|
final Bundle b = getArguments();
|
||||||
|
managerMode = ((b != null) && (MODE_MANAGER.equals(b.getString(KEY_MODE))));
|
||||||
|
|
||||||
|
View view = inflater.inflate(R.layout.fragment_subaddress, container, false);
|
||||||
|
|
||||||
|
final MaterialElevationScale exitTransition = new MaterialElevationScale(false);
|
||||||
|
exitTransition.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
||||||
|
setExitTransition(exitTransition);
|
||||||
|
final MaterialElevationScale reenterTransition = new MaterialElevationScale(true);
|
||||||
|
reenterTransition.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
||||||
|
setReenterTransition(reenterTransition);
|
||||||
|
|
||||||
|
view.findViewById(R.id.fab).setOnClickListener(this);
|
||||||
|
|
||||||
|
if (managerMode) {
|
||||||
|
view.findViewById(R.id.tvInstruction).setVisibility(View.GONE);
|
||||||
|
view.findViewById(R.id.tvHint).setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
final RecyclerView list = view.findViewById(R.id.list);
|
||||||
|
adapter = new SubaddressInfoAdapter(getActivity(), this);
|
||||||
|
list.setAdapter(adapter);
|
||||||
|
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
||||||
|
@Override
|
||||||
|
public void onItemRangeInserted(int positionStart, int itemCount) {
|
||||||
|
list.scrollToPosition(positionStart);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Helper.hideKeyboard(getActivity());
|
||||||
|
|
||||||
|
wallet = WalletManager.getInstance().getWallet();
|
||||||
|
|
||||||
|
loadList();
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
postponeEnterTransition();
|
||||||
|
view.getViewTreeObserver().addOnPreDrawListener(() -> {
|
||||||
|
startPostponedEnterTransition();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadList() {
|
||||||
|
Timber.d("loadList()");
|
||||||
|
final int numSubaddresses = wallet.getNumSubaddresses();
|
||||||
|
final List<Subaddress> list = new ArrayList<>();
|
||||||
|
for (int i = 0; i < numSubaddresses; i++) {
|
||||||
|
list.add(wallet.getSubaddressObject(i));
|
||||||
|
}
|
||||||
|
adapter.setInfos(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
int id = v.getId();
|
||||||
|
if (id == R.id.fab) {
|
||||||
|
getNewSubaddress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int lastUsedSubaddress() {
|
||||||
|
int lastUsedSubaddress = 0;
|
||||||
|
for (TransactionInfo info : wallet.getHistory().getAll()) {
|
||||||
|
if (info.addressIndex > lastUsedSubaddress)
|
||||||
|
lastUsedSubaddress = info.addressIndex;
|
||||||
|
}
|
||||||
|
return lastUsedSubaddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getNewSubaddress() {
|
||||||
|
final int maxSubaddresses = lastUsedSubaddress() + wallet.getDeviceType().getSubaddressLookahead();
|
||||||
|
if (wallet.getNumSubaddresses() < maxSubaddresses)
|
||||||
|
new AsyncSubaddress().executeOnExecutor(MoneroThreadPoolExecutor.MONERO_THREAD_POOL_EXECUTOR);
|
||||||
|
else
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.max_subaddress_warning), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
private class AsyncSubaddress extends AsyncTask<Void, Void, Boolean> {
|
||||||
|
boolean dialogOpened = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPreExecute() {
|
||||||
|
super.onPreExecute();
|
||||||
|
if ((wallet.getDeviceType() == Wallet.Device.Device_Ledger) && (progressCallback != null)) {
|
||||||
|
progressCallback.showLedgerProgressDialog(LedgerProgressDialog.TYPE_SUBADDRESS);
|
||||||
|
dialogOpened = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Boolean doInBackground(Void... params) {
|
||||||
|
if (params.length != 0) return false;
|
||||||
|
wallet.getNewSubaddress();
|
||||||
|
wallet.store();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostExecute(Boolean result) {
|
||||||
|
super.onPostExecute(result);
|
||||||
|
if (dialogOpened)
|
||||||
|
progressCallback.dismissProgressDialog();
|
||||||
|
if (!isAdded()) // never mind then
|
||||||
|
return;
|
||||||
|
loadList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean managerMode = false;
|
||||||
|
|
||||||
|
// Callbacks from SubaddressInfoAdapter
|
||||||
|
@Override
|
||||||
|
public void onInteraction(final View view, final Subaddress subaddress) {
|
||||||
|
if (managerMode)
|
||||||
|
activityCallback.showSubaddress(view, subaddress.getAddressIndex());
|
||||||
|
else
|
||||||
|
activityCallback.onSubaddressSelected(subaddress); // also closes the fragment with onBackpressed()
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onLongInteraction(View view, Subaddress subaddress) {
|
||||||
|
activityCallback.showSubaddress(view, subaddress.getAddressIndex());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,175 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 m2049r
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.m2049r.xmrwallet;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
import com.google.android.material.transition.MaterialContainerTransform;
|
||||||
|
import com.m2049r.xmrwallet.data.Subaddress;
|
||||||
|
import com.m2049r.xmrwallet.layout.TransactionInfoAdapter;
|
||||||
|
import com.m2049r.xmrwallet.model.TransactionInfo;
|
||||||
|
import com.m2049r.xmrwallet.model.Wallet;
|
||||||
|
import com.m2049r.xmrwallet.util.Helper;
|
||||||
|
import com.m2049r.xmrwallet.util.ThemeHelper;
|
||||||
|
import com.m2049r.xmrwallet.widget.Toolbar;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import timber.log.Timber;
|
||||||
|
|
||||||
|
public class SubaddressInfoFragment extends Fragment
|
||||||
|
implements TransactionInfoAdapter.OnInteractionListener, OnBlockUpdateListener {
|
||||||
|
private TransactionInfoAdapter adapter;
|
||||||
|
|
||||||
|
private Subaddress subaddress;
|
||||||
|
|
||||||
|
private TextInputLayout etName;
|
||||||
|
private TextView tvAddress;
|
||||||
|
private TextView tvTxLabel;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_subaddressinfo, container, false);
|
||||||
|
|
||||||
|
etName = view.findViewById(R.id.etName);
|
||||||
|
tvAddress = view.findViewById(R.id.tvAddress);
|
||||||
|
tvTxLabel = view.findViewById(R.id.tvTxLabel);
|
||||||
|
|
||||||
|
final RecyclerView list = view.findViewById(R.id.list);
|
||||||
|
adapter = new TransactionInfoAdapter(getActivity(), this);
|
||||||
|
list.setAdapter(adapter);
|
||||||
|
|
||||||
|
final Wallet wallet = activityCallback.getWallet();
|
||||||
|
|
||||||
|
Bundle b = getArguments();
|
||||||
|
final int subaddressIndex = b.getInt("subaddressIndex");
|
||||||
|
subaddress = wallet.getSubaddressObject(subaddressIndex);
|
||||||
|
|
||||||
|
etName.getEditText().setText(subaddress.getDisplayLabel());
|
||||||
|
tvAddress.setText(getContext().getString(R.string.subbaddress_info_subtitle,
|
||||||
|
subaddress.getAddressIndex(), subaddress.getSquashedAddress()));
|
||||||
|
|
||||||
|
etName.getEditText().setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
|
if (!hasFocus) {
|
||||||
|
wallet.setSubaddressLabel(subaddressIndex, etName.getEditText().getText().toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
etName.getEditText().setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|
||||||
|
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
|
||||||
|
Helper.hideKeyboard(getActivity());
|
||||||
|
wallet.setSubaddressLabel(subaddressIndex, etName.getEditText().getText().toString());
|
||||||
|
onRefreshed(wallet);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
onRefreshed(wallet);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
final MaterialContainerTransform transform = new MaterialContainerTransform();
|
||||||
|
transform.setDrawingViewId(R.id.fragment_container);
|
||||||
|
transform.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
||||||
|
transform.setAllContainerColors(ThemeHelper.getThemedColor(getContext(), android.R.attr.colorBackground));
|
||||||
|
setSharedElementEnterTransition(transform);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onRefreshed(final Wallet wallet) {
|
||||||
|
Timber.d("onRefreshed");
|
||||||
|
List<TransactionInfo> list = new ArrayList<>();
|
||||||
|
for (TransactionInfo info : wallet.getHistory().getAll()) {
|
||||||
|
if (info.addressIndex == subaddress.getAddressIndex())
|
||||||
|
list.add(info);
|
||||||
|
}
|
||||||
|
adapter.setInfos(list);
|
||||||
|
if (list.isEmpty())
|
||||||
|
tvTxLabel.setText(R.string.subaddress_notx_label);
|
||||||
|
else
|
||||||
|
tvTxLabel.setText(R.string.subaddress_tx_label);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockUpdate(Wallet wallet) {
|
||||||
|
onRefreshed(wallet);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Callbacks from TransactionInfoAdapter
|
||||||
|
@Override
|
||||||
|
public void onInteraction(final View view, final TransactionInfo infoItem) {
|
||||||
|
activityCallback.onTxDetailsRequest(view, infoItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
Listener activityCallback;
|
||||||
|
|
||||||
|
// Container Activity must implement this interface
|
||||||
|
public interface Listener {
|
||||||
|
void onTxDetailsRequest(View view, TransactionInfo info);
|
||||||
|
|
||||||
|
Wallet getWallet();
|
||||||
|
|
||||||
|
void setToolbarButton(int type);
|
||||||
|
|
||||||
|
void setTitle(String title, String subtitle);
|
||||||
|
|
||||||
|
void setSubtitle(String subtitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttach(@NonNull Context context) {
|
||||||
|
super.onAttach(context);
|
||||||
|
if (context instanceof Listener) {
|
||||||
|
this.activityCallback = (Listener) context;
|
||||||
|
} else {
|
||||||
|
throw new ClassCastException(context.toString()
|
||||||
|
+ " must implement Listener");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
Timber.d("onResume()");
|
||||||
|
activityCallback.setSubtitle(getString(R.string.subbaddress_title));
|
||||||
|
activityCallback.setToolbarButton(Toolbar.BUTTON_BACK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
}
|
@@ -22,7 +22,9 @@ import android.content.Intent;
|
|||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@@ -37,12 +39,14 @@ import androidx.core.content.ContextCompat;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.google.android.material.transition.MaterialContainerTransform;
|
import com.google.android.material.transition.MaterialContainerTransform;
|
||||||
|
import com.google.android.material.transition.MaterialElevationScale;
|
||||||
|
import com.m2049r.xmrwallet.data.Subaddress;
|
||||||
import com.m2049r.xmrwallet.data.UserNotes;
|
import com.m2049r.xmrwallet.data.UserNotes;
|
||||||
import com.m2049r.xmrwallet.model.TransactionInfo;
|
import com.m2049r.xmrwallet.model.TransactionInfo;
|
||||||
import com.m2049r.xmrwallet.model.Transfer;
|
import com.m2049r.xmrwallet.model.Transfer;
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.xmrwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.util.ThemeHelper;
|
|
||||||
import com.m2049r.xmrwallet.util.Helper;
|
import com.m2049r.xmrwallet.util.Helper;
|
||||||
|
import com.m2049r.xmrwallet.util.ThemeHelper;
|
||||||
import com.m2049r.xmrwallet.widget.Toolbar;
|
import com.m2049r.xmrwallet.widget.Toolbar;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -52,6 +56,8 @@ import java.util.HashSet;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class TxFragment extends Fragment {
|
public class TxFragment extends Fragment {
|
||||||
|
|
||||||
static public final String ARG_INFO = "info";
|
static public final String ARG_INFO = "info";
|
||||||
@@ -88,11 +94,16 @@ public class TxFragment extends Fragment {
|
|||||||
private ImageView tvXmrToLogo;
|
private ImageView tvXmrToLogo;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
Bundle savedInstanceState) {
|
|
||||||
|
|
||||||
View view = inflater.inflate(R.layout.fragment_tx_info, container, false);
|
View view = inflater.inflate(R.layout.fragment_tx_info, container, false);
|
||||||
|
|
||||||
|
final MaterialElevationScale exitTransition = new MaterialElevationScale(false);
|
||||||
|
exitTransition.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
||||||
|
setExitTransition(exitTransition);
|
||||||
|
final MaterialElevationScale reenterTransition = new MaterialElevationScale(true);
|
||||||
|
reenterTransition.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
||||||
|
setReenterTransition(reenterTransition);
|
||||||
|
|
||||||
cvXmrTo = view.findViewById(R.id.cvXmrTo);
|
cvXmrTo = view.findViewById(R.id.cvXmrTo);
|
||||||
tvTxXmrToKey = view.findViewById(R.id.tvTxXmrToKey);
|
tvTxXmrToKey = view.findViewById(R.id.tvTxXmrToKey);
|
||||||
tvDestinationBtc = view.findViewById(R.id.tvDestinationBtc);
|
tvDestinationBtc = view.findViewById(R.id.tvDestinationBtc);
|
||||||
@@ -121,9 +132,8 @@ public class TxFragment extends Fragment {
|
|||||||
Toast.makeText(getActivity(), getString(R.string.message_copy_xmrtokey), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), getString(R.string.message_copy_xmrtokey), Toast.LENGTH_SHORT).show();
|
||||||
});
|
});
|
||||||
|
|
||||||
Bundle args = getArguments();
|
info = getArguments().getParcelable(ARG_INFO);
|
||||||
TransactionInfo info = args.getParcelable(ARG_INFO);
|
show();
|
||||||
show(info);
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +202,7 @@ public class TxFragment extends Fragment {
|
|||||||
TransactionInfo info = null;
|
TransactionInfo info = null;
|
||||||
UserNotes userNotes = null;
|
UserNotes userNotes = null;
|
||||||
|
|
||||||
void loadNotes(TransactionInfo info) {
|
void loadNotes() {
|
||||||
if ((userNotes == null) || (info.notes == null)) {
|
if ((userNotes == null) || (info.notes == null)) {
|
||||||
info.notes = activityCallback.getTxNotes(info.hash);
|
info.notes = activityCallback.getTxNotes(info.hash);
|
||||||
}
|
}
|
||||||
@@ -205,19 +215,28 @@ public class TxFragment extends Fragment {
|
|||||||
tvTxFee.setTextColor(clr);
|
tvTxFee.setTextColor(clr);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void show(TransactionInfo info) {
|
private void showSubaddressLabel() {
|
||||||
|
final Subaddress subaddress = activityCallback.getWalletSubaddress(info.accountIndex, info.addressIndex);
|
||||||
|
final Context ctx = getContext();
|
||||||
|
Spanned label = Html.fromHtml(ctx.getString(R.string.tx_account_formatted,
|
||||||
|
info.accountIndex, info.addressIndex,
|
||||||
|
Integer.toHexString(ContextCompat.getColor(ctx, R.color.monerujoGreen) & 0xFFFFFF),
|
||||||
|
Integer.toHexString(ContextCompat.getColor(ctx, R.color.monerujoBackground) & 0xFFFFFF),
|
||||||
|
subaddress.getDisplayLabel()));
|
||||||
|
tvAccount.setText(label);
|
||||||
|
tvAccount.setOnClickListener(v -> activityCallback.showSubaddress(v, info.addressIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void show() {
|
||||||
if (info.txKey == null) {
|
if (info.txKey == null) {
|
||||||
info.txKey = activityCallback.getTxKey(info.hash);
|
info.txKey = activityCallback.getTxKey(info.hash);
|
||||||
}
|
}
|
||||||
if (info.address == null) {
|
if (info.address == null) {
|
||||||
info.address = activityCallback.getTxAddress(info.account, info.subaddress);
|
info.address = activityCallback.getTxAddress(info.accountIndex, info.addressIndex);
|
||||||
}
|
}
|
||||||
loadNotes(info);
|
loadNotes();
|
||||||
|
|
||||||
activityCallback.setSubtitle(getString(R.string.tx_title));
|
showSubaddressLabel();
|
||||||
activityCallback.setToolbarButton(Toolbar.BUTTON_BACK);
|
|
||||||
|
|
||||||
tvAccount.setText(getString(R.string.tx_account_formatted, info.account, info.subaddress));
|
|
||||||
tvAddress.setText(info.address);
|
tvAddress.setText(info.address);
|
||||||
|
|
||||||
tvTxTimestamp.setText(TS_FORMATTER.format(new Date(info.timestamp * 1000)));
|
tvTxTimestamp.setText(TS_FORMATTER.format(new Date(info.timestamp * 1000)));
|
||||||
@@ -256,8 +275,8 @@ public class TxFragment extends Fragment {
|
|||||||
setTxColour(ContextCompat.getColor(getContext(), R.color.tx_minus));
|
setTxColour(ContextCompat.getColor(getContext(), R.color.tx_minus));
|
||||||
}
|
}
|
||||||
Set<String> destinations = new HashSet<>();
|
Set<String> destinations = new HashSet<>();
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuilder sb = new StringBuilder();
|
||||||
StringBuffer dstSb = new StringBuffer();
|
StringBuilder dstSb = new StringBuilder();
|
||||||
if (info.transfers != null) {
|
if (info.transfers != null) {
|
||||||
boolean newline = false;
|
boolean newline = false;
|
||||||
for (Transfer transfer : info.transfers) {
|
for (Transfer transfer : info.transfers) {
|
||||||
@@ -281,14 +300,12 @@ public class TxFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sb.append("-");
|
sb.append("-");
|
||||||
dstSb.append(info.direction ==
|
dstSb.append(info.direction == TransactionInfo.Direction.Direction_In ?
|
||||||
TransactionInfo.Direction.Direction_In ?
|
activityCallback.getWalletSubaddress(info.accountIndex, info.addressIndex).getAddress() :
|
||||||
activityCallback.getWalletSubaddress(info.account, info.subaddress) :
|
|
||||||
"-");
|
"-");
|
||||||
}
|
}
|
||||||
tvTxTransfers.setText(sb.toString());
|
tvTxTransfers.setText(sb.toString());
|
||||||
tvDestination.setText(dstSb.toString());
|
tvDestination.setText(dstSb.toString());
|
||||||
this.info = info;
|
|
||||||
showBtcInfo();
|
showBtcInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +351,7 @@ public class TxFragment extends Fragment {
|
|||||||
final MaterialContainerTransform transform = new MaterialContainerTransform();
|
final MaterialContainerTransform transform = new MaterialContainerTransform();
|
||||||
transform.setDrawingViewId(R.id.fragment_container);
|
transform.setDrawingViewId(R.id.fragment_container);
|
||||||
transform.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
transform.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
||||||
transform.setAllContainerColors(ThemeHelper.getThemedColor(getContext(), R.attr.colorSurface));
|
transform.setAllContainerColors(ThemeHelper.getThemedColor(getContext(), android.R.attr.colorBackground));
|
||||||
setSharedElementEnterTransition(transform);
|
setSharedElementEnterTransition(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +364,7 @@ public class TxFragment extends Fragment {
|
|||||||
Listener activityCallback;
|
Listener activityCallback;
|
||||||
|
|
||||||
public interface Listener {
|
public interface Listener {
|
||||||
String getWalletSubaddress(int accountIndex, int subaddressIndex);
|
Subaddress getWalletSubaddress(int accountIndex, int subaddressIndex);
|
||||||
|
|
||||||
String getTxKey(String hash);
|
String getTxKey(String hash);
|
||||||
|
|
||||||
@@ -361,6 +378,8 @@ public class TxFragment extends Fragment {
|
|||||||
|
|
||||||
void setSubtitle(String subtitle);
|
void setSubtitle(String subtitle);
|
||||||
|
|
||||||
|
void showSubaddress(View view, final int subaddressIndex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -385,4 +404,13 @@ public class TxFragment extends Fragment {
|
|||||||
Helper.hideKeyboard(getActivity());
|
Helper.hideKeyboard(getActivity());
|
||||||
super.onPause();
|
super.onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
Timber.d("onResume()");
|
||||||
|
activityCallback.setSubtitle(getString(R.string.tx_title));
|
||||||
|
activityCallback.setToolbarButton(Toolbar.BUTTON_BACK);
|
||||||
|
showSubaddressLabel();
|
||||||
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@@ -79,6 +79,7 @@ public class WalletFragment extends Fragment
|
|||||||
private Button bSend;
|
private Button bSend;
|
||||||
private ImageView ivStreetGunther;
|
private ImageView ivStreetGunther;
|
||||||
private Drawable streetGunther = null;
|
private Drawable streetGunther = null;
|
||||||
|
RecyclerView txlist;
|
||||||
|
|
||||||
private Spinner sCurrency;
|
private Spinner sCurrency;
|
||||||
|
|
||||||
@@ -106,13 +107,6 @@ public class WalletFragment extends Fragment
|
|||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_wallet, container, false);
|
View view = inflater.inflate(R.layout.fragment_wallet, container, false);
|
||||||
|
|
||||||
final MaterialElevationScale exitTransition = new MaterialElevationScale(false);
|
|
||||||
exitTransition.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
|
||||||
setExitTransition(exitTransition);
|
|
||||||
final MaterialElevationScale reenterTransition = new MaterialElevationScale(true);
|
|
||||||
reenterTransition.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
|
||||||
setReenterTransition(reenterTransition);
|
|
||||||
|
|
||||||
ivStreetGunther = view.findViewById(R.id.ivStreetGunther);
|
ivStreetGunther = view.findViewById(R.id.ivStreetGunther);
|
||||||
tvStreetView = view.findViewById(R.id.tvStreetView);
|
tvStreetView = view.findViewById(R.id.tvStreetView);
|
||||||
llBalance = view.findViewById(R.id.llBalance);
|
llBalance = view.findViewById(R.id.llBalance);
|
||||||
@@ -140,13 +134,19 @@ public class WalletFragment extends Fragment
|
|||||||
bSend = view.findViewById(R.id.bSend);
|
bSend = view.findViewById(R.id.bSend);
|
||||||
bReceive = view.findViewById(R.id.bReceive);
|
bReceive = view.findViewById(R.id.bReceive);
|
||||||
|
|
||||||
RecyclerView recyclerView = view.findViewById(R.id.list);
|
txlist = view.findViewById(R.id.list);
|
||||||
|
|
||||||
adapter = new TransactionInfoAdapter(getActivity(), this);
|
adapter = new TransactionInfoAdapter(getActivity(), this);
|
||||||
recyclerView.setAdapter(adapter);
|
txlist.setAdapter(adapter);
|
||||||
|
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
||||||
|
@Override
|
||||||
|
public void onItemRangeInserted(int positionStart, int itemCount) {
|
||||||
|
if ((positionStart == 0) && (txlist.computeVerticalScrollOffset() == 0))
|
||||||
|
txlist.scrollToPosition(positionStart);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
SwipeableRecyclerViewTouchListener swipeTouchListener =
|
txlist.addOnItemTouchListener(
|
||||||
new SwipeableRecyclerViewTouchListener(recyclerView,
|
new SwipeableRecyclerViewTouchListener(txlist,
|
||||||
new SwipeableRecyclerViewTouchListener.SwipeListener() {
|
new SwipeableRecyclerViewTouchListener.SwipeListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean canSwipeLeft(int position) {
|
public boolean canSwipeLeft(int position) {
|
||||||
@@ -173,10 +173,7 @@ public class WalletFragment extends Fragment
|
|||||||
adapter.removeItem(position);
|
adapter.removeItem(position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
|
|
||||||
recyclerView.addOnItemTouchListener(swipeTouchListener);
|
|
||||||
|
|
||||||
|
|
||||||
bSend.setOnClickListener(v -> activityCallback.onSendRequest(v));
|
bSend.setOnClickListener(v -> activityCallback.onSendRequest(v));
|
||||||
bReceive.setOnClickListener(v -> activityCallback.onWalletReceive(v));
|
bReceive.setOnClickListener(v -> activityCallback.onWalletReceive(v));
|
||||||
@@ -338,24 +335,34 @@ public class WalletFragment extends Fragment
|
|||||||
final MaterialElevationScale reenterTransition = new MaterialElevationScale(true);
|
final MaterialElevationScale reenterTransition = new MaterialElevationScale(true);
|
||||||
reenterTransition.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
reenterTransition.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
||||||
setReenterTransition(reenterTransition);
|
setReenterTransition(reenterTransition);
|
||||||
|
|
||||||
activityCallback.onTxDetailsRequest(view, infoItem);
|
activityCallback.onTxDetailsRequest(view, infoItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// called from activity
|
// called from activity
|
||||||
|
|
||||||
|
|
||||||
|
// if account index has changed scroll to top?
|
||||||
|
private int accountIndex = 0;
|
||||||
|
|
||||||
public void onRefreshed(final Wallet wallet, final boolean full) {
|
public void onRefreshed(final Wallet wallet, final boolean full) {
|
||||||
Timber.d("onRefreshed(%b)", full);
|
Timber.d("onRefreshed(%b)", full);
|
||||||
|
|
||||||
if (full) {
|
if (full) {
|
||||||
List<TransactionInfo> list = new ArrayList<>();
|
List<TransactionInfo> list = new ArrayList<>();
|
||||||
final long streetHeight = activityCallback.getStreetModeHeight();
|
final long streetHeight = activityCallback.getStreetModeHeight();
|
||||||
Timber.d("StreetHeight=%d", streetHeight);
|
Timber.d("StreetHeight=%d", streetHeight);
|
||||||
for (TransactionInfo info : wallet.getHistory().getAll()) {
|
for (TransactionInfo info : wallet.getHistory().getAll()) {
|
||||||
Timber.d("TxHeight=%d", info.blockheight);
|
Timber.d("TxHeight=%d, Label=%s", info.blockheight, info.subaddressLabel);
|
||||||
if ((info.isPending || (info.blockheight >= streetHeight))
|
if ((info.isPending || (info.blockheight >= streetHeight))
|
||||||
&& !dismissedTransactions.contains(info.hash))
|
&& !dismissedTransactions.contains(info.hash))
|
||||||
list.add(info);
|
list.add(info);
|
||||||
}
|
}
|
||||||
adapter.setInfos(list);
|
adapter.setInfos(list);
|
||||||
|
if (accountIndex != wallet.getAccountIndex()) {
|
||||||
|
accountIndex = wallet.getAccountIndex();
|
||||||
|
txlist.scrollToPosition(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateStatus(wallet);
|
updateStatus(wallet);
|
||||||
}
|
}
|
||||||
@@ -522,9 +529,10 @@ public class WalletFragment extends Fragment
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
setExitTransition(null);
|
||||||
|
setReenterTransition(null);
|
||||||
Timber.d("onResume()");
|
Timber.d("onResume()");
|
||||||
activityCallback.setTitle(walletTitle, walletSubtitle);
|
activityCallback.setTitle(walletTitle, walletSubtitle);
|
||||||
//activityCallback.setToolbarButton(Toolbar.BUTTON_CLOSE); // TODO: Close button somewhere else
|
|
||||||
activityCallback.setToolbarButton(Toolbar.BUTTON_NONE);
|
activityCallback.setToolbarButton(Toolbar.BUTTON_NONE);
|
||||||
setProgress(syncProgress);
|
setProgress(syncProgress);
|
||||||
setProgress(syncText);
|
setProgress(syncText);
|
||||||
|
59
app/src/main/java/com/m2049r/xmrwallet/data/Subaddress.java
Normal file
59
app/src/main/java/com/m2049r/xmrwallet/data/Subaddress.java
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 m2049r
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.m2049r.xmrwallet.data;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class Subaddress implements Comparable<Subaddress> {
|
||||||
|
@Getter
|
||||||
|
final private int accountIndex;
|
||||||
|
@Getter
|
||||||
|
final private int addressIndex;
|
||||||
|
@Getter
|
||||||
|
final private String address;
|
||||||
|
@Getter
|
||||||
|
private final String label;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Subaddress another) { // newer is <
|
||||||
|
final int compareAccountIndex = another.accountIndex - accountIndex;
|
||||||
|
if (compareAccountIndex == 0)
|
||||||
|
return another.addressIndex - addressIndex;
|
||||||
|
return compareAccountIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSquashedAddress() {
|
||||||
|
return address.substring(0, 8) + "…" + address.substring(address.length() - 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Pattern DEFAULT_LABEL_FORMATTER = Pattern.compile("^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}:[0-9]{2}:[0-9]{2}$");
|
||||||
|
|
||||||
|
public String getDisplayLabel() {
|
||||||
|
if (label.isEmpty() || (DEFAULT_LABEL_FORMATTER.matcher(label).matches()))
|
||||||
|
return ("#" + addressIndex);
|
||||||
|
else
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
}
|
@@ -547,7 +547,7 @@ public class SendFragment extends Fragment
|
|||||||
final MaterialContainerTransform transform = new MaterialContainerTransform();
|
final MaterialContainerTransform transform = new MaterialContainerTransform();
|
||||||
transform.setDrawingViewId(R.id.fragment_container);
|
transform.setDrawingViewId(R.id.fragment_container);
|
||||||
transform.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
transform.setDuration(getResources().getInteger(R.integer.tx_item_transition_duration));
|
||||||
transform.setAllContainerColors(ThemeHelper.getThemedColor(Objects.requireNonNull(getContext()), R.attr.colorSurface));
|
transform.setAllContainerColors(ThemeHelper.getThemedColor(getContext(), android.R.attr.colorBackground));
|
||||||
setSharedElementEnterTransition(transform);
|
setSharedElementEnterTransition(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ public class NodeInfoAdapter extends RecyclerView.Adapter<NodeInfoAdapter.ViewHo
|
|||||||
public interface OnInteractionListener {
|
public interface OnInteractionListener {
|
||||||
void onInteraction(View view, NodeInfo item);
|
void onInteraction(View view, NodeInfo item);
|
||||||
|
|
||||||
void onLongInteraction(View view, NodeInfo item);
|
boolean onLongInteraction(View view, NodeInfo item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final List<NodeInfo> nodeItems = new ArrayList<>();
|
private final List<NodeInfo> nodeItems = new ArrayList<>();
|
||||||
@@ -213,10 +213,10 @@ public class NodeInfoAdapter extends RecyclerView.Adapter<NodeInfoAdapter.ViewHo
|
|||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
int position = getAdapterPosition(); // gets item position
|
int position = getAdapterPosition(); // gets item position
|
||||||
if (position != RecyclerView.NO_POSITION) { // Check if an item was deleted, but the user clicked it before the UI removed it
|
if (position != RecyclerView.NO_POSITION) { // Check if an item was deleted, but the user clicked it before the UI removed it
|
||||||
listener.onLongInteraction(view, nodeItems.get(position));
|
return listener.onLongInteraction(view, nodeItems.get(position));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,155 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 m2049r
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.m2049r.xmrwallet.layout;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.DiffUtil;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.m2049r.xmrwallet.R;
|
||||||
|
import com.m2049r.xmrwallet.data.Subaddress;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import timber.log.Timber;
|
||||||
|
|
||||||
|
public class SubaddressInfoAdapter extends RecyclerView.Adapter<SubaddressInfoAdapter.ViewHolder> {
|
||||||
|
public interface OnInteractionListener {
|
||||||
|
void onInteraction(View view, Subaddress item);
|
||||||
|
|
||||||
|
boolean onLongInteraction(View view, Subaddress item);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final List<Subaddress> items;
|
||||||
|
private final OnInteractionListener listener;
|
||||||
|
|
||||||
|
Context context;
|
||||||
|
|
||||||
|
public SubaddressInfoAdapter(Context context, OnInteractionListener listener) {
|
||||||
|
this.context = context;
|
||||||
|
this.items = new ArrayList<>();
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class SubaddressInfoDiff extends DiffCallback<Subaddress> {
|
||||||
|
|
||||||
|
public SubaddressInfoDiff(List<Subaddress> oldList, List<Subaddress> newList) {
|
||||||
|
super(oldList, newList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
|
||||||
|
return mOldList.get(oldItemPosition).getAddress().equals(mNewList.get(newItemPosition).getAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
|
||||||
|
return mOldList.get(oldItemPosition).equals(mNewList.get(newItemPosition));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.item_subaddress, parent, false);
|
||||||
|
return new ViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||||
|
holder.bind(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Subaddress getItem(int position) {
|
||||||
|
return items.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInfos(List<Subaddress> newItems) {
|
||||||
|
if (newItems == null) {
|
||||||
|
newItems = new ArrayList<>();
|
||||||
|
Timber.d("setInfos null");
|
||||||
|
} else {
|
||||||
|
Timber.d("setInfos %s", newItems.size());
|
||||||
|
}
|
||||||
|
Collections.sort(newItems);
|
||||||
|
final DiffCallback<Subaddress> diffCallback = new SubaddressInfoDiff(items, newItems);
|
||||||
|
final DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(diffCallback);
|
||||||
|
items.clear();
|
||||||
|
items.addAll(newItems);
|
||||||
|
diffResult.dispatchUpdatesTo(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||||
|
final TextView tvName;
|
||||||
|
final TextView tvAddress;
|
||||||
|
Subaddress item;
|
||||||
|
|
||||||
|
ViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
tvName = itemView.findViewById(R.id.tvName);
|
||||||
|
tvAddress = itemView.findViewById(R.id.tvAddress);
|
||||||
|
itemView.setOnClickListener(this);
|
||||||
|
itemView.setOnLongClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bind(int position) {
|
||||||
|
item = getItem(position);
|
||||||
|
itemView.setTransitionName(context.getString(R.string.subaddress_item_transition_name, item.getAddressIndex()));
|
||||||
|
|
||||||
|
final String label = item.getDisplayLabel();
|
||||||
|
final String address = context.getString(R.string.subbaddress_info_subtitle,
|
||||||
|
item.getAddressIndex(), item.getSquashedAddress());
|
||||||
|
tvName.setText(label.isEmpty() ? address : label);
|
||||||
|
tvAddress.setText(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (listener != null) {
|
||||||
|
int position = getAdapterPosition(); // gets item position
|
||||||
|
if (position != RecyclerView.NO_POSITION) { // Check if an item was deleted, but the user clicked it before the UI removed it
|
||||||
|
listener.onInteraction(view, getItem(position));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onLongClick(View view) {
|
||||||
|
if (listener != null) {
|
||||||
|
int position = getAdapterPosition(); // gets item position
|
||||||
|
if (position != RecyclerView.NO_POSITION) { // Check if an item was deleted, but the user clicked it before the UI removed it
|
||||||
|
return listener.onLongInteraction(view, getItem(position));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -17,6 +17,8 @@
|
|||||||
package com.m2049r.xmrwallet.layout;
|
package com.m2049r.xmrwallet.layout;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -46,7 +48,6 @@ import java.util.TimeZone;
|
|||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfoAdapter.ViewHolder> {
|
public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfoAdapter.ViewHolder> {
|
||||||
|
|
||||||
private final SimpleDateFormat DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
private final SimpleDateFormat DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||||
|
|
||||||
private final int outboundColour;
|
private final int outboundColour;
|
||||||
@@ -94,6 +95,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|||||||
return (oldItem.direction == newItem.direction)
|
return (oldItem.direction == newItem.direction)
|
||||||
&& (oldItem.isPending == newItem.isPending)
|
&& (oldItem.isPending == newItem.isPending)
|
||||||
&& (oldItem.isFailed == newItem.isFailed)
|
&& (oldItem.isFailed == newItem.isFailed)
|
||||||
|
&& (oldItem.subaddressLabel.equals(newItem.subaddressLabel))
|
||||||
&& (Objects.equals(oldItem.notes, newItem.notes));
|
&& (Objects.equals(oldItem.notes, newItem.notes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -211,14 +213,25 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
|||||||
setTxColour(outboundColour);
|
setTxColour(outboundColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String tag = null;
|
||||||
|
String info = "";
|
||||||
|
if ((infoItem.addressIndex != 0) && (infoItem.direction == TransactionInfo.Direction.Direction_In))
|
||||||
|
tag = infoItem.getDisplayLabel();
|
||||||
if ((userNotes.note.isEmpty())) {
|
if ((userNotes.note.isEmpty())) {
|
||||||
this.tvPaymentId.setText(infoItem.paymentId.equals("0000000000000000") ?
|
if (!infoItem.paymentId.equals("0000000000000000")) {
|
||||||
(infoItem.subaddress != 0 ?
|
info = infoItem.paymentId;
|
||||||
(context.getString(R.string.tx_subaddress, infoItem.subaddress)) :
|
}
|
||||||
"") :
|
|
||||||
infoItem.paymentId);
|
|
||||||
} else {
|
} else {
|
||||||
this.tvPaymentId.setText(userNotes.note);
|
info = userNotes.note;
|
||||||
|
}
|
||||||
|
if (tag == null) {
|
||||||
|
tvPaymentId.setText(info);
|
||||||
|
} else {
|
||||||
|
Spanned label = Html.fromHtml(context.getString(R.string.tx_details_notes,
|
||||||
|
Integer.toHexString(ContextCompat.getColor(context, R.color.monerujoGreen) & 0xFFFFFF),
|
||||||
|
Integer.toHexString(ContextCompat.getColor(context, R.color.monerujoBackground) & 0xFFFFFF),
|
||||||
|
tag, info.isEmpty() ? "" : (" " + info)));
|
||||||
|
tvPaymentId.setText(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tvDateTime.setText(getDateTime(infoItem.timestamp));
|
this.tvDateTime.setText(getDateTime(infoItem.timestamp));
|
||||||
|
@@ -71,18 +71,18 @@ public class TransactionHistory {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
List<TransactionInfo> t = refreshJ();
|
List<TransactionInfo> transactionInfos = refreshJ();
|
||||||
Timber.d("refreshed %d", t.size());
|
Timber.d("refreshed %d", transactionInfos.size());
|
||||||
for (Iterator<TransactionInfo> iterator = t.iterator(); iterator.hasNext(); ) {
|
for (Iterator<TransactionInfo> iterator = transactionInfos.iterator(); iterator.hasNext(); ) {
|
||||||
TransactionInfo info = iterator.next();
|
TransactionInfo info = iterator.next();
|
||||||
if (info.account != accountIndex) {
|
if (info.accountIndex != accountIndex) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
Timber.d("removed %s", info.hash);
|
Timber.d("removed %s", info.hash);
|
||||||
} else {
|
} else {
|
||||||
Timber.d("kept %s", info.hash);
|
Timber.d("kept %s", info.hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
transactions = t;
|
transactions = transactionInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private native List<TransactionInfo> refreshJ();
|
private native List<TransactionInfo> refreshJ();
|
||||||
|
@@ -19,13 +19,17 @@ package com.m2049r.xmrwallet.model;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.m2049r.xmrwallet.data.Subaddress;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
// this is not the TransactionInfo from the API as that is owned by the TransactionHistory
|
// this is not the TransactionInfo from the API as that is owned by the TransactionHistory
|
||||||
// this is a POJO for the TransactionInfoAdapter
|
// this is a POJO for the TransactionInfoAdapter
|
||||||
public class TransactionInfo implements Parcelable, Comparable<TransactionInfo> {
|
public class TransactionInfo implements Parcelable, Comparable<TransactionInfo> {
|
||||||
static final String TAG = "TransactionInfo";
|
@RequiredArgsConstructor
|
||||||
|
|
||||||
public enum Direction {
|
public enum Direction {
|
||||||
Direction_In(0),
|
Direction_In(0),
|
||||||
Direction_Out(1);
|
Direction_Out(1);
|
||||||
@@ -40,15 +44,8 @@ public class TransactionInfo implements Parcelable, Comparable<TransactionInfo>
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getValue() {
|
@Getter
|
||||||
return value;
|
private final int value;
|
||||||
}
|
|
||||||
|
|
||||||
private int value;
|
|
||||||
|
|
||||||
Direction(int value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Direction direction;
|
public Direction direction;
|
||||||
@@ -60,8 +57,8 @@ public class TransactionInfo implements Parcelable, Comparable<TransactionInfo>
|
|||||||
public String hash;
|
public String hash;
|
||||||
public long timestamp;
|
public long timestamp;
|
||||||
public String paymentId;
|
public String paymentId;
|
||||||
public int account;
|
public int accountIndex;
|
||||||
public int subaddress;
|
public int addressIndex;
|
||||||
public long confirmations;
|
public long confirmations;
|
||||||
public String subaddressLabel;
|
public String subaddressLabel;
|
||||||
public List<Transfer> transfers;
|
public List<Transfer> transfers;
|
||||||
@@ -80,8 +77,8 @@ public class TransactionInfo implements Parcelable, Comparable<TransactionInfo>
|
|||||||
String hash,
|
String hash,
|
||||||
long timestamp,
|
long timestamp,
|
||||||
String paymentId,
|
String paymentId,
|
||||||
int account,
|
int accountIndex,
|
||||||
int subaddress,
|
int addressIndex,
|
||||||
long confirmations,
|
long confirmations,
|
||||||
String subaddressLabel,
|
String subaddressLabel,
|
||||||
List<Transfer> transfers) {
|
List<Transfer> transfers) {
|
||||||
@@ -94,13 +91,20 @@ public class TransactionInfo implements Parcelable, Comparable<TransactionInfo>
|
|||||||
this.hash = hash;
|
this.hash = hash;
|
||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
this.paymentId = paymentId;
|
this.paymentId = paymentId;
|
||||||
this.account = account;
|
this.accountIndex = accountIndex;
|
||||||
this.subaddress = subaddress;
|
this.addressIndex = addressIndex;
|
||||||
this.confirmations = confirmations;
|
this.confirmations = confirmations;
|
||||||
this.subaddressLabel = subaddressLabel;
|
this.subaddressLabel = subaddressLabel;
|
||||||
this.transfers = transfers;
|
this.transfers = transfers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDisplayLabel() {
|
||||||
|
if (subaddressLabel.isEmpty() || (Subaddress.DEFAULT_LABEL_FORMATTER.matcher(subaddressLabel).matches()))
|
||||||
|
return ("#" + addressIndex);
|
||||||
|
else
|
||||||
|
return subaddressLabel;
|
||||||
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return direction + "@" + blockheight + " " + amount;
|
return direction + "@" + blockheight + " " + amount;
|
||||||
}
|
}
|
||||||
@@ -116,8 +120,8 @@ public class TransactionInfo implements Parcelable, Comparable<TransactionInfo>
|
|||||||
out.writeString(hash);
|
out.writeString(hash);
|
||||||
out.writeLong(timestamp);
|
out.writeLong(timestamp);
|
||||||
out.writeString(paymentId);
|
out.writeString(paymentId);
|
||||||
out.writeInt(account);
|
out.writeInt(accountIndex);
|
||||||
out.writeInt(subaddress);
|
out.writeInt(addressIndex);
|
||||||
out.writeLong(confirmations);
|
out.writeLong(confirmations);
|
||||||
out.writeString(subaddressLabel);
|
out.writeString(subaddressLabel);
|
||||||
out.writeList(transfers);
|
out.writeList(transfers);
|
||||||
@@ -146,8 +150,8 @@ public class TransactionInfo implements Parcelable, Comparable<TransactionInfo>
|
|||||||
hash = in.readString();
|
hash = in.readString();
|
||||||
timestamp = in.readLong();
|
timestamp = in.readLong();
|
||||||
paymentId = in.readString();
|
paymentId = in.readString();
|
||||||
account = in.readInt();
|
accountIndex = in.readInt();
|
||||||
subaddress = in.readInt();
|
addressIndex = in.readInt();
|
||||||
confirmations = in.readLong();
|
confirmations = in.readLong();
|
||||||
subaddressLabel = in.readString();
|
subaddressLabel = in.readString();
|
||||||
transfers = in.readArrayList(Transfer.class.getClassLoader());
|
transfers = in.readArrayList(Transfer.class.getClassLoader());
|
||||||
|
@@ -19,6 +19,7 @@ package com.m2049r.xmrwallet.model;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.m2049r.xmrwallet.data.Subaddress;
|
||||||
import com.m2049r.xmrwallet.data.TxData;
|
import com.m2049r.xmrwallet.data.TxData;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -26,6 +27,8 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class Wallet {
|
public class Wallet {
|
||||||
@@ -104,10 +107,14 @@ public class Wallet {
|
|||||||
this.accountIndex = accountIndex;
|
this.accountIndex = accountIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
public enum Device {
|
public enum Device {
|
||||||
Device_Undefined,
|
Device_Undefined(0, 0),
|
||||||
Device_Software,
|
Device_Software(50, 200),
|
||||||
Device_Ledger
|
Device_Ledger(5, 20);
|
||||||
|
private final int accountLookahead;
|
||||||
|
private final int subaddressLookahead;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum StatusEnum {
|
public enum StatusEnum {
|
||||||
@@ -160,6 +167,15 @@ public class Wallet {
|
|||||||
|
|
||||||
private native String getAddressJ(int accountIndex, int addressIndex);
|
private native String getAddressJ(int accountIndex, int addressIndex);
|
||||||
|
|
||||||
|
public Subaddress getSubaddressObject(int accountIndex, int subAddressIndex) {
|
||||||
|
return new Subaddress(accountIndex, subAddressIndex,
|
||||||
|
getSubaddress(subAddressIndex), getSubaddressLabel(subAddressIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Subaddress getSubaddressObject(int subAddressIndex) {
|
||||||
|
return getSubaddressObject(accountIndex, subAddressIndex);
|
||||||
|
}
|
||||||
|
|
||||||
public native String getPath();
|
public native String getPath();
|
||||||
|
|
||||||
public NetworkType getNetworkType() {
|
public NetworkType getNetworkType() {
|
||||||
@@ -428,6 +444,11 @@ public class Wallet {
|
|||||||
setSubaddressLabel(accountIndex, 0, label);
|
setSubaddressLabel(accountIndex, 0, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSubaddressLabel(int addressIndex, String label) {
|
||||||
|
setSubaddressLabel(accountIndex, addressIndex, label);
|
||||||
|
getHistory().refreshWithNotes(this);
|
||||||
|
}
|
||||||
|
|
||||||
public native void setSubaddressLabel(int accountIndex, int addressIndex, String label);
|
public native void setSubaddressLabel(int accountIndex, int addressIndex, String label);
|
||||||
|
|
||||||
public native int getNumAccounts();
|
public native int getNumAccounts();
|
||||||
|
@@ -26,18 +26,27 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/MoneroText.Label"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:text="@string/tx_subaddress"
|
||||||
|
android:textAlignment="textStart" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvAddressLabel"
|
android:id="@+id/tvAddress"
|
||||||
style="@style/MoneroLabel.Heading"
|
style="@style/MoneroText.Medium"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="start"
|
||||||
android:text="@string/generate_address_label" />
|
android:layout_weight="1"
|
||||||
|
tools:text="TAG 9wZnnNctRc7RaLya1rxykH21dUwfQpNGmVLjAvkvqe7nKT2Mw848AJNGMunW5xjoSZ5vCCU3uDnUoVqSSHxzRtQBE3f6crx" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/bCopyAddress"
|
android:id="@+id/bCopyAddress"
|
||||||
@@ -45,33 +54,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:background="?android:selectableItemBackground"
|
android:background="?android:selectableItemBackground"
|
||||||
|
android:padding="8dp"
|
||||||
android:src="@drawable/ic_content_copy_24dp" />
|
android:src="@drawable/ic_content_copy_24dp" />
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:weightSum="10">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvAddress"
|
|
||||||
style="@style/MoneroText.Medium"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_weight="10"
|
|
||||||
android:textAlignment="center"
|
|
||||||
tools:text="9wZnnNctRc7RaLya1rxykH21dUwfQpNGmVLjAvkvqe7nKT2Mw848AJNGMunW5xjoSZ5vCCU3uDnUoVqSSHxzRtQBE3f6crx" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/bSubaddress"
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:background="?android:selectableItemBackground"
|
|
||||||
android:src="@drawable/ic_refresh_24dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
74
app/src/main/res/layout/fragment_subaddress.xml
Normal file
74
app/src/main/res/layout/fragment_subaddress.xml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvInstruction"
|
||||||
|
style="@style/MoneroText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/header_top"
|
||||||
|
android:layout_marginBottom="@dimen/data_top"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/subaddress_select_label" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="80dp"
|
||||||
|
android:transitionGroup="true"
|
||||||
|
app:layoutManager="LinearLayoutManager"
|
||||||
|
tools:listitem="@layout/item_subaddress" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvHint"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:text="@string/subaddress_details_hint"
|
||||||
|
app:drawableStartCompat="@drawable/ic_info_outline_gray_24dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:background="@drawable/gradient_oval"
|
||||||
|
android:elevation="6dp">
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:backgroundTint="@android:color/transparent"
|
||||||
|
android:backgroundTintMode="src_in"
|
||||||
|
android:src="@drawable/ic_add_white_24dp"
|
||||||
|
app:borderWidth="0dp"
|
||||||
|
app:elevation="0dp"
|
||||||
|
app:fabSize="normal"
|
||||||
|
app:pressedTranslationZ="0dp" />
|
||||||
|
</FrameLayout>
|
||||||
|
</FrameLayout>
|
56
app/src/main/res/layout/fragment_subaddressinfo.xml
Normal file
56
app/src/main/res/layout/fragment_subaddressinfo.xml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:transitionName="@string/subaddress_info_transition_name">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvAddress"
|
||||||
|
style="@style/MoneroText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/header_top_first"
|
||||||
|
tools:text="#1: 8AioXCmK...aGivEa7C" />
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/etName"
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/header_top_first"
|
||||||
|
android:layout_marginBottom="@dimen/header_top_first">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
style="@style/MoneroEdit"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/subbaddress_name_hint"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textAlignment="textStart" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTxLabel"
|
||||||
|
style="@style/MoneroText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/section_top"
|
||||||
|
android:layout_marginBottom="@dimen/header_top"
|
||||||
|
android:text="@string/subaddress_tx_label" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="80dp"
|
||||||
|
android:transitionGroup="true"
|
||||||
|
app:layoutManager="LinearLayoutManager"
|
||||||
|
tools:listitem="@layout/item_transaction" />
|
||||||
|
</LinearLayout>
|
@@ -206,9 +206,8 @@
|
|||||||
android:paddingStart="8dp"
|
android:paddingStart="8dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingEnd="8dp"
|
android:paddingEnd="8dp"
|
||||||
android:selectAllOnFocus="true"
|
android:transitionName="@string/subaddress_txinfo_transition_name"
|
||||||
android:textIsSelectable="true"
|
tools:text="(0,1) #17" />
|
||||||
tools:text="(0,1)" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvAddress"
|
android:id="@+id/tvAddress"
|
||||||
|
32
app/src/main/res/layout/item_subaddress.xml
Normal file
32
app/src/main/res/layout/item_subaddress.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvName"
|
||||||
|
style="@style/MoneroText.Label.Subaddress"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
tools:text="My First Subaddress" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvAddress"
|
||||||
|
style="@style/MoneroText.Small"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="#1: 8AioXCmK...aGivEa7C" />
|
||||||
|
</LinearLayout>
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
@@ -6,11 +6,6 @@
|
|||||||
android:orderInCategory="50"
|
android:orderInCategory="50"
|
||||||
android:title="@string/menu_streetmode" />
|
android:title="@string/menu_streetmode" />
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_receive"
|
|
||||||
android:orderInCategory="100"
|
|
||||||
android:title="@string/menu_receive" />
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_rename"
|
android:id="@+id/action_rename"
|
||||||
android:orderInCategory="200"
|
android:orderInCategory="200"
|
||||||
|
@@ -16,6 +16,12 @@
|
|||||||
android:title="@string/menu_rename"
|
android:title="@string/menu_rename"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_subaddresses"
|
||||||
|
android:orderInCategory="250"
|
||||||
|
android:title="@string/subbaddress_title"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_help_wallet"
|
android:id="@+id/action_help_wallet"
|
||||||
android:orderInCategory="300"
|
android:orderInCategory="300"
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<string name="menu_share">Compartir</string>
|
<string name="menu_share">Compartir</string>
|
||||||
<string name="menu_help">Ajuda</string>
|
<string name="menu_help">Ajuda</string>
|
||||||
<string name="menu_receive">Rebre</string>
|
<string name="menu_receive">Rebre</string>
|
||||||
<string name="menu_rename">Canvi de nom …</string>
|
<string name="menu_rename">Canvi de nom</string>
|
||||||
<string name="menu_archive">Arxivar</string>
|
<string name="menu_archive">Arxivar</string>
|
||||||
<string name="menu_backup">Còpia de seguretat</string>
|
<string name="menu_backup">Còpia de seguretat</string>
|
||||||
<string name="menu_changepw">Canvi de contrasenya</string>
|
<string name="menu_changepw">Canvi de contrasenya</string>
|
||||||
@@ -287,8 +287,8 @@
|
|||||||
<string name="tx_account">Compte #</string>
|
<string name="tx_account">Compte #</string>
|
||||||
|
|
||||||
<string name="send_sweepall">Envia tots els fons confirmats cap aquest compte!</string>
|
<string name="send_sweepall">Envia tots els fons confirmats cap aquest compte!</string>
|
||||||
<string name="tx_subaddress">Subadreces #%1$d</string>
|
<string name="tx_subaddress">Subadreces</string>
|
||||||
<string name="generate_address_label_sub">Subadreces Públiques #%1$d</string>
|
<string name="generate_address_label_sub">Subadreces Públiques #%1$d: %2$s</string>
|
||||||
|
|
||||||
<string name="menu_language">Idioma</string>
|
<string name="menu_language">Idioma</string>
|
||||||
<string name="language_system_default">Utilitzar Idioma del Sistema</string>
|
<string name="language_system_default">Utilitzar Idioma del Sistema</string>
|
||||||
@@ -410,4 +410,14 @@
|
|||||||
<string name="info_xmrto_help_xmr"><![CDATA[
|
<string name="info_xmrto_help_xmr"><![CDATA[
|
||||||
<b>Please enter or scan a Monero address.</b>
|
<b>Please enter or scan a Monero address.</b>
|
||||||
]]></string>
|
]]></string>
|
||||||
|
|
||||||
|
<string name="subbaddress_title">Subaddresses</string>
|
||||||
|
<string name="subbaddress_name_hint">Subaddress Name</string>
|
||||||
|
<string name="max_subaddress_warning">Too many unused addresses - use some to enable creating more!</string>
|
||||||
|
<string name="max_account_warning">Too many unused accounts - use some to enable creating more!</string>
|
||||||
|
<string name="subaddress_tx_label">Transactions for this subaddress:</string>
|
||||||
|
<string name="subaddress_notx_label">No transactions for this subaddress yet</string>
|
||||||
|
<string name="subaddress_select_label">Select a subaddress</string>
|
||||||
|
<string name="subaddress_details_hint">Long-press for details</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<string name="menu_share">Teilen</string>
|
<string name="menu_share">Teilen</string>
|
||||||
<string name="menu_help">Hilfe</string>
|
<string name="menu_help">Hilfe</string>
|
||||||
<string name="menu_receive">Empfangen</string>
|
<string name="menu_receive">Empfangen</string>
|
||||||
<string name="menu_rename">Umbenennen …</string>
|
<string name="menu_rename">Umbenennen</string>
|
||||||
<string name="menu_archive">Archivieren</string>
|
<string name="menu_archive">Archivieren</string>
|
||||||
<string name="menu_backup">Backup</string>
|
<string name="menu_backup">Backup</string>
|
||||||
<string name="menu_changepw">Passwort ändern</string>
|
<string name="menu_changepw">Passwort ändern</string>
|
||||||
@@ -280,8 +280,8 @@
|
|||||||
<string name="tx_account">Konto #</string>
|
<string name="tx_account">Konto #</string>
|
||||||
|
|
||||||
<string name="send_sweepall">Versende ALLE(!) verfügbaren Gelder aus diesem Konto</string>
|
<string name="send_sweepall">Versende ALLE(!) verfügbaren Gelder aus diesem Konto</string>
|
||||||
<string name="tx_subaddress">Subadresse #%1$d</string>
|
<string name="tx_subaddress">Subadresse</string>
|
||||||
<string name="generate_address_label_sub">Öffentliche Subadresse #%1$d</string>
|
<string name="generate_address_label_sub">Öffentliche Subadresse #%1$d: %2$s</string>
|
||||||
|
|
||||||
<string name="menu_language">Sprache</string>
|
<string name="menu_language">Sprache</string>
|
||||||
<string name="language_system_default">Benutze Systemsprache</string>
|
<string name="language_system_default">Benutze Systemsprache</string>
|
||||||
@@ -412,4 +412,14 @@
|
|||||||
<string name="info_xmrto_help_xmr"><![CDATA[
|
<string name="info_xmrto_help_xmr"><![CDATA[
|
||||||
<b>Please enter or scan a Monero address.</b>
|
<b>Please enter or scan a Monero address.</b>
|
||||||
]]></string>
|
]]></string>
|
||||||
|
|
||||||
|
<string name="subbaddress_title">Subaddresses</string>
|
||||||
|
<string name="subbaddress_name_hint">Subaddress Name</string>
|
||||||
|
<string name="max_subaddress_warning">Too many unused addresses - use some to enable creating more!</string>
|
||||||
|
<string name="max_account_warning">Too many unused accounts - use some to enable creating more!</string>
|
||||||
|
<string name="subaddress_tx_label">Transactions for this subaddress:</string>
|
||||||
|
<string name="subaddress_notx_label">No transactions for this subaddress yet</string>
|
||||||
|
<string name="subaddress_select_label">Select a subaddress</string>
|
||||||
|
<string name="subaddress_details_hint">Long-press for details</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<string name="menu_share">Μοιράσου</string>
|
<string name="menu_share">Μοιράσου</string>
|
||||||
<string name="menu_help">Βοήθεια</string>
|
<string name="menu_help">Βοήθεια</string>
|
||||||
<string name="menu_receive">Λήψη</string>
|
<string name="menu_receive">Λήψη</string>
|
||||||
<string name="menu_rename">Μετονομασία …</string>
|
<string name="menu_rename">Μετονομασία</string>
|
||||||
<string name="menu_archive">Αρχειοθέτησε</string>
|
<string name="menu_archive">Αρχειοθέτησε</string>
|
||||||
<string name="menu_backup">Δημιουργία αντίγραφου ασφαλείας</string>
|
<string name="menu_backup">Δημιουργία αντίγραφου ασφαλείας</string>
|
||||||
|
|
||||||
@@ -280,8 +280,8 @@
|
|||||||
<string name="accounts_new">Added new account #%1$d</string>
|
<string name="accounts_new">Added new account #%1$d</string>
|
||||||
<string name="tx_account">Account #</string>
|
<string name="tx_account">Account #</string>
|
||||||
<string name="send_sweepall">Send all confirmed funds in this account!</string>
|
<string name="send_sweepall">Send all confirmed funds in this account!</string>
|
||||||
<string name="tx_subaddress">Subaddress #%1$d</string>
|
<string name="tx_subaddress">Subaddress</string>
|
||||||
<string name="generate_address_label_sub">Public Subaddress #%1$d</string>
|
<string name="generate_address_label_sub">Public Subaddress #%1$d: %2$s</string>
|
||||||
|
|
||||||
<string name="menu_language">Language</string>
|
<string name="menu_language">Language</string>
|
||||||
<string name="language_system_default">Use System Language</string>
|
<string name="language_system_default">Use System Language</string>
|
||||||
@@ -412,4 +412,14 @@
|
|||||||
<string name="info_xmrto_help_xmr"><![CDATA[
|
<string name="info_xmrto_help_xmr"><![CDATA[
|
||||||
<b>Please enter or scan a Monero address.</b>
|
<b>Please enter or scan a Monero address.</b>
|
||||||
]]></string>
|
]]></string>
|
||||||
|
|
||||||
|
<string name="subbaddress_title">Subaddresses</string>
|
||||||
|
<string name="subbaddress_name_hint">Subaddress Name</string>
|
||||||
|
<string name="max_subaddress_warning">Too many unused addresses - use some to enable creating more!</string>
|
||||||
|
<string name="max_account_warning">Too many unused accounts - use some to enable creating more!</string>
|
||||||
|
<string name="subaddress_tx_label">Transactions for this subaddress:</string>
|
||||||
|
<string name="subaddress_notx_label">No transactions for this subaddress yet</string>
|
||||||
|
<string name="subaddress_select_label">Select a subaddress</string>
|
||||||
|
<string name="subaddress_details_hint">Long-press for details</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<string name="menu_share">Kunhavigi</string>
|
<string name="menu_share">Kunhavigi</string>
|
||||||
<string name="menu_help">Helpo</string>
|
<string name="menu_help">Helpo</string>
|
||||||
<string name="menu_receive">Ricevi</string>
|
<string name="menu_receive">Ricevi</string>
|
||||||
<string name="menu_rename">Renomi …</string>
|
<string name="menu_rename">Renomi</string>
|
||||||
<string name="menu_archive">Arkivo</string>
|
<string name="menu_archive">Arkivo</string>
|
||||||
<string name="menu_backup">Sekurkopio</string>
|
<string name="menu_backup">Sekurkopio</string>
|
||||||
<string name="menu_changepw">Ŝanĝi pasfrazon</string>
|
<string name="menu_changepw">Ŝanĝi pasfrazon</string>
|
||||||
@@ -287,8 +287,8 @@
|
|||||||
<string name="tx_account">Konto #</string>
|
<string name="tx_account">Konto #</string>
|
||||||
|
|
||||||
<string name="send_sweepall">Sendi ĉiujn konfirmitajn monsumojn al tiu konto!</string>
|
<string name="send_sweepall">Sendi ĉiujn konfirmitajn monsumojn al tiu konto!</string>
|
||||||
<string name="tx_subaddress">Subadreso #%1$d</string>
|
<string name="tx_subaddress">Subadreso</string>
|
||||||
<string name="generate_address_label_sub">Publika subadreso #%1$d</string>
|
<string name="generate_address_label_sub">Publika subadreso #%1$d: %2$s</string>
|
||||||
|
|
||||||
<string name="menu_language">Lingvo</string>
|
<string name="menu_language">Lingvo</string>
|
||||||
<string name="language_system_default">Uzi la sistemlingvon</string>
|
<string name="language_system_default">Uzi la sistemlingvon</string>
|
||||||
@@ -412,4 +412,14 @@
|
|||||||
<string name="info_xmrto_help_xmr"><![CDATA[
|
<string name="info_xmrto_help_xmr"><![CDATA[
|
||||||
<b>Please enter or scan a Monero address.</b>
|
<b>Please enter or scan a Monero address.</b>
|
||||||
]]></string>
|
]]></string>
|
||||||
|
|
||||||
|
<string name="subbaddress_title">Subaddresses</string>
|
||||||
|
<string name="subbaddress_name_hint">Subaddress Name</string>
|
||||||
|
<string name="max_subaddress_warning">Too many unused addresses - use some to enable creating more!</string>
|
||||||
|
<string name="max_account_warning">Too many unused accounts - use some to enable creating more!</string>
|
||||||
|
<string name="subaddress_tx_label">Transactions for this subaddress:</string>
|
||||||
|
<string name="subaddress_notx_label">No transactions for this subaddress yet</string>
|
||||||
|
<string name="subaddress_select_label">Select a subaddress</string>
|
||||||
|
<string name="subaddress_details_hint">Long-press for details</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user