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

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();