mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
refactoring
This commit is contained in:
@ -587,8 +587,10 @@ class CallActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setActionButtonEnabled(button: ImageView, isEnabled: Boolean) {
|
private fun setActionButtonEnabled(button: ImageView, enabled: Boolean) {
|
||||||
button.isEnabled = isEnabled
|
button.apply {
|
||||||
button.alpha = if (isEnabled) 1.0f else LOWER_ALPHA
|
isEnabled = enabled
|
||||||
|
alpha = if (enabled) 1.0f else LOWER_ALPHA
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ class ConferenceActivity : SimpleActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_conference)
|
setContentView(R.layout.activity_conference)
|
||||||
supportActionBar
|
|
||||||
|
|
||||||
conference_calls_list.adapter = ConferenceCallsAdapter(this, conference_calls_list, ArrayList(CallManager.getConferenceCalls())) {}
|
conference_calls_list.adapter = ConferenceCallsAdapter(this, conference_calls_list, ArrayList(CallManager.getConferenceCalls())) {}
|
||||||
}
|
}
|
||||||
|
@ -33,14 +33,11 @@ class ConferenceCallsAdapter(
|
|||||||
|
|
||||||
override fun getSelectableItemCount(): Int = data.size
|
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)
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_conference_call, parent)
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ fun getCallContact(context: Context, call: Call?, callback: (CallContact) -> Uni
|
|||||||
callback(CallContact(context.getString(R.string.conference), "", "", ""))
|
callback(CallContact(context.getString(R.string.conference), "", "", ""))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val privateCursor = context.getMyContactsCursor(false, true)
|
val privateCursor = context.getMyContactsCursor(false, true)
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
val callContact = CallContact("", "", "", "")
|
val callContact = CallContact("", "", "", "")
|
||||||
|
@ -46,12 +46,8 @@ class CallManager {
|
|||||||
|
|
||||||
fun getPhoneState(): PhoneState {
|
fun getPhoneState(): PhoneState {
|
||||||
return when (calls.size) {
|
return when (calls.size) {
|
||||||
0 -> {
|
0 -> NoCall
|
||||||
NoCall
|
1 -> SingleCall(calls.first())
|
||||||
}
|
|
||||||
1 -> {
|
|
||||||
SingleCall(calls.first())
|
|
||||||
}
|
|
||||||
2 -> {
|
2 -> {
|
||||||
val active = calls.find { it.getStateCompat() == Call.STATE_ACTIVE }
|
val active = calls.find { it.getStateCompat() == Call.STATE_ACTIVE }
|
||||||
val newCall = calls.find { it.getStateCompat() == Call.STATE_CONNECTING || it.getStateCompat() == Call.STATE_DIALING }
|
val newCall = calls.find { it.getStateCompat() == Call.STATE_CONNECTING || it.getStateCompat() == Call.STATE_DIALING }
|
||||||
|
Reference in New Issue
Block a user