use of run.wallet.iota.ui.adapter.AddNodesListAdapter in project run-wallet-android by runplay.
the class NetworkNodesAddFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
listNodes.setLayoutManager(new RecyclerLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
((AppCompatActivity) getActivity()).setSupportActionBar(addNodeToolbar);
setHasOptionsMenu(false);
enterPod.setBackgroundColor(B.getColor(getActivity(), AppTheme.getSecondary()));
addNodeToolbar.setNavigationIcon(getResources().getDrawable(R.drawable.md_nav_back));
addNodeToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getActivity().onBackPressed();
}
});
protocol.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
changeProtocol();
}
});
addNodeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Nodes.Node node = new Nodes.Node();
node.ip = nodeAddress.getText().toString();
node.port = Sf.toInt(port.getText().toString());
node.protocol = protocol.getText().toString();
node.ip = Utils.stripHttp(node.ip);
if (node.ip.length() > 3 && node.ip.contains(".") && node.port > 0) {
Store.addNode(getActivity(), node.ip, node.port, node.protocol);
getActivity().onBackPressed();
} else {
addressLayout.setError(getString(R.string.messages_enter_neighbor_address));
}
}
});
nodeAddress.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
// nodeAddress.
addressLayout.setError(null);
}
});
adapter = new AddNodesListAdapter(getActivity(), this);
listNodes.setAdapter(adapter);
}
Aggregations