This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun sendMessage_MultipleMessagesFromSameUser() { | |
val newChatMessage1 = "I have a slightly swollen lip" | |
val newChatMessage2 = "And a headache" | |
val newChatMessageEntry = chatFragment.view!!.findViewById(R.id.et_new_chat_message) as EditText | |
newChatMessageEntry.setText(newChatMessage1) | |
val chatSendButton = chatFragment.view!!.findViewById(R.id.iv_chat_send_button) as ImageView | |
chatSendButton.callOnClick() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val firstName = getFullName( | |
relationshipID = deploymentDescriptor, | |
kpSessionManager.user, | |
proxyList = kpSessionManager.userSession.activeProxyListWithoutSelf | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun getInitialPrescriptionList(): List<HomeUiModel> { | |
return listOf( | |
HomeUiModel.HeaderUiModel(HeaderType.PHARMACY), | |
HomeUiModel.SubHeader(SubHeaderType.LOADING), | |
HomeUiModel.ShimmerUiModel(loadingType = LoadingType.PHARMACY), | |
HomeUiModel.ViewDetailUiModel(ViewMoreType.PHARMACY), | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROXYLOOP@for (proxy in proxyList) { | |
when (proxy.relation) { | |
(Proxy.RELATION_SELF) -> break@PROXYLOOP | |
(Proxy.RELATION_CHILD) -> continue@PROXYLOOP | |
(Proxy.RELATION_TEEN) -> { | |
// Logic for teen relation | |
} | |
} | |
// Additional processing | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (proxy in proxyList) { | |
when (proxy.relation) { | |
(Proxy.RELATION_SELF) -> break | |
(Proxy.RELATION_CHILD) -> continue | |
(Proxy.RELATION_TEEN) -> { | |
// Logic for teen relation | |
} | |
} | |
// Additional processing | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun notifyAppointmentDataChangesNonFunctional() { | |
val notifier = object : DataChangeNotifier { | |
override fun publishDataChange() { | |
apptDataPubSub.onNext() | |
} | |
} | |
notifier.publishDataChange() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun notifyAppointmentDataChanges() { | |
val notifier = DataChangeNotifier { apptDataPubSub.onNext() } | |
notifier.publishDataChange() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun interface DataChangeNotifier { | |
fun publishDataChange() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed interface NewSession { | |
fun showMessage() | |
} | |
sealed interface ExistingSession | |
sealed class Navigation | |
class PreviousPage : Navigation(), ExistingSession | |
class NextPage : Navigation(), ExistingSession | |
class Home : Navigation(), NewSession { | |
override fun showMessage() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JvmInline | |
value class PreferredFirstNameInline(private val name: String) // No overhead for PreferredFirstNameInline class unless needed for boxing | |
// as compared to | |
data class PreferredFirstName(private val name: String) | |
fun main() { | |
// The Java code decompiled from the bytecode shows the underlying implementation. | |
val inlineFirstName = PreferredFirstNameInline("fred") // Implemented by static method | |
/** |
OlderNewer