Skip to content

Commit 03ae9d1

Browse files
committed
Remove extra dialer button and use preferred sim
The app should just use the default SIM handle or let the user decide. Context: - #50 - #155 - #324
1 parent 8a8cb12 commit 03ae9d1

2 files changed

Lines changed: 5 additions & 41 deletions

File tree

app/src/main/kotlin/org/fossify/phone/activities/DialpadActivity.kt

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class DialpadActivity : SimpleActivity() {
139139
binding.apply {
140140
dialpadClearChar.setOnClickListener { clearChar(it) }
141141
dialpadClearChar.setOnLongClickListener { clearInput(); true }
142-
dialpadCallButton.setOnClickListener { initCall(dialpadInput.value, 0) }
142+
dialpadCallButton.setOnClickListener { initCall(dialpadInput.value) }
143143
dialpadInput.onTextChangeListener { dialpadValueChanged(it) }
144144
dialpadInput.requestFocus()
145145
dialpadInput.disableKeyboard()
@@ -150,24 +150,8 @@ class DialpadActivity : SimpleActivity() {
150150
}
151151

152152
val properPrimaryColor = getProperPrimaryColor()
153-
val callIconId = if (areMultipleSIMsAvailable()) {
154-
val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_two_vector, properPrimaryColor.getContrastColor())
155-
binding.apply {
156-
dialpadCallTwoButton.setImageDrawable(callIcon)
157-
dialpadCallTwoButton.background.applyColorFilter(properPrimaryColor)
158-
dialpadCallTwoButton.beVisible()
159-
dialpadCallTwoButton.setOnClickListener {
160-
initCall(dialpadInput.value, 1)
161-
}
162-
}
163-
164-
R.drawable.ic_phone_one_vector
165-
} else {
166-
R.drawable.ic_phone_vector
167-
}
168-
169153
binding.apply {
170-
val callIcon = resources.getColoredDrawableWithColor(callIconId, properPrimaryColor.getContrastColor())
154+
val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_vector, properPrimaryColor.getContrastColor())
171155
dialpadCallButton.setImageDrawable(callIcon)
172156
dialpadCallButton.background.applyColorFilter(properPrimaryColor)
173157

@@ -316,13 +300,9 @@ class DialpadActivity : SimpleActivity() {
316300
}
317301
}
318302

319-
private fun initCall(number: String = binding.dialpadInput.value, handleIndex: Int) {
303+
private fun initCall(number: String = binding.dialpadInput.value) {
320304
if (number.isNotEmpty()) {
321-
if (handleIndex != -1 && areMultipleSIMsAvailable()) {
322-
callContactWithSimWithConfirmationCheck(number, number, handleIndex == 0)
323-
} else {
324-
startCallWithConfirmationCheck(number, number)
325-
}
305+
startCallWithConfirmationCheck(number, number)
326306

327307
Handler().postDelayed({
328308
binding.dialpadInput.setText("")
@@ -343,7 +323,7 @@ class DialpadActivity : SimpleActivity() {
343323
if (binding.dialpadInput.value.length == 1) {
344324
val speedDial = speedDialValues.firstOrNull { it.id == id }
345325
if (speedDial?.isValid() == true) {
346-
initCall(speedDial.number, -1)
326+
initCall(speedDial.number)
347327
return true
348328
}
349329
}

app/src/main/res/layout/activity_dialpad.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,5 @@
125125
app:layout_constraintEnd_toEndOf="parent"
126126
app:layout_constraintStart_toStartOf="parent" />
127127

128-
<ImageView
129-
android:id="@+id/dialpad_call_two_button"
130-
android:layout_width="@dimen/dialpad_button_size_small"
131-
android:layout_height="@dimen/dialpad_button_size_small"
132-
android:layout_marginBottom="@dimen/activity_margin"
133-
android:background="@drawable/circle_button_background_ripple"
134-
android:contentDescription="@string/call_number"
135-
android:elevation="@dimen/medium_margin"
136-
android:padding="@dimen/normal_margin"
137-
android:src="@drawable/ic_phone_two_vector"
138-
android:visibility="gone"
139-
app:layout_constraintBottom_toBottomOf="parent"
140-
app:layout_constraintEnd_toStartOf="@+id/dialpad_call_button"
141-
app:layout_constraintStart_toStartOf="parent"
142-
app:layout_constraintTop_toTopOf="@+id/dialpad_call_button" />
143-
144128
</androidx.constraintlayout.widget.ConstraintLayout>
145129
</androidx.coordinatorlayout.widget.CoordinatorLayout>

0 commit comments

Comments
 (0)