Skip to content

Commit ccf367a

Browse files
committed
style: Use expression bodies
1 parent 5540161 commit ccf367a

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

ui/src/main/kotlin/com/algolia/instantsearch/voice/ui/VoiceAndroidView.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@ class VoiceAndroidView(
3434
view.suggestions.text = html
3535
}
3636

37-
override fun setTitle(title: VoiceUI.Title) {
38-
view.voiceInput.title.setText(title.resource)
39-
}
37+
override fun setTitle(title: VoiceUI.Title) = view.voiceInput.title.setText(title.resource)
4038

4139
override fun setSubtitle(subtitle: String) {
4240
view.voiceInput.subtitle.text = subtitle
4341
}
4442

45-
override fun setSubtitle(subtitle: VoiceUI.Subtitle) {
46-
view.voiceInput.subtitle.setText(subtitle.resource)
47-
}
43+
override fun setSubtitle(subtitle: VoiceUI.Subtitle) = view.voiceInput.subtitle.setText(subtitle.resource)
4844

4945
override fun setSuggestionVisibility(isVisible: Boolean) {
5046
view.voiceInput.suggestions.visibility = if (isVisible) View.VISIBLE else View.INVISIBLE
@@ -54,9 +50,8 @@ class VoiceAndroidView(
5450
view.voiceInput.hint.visibility = if (isVisible) View.VISIBLE else View.INVISIBLE
5551
}
5652

57-
override fun setRippleActivity(isActive: Boolean) {
53+
override fun setRippleActivity(isActive: Boolean) =
5854
if (isActive) view.voiceInput.ripple.start() else view.voiceInput.ripple.cancel()
59-
}
6055

6156
override fun setMicrophoneState(state: VoiceMicrophone.State) {
6257
view.voiceInput.microphone.state = state

ui/src/main/kotlin/com/algolia/instantsearch/voice/ui/VoiceInputDialogFragment.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ class VoiceInputDialogFragment : DialogFragment() {
5454
suggestions = arguments?.getStringArray(Field.Suggestions.name)
5555
}
5656

57-
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
58-
return inflater.inflate(R.layout.voice_input, container, false)
59-
}
57+
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? =
58+
inflater.inflate(R.layout.voice_input, container, false)
6059

6160
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
6261
super.onViewCreated(view, savedInstanceState)

0 commit comments

Comments
 (0)