refactoring

This commit is contained in:
Mysochenko Yuriy 2022-05-19 14:06:07 +03:00
parent 936f232f44
commit 7142b6363b
5 changed files with 11 additions and 16 deletions

View File

@ -587,8 +587,10 @@ class CallActivity : SimpleActivity() {
}
}
private fun setActionButtonEnabled(button: ImageView, isEnabled: Boolean) {
button.isEnabled = isEnabled
button.alpha = if (isEnabled) 1.0f else LOWER_ALPHA
private fun setActionButtonEnabled(button: ImageView, enabled: Boolean) {
button.apply {
isEnabled = enabled
alpha = if (enabled) 1.0f else LOWER_ALPHA
}
}
}

View File

@ -11,7 +11,6 @@ class ConferenceActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_conference)
supportActionBar
conference_calls_list.adapter = ConferenceCallsAdapter(this, conference_calls_list, ArrayList(CallManager.getConferenceCalls())) {}
}

View File

@ -33,14 +33,11 @@ class ConferenceCallsAdapter(
override fun getSelectableItemCount(): Int = data.size
override fun onActionModeCreated() {
}
override fun onActionModeCreated() {}
override fun onActionModeDestroyed() {
}
override fun onActionModeDestroyed() {}
override fun prepareActionMode(menu: Menu) {
}
override fun prepareActionMode(menu: Menu) {}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_conference_call, parent)

View File

@ -17,6 +17,7 @@ fun getCallContact(context: Context, call: Call?, callback: (CallContact) -> Uni
callback(CallContact(context.getString(R.string.conference), "", "", ""))
return
}
val privateCursor = context.getMyContactsCursor(false, true)
ensureBackgroundThread {
val callContact = CallContact("", "", "", "")

View File

@ -46,12 +46,8 @@ class CallManager {
fun getPhoneState(): PhoneState {
return when (calls.size) {
0 -> {
NoCall
}
1 -> {
SingleCall(calls.first())
}
0 -> NoCall
1 -> SingleCall(calls.first())
2 -> {
val active = calls.find { it.getStateCompat() == Call.STATE_ACTIVE }
val newCall = calls.find { it.getStateCompat() == Call.STATE_CONNECTING || it.getStateCompat() == Call.STATE_DIALING }