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) { | ||||
|         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 | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -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())) {} | ||||
|     } | ||||
|   | ||||
| @@ -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) | ||||
|  | ||||
|   | ||||
| @@ -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("", "", "", "") | ||||
|   | ||||
| @@ -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 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user