Search in sources :

Example 1 with IbcPath

use of wannabit.io.cosmostaion.dao.IbcPath in project cosmostation-android by cosmostation.

the class BaseData method getIbcSendableRelayers.

public ArrayList<IbcPath> getIbcSendableRelayers() {
    ArrayList<IbcPath> result = new ArrayList<>();
    for (IbcPath ibcPath : mIbcPaths) {
        for (IbcPath.Path path : ibcPath.paths) {
            if (path.auth != null && path.auth) {
                result.add(ibcPath);
            }
        }
    }
    Set<IbcPath> arr2 = new HashSet<>(result);
    ArrayList<IbcPath> resArr2 = new ArrayList<>(arr2);
    return resArr2;
}
Also used : IbcPath(wannabit.io.cosmostaion.dao.IbcPath) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet)

Example 2 with IbcPath

use of wannabit.io.cosmostaion.dao.IbcPath in project cosmostation-android by cosmostation.

the class Dialog_IBC_Receive_Chain method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_template_recycler, null);
    mDialogTitle = view.findViewById(R.id.dialog_title);
    mDialogTitle.setText(R.string.str_select_ibc_destination);
    mRecyclerView = view.findViewById(R.id.recycler);
    mIbcSendableRelayers = (ArrayList<IbcPath>) getArguments().getSerializable("chain");
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
    mRecyclerView.setHasFixedSize(true);
    mRelayerListAdapter = new RelayerListAdapter();
    mRecyclerView.setAdapter(mRelayerListAdapter);
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setView(view);
    return builder.create();
}
Also used : AlertDialog(android.app.AlertDialog) IbcPath(wannabit.io.cosmostaion.dao.IbcPath) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 3 with IbcPath

use of wannabit.io.cosmostaion.dao.IbcPath in project cosmostation-android by cosmostation.

the class BaseData method getIbcRollbackRelayer.

public ArrayList<IbcPath> getIbcRollbackRelayer(String denom) {
    ArrayList<IbcPath> result = new ArrayList<>();
    IbcToken ibcToken = getIbcToken(denom.replaceAll("ibc/", ""));
    if (mIbcPaths != null && mIbcPaths.size() > 0) {
        for (IbcPath ibcPath : mIbcPaths) {
            for (IbcPath.Path path : ibcPath.paths) {
                if (path.channel_id != null && path.channel_id.equalsIgnoreCase(ibcToken.channel_id)) {
                    result.add(ibcPath);
                }
            }
        }
    }
    return result;
}
Also used : IbcToken(wannabit.io.cosmostaion.dao.IbcToken) IbcPath(wannabit.io.cosmostaion.dao.IbcPath) ArrayList(java.util.ArrayList)

Aggregations

IbcPath (wannabit.io.cosmostaion.dao.IbcPath)3 ArrayList (java.util.ArrayList)2 AlertDialog (android.app.AlertDialog)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 HashSet (java.util.HashSet)1 IbcToken (wannabit.io.cosmostaion.dao.IbcToken)1