diff --git a/core/src/main/java/com/vergepay/core/network/ServerClient.java b/core/src/main/java/com/vergepay/core/network/ServerClient.java index a76d8db..3ffa94f 100644 --- a/core/src/main/java/com/vergepay/core/network/ServerClient.java +++ b/core/src/main/java/com/vergepay/core/network/ServerClient.java @@ -431,7 +431,7 @@ public void getUnspentTx(final AddressStatus status, checkNotNull(stratumClient); CallMessage message = new CallMessage("blockchain.address.listunspent", - Arrays.asList(status.getAddress().toString())); + Collections.singletonList(status.getAddress().toString())); final ListenableFuture result = stratumClient.call(message); Futures.addCallback(result, new FutureCallback() { @@ -464,7 +464,7 @@ public void getHistoryTx(final AddressStatus status, checkNotNull(stratumClient); final CallMessage message = new CallMessage("blockchain.address.get_history", - Arrays.asList(status.getAddress().toString())); + Collections.singletonList(status.getAddress().toString())); final ListenableFuture result = stratumClient.call(message); Futures.addCallback(result, new FutureCallback() { diff --git a/core/src/main/java/com/vergepay/core/wallet/WalletProtobufSerializer.java b/core/src/main/java/com/vergepay/core/wallet/WalletProtobufSerializer.java index 1af7706..81b05c5 100644 --- a/core/src/main/java/com/vergepay/core/wallet/WalletProtobufSerializer.java +++ b/core/src/main/java/com/vergepay/core/wallet/WalletProtobufSerializer.java @@ -104,7 +104,7 @@ public static Protos.Wallet toProtobuf(Wallet wallet) { } else { // Some other form of encryption has been specified that we do not know how to persist. throw new RuntimeException("The wallet has encryption of type '" + - keyCrypter.getClass().toString() + "' but this WalletProtobufSerializer " + + keyCrypter.getClass() + "' but this WalletProtobufSerializer " + "does not know how to persist this."); } } diff --git a/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtFamilyWallet.java b/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtFamilyWallet.java index dca1f87..c722ba0 100644 --- a/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtFamilyWallet.java +++ b/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtFamilyWallet.java @@ -371,7 +371,7 @@ public Map getPendingTransactions() { @Override public List getActiveAddresses() { - return ImmutableList.of((AbstractAddress) address); + return ImmutableList.of(address); } @Override diff --git a/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtFamilyWalletProtobufSerializer.java b/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtFamilyWalletProtobufSerializer.java index 9b07a0b..7832157 100644 --- a/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtFamilyWalletProtobufSerializer.java +++ b/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtFamilyWalletProtobufSerializer.java @@ -43,7 +43,7 @@ final public class NxtFamilyWalletProtobufSerializer { private static final Logger log = LoggerFactory.getLogger(NxtFamilyWalletProtobufSerializer.class); // Used for de-serialization - private Map txMap = new HashMap(); + private final Map txMap = new HashMap(); public static Protos.WalletPocket toProtobuf(NxtFamilyWallet account) { diff --git a/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtTransaction.java b/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtTransaction.java index 9bde001..806fbc3 100644 --- a/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtTransaction.java +++ b/core/src/main/java/com/vergepay/core/wallet/families/nxt/NxtTransaction.java @@ -101,7 +101,7 @@ public List getSentTo() { @Override public List getReceivedFrom() { - return ImmutableList.of((AbstractAddress) new NxtAddress(type, tx.getSenderId())); + return ImmutableList.of(new NxtAddress(type, tx.getSenderId())); } @Override diff --git a/wallet/src/main/java/com/vergepay/wallet/Constants.java b/wallet/src/main/java/com/vergepay/wallet/Constants.java index a66ddd1..29909df 100644 --- a/wallet/src/main/java/com/vergepay/wallet/Constants.java +++ b/wallet/src/main/java/com/vergepay/wallet/Constants.java @@ -135,13 +135,13 @@ public class Constants { } public static final CoinType DEFAULT_COIN = VergeMain.get(); - public static final List DEFAULT_COINS = ImmutableList.of((CoinType) VergeMain.get()); + public static final List DEFAULT_COINS = ImmutableList.of(VergeMain.get()); public static final ArrayList DEFAULT_TEST_COIN_IDS = Lists.newArrayList( BitcoinTest.get().getId(), LitecoinTest.get().getId() ); public static final List SUPPORTED_COINS = ImmutableList.of( - (CoinType) VergeMain.get() + VergeMain.get() ); } diff --git a/wallet/src/main/java/com/vergepay/wallet/ExchangeRatesProvider.java b/wallet/src/main/java/com/vergepay/wallet/ExchangeRatesProvider.java index ea5b9b4..96453a0 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ExchangeRatesProvider.java +++ b/wallet/src/main/java/com/vergepay/wallet/ExchangeRatesProvider.java @@ -100,8 +100,8 @@ public String toString() { private String lastCryptoCurrency = null; private static final String BASE_URL = "https://www.binance.com/api/v3/ticker/price?symbol=XVGUSDT"; - private static final String TO_LOCAL_URL = BASE_URL + ""; // "/to-local/%s"; - private static final String TO_CRYPTO_URL = BASE_URL + ""; //"/to-crypto/%s"; + private static final String TO_LOCAL_URL = BASE_URL; // "/to-local/%s"; + private static final String TO_CRYPTO_URL = BASE_URL; //"/to-crypto/%s"; private static final String COINOMI_SOURCE = "http://dvzs4zoxkg6z43dd.onion"; private static final Logger log = LoggerFactory.getLogger(ExchangeRatesProvider.class); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/AboutActivity.java b/wallet/src/main/java/com/vergepay/wallet/ui/AboutActivity.java index efbe15c..689254b 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/AboutActivity.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/AboutActivity.java @@ -23,7 +23,7 @@ protected void onCreate(Bundle savedInstanceState) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(false); - TextView version = (TextView) findViewById(R.id.about_version); + TextView version = findViewById(R.id.about_version); if (getWalletApplication().packageInfo() != null) { version.setText(getWalletApplication().packageInfo().versionName); } else { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/AccountDetailsFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/AccountDetailsFragment.java index e5f66a7..1d74147 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/AccountDetailsFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/AccountDetailsFragment.java @@ -57,11 +57,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_account_details, container, false); - TextView publicKey = (TextView) view.findViewById(R.id.public_key); + TextView publicKey = view.findViewById(R.id.public_key); publicKey.setOnClickListener(getPubKeyOnClickListener()); publicKey.setText(publicKeySerialized); - ImageView qrView = (ImageView) view.findViewById(R.id.qr_code_public_key); + ImageView qrView = view.findViewById(R.id.qr_code_public_key); QrUtils.setQr(qrView, getResources(), publicKeySerialized); return view; diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/AddressRequestFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/AddressRequestFragment.java index 48b05d5..f3c5ceb 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/AddressRequestFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/AddressRequestFragment.java @@ -290,7 +290,7 @@ private void showNewAddressDialog() { } private void updateExchangeRate(ExchangeRate exchangeRate) { - amountCalculatorLink.setExchangeRate((ExchangeRate) exchangeRate); + amountCalculatorLink.setExchangeRate(exchangeRate); } @Override diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/AddressesListAdapter.java b/wallet/src/main/java/com/vergepay/wallet/ui/AddressesListAdapter.java index 2c2215f..142a5d2 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/AddressesListAdapter.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/AddressesListAdapter.java @@ -132,8 +132,8 @@ public View getView(final int position, View row, final ViewGroup parent) { } public void bindView(@Nonnull final View row, @Nonnull final AbstractAddress address) { - TextView addressLabel = (TextView) row.findViewById(R.id.address_row_label); - TextView addressRaw = (TextView) row.findViewById(R.id.address_row_address); + TextView addressLabel = row.findViewById(R.id.address_row_label); + TextView addressRaw = row.findViewById(R.id.address_row_address); String label = resolveLabel(address); @@ -147,8 +147,8 @@ public void bindView(@Nonnull final View row, @Nonnull final AbstractAddress add addressRaw.setVisibility(View.GONE); } - TextView addressUsageLabel = (TextView) row.findViewById(R.id.address_row_usage); - TextView addressUsageFontIcon = (TextView) row.findViewById(R.id.address_row_usage_font_icon); + TextView addressUsageLabel = row.findViewById(R.id.address_row_usage); + TextView addressUsageFontIcon = row.findViewById(R.id.address_row_usage_font_icon); Fonts.setTypeface(addressUsageFontIcon, Fonts.Font.COINOMI_FONT_ICONS); if (usedAddresses.contains(address)) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/AppLockFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/AppLockFragment.java index 749abb1..0228e0f 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/AppLockFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/AppLockFragment.java @@ -36,9 +36,9 @@ public static AppLockFragment newInstance(Bundle args) { @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_app_lock, container, false); - fingerPrintButton = (Button) view.findViewById(R.id.fingerprint_button); - pincodeButton = (Button) view.findViewById(R.id.pincode_button); - skipButton = (Button) view.findViewById(R.id.skip_button); + fingerPrintButton = view.findViewById(R.id.fingerprint_button); + pincodeButton = view.findViewById(R.id.pincode_button); + skipButton = view.findViewById(R.id.skip_button); pincodeButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/ApplockActivity.java b/wallet/src/main/java/com/vergepay/wallet/ui/ApplockActivity.java index de6fed9..28db668 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/ApplockActivity.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/ApplockActivity.java @@ -19,7 +19,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { boolean hasPincodeHash = ((WalletApplication) getApplication()).getConfiguration().hasPincodeHash(); - Button removeAppLock = (Button) findViewById(R.id.remove_app_lock); + Button removeAppLock = findViewById(R.id.remove_app_lock); if (hasPincodeHash) { removeAppLock.setOnClickListener(new View.OnClickListener() { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/DialogBuilder.java b/wallet/src/main/java/com/vergepay/wallet/ui/DialogBuilder.java index 93ed560..7cc8bb6 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/DialogBuilder.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/DialogBuilder.java @@ -50,8 +50,8 @@ public DialogBuilder(final Context context) { super(context); this.customTitle = LayoutInflater.from(context).inflate(R.layout.dialog_title, null); - this.iconView = (ImageView) customTitle.findViewById(android.R.id.icon); - this.titleView = (TextView) customTitle.findViewById(android.R.id.title); + this.iconView = customTitle.findViewById(android.R.id.icon); + this.titleView = customTitle.findViewById(android.R.id.title); } @Override diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/EditAddressBookEntryFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/EditAddressBookEntryFragment.java index 37495a9..9895f2a 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/EditAddressBookEntryFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/EditAddressBookEntryFragment.java @@ -112,10 +112,10 @@ public Dialog onCreateDialog(final Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.edit_address_book_entry_dialog, null); - final TextView viewAddress = (TextView) view.findViewById(R.id.edit_address_book_entry_address); + final TextView viewAddress = view.findViewById(R.id.edit_address_book_entry_address); viewAddress.setText(GenericUtils.addressSplitToGroups(address)); - final TextView viewLabel = (TextView) view.findViewById(R.id.edit_address_book_entry_label); + final TextView viewLabel = view.findViewById(R.id.edit_address_book_entry_label); viewLabel.setText(label != null ? label : suggestedAddressLabel); dialog.setView(view); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/EnterPincodeFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/EnterPincodeFragment.java index 1a57e4e..342dd38 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/EnterPincodeFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/EnterPincodeFragment.java @@ -27,10 +27,10 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_pincode, container, false); - pinCode1 = ((EditText) view.findViewById(R.id.pincode_1)); - pinCode2 = ((EditText) view.findViewById(R.id.pincode_2)); - pinCode3 = ((EditText) view.findViewById(R.id.pincode_3)); - pinCode4 = ((EditText) view.findViewById(R.id.pincode_4)); + pinCode1 = view.findViewById(R.id.pincode_1); + pinCode2 = view.findViewById(R.id.pincode_2); + pinCode3 = view.findViewById(R.id.pincode_3); + pinCode4 = view.findViewById(R.id.pincode_4); pinCode1.addTextChangedListener(new ViewSwitcher(pinCode2)); pinCode2.addTextChangedListener(new ViewSwitcher(pinCode3)); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/ExchangeHistoryFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/ExchangeHistoryFragment.java index 46eaf6c..321ff4f 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/ExchangeHistoryFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/ExchangeHistoryFragment.java @@ -91,7 +91,7 @@ public View onCreateView(final LayoutInflater inflater, final ViewGroup containe @Override public void setEmptyText(final CharSequence text) { if (getView() != null) { - final TextView emptyView = (TextView) getView().findViewById(android.R.id.empty); + final TextView emptyView = getView().findViewById(android.R.id.empty); emptyView.setText(text); } } @@ -136,11 +136,11 @@ public void bindView(final View view, final Context context, final Cursor cursor Fonts.setTypeface(errorIcon, Fonts.Font.COINOMI_FONT_ICONS); Fonts.setTypeface(view.findViewById(R.id.exchange_arrow), Fonts.Font.COINOMI_FONT_ICONS); final View progress = view.findViewById(R.id.exchange_status_progress); - final TextView statusText = (TextView) view.findViewById(R.id.exchange_status_text); + final TextView statusText = view.findViewById(R.id.exchange_status_text); final View values = view.findViewById(R.id.exchange_values); - final Amount deposit = (Amount) view.findViewById(R.id.exchange_deposit); - final Amount withdraw = (Amount) view.findViewById(R.id.exchange_withdraw); - final AddressView addressView = (AddressView) view.findViewById(R.id.withdraw_address); + final Amount deposit = view.findViewById(R.id.exchange_deposit); + final Amount withdraw = view.findViewById(R.id.exchange_withdraw); + final AddressView addressView = view.findViewById(R.id.withdraw_address); switch (entry.status) { case ExchangeEntry.STATUS_INITIAL: diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/ExchangeRatesFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/ExchangeRatesFragment.java index 596ece5..8516724 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/ExchangeRatesFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/ExchangeRatesFragment.java @@ -120,7 +120,7 @@ public View onCreateView(final LayoutInflater inflater, final ViewGroup containe @Override public void setEmptyText(final CharSequence text) { - final TextView emptyView = (TextView) getView().findViewById(android.R.id.empty); + final TextView emptyView = getView().findViewById(android.R.id.empty); emptyView.setText(text); } @@ -279,10 +279,10 @@ public void bindView(final View view, final Context context, final Cursor cursor view.setBackgroundResource(isDefaultCurrency ? R.color.bg_list_selected : R.color.bg_list); - final TextView currencyCodeView = (TextView) view.findViewById(R.id.exchange_rate_row_currency_code); + final TextView currencyCodeView = view.findViewById(R.id.exchange_rate_row_currency_code); currencyCodeView.setText(exchangeRate.currencyCodeId); - final TextView currencyNameView = (TextView) view.findViewById(R.id.exchange_rate_row_currency_name); + final TextView currencyNameView = view.findViewById(R.id.exchange_rate_row_currency_name); String currencyName = WalletUtils.getCurrencyName(exchangeRate.currencyCodeId); if (currencyName != null) { currencyNameView.setText(currencyName); @@ -292,11 +292,11 @@ public void bindView(final View view, final Context context, final Cursor cursor currencyNameView.setVisibility(View.INVISIBLE); } - final Amount rateAmountUnitView = (Amount) view.findViewById(R.id.exchange_rate_row_rate_unit); + final Amount rateAmountUnitView = view.findViewById(R.id.exchange_rate_row_rate_unit); rateAmountUnitView.setAmount(GenericUtils.formatCoinValue(type, rateBase, true)); rateAmountUnitView.setSymbol(type.getSymbol()); - final Amount rateAmountView = (Amount) view.findViewById(R.id.exchange_rate_row_rate); + final Amount rateAmountView = view.findViewById(R.id.exchange_rate_row_rate); Value fiatAmount = exchangeRate.rate.convert(type, rateBase); rateAmountView.setAmount(GenericUtils.formatFiatValue(fiatAmount)); rateAmountView.setSymbol(fiatAmount.type.getSymbol()); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/FinalizeWalletRestorationFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/FinalizeWalletRestorationFragment.java index bd8f2fd..a38205a 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/FinalizeWalletRestorationFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/FinalizeWalletRestorationFragment.java @@ -95,7 +95,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_finalize_wallet_restoration, container, false); - status = (TextView) view.findViewById(R.id.restoration_status); + status = view.findViewById(R.id.restoration_status); return view; } diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/MakeTransactionFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/MakeTransactionFragment.java index 017ab78..78b527b 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/MakeTransactionFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/MakeTransactionFragment.java @@ -218,7 +218,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, transactionInfo.setVisibility(View.GONE); - final TextView passwordLabelView = (TextView) view.findViewById(R.id.enter_password_label); + final TextView passwordLabelView = view.findViewById(R.id.enter_password_label); if (sourceAccount != null && sourceAccount.isEncrypted()) { passwordView.requestFocus(); passwordView.setVisibility(View.VISIBLE); @@ -231,7 +231,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, tradeWithdrawSendOutput.setVisibility(View.GONE); showTransaction(); - TextView poweredByShapeShift = (TextView) view.findViewById(R.id.powered_by_shapeshift); + TextView poweredByShapeShift = view.findViewById(R.id.powered_by_shapeshift); poweredByShapeShift.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/NavigationDrawerFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/NavigationDrawerFragment.java index fde9579..0633907 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/NavigationDrawerFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/NavigationDrawerFragment.java @@ -94,7 +94,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_navigation_drawer, container, false); - mDrawerListView = (ListView) view.findViewById(R.id.coins_list); + mDrawerListView = view.findViewById(R.id.coins_list); mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/PasswordConfirmationFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/PasswordConfirmationFragment.java index 973c1b2..9d5a168 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/PasswordConfirmationFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/PasswordConfirmationFragment.java @@ -57,14 +57,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Fonts.setTypeface(view.findViewById(R.id.key_icon), Fonts.Font.COINOMI_FONT_ICONS); - TextView messageView = (TextView) view.findViewById(R.id.message); + TextView messageView = view.findViewById(R.id.message); if (message != null) { messageView.setText(message); } else { messageView.setVisibility(View.GONE); } - final EditText password = (EditText) view.findViewById(R.id.password); + final EditText password = view.findViewById(R.id.password); view.findViewById(R.id.button_confirm).setOnClickListener(new View.OnClickListener() { @Override diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/PayWithDialog.java b/wallet/src/main/java/com/vergepay/wallet/ui/PayWithDialog.java index fc7c16c..94d297e 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/PayWithDialog.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/PayWithDialog.java @@ -70,7 +70,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { } // Setup accounts that we can send from directly - ViewGroup typeAccounts = (ViewGroup) view.findViewById(R.id.pay_with_layout); + ViewGroup typeAccounts = view.findViewById(R.id.pay_with_layout); boolean canSend = false; for (WalletAccount account : app.getAccounts(type)) { if (account.getBalance().isPositive()) { @@ -85,7 +85,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { } // Setup possible exchange accounts - ViewGroup exchangeAccounts = (ViewGroup) view.findViewById(R.id.exchange_and_pay_layout); + ViewGroup exchangeAccounts = view.findViewById(R.id.exchange_and_pay_layout); boolean canExchange = false; for (WalletAccount account : app.getAllAccounts()) { if (!account.isType(type) && account.getBalance().isPositive()) { @@ -95,7 +95,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { } if (canExchange) { - TextView poweredByShapeShift = (TextView) view.findViewById(R.id.powered_by_shapeshift); + TextView poweredByShapeShift = view.findViewById(R.id.powered_by_shapeshift); poweredByShapeShift.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/PreviousAddressesFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/PreviousAddressesFragment.java index cb41197..4afa0d6 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/PreviousAddressesFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/PreviousAddressesFragment.java @@ -95,7 +95,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, View view = inflater.inflate(R.layout.fragment_previous_addresses, container, false); - final ListView previousAddresses = (ListView) view.findViewById(R.id.previous_addresses); + final ListView previousAddresses = view.findViewById(R.id.previous_addresses); // Set a space to the beginning and end of the list. If possible find a better way View spacerView = new View(getActivity()); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/RestoreFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/RestoreFragment.java index 1950866..67c7207 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/RestoreFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/RestoreFragment.java @@ -86,7 +86,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Fonts.setTypeface(view.findViewById(R.id.coins_icon), Fonts.Font.COINOMI_FONT_ICONS); - ImageButton scanQrButton = (ImageButton) view.findViewById(R.id.scan_qr_code); + ImageButton scanQrButton = view.findViewById(R.id.scan_qr_code); scanQrButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -97,7 +97,7 @@ public void onClick(View v) { // Setup auto complete the mnemonic words ArrayAdapter adapter = new ArrayAdapter<>(this.getActivity(), R.layout.item_simple, MnemonicCode.INSTANCE.getWordList()); - mnemonicTextView = (MultiAutoCompleteTextView) view.findViewById(R.id.seed); + mnemonicTextView = view.findViewById(R.id.seed); mnemonicTextView.setAdapter(adapter); mnemonicTextView.setTokenizer(new SpaceTokenizer() { @Override @@ -107,10 +107,10 @@ public void onToken() { }); // Restore message - errorMnemonicΜessage = (TextView) view.findViewById(R.id.restore_message); + errorMnemonicΜessage = view.findViewById(R.id.restore_message); errorMnemonicΜessage.setVisibility(View.GONE); - bip39Passphrase = (EditText) view.findViewById(R.id.bip39_passphrase); + bip39Passphrase = view.findViewById(R.id.bip39_passphrase); final View bip39PassphraseTitle = view.findViewById(R.id.bip39_passphrase_title); bip39Passphrase.setVisibility(View.GONE); @@ -119,7 +119,7 @@ public void onToken() { // For existing seed final View bip39Info = view.findViewById(R.id.bip39_info); bip39Info.setVisibility(View.GONE); - final CheckBox useBip39Checkbox = (CheckBox) view.findViewById(R.id.use_bip39); + final CheckBox useBip39Checkbox = view.findViewById(R.id.use_bip39); if (isNewSeed) useBip39Checkbox.setVisibility(View.GONE); useBip39Checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @@ -142,7 +142,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { }); // Skip link - skipButton = (Button) view.findViewById(R.id.seed_entry_skip); + skipButton = view.findViewById(R.id.seed_entry_skip); if (isNewSeed) { skipButton.setOnClickListener(getOnSkipListener()); skipButton.setVisibility(View.VISIBLE); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/ScanActivity.java b/wallet/src/main/java/com/vergepay/wallet/ui/ScanActivity.java index bbd79d7..9802522 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/ScanActivity.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/ScanActivity.java @@ -103,7 +103,7 @@ public void onCreate(final Bundle savedInstanceState) setContentView(R.layout.scan_activity); - scannerView = (ScannerView) findViewById(R.id.scan_activity_mask); + scannerView = findViewById(R.id.scan_activity_mask); } @Override @@ -115,7 +115,7 @@ protected void onResume() cameraThread.start(); cameraHandler = new Handler(cameraThread.getLooper()); - final SurfaceView surfaceView = (SurfaceView) findViewById(R.id.scan_activity_preview); + final SurfaceView surfaceView = findViewById(R.id.scan_activity_preview); surfaceHolder = surfaceView.getHolder(); surfaceHolder.addCallback(this); surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/SeedFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/SeedFragment.java index ea901c6..3b84139 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/SeedFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/SeedFragment.java @@ -41,10 +41,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_seed, container, false); - TextView seedFontIcon = (TextView) view.findViewById(R.id.seed_icon); + TextView seedFontIcon = view.findViewById(R.id.seed_icon); Fonts.setTypeface(seedFontIcon, Fonts.Font.COINOMI_FONT_ICONS); - final Button buttonNext = (Button) view.findViewById(R.id.button_next); + final Button buttonNext = view.findViewById(R.id.button_next); buttonNext.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -56,7 +56,7 @@ public void onClick(View v) { }); buttonNext.setEnabled(false); - mnemonicView = (TextView) view.findViewById(R.id.seed); + mnemonicView = view.findViewById(R.id.seed); generateNewMnemonic(); // Touch the seed icon to generate extra long seed @@ -71,7 +71,7 @@ public void onClick(View v) { } }); - final CheckBox backedUpSeed = (CheckBox) view.findViewById(R.id.backed_up_seed); + final CheckBox backedUpSeed = view.findViewById(R.id.backed_up_seed); backedUpSeed.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/SelectCoinTypeDialog.java b/wallet/src/main/java/com/vergepay/wallet/ui/SelectCoinTypeDialog.java index feb8fe5..1ec8cb2 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/SelectCoinTypeDialog.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/SelectCoinTypeDialog.java @@ -70,7 +70,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { final LayoutInflater inflater = LayoutInflater.from(getActivity()); final View view = inflater.inflate(R.layout.select_coin_for_address, null); - ViewGroup container = (ViewGroup) view.findViewById(R.id.pay_as_layout); + ViewGroup container = view.findViewById(R.id.pay_as_layout); int paddingBottom = getResources().getDimensionPixelSize(R.dimen.activity_vertical_margin); AddressView addressView = null; diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/SelectCoinsFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/SelectCoinsFragment.java index 6e8f18d..30d58df 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/SelectCoinsFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/SelectCoinsFragment.java @@ -98,7 +98,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_select_coins_list, container, false); - nextButton = (Button) view.findViewById(R.id.button_next); + nextButton = view.findViewById(R.id.button_next); if (isMultipleChoice) { nextButton.setEnabled(false); nextButton.setOnClickListener(getNextOnClickListener()); @@ -106,7 +106,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, nextButton.setVisibility(View.GONE); } - coinList = (ListView) view.findViewById(R.id.coins_list); + coinList = view.findViewById(R.id.coins_list); // Set header if needed if (message != null) { HeaderWithFontIcon header = new HeaderWithFontIcon(context); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/SendFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/SendFragment.java index 3a7bfd7..a495bed 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/SendFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/SendFragment.java @@ -1259,9 +1259,9 @@ public void bindView(final View view, final Context context, final Cursor cursor CoinType type = CoinID.typeFromId(coinId); final ViewGroup viewGroup = (ViewGroup) view; - final TextView labelView = (TextView) viewGroup.findViewById(R.id.address_book_row_label); + final TextView labelView = viewGroup.findViewById(R.id.address_book_row_label); labelView.setText(label); - final TextView addressView = (TextView) viewGroup.findViewById(R.id.address_book_row_address); + final TextView addressView = viewGroup.findViewById(R.id.address_book_row_address); try { addressView.setText(GenericUtils.addressSplitToGroupsMultiline(type.newAddress(addressStr))); } catch (AddressMalformedException e) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/SetPasswordFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/SetPasswordFragment.java index 9376397..011ad5b 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/SetPasswordFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/SetPasswordFragment.java @@ -66,14 +66,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Fonts.setTypeface(view.findViewById(R.id.key_icon), Fonts.Font.COINOMI_FONT_ICONS); - errorPassword = (TextView) view.findViewById(R.id.password_error); - errorPasswordsMismatch = (TextView) view.findViewById(R.id.passwords_mismatch); + errorPassword = view.findViewById(R.id.password_error); + errorPasswordsMismatch = view.findViewById(R.id.passwords_mismatch); clearError(errorPassword); clearError(errorPasswordsMismatch); - password1 = (EditText) view.findViewById(R.id.password1); - password2 = (EditText) view.findViewById(R.id.password2); + password1 = view.findViewById(R.id.password1); + password2 = view.findViewById(R.id.password2); password1.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override @@ -98,7 +98,7 @@ public void onFocusChange(View textView, boolean hasFocus) { }); // Next button - Button finishButton = (Button) view.findViewById(R.id.button_next); + Button finishButton = view.findViewById(R.id.button_next); finishButton.setOnClickListener(getOnFinishListener()); finishButton.setImeOptions(EditorInfo.IME_ACTION_DONE); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/ShowSeedFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/ShowSeedFragment.java index b19d062..c70566d 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/ShowSeedFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/ShowSeedFragment.java @@ -99,12 +99,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, seedEncryptedLayout.setVisibility(View.GONE); // Hide layout as maybe we have to show the password dialog seedLayout.setVisibility(View.GONE); - seedView = (TextView) view.findViewById(R.id.seed); + seedView = view.findViewById(R.id.seed); seedPasswordProtectedView = view.findViewById(R.id.seed_password_protected); Fonts.setTypeface(view.findViewById(R.id.seed_password_protected_lock), Fonts.Font.COINOMI_FONT_ICONS); - qrView = (ImageView) view.findViewById(R.id.qr_code_seed); + qrView = view.findViewById(R.id.qr_code_seed); - TextView lockIcon = (TextView) view.findViewById(R.id.lock_icon); + TextView lockIcon = view.findViewById(R.id.lock_icon); Fonts.setTypeface(lockIcon, Fonts.Font.COINOMI_FONT_ICONS); lockIcon.setOnClickListener(new View.OnClickListener() { @Override diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/SignVerifyMessageFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/SignVerifyMessageFragment.java index d7f6050..3caa9b4 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/SignVerifyMessageFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/SignVerifyMessageFragment.java @@ -97,19 +97,19 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_sign_message, container, false); - signingAddressView = (AutoCompleteTextView) view.findViewById(R.id.signing_address); + signingAddressView = view.findViewById(R.id.signing_address); ArrayAdapter adapter = new ArrayAdapter<>(getActivity(), R.layout.item_simple, account.getActiveAddresses()); signingAddressView.setAdapter(adapter); - messageView = (EditText) view.findViewById(R.id.message); - signatureView = (EditText) view.findViewById(R.id.signature); + messageView = view.findViewById(R.id.message); + signatureView = view.findViewById(R.id.signature); - addressError = (TextView) view.findViewById(R.id.address_error_message); - signatureOK = (TextView) view.findViewById(R.id.signature_ok); - signatureError = (TextView) view.findViewById(R.id.signature_error); + addressError = view.findViewById(R.id.address_error_message); + signatureOK = view.findViewById(R.id.signature_ok); + signatureError = view.findViewById(R.id.signature_error); - verifyButton = (Button) view.findViewById(R.id.button_verify); + verifyButton = view.findViewById(R.id.button_verify); verifyButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -118,7 +118,7 @@ public void onClick(View v) { } }); - signButton = (Button) view.findViewById(R.id.button_sign); + signButton = view.findViewById(R.id.button_sign); signButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/TradeSelectFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/TradeSelectFragment.java index bf60861..6439be9 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/TradeSelectFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/TradeSelectFragment.java @@ -149,16 +149,16 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_trade_select, container, false); - sourceSpinner = (Spinner) view.findViewById(R.id.from_coin); + sourceSpinner = view.findViewById(R.id.from_coin); sourceSpinner.setAdapter(getSourceSpinnerAdapter()); sourceSpinner.setOnItemSelectedListener(getSourceSpinnerListener()); - destinationSpinner = (Spinner) view.findViewById(R.id.to_coin); + destinationSpinner = view.findViewById(R.id.to_coin); destinationSpinner.setAdapter(getDestinationSpinnerAdapter()); destinationSpinner.setOnItemSelectedListener(getDestinationSpinnerListener()); - sourceAmountView = (AmountEditView) view.findViewById(R.id.trade_coin_amount); - destinationAmountView = (AmountEditView) view.findViewById(R.id.receive_coin_amount); + sourceAmountView = view.findViewById(R.id.trade_coin_amount); + destinationAmountView = view.findViewById(R.id.receive_coin_amount); amountCalculatorLink = new CurrencyCalculatorLink(sourceAmountView, destinationAmountView); @@ -166,9 +166,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, // receiveCoinWarning.setVisibility(View.GONE); // addressError = (TextView) view.findViewById(R.id.address_error_message); // addressError.setVisibility(View.GONE); - amountError = (TextView) view.findViewById(R.id.amount_error_message); + amountError = view.findViewById(R.id.amount_error_message); amountError.setVisibility(View.GONE); - amountWarning = (TextView) view.findViewById(R.id.amount_warning_message); + amountWarning = view.findViewById(R.id.amount_warning_message); amountWarning.setVisibility(View.GONE); // scanQrCodeButton = (ImageButton) view.findViewById(R.id.scan_qr_code); @@ -190,7 +190,7 @@ public void onClick(View v) { } }); - nextButton = (Button) view.findViewById(R.id.button_next); + nextButton = view.findViewById(R.id.button_next); nextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/TradeStatusFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/TradeStatusFragment.java index ff0abd1..7ea5667 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/TradeStatusFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/TradeStatusFragment.java @@ -201,21 +201,21 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_trade_status, container, false); - exchangeInfo = (TextView) view.findViewById(R.id.exchange_status_info); - depositIcon = (TextView) view.findViewById(R.id.trade_deposit_status_icon); - depositProgress = (ProgressBar) view.findViewById(R.id.trade_deposit_status_progress); - depositText = (TextView) view.findViewById(R.id.trade_deposit_status_text); - exchangeIcon = (TextView) view.findViewById(R.id.trade_exchange_status_icon); - exchangeProgress = (ProgressBar) view.findViewById(R.id.trade_exchange_status_progress); - exchangeText = (TextView) view.findViewById(R.id.trade_exchange_status_text); - errorIcon = (TextView) view.findViewById(R.id.trade_error_status_icon); - errorText = (TextView) view.findViewById(R.id.trade_error_status_text); + exchangeInfo = view.findViewById(R.id.exchange_status_info); + depositIcon = view.findViewById(R.id.trade_deposit_status_icon); + depositProgress = view.findViewById(R.id.trade_deposit_status_progress); + depositText = view.findViewById(R.id.trade_deposit_status_text); + exchangeIcon = view.findViewById(R.id.trade_exchange_status_icon); + exchangeProgress = view.findViewById(R.id.trade_exchange_status_progress); + exchangeText = view.findViewById(R.id.trade_exchange_status_text); + errorIcon = view.findViewById(R.id.trade_error_status_icon); + errorText = view.findViewById(R.id.trade_error_status_text); Fonts.setTypeface(depositIcon, Fonts.Font.COINOMI_FONT_ICONS); Fonts.setTypeface(exchangeIcon, Fonts.Font.COINOMI_FONT_ICONS); Fonts.setTypeface(errorIcon, Fonts.Font.COINOMI_FONT_ICONS); - viewTransaction = (Button) view.findViewById(R.id.trade_view_transaction); - emailReceipt = (Button) view.findViewById(R.id.trade_email_receipt); + viewTransaction = view.findViewById(R.id.trade_view_transaction); + emailReceipt = view.findViewById(R.id.trade_email_receipt); if (showExitButton) { view.findViewById(R.id.button_exit).setOnClickListener(new View.OnClickListener() { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/TransactionDetailsFragment.java b/wallet/src/main/java/com/vergepay/wallet/ui/TransactionDetailsFragment.java index 5dcb65e..4f7280b 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/TransactionDetailsFragment.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/TransactionDetailsFragment.java @@ -92,22 +92,22 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_transaction_details, container, false); - outputRows = (ListView) view.findViewById(R.id.output_rows); + outputRows = view.findViewById(R.id.output_rows); outputRows.setOnItemClickListener(getListener()); // Header View header = inflater.inflate(R.layout.fragment_transaction_details_header, null); outputRows.addHeaderView(header, null, false); - txStatusView = (TextView) header.findViewById(R.id.tx_status); - txDateLabel = (TextView) header.findViewById(R.id.tx_date_label); - txDate = (TextView) header.findViewById(R.id.tx_date); + txStatusView = header.findViewById(R.id.tx_status); + txDateLabel = header.findViewById(R.id.tx_date_label); + txDate = header.findViewById(R.id.tx_date); // Footer View footer = inflater.inflate(R.layout.fragment_transaction_details_footer, null); outputRows.addFooterView(footer, null, false); - txIdView = (TextView) footer.findViewById(R.id.tx_id); - txMessageLabel = (TextView) footer.findViewById(R.id.tx_message_label); - txMessage = (TextView) footer.findViewById(R.id.tx_message); + txIdView = footer.findViewById(R.id.tx_id); + txMessageLabel = footer.findViewById(R.id.tx_message_label); + txMessage = footer.findViewById(R.id.tx_message); pocket.addEventListener(walletListener); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/TransactionsListAdapter.java b/wallet/src/main/java/com/vergepay/wallet/ui/TransactionsListAdapter.java index ab1b2dc..a8dbf54 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/TransactionsListAdapter.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/TransactionsListAdapter.java @@ -213,17 +213,17 @@ public void bindView(@Nonnull final View row, @Nonnull final AbstractTransaction // TODO set colors as theme, not here in code - final TextView rowDirectionText = (TextView) row.findViewById(R.id.transaction_row_direction_text); - final TextView rowDirectionFontIcon = (TextView) row.findViewById(R.id.transaction_row_direction_font_icon); + final TextView rowDirectionText = row.findViewById(R.id.transaction_row_direction_text); + final TextView rowDirectionFontIcon = row.findViewById(R.id.transaction_row_direction_font_icon); Fonts.setTypeface(rowDirectionFontIcon, Fonts.Font.COINOMI_FONT_ICONS); - final TextView rowConfirmationsFontIcon = (TextView) row.findViewById(R.id.transaction_row_confirmations_font_icon); + final TextView rowConfirmationsFontIcon = row.findViewById(R.id.transaction_row_confirmations_font_icon); Fonts.setTypeface(rowConfirmationsFontIcon, Fonts.Font.COINOMI_FONT_ICONS); - final TextView rowMessageFontIcon = (TextView) row.findViewById(R.id.transaction_row_message_font_icon); + final TextView rowMessageFontIcon = row.findViewById(R.id.transaction_row_message_font_icon); Fonts.setTypeface(rowMessageFontIcon, Fonts.Font.COINOMI_FONT_ICONS); - final TextView rowDate = (TextView) row.findViewById(R.id.transaction_row_time); - final TextView rowLabel = (TextView) row.findViewById(R.id.transaction_row_label); - final TextView rowAddress = (TextView) row.findViewById(R.id.transaction_row_address); - final CurrencyTextView rowValue = (CurrencyTextView) row.findViewById(R.id.transaction_row_value); + final TextView rowDate = row.findViewById(R.id.transaction_row_time); + final TextView rowLabel = row.findViewById(R.id.transaction_row_label); + final TextView rowAddress = row.findViewById(R.id.transaction_row_address); + final CurrencyTextView rowValue = row.findViewById(R.id.transaction_row_value); // confidence if (confidenceType == ConfidenceType.PENDING) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/UnlockWalletDialog.java b/wallet/src/main/java/com/vergepay/wallet/ui/UnlockWalletDialog.java index 2f6e429..8773b6e 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/UnlockWalletDialog.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/UnlockWalletDialog.java @@ -44,7 +44,7 @@ public void onDetach() { public Dialog onCreateDialog(Bundle savedInstanceState) { final LayoutInflater inflater = LayoutInflater.from(getActivity()); final View view = inflater.inflate(R.layout.get_password_dialog, null); - passwordView = (TextView) view.findViewById(R.id.password); + passwordView = view.findViewById(R.id.password); return new DialogBuilder(getActivity()) .setTitle(R.string.unlock_wallet_title) diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/WalletActivity.java b/wallet/src/main/java/com/vergepay/wallet/ui/WalletActivity.java index 3998334..c370992 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/WalletActivity.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/WalletActivity.java @@ -177,7 +177,7 @@ protected void onCreate(Bundle savedInstanceState) { createNavDrawerItems(); mNavigationDrawerFragment.setUp( R.id.navigation_drawer, - (DrawerLayout) findViewById(R.id.drawer_layout), + findViewById(R.id.drawer_layout), navDrawerItems); if (getIntent().hasExtra(Constants.ARG_URI)) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/adaptors/AccountListAdapter.java b/wallet/src/main/java/com/vergepay/wallet/ui/adaptors/AccountListAdapter.java index dcae36f..d37126a 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/adaptors/AccountListAdapter.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/adaptors/AccountListAdapter.java @@ -98,18 +98,18 @@ public View getView(final int position, View row, final ViewGroup parent) { } private void bindView(View row, WalletAccount account) { - final ImageView icon = (ImageView) row.findViewById(R.id.account_icon); + final ImageView icon = row.findViewById(R.id.account_icon); icon.setImageResource(Constants.COINS_ICONS.get(account.getCoinType())); - final TextView rowLabel = (TextView) row.findViewById(R.id.account_description); + final TextView rowLabel = row.findViewById(R.id.account_description); rowLabel.setText(account.getDescriptionOrCoinName()); - final Amount rowValue = (Amount) row.findViewById(R.id.account_balance); + final Amount rowValue = row.findViewById(R.id.account_balance); rowValue.setAmount(GenericUtils.formatFiatValue(account.getBalance(), 4, 0)); rowValue.setSymbol(account.getCoinType().getSymbol()); ExchangeRatesProvider.ExchangeRate rate = rates.get(account.getCoinType().getSymbol()); - final Amount rowBalanceRateValue = (Amount) row.findViewById(R.id.account_balance_rate); + final Amount rowBalanceRateValue = row.findViewById(R.id.account_balance_rate); if (rate != null && account.getCoinType() != null) { Value localAmount = rate.rate.convert(account.getBalance()); GenericUtils.formatCoinValue(localAmount.type, localAmount,true); @@ -120,7 +120,7 @@ private void bindView(View row, WalletAccount account) { rowBalanceRateValue.setVisibility(View.GONE); } - final Amount rowRateValue = (Amount) row.findViewById(R.id.exchange_rate_row_rate); + final Amount rowRateValue = row.findViewById(R.id.exchange_rate_row_rate); if (rate != null && account.getCoinType() != null) { Value localAmount = rate.rate.convert(account.getCoinType().oneCoin()); GenericUtils.formatCoinValue(localAmount.type, localAmount, true); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/dialogs/CreateNewAddressDialog.java b/wallet/src/main/java/com/vergepay/wallet/ui/dialogs/CreateNewAddressDialog.java index ef14989..0f85c65 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/dialogs/CreateNewAddressDialog.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/dialogs/CreateNewAddressDialog.java @@ -73,7 +73,7 @@ public void onClick(DialogInterface dialog, int which) { if (pocketHD.canCreateFreshReceiveAddress()) { final LayoutInflater inflater = LayoutInflater.from(getActivity()); final View view = inflater.inflate(R.layout.new_address_dialog, null); - final TextView viewLabel = (TextView) view.findViewById(R.id.new_address_label); + final TextView viewLabel = view.findViewById(R.id.new_address_label); final DialogBuilder builder = new DialogBuilder(getActivity()); builder.setView(view); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/dialogs/FingerprintScanDialog.java b/wallet/src/main/java/com/vergepay/wallet/ui/dialogs/FingerprintScanDialog.java index 8cad19d..b009ca3 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/dialogs/FingerprintScanDialog.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/dialogs/FingerprintScanDialog.java @@ -96,8 +96,8 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_scan_fingerprint, container, false); - TextView titleAdd = (TextView) view.findViewById(R.id.title_add); - TextView titleCheck = (TextView) view.findViewById(R.id.title_check); + TextView titleAdd = view.findViewById(R.id.title_add); + TextView titleCheck = view.findViewById(R.id.title_check); switch (mode) { case CHECK: @@ -108,7 +108,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, break; } - Button pincodeButton = (Button) view.findViewById(R.id.pincode_button); + Button pincodeButton = view.findViewById(R.id.pincode_button); if (mode == Mode.ADD) { pincodeButton.setVisibility(View.GONE); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/widget/AddressView.java b/wallet/src/main/java/com/vergepay/wallet/ui/widget/AddressView.java index a949199..35e489d 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/widget/AddressView.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/widget/AddressView.java @@ -51,9 +51,9 @@ public AddressView(Context context, AttributeSet attrs) { private void inflateLayout(Context context) { LayoutInflater.from(context).inflate(R.layout.address, this, true); - iconView = (ImageView) findViewById(R.id.icon); - addressLabelView = (TextView) findViewById(R.id.address_label); - addressView = (TextView) findViewById(R.id.address); + iconView = findViewById(R.id.icon); + addressLabelView = findViewById(R.id.address_label); + addressView = findViewById(R.id.address); } public void setAddressAndLabel(AbstractAddress address) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/widget/Amount.java b/wallet/src/main/java/com/vergepay/wallet/ui/widget/Amount.java index 9cb9746..61de772 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/widget/Amount.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/widget/Amount.java @@ -27,7 +27,7 @@ public Amount(Context context, AttributeSet attrs) { LayoutInflater.from(context).inflate(R.layout.amount, this, true); - symbolView = (TextView) findViewById(R.id.symbol); + symbolView = findViewById(R.id.symbol); // amountPending = (TextView) findViewById(R.id.amount_pending); // amountPending.setVisibility(GONE); @@ -41,7 +41,7 @@ public Amount(Context context, AttributeSet attrs) { a.recycle(); } - amountView = (FontFitTextView) findViewById(R.id.amount_text); + amountView = findViewById(R.id.amount_text); if (!getRootView().isInEditMode()) { if (isBig) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/widget/AmountEditView.java b/wallet/src/main/java/com/vergepay/wallet/ui/widget/AmountEditView.java index 3dce5f1..18238ee 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/widget/AmountEditView.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/widget/AmountEditView.java @@ -59,7 +59,7 @@ public AmountEditView(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater.from(context).inflate(R.layout.amount_edit, this, true); - LinearLayout layout = (LinearLayout) findViewById(R.id.amount_layout); + LinearLayout layout = findViewById(R.id.amount_layout); amountText = (EditText) layout.getChildAt(0); amountText.addTextChangedListener(amountTextListener); amountText.setOnFocusChangeListener(amountTextListener); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/widget/HeaderWithFontIcon.java b/wallet/src/main/java/com/vergepay/wallet/ui/widget/HeaderWithFontIcon.java index c17b496..f0032b1 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/widget/HeaderWithFontIcon.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/widget/HeaderWithFontIcon.java @@ -20,8 +20,8 @@ public HeaderWithFontIcon(Context context) { LayoutInflater.from(context).inflate(R.layout.header_with_font_icon, this, true); - messageView = (TextView) findViewById(R.id.message); - fontIconView = (TextView) findViewById(R.id.font_icon); + messageView = findViewById(R.id.message); + fontIconView = findViewById(R.id.font_icon); Fonts.setTypeface(fontIconView, Fonts.Font.COINOMI_FONT_ICONS); } diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/widget/NavDrawerItemView.java b/wallet/src/main/java/com/vergepay/wallet/ui/widget/NavDrawerItemView.java index 6f9d790..ebb179d 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/widget/NavDrawerItemView.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/widget/NavDrawerItemView.java @@ -27,8 +27,8 @@ public NavDrawerItemView(Context context) { super(context); view = LayoutInflater.from(context).inflate(R.layout.nav_drawer_item, this, true); - title = (TextView) findViewById(R.id.item_text); - icon = (ImageView) findViewById(R.id.item_icon); + title = findViewById(R.id.item_text); + icon = findViewById(R.id.item_icon); } public void setData(String titleStr, int iconRes) { diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/widget/SendOutput.java b/wallet/src/main/java/com/vergepay/wallet/ui/widget/SendOutput.java index 87ba857..acdf15f 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/widget/SendOutput.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/widget/SendOutput.java @@ -59,13 +59,13 @@ public SendOutput(Context context, AttributeSet attrs) { private void inflateView(Context context) { LayoutInflater.from(context).inflate(R.layout.transaction_output, this, true); - sendTypeText = (TextView) findViewById(R.id.send_output_type_text); - amount = (TextView) findViewById(R.id.amount); - symbol = (TextView) findViewById(R.id.symbol); - amountLocal = (TextView) findViewById(R.id.local_amount); - symbolLocal = (TextView) findViewById(R.id.local_symbol); - addressLabelView = (TextView) findViewById(R.id.output_label); - addressView = (TextView) findViewById(R.id.output_address); + sendTypeText = findViewById(R.id.send_output_type_text); + amount = findViewById(R.id.amount); + symbol = findViewById(R.id.symbol); + amountLocal = findViewById(R.id.local_amount); + symbolLocal = findViewById(R.id.local_symbol); + addressLabelView = findViewById(R.id.output_label); + addressView = findViewById(R.id.output_address); amountLocal.setVisibility(GONE); symbolLocal.setVisibility(GONE); diff --git a/wallet/src/main/java/com/vergepay/wallet/ui/widget/TransactionAmountVisualizer.java b/wallet/src/main/java/com/vergepay/wallet/ui/widget/TransactionAmountVisualizer.java index 18aa560..7c5e29b 100644 --- a/wallet/src/main/java/com/vergepay/wallet/ui/widget/TransactionAmountVisualizer.java +++ b/wallet/src/main/java/com/vergepay/wallet/ui/widget/TransactionAmountVisualizer.java @@ -47,12 +47,12 @@ public TransactionAmountVisualizer(Context context, AttributeSet attrs) { LayoutInflater.from(context).inflate(R.layout.transaction_amount_visualizer, this, true); - output = (SendOutput) findViewById(R.id.transaction_output); + output = findViewById(R.id.transaction_output); output.setVisibility(View.GONE); - fee = (SendOutput) findViewById(R.id.transaction_fee); + fee = findViewById(R.id.transaction_fee); fee.setVisibility(View.GONE); - txMessageLabel = (TextView) findViewById(R.id.tx_message_label); - txMessage = (TextView) findViewById(R.id.tx_message); + txMessageLabel = findViewById(R.id.tx_message_label); + txMessage = findViewById(R.id.tx_message); if (isInEditMode()) { output.setVisibility(View.VISIBLE);