mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-09 15:50:00 +00:00
0.4.7.1:
- Hotfixes for 0.4.7 for editing nodes - Better IPv6 address handling in node settings
This commit is contained in:
parent
c8ed32e5b0
commit
c64dbfdfec
8 changed files with 18 additions and 13 deletions
|
@ -9,8 +9,8 @@ android {
|
|||
applicationId "net.mynero.wallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
versionCode 40700
|
||||
versionName "0.4.7 'Fluorine Fermi'"
|
||||
versionCode 40701
|
||||
versionName "0.4.7.1 'Fluorine Fermi'"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
|
|
|
@ -91,6 +91,9 @@ public class AddNodeBottomSheetDialog extends BottomSheetDialogFragment {
|
|||
jsonObject.put("password", pass);
|
||||
}
|
||||
|
||||
if (nodeAddr.contains(":") && !nodeAddr.startsWith("[") && !nodeAddr.endsWith("]"))
|
||||
nodeAddr = "[" + nodeAddr + "]";
|
||||
|
||||
jsonObject.put("host", nodeAddr);
|
||||
jsonObject.put("rpcPort", Integer.parseInt(portString));
|
||||
jsonObject.put("network", "mainnet");
|
||||
|
|
|
@ -35,7 +35,7 @@ import timber.log.Timber;
|
|||
|
||||
public class EditNodeBottomSheetDialog extends BottomSheetDialogFragment {
|
||||
public EditNodeListener listener = null;
|
||||
public JSONObject nodeJson = null;
|
||||
public Node node = null;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
@ -54,7 +54,6 @@ public class EditNodeBottomSheetDialog extends BottomSheetDialogFragment {
|
|||
EditText passwordEditText = view.findViewById(R.id.password_edittext);
|
||||
ImageButton pastePasswordImageButton = view.findViewById(R.id.paste_password_imagebutton);
|
||||
|
||||
Node node = Node.fromJson(nodeJson);
|
||||
if(node == null) return;
|
||||
addressEditText.setText(node.getHost());
|
||||
portEditText.setText(""+node.getRpcPort());
|
||||
|
@ -87,7 +86,7 @@ public class EditNodeBottomSheetDialog extends BottomSheetDialogFragment {
|
|||
addPasteListener(view, passwordEditText, R.id.paste_password_imagebutton);
|
||||
|
||||
deleteNodeButton.setOnClickListener(view1 -> {
|
||||
listener.onNodeDeleted(Node.fromJson(nodeJson));
|
||||
listener.onNodeDeleted(node);
|
||||
dismiss();
|
||||
});
|
||||
doneEditingButton.setOnClickListener(view1 -> {
|
||||
|
@ -114,12 +113,15 @@ public class EditNodeBottomSheetDialog extends BottomSheetDialogFragment {
|
|||
jsonObject.put("password", pass);
|
||||
}
|
||||
|
||||
if (nodeAddr.contains(":") && !nodeAddr.startsWith("[") && !nodeAddr.endsWith("]"))
|
||||
nodeAddr = "[" + nodeAddr + "]";
|
||||
|
||||
jsonObject.put("host", nodeAddr);
|
||||
jsonObject.put("rpcPort", Integer.parseInt(portString));
|
||||
jsonObject.put("network", "mainnet");
|
||||
jsonObject.put("name", nodeName);
|
||||
|
||||
listener.onNodeEdited(Node.fromJson(nodeJson), Node.fromJson(jsonObject));
|
||||
listener.onNodeEdited(node, Node.fromJson(jsonObject));
|
||||
dismiss();
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
@ -114,7 +114,7 @@ public class NodeSelectionBottomSheetDialog extends BottomSheetDialogFragment im
|
|||
@Override
|
||||
public boolean onSelectEditNode(Node node) {
|
||||
if (listener != null) {
|
||||
listener.onClickedEditNode(node.toJson());
|
||||
listener.onClickedEditNode(node);
|
||||
}
|
||||
dismiss();
|
||||
return true;
|
||||
|
@ -122,7 +122,7 @@ public class NodeSelectionBottomSheetDialog extends BottomSheetDialogFragment im
|
|||
|
||||
public interface NodeSelectionDialogListener {
|
||||
void onNodeSelected();
|
||||
void onClickedEditNode(JSONObject nodeJson);
|
||||
void onClickedEditNode(Node node);
|
||||
void onClickedAddNode();
|
||||
}
|
||||
}
|
|
@ -285,7 +285,7 @@ public class OnboardingFragment extends Fragment implements NodeSelectionBottomS
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onClickedEditNode(JSONObject nodeJson) { }
|
||||
public void onClickedEditNode(Node node) { }
|
||||
|
||||
@Override
|
||||
public void onClickedAddNode() {
|
||||
|
|
|
@ -248,10 +248,10 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onClickedEditNode(JSONObject nodeJson) {
|
||||
public void onClickedEditNode(Node node) {
|
||||
EditNodeBottomSheetDialog editNodeDialog = new EditNodeBottomSheetDialog();
|
||||
editNodeDialog.listener = this;
|
||||
editNodeDialog.nodeJson = nodeJson;
|
||||
editNodeDialog.node = node;
|
||||
editNodeDialog.show(getActivity().getSupportFragmentManager(), "edit_node_dialog");
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
android:background="@drawable/edittext_bg"
|
||||
android:hint="@string/node_address_hint"
|
||||
android:inputType="text"
|
||||
android:digits="-QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:"
|
||||
android:digits="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:-[]"
|
||||
app:layout_constraintBottom_toTopOf="@id/username_edittext"
|
||||
app:layout_constraintEnd_toStartOf="@id/node_port_edittext"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
android:background="@drawable/edittext_bg"
|
||||
android:hint="@string/node_address_hint"
|
||||
android:inputType="text"
|
||||
android:digits="-QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:"
|
||||
android:digits="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890.:-[]"
|
||||
app:layout_constraintBottom_toTopOf="@id/username_edittext"
|
||||
app:layout_constraintEnd_toStartOf="@id/node_port_edittext"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
|
Loading…
Reference in a new issue