Search in sources :

Example 1 with ItemDividerDecorator

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());
}
Also used : ItemDividerDecorator(com.samourai.wallet.widgets.ItemDividerDecorator) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 2 with ItemDividerDecorator

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);
}
Also used : ItemDividerDecorator(com.samourai.wallet.widgets.ItemDividerDecorator) Drawable(android.graphics.drawable.Drawable) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 3 with ItemDividerDecorator

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();
    });
}
Also used : ClipboardManager(android.content.ClipboardManager) ItemDividerDecorator(com.samourai.wallet.widgets.ItemDividerDecorator) ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) TextView(android.widget.TextView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ClipData(android.content.ClipData)

Example 4 with ItemDividerDecorator

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();
}
Also used : ItemDividerDecorator(com.samourai.wallet.widgets.ItemDividerDecorator) Drawable(android.graphics.drawable.Drawable) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 5 with ItemDividerDecorator

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);
    });
}
Also used : CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Disposable(io.reactivex.disposables.Disposable) IntentFilter(android.content.IntentFilter) ItemDividerDecorator(com.samourai.wallet.widgets.ItemDividerDecorator) LinearLayoutManagerWrapper(com.samourai.wallet.util.LinearLayoutManagerWrapper) ArrayList(java.util.ArrayList) Drawable(android.graphics.drawable.Drawable) Intent(android.content.Intent) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

ItemDividerDecorator (com.samourai.wallet.widgets.ItemDividerDecorator)8 Drawable (android.graphics.drawable.Drawable)6 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)6 ArrayList (java.util.ArrayList)3 Intent (android.content.Intent)2 IntentFilter (android.content.IntentFilter)2 RecyclerView (android.support.v7.widget.RecyclerView)2 View (android.view.View)2 TextView (android.widget.TextView)2 LinearLayoutManagerWrapper (com.samourai.wallet.util.LinearLayoutManagerWrapper)2 ClipData (android.content.ClipData)1 ClipboardManager (android.content.ClipboardManager)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Bundle (android.os.Bundle)1 Handler (android.os.Handler)1 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 Toolbar (android.support.v7.widget.Toolbar)1 ImageView (android.widget.ImageView)1 DecryptionException (com.samourai.wallet.crypto.DecryptionException)1 HD_Wallet (com.samourai.wallet.hd.HD_Wallet)1