Updated on 2026-08-14

This commit is contained in:
Tangem 2018-06-06 15:42:19 +03:00
parent 49c3ff4427
commit 424a5dc382
18 changed files with 1037 additions and 1102 deletions

Binary file not shown.

View file

@ -58,14 +58,25 @@ public class BtcEngine extends CoinEngine {
return new String[]{/*"testnetnode.arihanc.com"*/"testnet.hsmiths.com", "testnet.qtornado.com", "testnet1.bauerj.eu"};
}
public static Integer[] GetBitcoinServicePorts() {
return new Integer[]{8080, 50001/* 8080*/, 50001, 50001, 50001, 50001, 50001, 50001, 50001, 50001};
}
public static Integer[] GetBitcoinTestNetServicePorts() {
return new Integer[]{/*51001*/53011, 51001, 50001};
}
// public static String[] GetBitcoinTestNetServiceHosts() {
// return new String[]{"electrum.akinbo.org"/*, "testnet.hsmiths.com", "testnet.qtornado.com", "testnet1.bauerj.eu"*/};
// }
//
// public static Integer[] GetBitcoinTestNetServicePorts() {
// return new Integer[]{51001/*53011, 51001, 50001*/};
// }
public static Integer[] GetBitcoinServicePorts() {
return new Integer[]{8080, 50001/* 8080*/, 50001, 50001, 50001, 50001, 50001, 50001, 50001, 50001};
}
static int serviceIndex = GetNextBitconMainNetServiceIndex();
static int dynamicIndex = GetNextBitconMainNetServiceIndex();

View file

