diff --git a/android/src/main/kotlin/com/dgsd/android/solar/AppCoordinator.kt b/android/src/main/kotlin/com/dgsd/android/solar/AppCoordinator.kt index d47a0ec..ba8bc2c 100644 --- a/android/src/main/kotlin/com/dgsd/android/solar/AppCoordinator.kt +++ b/android/src/main/kotlin/com/dgsd/android/solar/AppCoordinator.kt @@ -42,7 +42,6 @@ class AppCoordinator( object RequestAmount : Destination object SendWithQR : Destination object SendWithAddress : Destination - object SendWithNearby : Destination object MobileWalletAdapterAuthorize : Destination object MobileWalletAdapterSignTransactions : Destination object MobileWalletAdapterSignMessages : Destination @@ -122,10 +121,6 @@ class AppCoordinator( _destination.tryEmit(Destination.SendWithAddress) } - fun navigateToSendWithNearby() { - _destination.tryEmit(Destination.SendWithNearby) - } - fun navigateToSendWithQrCode() { _destination.tryEmit(Destination.SendWithQR) } diff --git a/android/src/main/kotlin/com/dgsd/android/solar/MainActivity.kt b/android/src/main/kotlin/com/dgsd/android/solar/MainActivity.kt index 4951a4b..eea4e77 100644 --- a/android/src/main/kotlin/com/dgsd/android/solar/MainActivity.kt +++ b/android/src/main/kotlin/com/dgsd/android/solar/MainActivity.kt @@ -98,7 +98,6 @@ class MainActivity : AppCompatActivity() { Destination.RequestAmount -> ScreenTransitionType.SLIDE_FROM_BOTTOM Destination.ShareWalletAddress -> ScreenTransitionType.SLIDE_FROM_BOTTOM Destination.SendWithAddress -> ScreenTransitionType.SLIDE_FROM_BOTTOM - Destination.SendWithNearby -> ScreenTransitionType.SLIDE_FROM_BOTTOM Destination.SendWithQR -> ScreenTransitionType.SLIDE_FROM_BOTTOM is Destination.SendWithSolPayRequest -> ScreenTransitionType.SLIDE_FROM_BOTTOM Destination.Settings -> ScreenTransitionType.DEFAULT @@ -120,7 +119,6 @@ class MainActivity : AppCompatActivity() { is Destination.TransactionDetails -> TransactionDetailsFragment.newInstance(destination.signature) Destination.SendWithAddress -> SendContainerFragment.newEnterAddressInstance() - Destination.SendWithNearby -> SendContainerFragment.newEnterAddressInstance() Destination.SendWithQR -> SendContainerFragment.newQRScanInstance() is Destination.SendWithSolPayRequest -> SendContainerFragment.newTransferRequestInstance(destination.requestUrl) diff --git a/android/src/main/kotlin/com/dgsd/android/solar/di/AppModule.kt b/android/src/main/kotlin/com/dgsd/android/solar/di/AppModule.kt index 93b8b0e..10aa498 100644 --- a/android/src/main/kotlin/com/dgsd/android/solar/di/AppModule.kt +++ b/android/src/main/kotlin/com/dgsd/android/solar/di/AppModule.kt @@ -20,8 +20,6 @@ import com.dgsd.android.solar.common.ui.PublicKeyFormatter import com.dgsd.android.solar.files.FileProviderManager import com.dgsd.android.solar.mobilewalletadapter.MobileWalletAdapterAuthorityManager import com.dgsd.android.solar.mobilewalletadapter.MobileWalletAdapterCoordinatorFactory -import com.dgsd.android.solar.nfc.NfcManager -import com.dgsd.android.solar.nfc.NfcManagerImpl import com.dgsd.android.solar.permission.PermissionsManager import com.dgsd.android.solar.session.manager.SessionManager import com.dgsd.android.solar.session.manager.SessionManagerImpl @@ -92,10 +90,6 @@ internal object AppModule { AppLockBiometricManagerImpl(get()) } - single { - NfcManagerImpl(get()) - } - single { ImageLoader.Builder(get()) .crossfade(true) diff --git a/android/src/main/kotlin/com/dgsd/android/solar/di/ViewModelModule.kt b/android/src/main/kotlin/com/dgsd/android/solar/di/ViewModelModule.kt index 2d1760e..da8d472 100644 --- a/android/src/main/kotlin/com/dgsd/android/solar/di/ViewModelModule.kt +++ b/android/src/main/kotlin/com/dgsd/android/solar/di/ViewModelModule.kt @@ -61,7 +61,6 @@ internal object ViewModelModule { transactionViewStateFactory = getScoped(), solanaApiRepository = getScoped(), solPay = getScoped(), - nfcManager = get(), ) } diff --git a/android/src/main/kotlin/com/dgsd/android/solar/home/HomeFragment.kt b/android/src/main/kotlin/com/dgsd/android/solar/home/HomeFragment.kt index 78a4301..9af81fc 100644 --- a/android/src/main/kotlin/com/dgsd/android/solar/home/HomeFragment.kt +++ b/android/src/main/kotlin/com/dgsd/android/solar/home/HomeFragment.kt @@ -175,10 +175,6 @@ class HomeFragment : Fragment(R.layout.frag_home) { appCoordinator.navigateToSendWithAddress() } - onEach(viewModel.navigateToSendWithNearby) { - appCoordinator.navigateToSendWithNearby() - } - onEach(viewModel.navigateToScanQr) { appCoordinator.navigateToSendWithQrCode() } diff --git a/android/src/main/kotlin/com/dgsd/android/solar/home/HomeViewModel.kt b/android/src/main/kotlin/com/dgsd/android/solar/home/HomeViewModel.kt index 0ac5b91..c886102 100644 --- a/android/src/main/kotlin/com/dgsd/android/solar/home/HomeViewModel.kt +++ b/android/src/main/kotlin/com/dgsd/android/solar/home/HomeViewModel.kt @@ -17,7 +17,6 @@ import com.dgsd.android.solar.flow.asEventFlow import com.dgsd.android.solar.flow.call import com.dgsd.android.solar.model.LamportsWithTimestamp import com.dgsd.android.solar.model.TransactionOrSignature -import com.dgsd.android.solar.nfc.NfcManager import com.dgsd.android.solar.repository.SolanaApiRepository import com.dgsd.ksol.model.PublicKey import com.dgsd.ksol.model.TransactionSignature @@ -38,7 +37,6 @@ class HomeViewModel( private val transactionViewStateFactory: TransactionViewStateFactory, private val solanaApiRepository: SolanaApiRepository, private val solPay: SolPay, - private val nfcManager: NfcManager, ) : AndroidViewModel(application) { private val balanceResourceConsumer = ResourceFlowConsumer(viewModelScope) @@ -114,9 +112,6 @@ class HomeViewModel( private val _navigateToSendWithAddress = SimpleMutableEventFlow() val navigateToSendWithAddress = _navigateToSendWithAddress.asEventFlow() - private val _navigateToSendWithNearby = SimpleMutableEventFlow() - val navigateToSendWithNearby = _navigateToSendWithNearby.asEventFlow() - private val _navigateToSendToAddress = MutableEventFlow() val navigateToSendWithSolPayRequest = _navigateToSendToAddress.asEventFlow() @@ -183,15 +178,6 @@ class HomeViewModel( R.drawable.ic_baseline_keyboard_24, SendActionSheetItem.Type.EnterPublicAddress ), - if (nfcManager.isNfAvailable()) { - SendActionSheetItem( - getString(R.string.home_send_action_sheet_item_nearby), - R.drawable.ic_baseline_tap_and_play_24, - SendActionSheetItem.Type.Nearby - ) - } else { - null - }, ) ) } @@ -200,7 +186,6 @@ class HomeViewModel( when (type) { SendActionSheetItem.Type.ScanQr -> _navigateToScanQr.call() SendActionSheetItem.Type.EnterPublicAddress -> _navigateToSendWithAddress.call() - SendActionSheetItem.Type.Nearby -> _navigateToSendWithNearby.call() is SendActionSheetItem.Type.PreselectedAddress -> { val request = SolPayTransferRequest(type.address) _navigateToSendToAddress.tryEmit(solPay.createUrl(request)) diff --git a/android/src/main/kotlin/com/dgsd/android/solar/home/SendActionSheetItem.kt b/android/src/main/kotlin/com/dgsd/android/solar/home/SendActionSheetItem.kt index a53519d..21eefa9 100644 --- a/android/src/main/kotlin/com/dgsd/android/solar/home/SendActionSheetItem.kt +++ b/android/src/main/kotlin/com/dgsd/android/solar/home/SendActionSheetItem.kt @@ -12,7 +12,6 @@ data class SendActionSheetItem( sealed interface Type { object ScanQr : Type object EnterPublicAddress : Type - object Nearby : Type data class PreselectedAddress(val address: PublicKey) : Type } } \ No newline at end of file diff --git a/android/src/main/kotlin/com/dgsd/android/solar/nfc/NfcManager.kt b/android/src/main/kotlin/com/dgsd/android/solar/nfc/NfcManager.kt deleted file mode 100644 index 641a0d0..0000000 --- a/android/src/main/kotlin/com/dgsd/android/solar/nfc/NfcManager.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.dgsd.android.solar.nfc - -interface NfcManager { - - fun isNfAvailable(): Boolean -} \ No newline at end of file diff --git a/android/src/main/kotlin/com/dgsd/android/solar/nfc/NfcManagerImpl.kt b/android/src/main/kotlin/com/dgsd/android/solar/nfc/NfcManagerImpl.kt deleted file mode 100644 index 7184412..0000000 --- a/android/src/main/kotlin/com/dgsd/android/solar/nfc/NfcManagerImpl.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.dgsd.android.solar.nfc - -import android.app.Application -import android.nfc.NfcAdapter - -class NfcManagerImpl(application: Application) : NfcManager { - - private val nfcAdapter = NfcAdapter.getDefaultAdapter(application) - - override fun isNfAvailable(): Boolean { - return nfcAdapter?.isEnabled == true - } -} \ No newline at end of file diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml index fb3a3e8..96d5c17 100644 --- a/android/src/main/res/values/strings.xml +++ b/android/src/main/res/values/strings.xml @@ -72,7 +72,6 @@ Send Request Send SOL - Another nearby SOLar user Address you copied (^1) Scan a QR code Enter a wallet address