Skip to content

Commit

Permalink
Remove "Nearby" option
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielGrech committed Aug 10, 2022
1 parent 272dafd commit d9bf216
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -122,10 +121,6 @@ class AppCoordinator(
_destination.tryEmit(Destination.SendWithAddress)
}

fun navigateToSendWithNearby() {
_destination.tryEmit(Destination.SendWithNearby)
}

fun navigateToSendWithQrCode() {
_destination.tryEmit(Destination.SendWithQR)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -92,10 +90,6 @@ internal object AppModule {
AppLockBiometricManagerImpl(get())
}

single<NfcManager> {
NfcManagerImpl(get())
}

single<ImageLoader> {
ImageLoader.Builder(get())
.crossfade(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ internal object ViewModelModule {
transactionViewStateFactory = getScoped(),
solanaApiRepository = getScoped(),
solPay = getScoped(),
nfcManager = get(),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ class HomeFragment : Fragment(R.layout.frag_home) {
appCoordinator.navigateToSendWithAddress()
}

onEach(viewModel.navigateToSendWithNearby) {
appCoordinator.navigateToSendWithNearby()
}

onEach(viewModel.navigateToScanQr) {
appCoordinator.navigateToSendWithQrCode()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<LamportsWithTimestamp>(viewModelScope)
Expand Down Expand Up @@ -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<String>()
val navigateToSendWithSolPayRequest = _navigateToSendToAddress.asEventFlow()

Expand Down Expand Up @@ -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
},
)
)
}
Expand All @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
<string name="send">Send</string>
<string name="request">Request</string>
<string name="home_send_sheet_title">Send SOL</string>
<string name="home_send_action_sheet_item_nearby">Another nearby SOLar user</string>
<string name="home_send_action_sheet_item_from_clipboard_template">Address you copied (^1)</string>
<string name="home_send_action_sheet_item_scan_qr">Scan a QR code</string>
<string name="home_send_action_sheet_item_enter_address">Enter a wallet address</string>
Expand Down

0 comments on commit d9bf216

Please sign in to comment.