Add toast when selecting node

This commit is contained in:
pokkst 2022-09-19 11:05:50 -05:00
parent 56471c62f1
commit 7ca22077d6
No known key found for this signature in database
GPG key ID: 90C2ED85E67A50FF
2 changed files with 9 additions and 0 deletions

View file

@ -1,10 +1,12 @@
package net.mynero.wallet.fragment.dialog; package net.mynero.wallet.fragment.dialog;
import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -74,6 +76,12 @@ public class NodeSelectionBottomSheetDialog extends BottomSheetDialogFragment im
@Override @Override
public void onSelectNode(Node node) { public void onSelectNode(Node node) {
Activity activity = getActivity();
if(activity != null) {
activity.runOnUiThread(() -> {
Toast.makeText(activity, getString(R.string.node_selected), Toast.LENGTH_SHORT).show();
});
}
PrefService.getInstance().edit().putString(Constants.PREF_NODE, node.getAddress()).apply(); PrefService.getInstance().edit().putString(Constants.PREF_NODE, node.getAddress()).apply();
WalletManager.getInstance().setDaemon(node); WalletManager.getInstance().setDaemon(node);
adapter.updateSelectedNode(); adapter.updateSelectedNode();

View file

@ -96,4 +96,5 @@
<string name="transaction_destination">Destination</string> <string name="transaction_destination">Destination</string>
<string name="confirmations">Confirmations</string> <string name="confirmations">Confirmations</string>
<string name="date">Date</string> <string name="date">Date</string>
<string name="node_selected">Node has been selected</string>
</resources> </resources>