mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-04-04 21:41:06 +02:00
updating commons with some styling changes
This commit is contained in:
parent
50cc182f69
commit
bf6d24ab7f
@ -62,7 +62,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:e79c9bba93'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:7f819f8a75'
|
||||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||||
implementation 'me.grantland:autofittextview:0.2.1'
|
implementation 'me.grantland:autofittextview:0.2.1'
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,6 @@ class CallActivity : SimpleActivity() {
|
|||||||
private var viewsUnderDialpad = arrayListOf<Pair<View, Float>>()
|
private var viewsUnderDialpad = arrayListOf<Pair<View, Float>>()
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
supportActionBar?.hide()
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_call)
|
setContentView(R.layout.activity_call)
|
||||||
|
|
||||||
@ -79,7 +78,7 @@ class CallActivity : SimpleActivity() {
|
|||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
updateState()
|
updateState()
|
||||||
updateNavigationBarColor(getBottomTabsBackgroundColor())
|
updateNavigationBarColor(getBottomNavigationBackgroundColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.simplemobiletools.dialer.activities
|
package com.simplemobiletools.dialer.activities
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import com.simplemobiletools.commons.helpers.NavigationIcon
|
||||||
import com.simplemobiletools.dialer.R
|
import com.simplemobiletools.dialer.R
|
||||||
import com.simplemobiletools.dialer.adapters.ConferenceCallsAdapter
|
import com.simplemobiletools.dialer.adapters.ConferenceCallsAdapter
|
||||||
import com.simplemobiletools.dialer.helpers.CallManager
|
import com.simplemobiletools.dialer.helpers.CallManager
|
||||||
@ -14,4 +15,9 @@ class ConferenceActivity : SimpleActivity() {
|
|||||||
|
|
||||||
conference_calls_list.adapter = ConferenceCallsAdapter(this, conference_calls_list, ArrayList(CallManager.getConferenceCalls())) {}
|
conference_calls_list.adapter = ConferenceCallsAdapter(this, conference_calls_list, ArrayList(CallManager.getConferenceCalls())) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
setupToolbar(conference_toolbar, NavigationIcon.Arrow)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import android.net.Uri
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.telecom.TelecomManager
|
import android.telecom.TelecomManager
|
||||||
import android.view.Menu
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.REQUEST_CODE_SET_DEFAULT_DIALER
|
import com.simplemobiletools.commons.helpers.REQUEST_CODE_SET_DEFAULT_DIALER
|
||||||
@ -34,11 +33,6 @@ class DialerActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
|
||||||
updateMenuItemColors(menu)
|
|
||||||
return super.onCreateOptionsMenu(menu)
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("MissingPermission")
|
@SuppressLint("MissingPermission")
|
||||||
private fun initOutgoingCall() {
|
private fun initOutgoingCall() {
|
||||||
try {
|
try {
|
||||||
|
@ -11,8 +11,6 @@ import android.telephony.PhoneNumberUtils
|
|||||||
import android.telephony.TelephonyManager
|
import android.telephony.TelephonyManager
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.Menu
|
|
||||||
import android.view.MenuItem
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import com.reddit.indicatorfastscroll.FastScrollItemIndicator
|
import com.reddit.indicatorfastscroll.FastScrollItemIndicator
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
@ -43,6 +41,7 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setupOptionsMenu()
|
||||||
speedDialValues = config.getSpeedDialValues()
|
speedDialValues = config.getSpeedDialValues()
|
||||||
privateCursor = getMyContactsCursor(false, true)
|
privateCursor = getMyContactsCursor(false, true)
|
||||||
|
|
||||||
@ -127,21 +126,18 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
super.onResume()
|
super.onResume()
|
||||||
updateTextColors(dialpad_holder)
|
updateTextColors(dialpad_holder)
|
||||||
dialpad_clear_char.applyColorFilter(getProperTextColor())
|
dialpad_clear_char.applyColorFilter(getProperTextColor())
|
||||||
updateNavigationBarColor(getBottomTabsBackgroundColor())
|
updateNavigationBarColor(getBottomNavigationBackgroundColor())
|
||||||
|
setupToolbar(dialpad_toolbar, NavigationIcon.Arrow)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
private fun setupOptionsMenu() {
|
||||||
menuInflater.inflate(R.menu.menu_dialpad, menu)
|
dialpad_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||||
updateMenuItemColors(menu)
|
when (menuItem.itemId) {
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
|
||||||
when (item.itemId) {
|
|
||||||
R.id.add_number_to_contact -> addNumberToContact()
|
R.id.add_number_to_contact -> addNumberToContact()
|
||||||
else -> return super.onOptionsItemSelected(item)
|
else -> return@setOnMenuItemClickListener false
|
||||||
|
}
|
||||||
|
return@setOnMenuItemClickListener true
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkDialIntent(): Boolean {
|
private fun checkDialIntent(): Boolean {
|
||||||
|
@ -47,7 +47,7 @@ import me.grantland.widget.AutofitHelper
|
|||||||
class MainActivity : SimpleActivity() {
|
class MainActivity : SimpleActivity() {
|
||||||
private var isSearchOpen = false
|
private var isSearchOpen = false
|
||||||
private var launchedDialer = false
|
private var launchedDialer = false
|
||||||
private var searchMenuItem: MenuItem? = null
|
private var mSearchMenuItem: MenuItem? = null
|
||||||
private var storedShowTabs = 0
|
private var storedShowTabs = 0
|
||||||
private var searchQuery = ""
|
private var searchQuery = ""
|
||||||
var cachedContacts = ArrayList<SimpleContact>()
|
var cachedContacts = ArrayList<SimpleContact>()
|
||||||
@ -56,6 +56,8 @@ class MainActivity : SimpleActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
appLaunched(BuildConfig.APPLICATION_ID)
|
appLaunched(BuildConfig.APPLICATION_ID)
|
||||||
|
setupOptionsMenu()
|
||||||
|
refreshMenuItems()
|
||||||
|
|
||||||
launchedDialer = savedInstanceState?.getBoolean(OPEN_DIAL_PAD_AT_LAUNCH) ?: false
|
launchedDialer = savedInstanceState?.getBoolean(OPEN_DIAL_PAD_AT_LAUNCH) ?: false
|
||||||
|
|
||||||
@ -81,11 +83,6 @@ class MainActivity : SimpleActivity() {
|
|||||||
SimpleContact.sorting = config.sorting
|
SimpleContact.sorting = config.sorting
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
|
||||||
super.onSaveInstanceState(outState)
|
|
||||||
outState.putBoolean(OPEN_DIAL_PAD_AT_LAUNCH, launchedDialer)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
val properPrimaryColor = getProperPrimaryColor()
|
val properPrimaryColor = getProperPrimaryColor()
|
||||||
@ -96,6 +93,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupTabColors()
|
setupTabColors()
|
||||||
|
setupToolbar(main_toolbar, searchMenuItem = mSearchMenuItem)
|
||||||
|
|
||||||
getAllFragments().forEach {
|
getAllFragments().forEach {
|
||||||
it?.setupColors(getProperTextColor(), getProperPrimaryColor(), getProperPrimaryColor())
|
it?.setupColors(getProperTextColor(), getProperPrimaryColor(), getProperPrimaryColor())
|
||||||
@ -121,31 +119,6 @@ class MainActivity : SimpleActivity() {
|
|||||||
config.lastUsedViewPagerPage = view_pager.currentItem
|
config.lastUsedViewPagerPage = view_pager.currentItem
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
|
||||||
menuInflater.inflate(R.menu.menu, menu)
|
|
||||||
menu.apply {
|
|
||||||
findItem(R.id.clear_call_history).isVisible = getCurrentFragment() == recents_fragment
|
|
||||||
findItem(R.id.sort).isVisible = getCurrentFragment() != recents_fragment
|
|
||||||
findItem(R.id.create_new_contact).isVisible = getCurrentFragment() == contacts_fragment
|
|
||||||
|
|
||||||
setupSearch(this)
|
|
||||||
updateMenuItemColors(this)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
|
||||||
when (item.itemId) {
|
|
||||||
R.id.clear_call_history -> clearCallHistory()
|
|
||||||
R.id.create_new_contact -> launchCreateNewContactIntent()
|
|
||||||
R.id.sort -> showSortingDialog(showCustomSorting = getCurrentFragment() is FavoritesFragment)
|
|
||||||
R.id.settings -> launchSettings()
|
|
||||||
R.id.about -> launchAbout()
|
|
||||||
else -> return super.onOptionsItemSelected(item)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
||||||
super.onActivityResult(requestCode, resultCode, resultData)
|
super.onActivityResult(requestCode, resultCode, resultData)
|
||||||
// we dont really care about the result, the app can work without being the default Dialer too
|
// we dont really care about the result, the app can work without being the default Dialer too
|
||||||
@ -154,11 +127,48 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
|
super.onSaveInstanceState(outState)
|
||||||
|
outState.putBoolean(OPEN_DIAL_PAD_AT_LAUNCH, launchedDialer)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||||
super.onConfigurationChanged(newConfig)
|
super.onConfigurationChanged(newConfig)
|
||||||
refreshItems()
|
refreshItems()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (isSearchOpen && mSearchMenuItem != null) {
|
||||||
|
mSearchMenuItem!!.collapseActionView()
|
||||||
|
} else {
|
||||||
|
super.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun refreshMenuItems() {
|
||||||
|
val currentFragment = getCurrentFragment()
|
||||||
|
main_toolbar.menu.apply {
|
||||||
|
findItem(R.id.clear_call_history).isVisible = currentFragment == recents_fragment
|
||||||
|
findItem(R.id.sort).isVisible = currentFragment != recents_fragment
|
||||||
|
findItem(R.id.create_new_contact).isVisible = currentFragment == contacts_fragment
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupOptionsMenu() {
|
||||||
|
setupSearch(main_toolbar.menu)
|
||||||
|
main_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||||
|
when (menuItem.itemId) {
|
||||||
|
R.id.clear_call_history -> clearCallHistory()
|
||||||
|
R.id.create_new_contact -> launchCreateNewContactIntent()
|
||||||
|
R.id.sort -> showSortingDialog(showCustomSorting = getCurrentFragment() is FavoritesFragment)
|
||||||
|
R.id.settings -> launchSettings()
|
||||||
|
R.id.about -> launchAbout()
|
||||||
|
else -> return@setOnMenuItemClickListener false
|
||||||
|
}
|
||||||
|
return@setOnMenuItemClickListener true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkContactPermissions() {
|
private fun checkContactPermissions() {
|
||||||
handlePermission(PERMISSION_READ_CONTACTS) {
|
handlePermission(PERMISSION_READ_CONTACTS) {
|
||||||
initFragments()
|
initFragments()
|
||||||
@ -167,8 +177,8 @@ class MainActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun setupSearch(menu: Menu) {
|
private fun setupSearch(menu: Menu) {
|
||||||
val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager
|
val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager
|
||||||
searchMenuItem = menu.findItem(R.id.search)
|
mSearchMenuItem = menu.findItem(R.id.search)
|
||||||
(searchMenuItem!!.actionView as SearchView).apply {
|
(mSearchMenuItem!!.actionView as SearchView).apply {
|
||||||
setSearchableInfo(searchManager.getSearchableInfo(componentName))
|
setSearchableInfo(searchManager.getSearchableInfo(componentName))
|
||||||
isSubmitButtonEnabled = false
|
isSubmitButtonEnabled = false
|
||||||
queryHint = getString(R.string.search)
|
queryHint = getString(R.string.search)
|
||||||
@ -185,7 +195,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItemCompat.setOnActionExpandListener(searchMenuItem, object : MenuItemCompat.OnActionExpandListener {
|
MenuItemCompat.setOnActionExpandListener(mSearchMenuItem, object : MenuItemCompat.OnActionExpandListener {
|
||||||
override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
|
override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
|
||||||
isSearchOpen = true
|
isSearchOpen = true
|
||||||
main_dialpad_button.beGone()
|
main_dialpad_button.beGone()
|
||||||
@ -254,7 +264,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
updateBottomTabItemColors(inactiveView, false)
|
updateBottomTabItemColors(inactiveView, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
val bottomBarColor = getBottomTabsBackgroundColor()
|
val bottomBarColor = getBottomNavigationBackgroundColor()
|
||||||
main_tabs_holder.setBackgroundColor(bottomBarColor)
|
main_tabs_holder.setBackgroundColor(bottomBarColor)
|
||||||
updateNavigationBarColor(bottomBarColor)
|
updateNavigationBarColor(bottomBarColor)
|
||||||
}
|
}
|
||||||
@ -264,11 +274,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
private fun initFragments() {
|
private fun initFragments() {
|
||||||
view_pager.offscreenPageLimit = 2
|
view_pager.offscreenPageLimit = 2
|
||||||
view_pager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
|
view_pager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
|
||||||
override fun onPageScrollStateChanged(state: Int) {
|
override fun onPageScrollStateChanged(state: Int) {}
|
||||||
if (state == ViewPager.SCROLL_STATE_SETTLING) {
|
|
||||||
closeSearch()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
|
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
|
||||||
|
|
||||||
@ -277,7 +283,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
getAllFragments().forEach {
|
getAllFragments().forEach {
|
||||||
it?.finishActMode()
|
it?.finishActMode()
|
||||||
}
|
}
|
||||||
invalidateOptionsMenu()
|
refreshMenuItems()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -296,7 +302,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main_tabs_holder.getTabAt(wantedTab)?.select()
|
main_tabs_holder.getTabAt(wantedTab)?.select()
|
||||||
invalidateOptionsMenu()
|
refreshMenuItems()
|
||||||
}, 100L)
|
}, 100L)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,6 +310,10 @@ class MainActivity : SimpleActivity() {
|
|||||||
launchDialpad()
|
launchDialpad()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
view_pager.onGlobalLayout {
|
||||||
|
refreshMenuItems()
|
||||||
|
}
|
||||||
|
|
||||||
if (config.openDialPadAtLaunch && !launchedDialer) {
|
if (config.openDialPadAtLaunch && !launchedDialer) {
|
||||||
launchDialpad()
|
launchDialpad()
|
||||||
launchedDialer = true
|
launchedDialer = true
|
||||||
@ -497,7 +507,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
getAllFragments().forEach {
|
getAllFragments().forEach {
|
||||||
it?.onSearchQueryChanged("")
|
it?.onSearchQueryChanged("")
|
||||||
}
|
}
|
||||||
searchMenuItem?.collapseActionView()
|
mSearchMenuItem?.collapseActionView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package com.simplemobiletools.dialer.activities
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
|
import com.simplemobiletools.commons.helpers.NavigationIcon
|
||||||
import com.simplemobiletools.commons.helpers.SimpleContactsHelper
|
import com.simplemobiletools.commons.helpers.SimpleContactsHelper
|
||||||
import com.simplemobiletools.commons.models.SimpleContact
|
import com.simplemobiletools.commons.models.SimpleContact
|
||||||
import com.simplemobiletools.dialer.R
|
import com.simplemobiletools.dialer.R
|
||||||
@ -30,6 +31,11 @@ class ManageSpeedDialActivity : SimpleActivity(), RemoveSpeedDialListener {
|
|||||||
updateTextColors(manage_speed_dial_scrollview)
|
updateTextColors(manage_speed_dial_scrollview)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
setupToolbar(manage_speed_dial_toolbar, NavigationIcon.Arrow)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
super.onStop()
|
super.onStop()
|
||||||
config.speedDial = Gson().toJson(speedDialValues)
|
config.speedDial = Gson().toJson(speedDialValues)
|
||||||
|
@ -25,6 +25,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
setupToolbar(settings_toolbar, NavigationIcon.Arrow)
|
||||||
|
|
||||||
setupPurchaseThankYou()
|
setupPurchaseThankYou()
|
||||||
setupCustomizeColors()
|
setupCustomizeColors()
|
||||||
@ -42,7 +43,6 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
setupDisableProximitySensor()
|
setupDisableProximitySensor()
|
||||||
setupDisableSwipeToAnswer()
|
setupDisableSwipeToAnswer()
|
||||||
updateTextColors(settings_holder)
|
updateTextColors(settings_holder)
|
||||||
invalidateOptionsMenu()
|
|
||||||
|
|
||||||
arrayOf(
|
arrayOf(
|
||||||
settings_color_customization_label,
|
settings_color_customization_label,
|
||||||
|
@ -3,6 +3,7 @@ package com.simplemobiletools.dialer.dialogs
|
|||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||||
import com.simplemobiletools.commons.extensions.beGoneIf
|
import com.simplemobiletools.commons.extensions.beGoneIf
|
||||||
|
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import com.simplemobiletools.commons.helpers.SORT_BY_CUSTOM
|
import com.simplemobiletools.commons.helpers.SORT_BY_CUSTOM
|
||||||
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_CREATED
|
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_CREATED
|
||||||
@ -23,10 +24,10 @@ class ChangeSortingDialog(
|
|||||||
private var view = activity.layoutInflater.inflate(R.layout.dialog_change_sorting, null)
|
private var view = activity.layoutInflater.inflate(R.layout.dialog_change_sorting, null)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
AlertDialog.Builder(activity)
|
activity.getAlertDialogBuilder()
|
||||||
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
|
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.sort_by)
|
activity.setupDialogStuff(view, this, R.string.sort_by)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package com.simplemobiletools.dialer.dialogs
|
package com.simplemobiletools.dialer.dialogs
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog
|
|
||||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||||
|
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
|
import com.simplemobiletools.commons.helpers.TAB_CALL_HISTORY
|
||||||
import com.simplemobiletools.commons.helpers.TAB_CONTACTS
|
import com.simplemobiletools.commons.helpers.TAB_CONTACTS
|
||||||
import com.simplemobiletools.commons.helpers.TAB_FAVORITES
|
import com.simplemobiletools.commons.helpers.TAB_FAVORITES
|
||||||
import com.simplemobiletools.commons.helpers.TAB_CALL_HISTORY
|
|
||||||
import com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
import com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
import com.simplemobiletools.dialer.R
|
import com.simplemobiletools.dialer.R
|
||||||
import com.simplemobiletools.dialer.extensions.config
|
import com.simplemobiletools.dialer.extensions.config
|
||||||
@ -27,10 +27,10 @@ class ManageVisibleTabsDialog(val activity: BaseSimpleActivity) {
|
|||||||
view.findViewById<MyAppCompatCheckbox>(value).isChecked = showTabs and key != 0
|
view.findViewById<MyAppCompatCheckbox>(value).isChecked = showTabs and key != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
activity.getAlertDialogBuilder()
|
||||||
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
|
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.apply {
|
||||||
activity.setupDialogStuff(view, this)
|
activity.setupDialogStuff(view, this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import com.simplemobiletools.commons.models.SimpleContact
|
|||||||
import com.simplemobiletools.dialer.R
|
import com.simplemobiletools.dialer.R
|
||||||
import com.simplemobiletools.dialer.activities.SimpleActivity
|
import com.simplemobiletools.dialer.activities.SimpleActivity
|
||||||
import com.simplemobiletools.dialer.adapters.ContactsAdapter
|
import com.simplemobiletools.dialer.adapters.ContactsAdapter
|
||||||
import com.simplemobiletools.dialer.extensions.config
|
|
||||||
import kotlinx.android.synthetic.main.dialog_select_contact.view.*
|
import kotlinx.android.synthetic.main.dialog_select_contact.view.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@ -38,10 +37,12 @@ class SelectContactDialog(val activity: SimpleActivity, contacts: ArrayList<Simp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog = AlertDialog.Builder(activity)
|
activity.getAlertDialogBuilder()
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.apply {
|
||||||
activity.setupDialogStuff(view, this)
|
activity.setupDialogStuff(view, this) { alertDialog ->
|
||||||
|
dialog = alertDialog
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import android.widget.RadioButton
|
|||||||
import android.widget.RadioGroup
|
import android.widget.RadioGroup
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||||
|
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import com.simplemobiletools.dialer.R
|
import com.simplemobiletools.dialer.R
|
||||||
import com.simplemobiletools.dialer.extensions.config
|
import com.simplemobiletools.dialer.extensions.config
|
||||||
@ -35,9 +36,11 @@ class SelectSIMDialog(val activity: BaseSimpleActivity, val phoneNumber: String,
|
|||||||
radioGroup!!.addView(radioButton, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
|
radioGroup!!.addView(radioButton, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog = AlertDialog.Builder(activity)
|
activity.getAlertDialogBuilder()
|
||||||
.create().apply {
|
.apply {
|
||||||
activity.setupDialogStuff(view, this)
|
activity.setupDialogStuff(view, this) { alertDialog ->
|
||||||
|
dialog = alertDialog
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package com.simplemobiletools.dialer.dialogs
|
|||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||||
|
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import com.simplemobiletools.dialer.R
|
import com.simplemobiletools.dialer.R
|
||||||
import com.simplemobiletools.dialer.activities.SimpleActivity
|
import com.simplemobiletools.dialer.activities.SimpleActivity
|
||||||
@ -27,9 +28,11 @@ class ShowGroupedCallsDialog(val activity: BaseSimpleActivity, callIds: ArrayLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog = AlertDialog.Builder(activity)
|
activity.getAlertDialogBuilder()
|
||||||
.create().apply {
|
.apply {
|
||||||
activity.setupDialogStuff(view, this)
|
activity.setupDialogStuff(view, this) { alertDialog ->
|
||||||
|
dialog = alertDialog
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/conference_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/conference_app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/conference_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:title="@string/conference"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/conference_frame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
android:id="@+id/conference_calls_list"
|
android:id="@+id/conference_calls_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -14,4 +36,5 @@
|
|||||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"
|
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"
|
||||||
tools:listitem="@layout/item_conference_call" />
|
tools:listitem="@layout/item_conference_call" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@ -1,11 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/dialpad_coordinator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/dialpad_app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/dialpad_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:menu="@menu/menu_dialpad"
|
||||||
|
app:title="@string/dialpad"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/dialpad_holder"
|
android:id="@+id/dialpad_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:focusableInTouchMode="true">
|
android:focusableInTouchMode="true"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/dialpad_placeholder"
|
android:id="@+id/dialpad_placeholder"
|
||||||
@ -123,4 +145,5 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/dialpad_call_button" />
|
app:layout_constraintTop_toTopOf="@+id/dialpad_call_button" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@ -1,10 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/main_holder"
|
android:id="@+id/main_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/main_app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/main_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:menu="@menu/menu"
|
||||||
|
app:title="@string/app_launcher_name"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/main_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyViewPager
|
<com.simplemobiletools.commons.views.MyViewPager
|
||||||
android:id="@+id/view_pager"
|
android:id="@+id/view_pager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -35,4 +57,5 @@
|
|||||||
app:tabMinWidth="150dp"
|
app:tabMinWidth="150dp"
|
||||||
app:tabRippleColor="@null" />
|
app:tabRippleColor="@null" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@ -1,11 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/manage_speed_dial_scrollview"
|
android:id="@+id/manage_speed_dial_coordinator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/manage_speed_dial_app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/manage_speed_dial_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:title="@string/manage_speed_dial"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:id="@+id/manage_speed_dial_scrollview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/manage_speed_dial_wrapper"
|
android:id="@+id/manage_speed_dial_wrapper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -30,4 +51,5 @@
|
|||||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@ -1,10 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/settings_scrollview"
|
android:id="@+id/settings_coordinator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/settings_app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
|
android:id="@+id/settings_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@color/color_primary"
|
||||||
|
app:title="@string/settings"
|
||||||
|
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:id="@+id/settings_scrollview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/settings_holder"
|
android:id="@+id/settings_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -331,4 +353,5 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@ -5,5 +5,5 @@
|
|||||||
android:id="@+id/add_number_to_contact"
|
android:id="@+id/add_number_to_contact"
|
||||||
android:icon="@drawable/ic_plus_vector"
|
android:icon="@drawable/ic_plus_vector"
|
||||||
android:title="@string/add_number_to_contact"
|
android:title="@string/add_number_to_contact"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="always" />
|
||||||
</menu>
|
</menu>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user