Updated on 2026-08-14
This commit is contained in:
parent
0bc2d0a1d1
commit
49c3ff4427
18 changed files with 78 additions and 90 deletions
|
|
@ -4,7 +4,6 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.nfc.NfcAdapter;
|
||||
import android.nfc.Tag;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
|
@ -92,7 +91,6 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
|
|||
lp.topMargin = (int) (dp * (-100 + antenna.Y * 250));
|
||||
lp2.topMargin = (int) (dp * (-125 + antenna.Y * 250));
|
||||
nfc.setLayoutParams(lp2);
|
||||
|
||||
Animation a = new Animation() {
|
||||
@Override
|
||||
protected void applyTransformation(float interpolatedTime, Transformation t) {
|
||||
|
|
@ -115,13 +113,13 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
|
|||
hideCleanButton();
|
||||
|
||||
// NFC
|
||||
Intent intent = getIntent();
|
||||
if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))) {
|
||||
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
if (tag != null && onNFCReaderCallback != null) {
|
||||
onNFCReaderCallback.onTagDiscovered(tag);
|
||||
}
|
||||
}
|
||||
// Intent intent = getIntent();
|
||||
// if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))) {
|
||||
// Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
// if (tag != null && onNFCReaderCallback != null) {
|
||||
// onNFCReaderCallback.onTagDiscovered(tag);
|
||||
// }
|
||||
// }
|
||||
|
||||
// check if device root
|
||||
RootBeer rootBeer = new RootBeer(this);
|
||||
|
|
@ -129,16 +127,16 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
|
|||
new RootFoundDialog().show(getFragmentManager(), RootFoundDialog.TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))) {
|
||||
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
if (tag != null && onNFCReaderCallback != null) {
|
||||
onNFCReaderCallback.onTagDiscovered(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
// @Override
|
||||
// protected void onNewIntent(Intent intent) {
|
||||
// super.onNewIntent(intent);
|
||||
// if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))) {
|
||||
// Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
// if (tag != null && onNFCReaderCallback != null) {
|
||||
// onNFCReaderCallback.onTagDiscovered(tag);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keycode, KeyEvent e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue