removing some redundant code
This commit is contained in:
parent
80b8d5b4d1
commit
870c325032
|
@ -11,7 +11,6 @@ import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.contacts.R
|
import com.simplemobiletools.contacts.R
|
||||||
import com.simplemobiletools.contacts.adapters.ContactsAdapter
|
import com.simplemobiletools.contacts.adapters.ContactsAdapter
|
||||||
import com.simplemobiletools.contacts.dialogs.CallConfirmationDialog
|
import com.simplemobiletools.contacts.dialogs.CallConfirmationDialog
|
||||||
import com.simplemobiletools.contacts.extensions.afterTextChanged
|
|
||||||
import com.simplemobiletools.contacts.extensions.callContact
|
import com.simplemobiletools.contacts.extensions.callContact
|
||||||
import com.simplemobiletools.contacts.extensions.config
|
import com.simplemobiletools.contacts.extensions.config
|
||||||
import com.simplemobiletools.contacts.extensions.startCallIntent
|
import com.simplemobiletools.contacts.extensions.startCallIntent
|
||||||
|
@ -43,7 +42,7 @@ class DialpadActivity : SimpleActivity() {
|
||||||
dialpad_clear_char.setOnClickListener { clearChar(it) }
|
dialpad_clear_char.setOnClickListener { clearChar(it) }
|
||||||
dialpad_clear_char.setOnLongClickListener { clearInput(); true }
|
dialpad_clear_char.setOnLongClickListener { clearInput(); true }
|
||||||
dialpad_call_button.setOnClickListener { initCall() }
|
dialpad_call_button.setOnClickListener { initCall() }
|
||||||
dialpad_input.afterTextChanged { dialpadValueChanged(it) }
|
dialpad_input.onTextChangeListener { dialpadValueChanged(it) }
|
||||||
ContactsHelper(this).getContacts { gotContacts(it) }
|
ContactsHelper(this).getContacts { gotContacts(it) }
|
||||||
disableKeyboardPopping()
|
disableKeyboardPopping()
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ import com.simplemobiletools.contacts.dialogs.ExportContactsDialog
|
||||||
import com.simplemobiletools.contacts.dialogs.FilterContactSourcesDialog
|
import com.simplemobiletools.contacts.dialogs.FilterContactSourcesDialog
|
||||||
import com.simplemobiletools.contacts.dialogs.ImportContactsDialog
|
import com.simplemobiletools.contacts.dialogs.ImportContactsDialog
|
||||||
import com.simplemobiletools.contacts.extensions.config
|
import com.simplemobiletools.contacts.extensions.config
|
||||||
import com.simplemobiletools.contacts.extensions.dbHelper
|
|
||||||
import com.simplemobiletools.contacts.extensions.getTempFile
|
import com.simplemobiletools.contacts.extensions.getTempFile
|
||||||
import com.simplemobiletools.contacts.fragments.MyViewPagerFragment
|
import com.simplemobiletools.contacts.fragments.MyViewPagerFragment
|
||||||
import com.simplemobiletools.contacts.helpers.*
|
import com.simplemobiletools.contacts.helpers.*
|
||||||
|
@ -63,9 +62,6 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||||
appLaunched(BuildConfig.APPLICATION_ID)
|
appLaunched(BuildConfig.APPLICATION_ID)
|
||||||
setupTabColors()
|
setupTabColors()
|
||||||
|
|
||||||
// just get a reference to the database to make sure it is created properly
|
|
||||||
dbHelper
|
|
||||||
|
|
||||||
handlePermission(PERMISSION_READ_CALL_LOG) {
|
handlePermission(PERMISSION_READ_CALL_LOG) {
|
||||||
if (it) {
|
if (it) {
|
||||||
handlePermission(PERMISSION_WRITE_CALL_LOG) {
|
handlePermission(PERMISSION_WRITE_CALL_LOG) {
|
||||||
|
@ -320,8 +316,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
|
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
|
||||||
}
|
|
||||||
|
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
main_tabs_holder.getTabAt(position)?.select()
|
main_tabs_holder.getTabAt(position)?.select()
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.simplemobiletools.contacts.extensions
|
|
||||||
|
|
||||||
import android.text.Editable
|
|
||||||
import android.text.TextWatcher
|
|
||||||
import android.widget.EditText
|
|
||||||
|
|
||||||
fun EditText.afterTextChanged(callback: (String) -> Unit) = addTextChangedListener(object : TextWatcher {
|
|
||||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
|
|
||||||
|
|
||||||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
|
|
||||||
|
|
||||||
override fun afterTextChanged(text: Editable) = callback(text.toString())
|
|
||||||
})
|
|
|
@ -1,7 +0,0 @@
|
||||||
<resources>
|
|
||||||
|
|
||||||
<style name="DialpadNumberStyle" parent="DialpadNumberStyle.Base">
|
|
||||||
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
|
@ -2,15 +2,12 @@
|
||||||
|
|
||||||
<style name="AppTheme" parent="AppTheme.Base"/>
|
<style name="AppTheme" parent="AppTheme.Base"/>
|
||||||
|
|
||||||
<style name="DialpadNumberStyle.Base">
|
<style name="DialpadNumberStyle">
|
||||||
<item name="android:gravity">center</item>
|
<item name="android:gravity">center</item>
|
||||||
<item name="android:paddingBottom">@dimen/medium_margin</item>
|
<item name="android:paddingBottom">@dimen/medium_margin</item>
|
||||||
<item name="android:paddingTop">@dimen/normal_margin</item>
|
<item name="android:paddingTop">@dimen/normal_margin</item>
|
||||||
<item name="android:textSize">@dimen/dialpad_text_size</item>
|
<item name="android:textSize">@dimen/dialpad_text_size</item>
|
||||||
</style>
|
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
|
||||||
|
|
||||||
<style name="DialpadNumberStyle" parent="DialpadNumberStyle.Base">
|
|
||||||
<item name="android:background">?attr/selectableItemBackground</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue