use of com.samourai.wallet.widgets.ItemDividerDecorator in project samourai-wallet-android by Samourai-Wallet.
the class ChooseUTXOsFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
utxoRecyclerView = view.findViewById(R.id.whirlpool_utxo_recyclerview);
if (getArguments() != null && getArguments().containsKey("preselected")) {
preselectedUTXOs = PreSelectUtil.getInstance().getPreSelected(getArguments().getString("preselected"));
}
utxoRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
utxoAdapter = new WhirlpoolUTXOAdapter();
loadCoins();
utxoRecyclerView.setAdapter(utxoAdapter);
utxoRecyclerView.addItemDecoration(new ItemDividerDecorator(getActivity().getDrawable(R.color.disabled_white)));
utxoRecyclerView.setItemAnimator(new DefaultItemAnimator());
}
use of com.samourai.wallet.widgets.ItemDividerDecorator in project samourai-wallet-android by Samourai-Wallet.
the class PaynymListFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
list = view.findViewById(R.id.paynym_accounts_rv);
Drawable drawable = this.getResources().getDrawable(R.drawable.divider_grey);
list.addItemDecoration(new ItemDividerDecorator(drawable));
list.setLayoutManager(new LinearLayoutManager(this.getContext()));
list.setNestedScrollingEnabled(true);
}
use of com.samourai.wallet.widgets.ItemDividerDecorator in project samourai-wallet-android by Samourai-Wallet.
the class PayNymDetailsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_paynym_details);
setSupportActionBar(findViewById(R.id.toolbar_paynym));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
userAvatar = findViewById(R.id.paybyn_user_avatar);
paynymCode = findViewById(R.id.paynym_payment_code);
followMessage = findViewById(R.id.follow_message);
historyRecyclerView = findViewById(R.id.recycler_view_paynym_history);
followBtn = findViewById(R.id.paynym_follow_btn);
paynymAvatarPorgress = findViewById(R.id.paynym_image_progress);
progressBar = findViewById(R.id.progressBar);
historyLayout = findViewById(R.id.historyLayout);
followLayout = findViewById(R.id.followLayout);
paynymLabel = findViewById(R.id.paynym_label);
confirmMessage = findViewById(R.id.confirm_message);
followsYoutext = findViewById(R.id.follows_you_text);
historyRecyclerView.setNestedScrollingEnabled(true);
if (getIntent().hasExtra("pcode")) {
pcode = getIntent().getStringExtra("pcode");
} else {
finish();
}
if (getIntent().hasExtra("label")) {
label = getIntent().getStringExtra("label");
}
paynymTxListAdapter = new PaynymTxListAdapter(txesList, getApplicationContext());
historyRecyclerView.setLayoutManager(new LinearLayoutManager(this));
historyRecyclerView.setAdapter(paynymTxListAdapter);
Drawable drawable = this.getResources().getDrawable(R.drawable.divider_grey);
historyRecyclerView.addItemDecoration(new ItemDividerDecorator(drawable));
setPayNym();
loadTxes();
followBtn.setOnClickListener(view -> {
followPaynym();
});
paynymLabel.setOnClickListener(view -> {
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("paynym", ((TextView) view).getText().toString());
clipboard.setPrimaryClip(clip);
Toast.makeText(this, "Paynym id copied", Toast.LENGTH_SHORT).show();
});
}
use of com.samourai.wallet.widgets.ItemDividerDecorator in project samourai-wallet-android by Samourai-Wallet.
the class CycleDetail method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cycle);
setSupportActionBar(findViewById(R.id.toolbar));
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
transactionId = findViewById(R.id.whirlpool_header_tx_hash);
cycleProgress = findViewById(R.id.pool_cycle_progress);
cycledTxsRecyclerView = findViewById(R.id.whirlpool_cycled_tx_rv);
cycledTxsRecyclerView.setLayoutManager(new LinearLayoutManager(this));
Drawable drawable = this.getResources().getDrawable(R.drawable.divider_grey);
cycledTxsRecyclerView.addItemDecoration(new ItemDividerDecorator(drawable));
cyclingTx = findViewById(R.id.cycling_tx_txt);
registeringInputs = findViewById(R.id.registering_inputs_txt);
waitingForConfirmation = findViewById(R.id.cyle_waiting_txt);
cycledTxesListHeader = findViewById(R.id.cycled_transaction_list_header);
registeringCheck = findViewById(R.id.register_input_check);
cyclingCheck = findViewById(R.id.cycling_check);
minerFee = findViewById(R.id.cycle_details_minerfee);
confirmCheck = findViewById(R.id.blockchain_confirm_check);
cycleProgress.setMax(100);
cycleProgress.setProgress(0);
hash = getIntent().getExtras().getString("hash");
if (hash == null) {
finish();
return;
}
enableCycle(false);
enableRegister(false);
enableBlockChainConfirm(false);
setMixStatus();
listenUTXO();
}
use of com.samourai.wallet.widgets.ItemDividerDecorator in project samourai-wallet-android by Samourai-Wallet.
the class WhirlpoolMain method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_whirlpool_main);
Toolbar toolbar = findViewById(R.id.toolbar_whirlpool);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
whirlpoolBalance = findViewById(R.id.whirlpool_balance_textview);
collapsingToolbarLayout = findViewById(R.id.collapsing_toolbar_whirlpool_main);
amountSubText = findViewById(R.id.toolbar_subtext);
progressBar = findViewById(R.id.whirlpool_main_progressBar);
premixList = findViewById(R.id.rv_whirlpool_dashboard);
swipeRefreshLayout = findViewById(R.id.tx_swipe_container_whirlpool);
findViewById(R.id.whirlpool_fab).setOnClickListener(view -> showBottomSheetDialog());
premixList.setLayoutManager(new LinearLayoutManagerWrapper(this));
adapter = new MixAdapter(new ArrayList<>());
Drawable drawable = this.getResources().getDrawable(R.drawable.divider_grey);
premixList.addItemDecoration(new ItemDividerDecorator(drawable));
premixList.setAdapter(adapter);
long postMixBalance = APIFactory.getInstance(WhirlpoolMain.this).getXpubPostMixBalance();
long preMixBalance = APIFactory.getInstance(WhirlpoolMain.this).getXpubPreMixBalance();
whirlpoolBalance.setText(getBTCDecimalFormat(postMixBalance + preMixBalance).concat(" BTC"));
startWhirlpool();
Disposable disposable = AndroidWhirlpoolWalletService.getInstance().listenConnectionStatus().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(connectionStates -> {
if (connectionStates == AndroidWhirlpoolWalletService.ConnectionStates.CONNECTED) {
listenPoolState();
loadMixes(false);
}
});
compositeDisposable.add(disposable);
IntentFilter broadcastIntent = new IntentFilter(DISPLAY_INTENT);
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(receiver, broadcastIntent);
collapsingToolbarLayout.setOnClickListener(view -> switchBalance());
swipeRefreshLayout.setOnRefreshListener(() -> {
Intent intent = new Intent(this, JobRefreshService.class);
intent.putExtra("notifTx", false);
intent.putExtra("dragged", true);
intent.putExtra("launch", false);
JobRefreshService.enqueueWork(getApplicationContext(), intent);
swipeRefreshLayout.setRefreshing(false);
progressBar.setVisibility(View.VISIBLE);
loadMixes(true);
});
}
Aggregations