@ -11,10 +11,10 @@ import android.view.Menu;
import android.view.MenuItem;
import com.tangem.domain.wallet.TangemCard;
import com.tangem.presentation.fragment.WalletInfo;
import com.tangem.wallet.R;
import com.tangem.presentation.fragment.WalletInfoFragment;
public class CardInfoActivity extends AppCompatActivity implements WalletInfoFragment.OnFragmentInteractionListener {
public class CardInfoActivity extends AppCompatActivity implements WalletInfo.OnFragmentInteractionListener {
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
@ -44,10 +44,10 @@ public class CardInfoActivity extends AppCompatActivity implements WalletInfoFra
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager = findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
TabLayout tabLayout = findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
String UID = getIntent().getStringExtra("UID");
@ -95,7 +95,7 @@ public class CardInfoActivity extends AppCompatActivity implements WalletInfoFra
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
if (position == 0) {
return WalletInfoFragment.newInstance(mCard);
return WalletInfo.newInstance(mCard);
} /*else if (position == 1) {
return WalletUnspentFragment.newInstance(mCard);
} else if (position == 2) {

View file

@ -7,7 +7,7 @@ import android.nfc.Tag;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.tangem.presentation.fragment.LoadedWalletFragment;
import com.tangem.presentation.fragment.LoadedWallet;
import com.tangem.wallet.R;
import java.util.Objects;
@ -23,7 +23,7 @@ public class LoadedWalletActivity extends AppCompatActivity {
if (Objects.requireNonNull(getIntent().getExtras()).containsKey(NfcAdapter.EXTRA_TAG)) {
Tag tag = getIntent().getParcelableExtra(NfcAdapter.EXTRA_TAG);
if (tag != null) {
LoadedWalletFragment fragment = (LoadedWalletFragment) (getSupportFragmentManager().findFragmentById(R.id.loaded_wallet_fragment));
LoadedWallet fragment = (LoadedWallet) (getSupportFragmentManager().findFragmentById(R.id.loaded_wallet_fragment));
fragment.onTagDiscovered(tag);
}
}
@ -31,8 +31,8 @@ public class LoadedWalletActivity extends AppCompatActivity {
@Override
public void onBackPressed() {
LoadedWalletFragment loadedWalletFragment = (LoadedWalletFragment) getSupportFragmentManager().findFragmentById(R.id.loaded_wallet_fragment);
Intent data = loadedWalletFragment.prepareResultIntent();
LoadedWallet loadedWallet = (LoadedWallet) getSupportFragmentManager().findFragmentById(R.id.loaded_wallet_fragment);
Intent data = loadedWallet.prepareResultIntent();
data.putExtra("modification", "update");
setResult(Activity.RESULT_OK, data);
finish();

View file

@ -28,7 +28,7 @@ import com.tangem.domain.wallet.LastSignStorage;
import com.tangem.domain.wallet.Logger;
import com.tangem.domain.wallet.PINStorage;
import com.tangem.presentation.dialog.RootFoundDialog;
import com.tangem.presentation.fragment.MainFragment;
import com.tangem.presentation.fragment.Main;
import com.tangem.util.CommonUtil;
import com.tangem.util.PhoneUtility;
import com.tangem.wallet.BuildConfig;
@ -106,8 +106,8 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
fab.setOnClickListener(this::showMenu);
// add fragment
MainFragment mainFragment = (MainFragment) getSupportFragmentManager().findFragmentById(R.id.fragmentMain);
if (mainFragment.getCardListAdapter().getItemCount() > 0)
Main main = (Main) getSupportFragmentManager().findFragmentById(R.id.fragmentMain);
if (main.getCardListAdapter().getItemCount() > 0)
showCleanButton();
else
hideCleanButton();

View file

@ -6,7 +6,7 @@ import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.tangem.wallet.R;
import com.tangem.presentation.fragment.VerifyCardFragment;
import com.tangem.presentation.fragment.VerifyCard;
public class VerifyCardActivity extends AppCompatActivity {
@ -21,8 +21,8 @@ public class VerifyCardActivity extends AppCompatActivity {
@Override
public void onBackPressed() {
//super.onBackPressed();
VerifyCardFragment verifyCardFragment = (VerifyCardFragment) getSupportFragmentManager().findFragmentById(R.id.verify_card_fragment);
Intent data = verifyCardFragment.prepareResultIntent();
VerifyCard verifyCard = (VerifyCard) getSupportFragmentManager().findFragmentById(R.id.verify_card_fragment);
Intent data = verifyCard.prepareResultIntent();
data.putExtra("modification", "update");
setResult(Activity.RESULT_OK, data);
finish();

View file

@ -67,14 +67,14 @@ import java.util.Objects;
/**
* A placeholder fragment containing a simple view.
*/
public class MainFragment extends Fragment implements NfcAdapter.ReaderCallback, CardListAdapter.UiCallbacks, CardProtocol.Notifications, MainActivity.OnCardsClean {
public class Main extends Fragment implements NfcAdapter.ReaderCallback, CardListAdapter.UiCallbacks, CardProtocol.Notifications, MainActivity.OnCardsClean {
private static final int REQUEST_CODE_SHOW_CARD_ACTIVITY = 1;
private static final int REQUEST_CODE_ENTER_PIN_ACTIVITY = 2;
private static final int REQUEST_CODE_REQUEST_CAMERA_PERMISSIONS = 3;
private NfcManager mNfcManager;
private ArrayList<String> slCardUIDs = new ArrayList<>();
private static final String logTag = "MainFragment";
private static final String logTag = "Main";
private ProgressBar progressBar;
private CardListAdapter mCardListAdapter;
@ -87,7 +87,7 @@ public class MainFragment extends Fragment implements NfcAdapter.ReaderCallback,
private SwipeRefreshLayout mSwipeRefreshLayout; //TODO: tmp
List<RequestWalletInfoTask> requestTasks = new ArrayList<>();
public MainFragment() {
public Main() {
}
// @Override

View file

@ -23,7 +23,7 @@ import java.io.IOException;
import java.util.Timer;
import java.util.TimerTask;
public class VerifyCardFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener, NfcAdapter.ReaderCallback {
public class VerifyCard extends Fragment implements SwipeRefreshLayout.OnRefreshListener, NfcAdapter.ReaderCallback {
TangemCard mCard;
TextView tvCardID, tvManufacturer, tvRegistrationDate, tvCardIdentity, tvLastSigned, tvRemainingSignatures, tvReusable, tvOk, tvError, tvMessage,
@ -32,7 +32,7 @@ public class VerifyCardFragment extends Fragment implements SwipeRefreshLayout.O
SwipeRefreshLayout mSwipeRefreshLayout;
private NfcManager mNfcManager;
public VerifyCardFragment() {
public VerifyCard() {
}

View file

@ -32,17 +32,17 @@ import static android.content.Context.CLIPBOARD_SERVICE;
* Activities that contain this fragment must implement the
* {@link OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link WalletInfoFragment#newInstance} factory method to
* Use the {@link WalletInfo#newInstance} factory method to
* create an instance of this fragment.
*/
public class WalletInfoFragment extends Fragment {
public class WalletInfo extends Fragment {
// TODO: Rename and change types of parameters
private TangemCard mCard;
private OnFragmentInteractionListener mListener;
public WalletInfoFragment() {
public WalletInfo() {
// Required empty public constructor
}
@ -50,11 +50,11 @@ public class WalletInfoFragment extends Fragment {
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @return A new instance of fragment WalletInfoFragment.
* @return A new instance of fragment WalletInfo.
*/
// TODO: Rename and change types and number of parameters
public static WalletInfoFragment newInstance(TangemCard card) {
WalletInfoFragment fragment = new WalletInfoFragment();
public static WalletInfo newInstance(TangemCard card) {
WalletInfo fragment = new WalletInfo();
Bundle args = new Bundle();
args.putString("UID",card.getUID());
card.SaveToBundle(args);

View file

@ -21,9 +21,7 @@
<!--</android.support.design.widget.AppBarLayout>-->
<include
layout="@layout/content_loaded_wallet"
android:layout_height="566dp"
tools:layout_editor_absoluteY="1dp"/>
layout="@layout/content_loaded_wallet"/>
<!--<android.support.design.widget.FloatingActionButton-->
<!--android:id="@+id/fab"-->
@ -33,4 +31,4 @@
<!--android:layout_margin="@dimen/fab_margin"-->
<!--app:srcCompat="@android:drawable/ic_dialog_email" />-->
</android.support.design.widget.CoordinatorLayout>
</android.support.design.widget.CoordinatorLayout>

View file

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/loaded_wallet_fragment"
android:name="com.tangem.presentation.fragment.LoadedWalletFragment"
android:name="com.tangem.presentation.fragment.LoadedWallet"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"

View file

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragmentMain"
android:name="com.tangem.presentation.fragment.MainFragment"
android:name="com.tangem.presentation.fragment.Main"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"

View file

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/verify_card_fragment"
android:name="com.tangem.presentation.fragment.VerifyCardFragment"
android:name="com.tangem.presentation.fragment.VerifyCard"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"

View file

@ -8,7 +8,7 @@
android:background="@color/white"
android:orientation="vertical"
android:padding="0dp"
tools:context="com.tangem.presentation.fragment.LoadedWalletFragment"
tools:context="com.tangem.presentation.fragment.LoadedWallet"
tools:showIn="@layout/activity_loaded_wallet">
<android.support.v4.widget.SwipeRefreshLayout
@ -520,7 +520,6 @@
android:id="@+id/rlToolButtons"
android:layout_width="0dp"
android:layout_height="40dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
@ -534,7 +533,6 @@
android:layout_toLeftOf="@+id/tvPurge"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:capitalize="none"
android:fontFamily="@font/raleway_r"
android:padding="8dp"
android:text="SEND"
@ -552,7 +550,6 @@
android:layout_weight="12"
android:background="@drawable/ic_show_menu"
android:backgroundTint="@color/colorPrimaryDark"
android:capitalize="none"
android:fontFamily="@font/raleway_r"
android:padding="8dp"
android:textAlignment="center"

View file

@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.fragment.MainFragment"
tools:context="com.tangem.presentation.fragment.Main"
tools:showIn="@layout/content_main">
<!--<android.support.v4.widget.SwipeRefreshLayout-->

View file

@ -8,7 +8,7 @@
android:background="@color/white"
android:orientation="vertical"
android:padding="0dp"
tools:context="com.tangem.presentation.fragment.VerifyCardFragment"
tools:context="com.tangem.presentation.fragment.VerifyCard"
tools:showIn="@layout/activity_verify_card">
<RelativeLayout

View file

@ -52,7 +52,7 @@
<string name="reset_pins_to_default">Reset PINs to default</string>
<string name="erase_wallet">Erase wallet</string>
<!-- MainActivity, MainFragment -->
<!-- MainActivity, Main -->
<string name="tap_tangem_card">Tap Tangem card with your smartphone</string>
<string name="scan_banknote">Scan a banknote with your \n smartphone as shown above</string>
<string name="try_to_scan_again">Try to scan again</string>
@ -69,6 +69,13 @@
<string name="banknote_banknote">&#160;&#160;BANKNOTE&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;BANKNOTE</string>
<string name="reusable_reusable">&#160;&#160;&#160;REUSABLE&#160;&#160;&#160;&#160;&#160;&#160;&#160;REUSABLE&#160;&#160;&#160;</string>
<!-- LoadedWalletActivity, LoadedWallet -->
<string name="wallet_empty">The wallet is empty</string>
<string name="not_enough_funds">Not enough funds for transaction fee (gas)!</string>
<string name="please_wait_while_previous">Please wait while previous transaction is confirmed in blockchain</string>
<string name="please_wait_for_confirmation">Please wait for confirmation of incoming transaction!</string>
<string name="card_hasn_t_remaining_signature">Card hasn\'t remaining signature!</string>
<!-- LogoActivity -->
<string name="beta">BETA</string>
<string name="smart_cash_ag">Smart Cash AG</string>