mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-04-03 13:01:49 +02:00
Added change_view_type option in menu
This commit is contained in:
parent
267e5c35f0
commit
7eafb4aaad
@ -26,6 +26,7 @@ import com.simplemobiletools.dialer.BuildConfig
|
|||||||
import com.simplemobiletools.dialer.R
|
import com.simplemobiletools.dialer.R
|
||||||
import com.simplemobiletools.dialer.adapters.ViewPagerAdapter
|
import com.simplemobiletools.dialer.adapters.ViewPagerAdapter
|
||||||
import com.simplemobiletools.dialer.dialogs.ChangeSortingDialog
|
import com.simplemobiletools.dialer.dialogs.ChangeSortingDialog
|
||||||
|
import com.simplemobiletools.dialer.dialogs.ChangeViewTypeDialog
|
||||||
import com.simplemobiletools.dialer.dialogs.FilterContactSourcesDialog
|
import com.simplemobiletools.dialer.dialogs.FilterContactSourcesDialog
|
||||||
import com.simplemobiletools.dialer.extensions.config
|
import com.simplemobiletools.dialer.extensions.config
|
||||||
import com.simplemobiletools.dialer.extensions.launchCreateNewContactIntent
|
import com.simplemobiletools.dialer.extensions.launchCreateNewContactIntent
|
||||||
@ -169,6 +170,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
findItem(R.id.clear_call_history).isVisible = currentFragment == recents_fragment
|
findItem(R.id.clear_call_history).isVisible = currentFragment == recents_fragment
|
||||||
findItem(R.id.sort).isVisible = currentFragment != recents_fragment
|
findItem(R.id.sort).isVisible = currentFragment != recents_fragment
|
||||||
findItem(R.id.create_new_contact).isVisible = currentFragment == contacts_fragment
|
findItem(R.id.create_new_contact).isVisible = currentFragment == contacts_fragment
|
||||||
|
findItem(R.id.change_view_type).isVisible = currentFragment == favorites_fragment
|
||||||
findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(R.bool.hide_google_relations)
|
findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(R.bool.hide_google_relations)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -196,6 +198,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
R.id.filter -> showFilterDialog()
|
R.id.filter -> showFilterDialog()
|
||||||
R.id.more_apps_from_us -> launchMoreAppsFromUsIntent()
|
R.id.more_apps_from_us -> launchMoreAppsFromUsIntent()
|
||||||
R.id.settings -> launchSettings()
|
R.id.settings -> launchSettings()
|
||||||
|
R.id.change_view_type -> changeViewType()
|
||||||
R.id.about -> launchAbout()
|
R.id.about -> launchAbout()
|
||||||
else -> return@setOnMenuItemClickListener false
|
else -> return@setOnMenuItemClickListener false
|
||||||
}
|
}
|
||||||
@ -203,6 +206,12 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun changeViewType() {
|
||||||
|
ChangeViewTypeDialog(this) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateMenuColors() {
|
private fun updateMenuColors() {
|
||||||
updateStatusbarColor(getProperBackgroundColor())
|
updateStatusbarColor(getProperBackgroundColor())
|
||||||
main_menu.updateColors()
|
main_menu.updateColors()
|
||||||
|
@ -34,6 +34,11 @@
|
|||||||
android:icon="@drawable/ic_info_vector"
|
android:icon="@drawable/ic_info_vector"
|
||||||
android:title="@string/about"
|
android:title="@string/about"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/change_view_type"
|
||||||
|
android:icon="@drawable/ic_settings_cog_vector"
|
||||||
|
android:title="@string/change_view_type"
|
||||||
|
app:showAsAction="ifRoom" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/more_apps_from_us"
|
android:id="@+id/more_apps_from_us"
|
||||||
android:icon="@drawable/ic_google_play_vector"
|
android:icon="@drawable/ic_google_play_vector"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user