mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-01 08:26:48 +01:00
populate Groups tab with the contact groups
This commit is contained in:
parent
707f3ee4a0
commit
796cb13c9c
@ -29,7 +29,7 @@ import kotlinx.android.synthetic.main.item_edit_address.view.*
|
|||||||
import kotlinx.android.synthetic.main.item_edit_email.view.*
|
import kotlinx.android.synthetic.main.item_edit_email.view.*
|
||||||
import kotlinx.android.synthetic.main.item_edit_phone_number.view.*
|
import kotlinx.android.synthetic.main.item_edit_phone_number.view.*
|
||||||
import kotlinx.android.synthetic.main.item_event.view.*
|
import kotlinx.android.synthetic.main.item_event.view.*
|
||||||
import kotlinx.android.synthetic.main.item_group.view.*
|
import kotlinx.android.synthetic.main.item_edit_group.view.*
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import org.joda.time.format.DateTimeFormat
|
import org.joda.time.format.DateTimeFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@ -331,7 +331,7 @@ class EditContactActivity : ContactActivity() {
|
|||||||
groups.forEachIndexed { index, group ->
|
groups.forEachIndexed { index, group ->
|
||||||
var groupHolder = contact_groups_holder.getChildAt(index)
|
var groupHolder = contact_groups_holder.getChildAt(index)
|
||||||
if (groupHolder == null) {
|
if (groupHolder == null) {
|
||||||
groupHolder = layoutInflater.inflate(R.layout.item_group, contact_groups_holder, false)
|
groupHolder = layoutInflater.inflate(R.layout.item_edit_group, contact_groups_holder, false)
|
||||||
contact_groups_holder.addView(groupHolder)
|
contact_groups_holder.addView(groupHolder)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,7 +359,7 @@ class EditContactActivity : ContactActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (groups.isEmpty()) {
|
if (groups.isEmpty()) {
|
||||||
layoutInflater.inflate(R.layout.item_group, contact_groups_holder, false).apply {
|
layoutInflater.inflate(R.layout.item_edit_group, contact_groups_holder, false).apply {
|
||||||
contact_group.apply {
|
contact_group.apply {
|
||||||
alpha = 0.5f
|
alpha = 0.5f
|
||||||
text = getString(R.string.no_groups)
|
text = getString(R.string.no_groups)
|
||||||
|
@ -95,6 +95,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
if (storedShowContactThumbnails != configShowContactThumbnails) {
|
if (storedShowContactThumbnails != configShowContactThumbnails) {
|
||||||
contacts_fragment?.showContactThumbnailsChanged(configShowContactThumbnails)
|
contacts_fragment?.showContactThumbnailsChanged(configShowContactThumbnails)
|
||||||
favorites_fragment?.showContactThumbnailsChanged(configShowContactThumbnails)
|
favorites_fragment?.showContactThumbnailsChanged(configShowContactThumbnails)
|
||||||
|
groups_fragment?.showContactThumbnailsChanged(configShowContactThumbnails)
|
||||||
}
|
}
|
||||||
|
|
||||||
val configTextColor = config.textColor
|
val configTextColor = config.textColor
|
||||||
@ -104,6 +105,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
}
|
}
|
||||||
contacts_fragment?.textColorChanged(configTextColor)
|
contacts_fragment?.textColorChanged(configTextColor)
|
||||||
favorites_fragment?.textColorChanged(configTextColor)
|
favorites_fragment?.textColorChanged(configTextColor)
|
||||||
|
groups_fragment?.textColorChanged(configTextColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
val configBackgroundColor = config.backgroundColor
|
val configBackgroundColor = config.backgroundColor
|
||||||
@ -117,6 +119,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
main_tabs_holder.getTabAt(viewpager.currentItem)?.icon?.applyColorFilter(getAdjustedPrimaryColor())
|
main_tabs_holder.getTabAt(viewpager.currentItem)?.icon?.applyColorFilter(getAdjustedPrimaryColor())
|
||||||
contacts_fragment?.primaryColorChanged(configPrimaryColor)
|
contacts_fragment?.primaryColorChanged(configPrimaryColor)
|
||||||
favorites_fragment?.primaryColorChanged(configPrimaryColor)
|
favorites_fragment?.primaryColorChanged(configPrimaryColor)
|
||||||
|
groups_fragment?.primaryColorChanged(configPrimaryColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
val configStartNameWithSurname = config.startNameWithSurname
|
val configStartNameWithSurname = config.startNameWithSurname
|
||||||
@ -132,6 +135,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
|
|
||||||
contacts_fragment?.onActivityResume()
|
contacts_fragment?.onActivityResume()
|
||||||
favorites_fragment?.onActivityResume()
|
favorites_fragment?.onActivityResume()
|
||||||
|
groups_fragment?.onActivityResume()
|
||||||
refreshContacts(true, true)
|
refreshContacts(true, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList<Cont
|
|||||||
MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) {
|
MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) {
|
||||||
|
|
||||||
private lateinit var contactDrawable: Drawable
|
private lateinit var contactDrawable: Drawable
|
||||||
var config = activity.config
|
private var config = activity.config
|
||||||
var startNameWithSurname: Boolean
|
var startNameWithSurname: Boolean
|
||||||
var showContactThumbnails: Boolean
|
var showContactThumbnails: Boolean
|
||||||
var showPhoneNumbers: Boolean
|
var showPhoneNumbers: Boolean
|
||||||
|
@ -0,0 +1,104 @@
|
|||||||
|
package com.simplemobiletools.contacts.adapters
|
||||||
|
|
||||||
|
import android.view.Menu
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
||||||
|
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||||
|
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||||
|
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||||
|
import com.simplemobiletools.commons.views.FastScroller
|
||||||
|
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
|
import com.simplemobiletools.contacts.R
|
||||||
|
import com.simplemobiletools.contacts.activities.SimpleActivity
|
||||||
|
import com.simplemobiletools.contacts.extensions.config
|
||||||
|
import com.simplemobiletools.contacts.models.Group
|
||||||
|
import kotlinx.android.synthetic.main.item_group.view.*
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
class GroupsAdapter(activity: SimpleActivity, var groups: ArrayList<Group>, recyclerView: MyRecyclerView, fastScroller: FastScroller,
|
||||||
|
itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) {
|
||||||
|
|
||||||
|
private var config = activity.config
|
||||||
|
private var smallPadding = activity.resources.getDimension(R.dimen.small_margin).toInt()
|
||||||
|
private var bigPadding = activity.resources.getDimension(R.dimen.normal_margin).toInt()
|
||||||
|
|
||||||
|
var showContactThumbnails = config.showContactThumbnails
|
||||||
|
|
||||||
|
override fun getActionMenuId() = R.menu.cab_groups
|
||||||
|
|
||||||
|
override fun prepareActionMode(menu: Menu) {
|
||||||
|
menu.apply {
|
||||||
|
findItem(R.id.cab_edit).isVisible = isOneItemSelected()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun prepareItemSelection(view: View) {}
|
||||||
|
|
||||||
|
override fun markItemSelection(select: Boolean, view: View?) {
|
||||||
|
view?.group_frame?.isSelected = select
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun actionItemPressed(id: Int) {
|
||||||
|
if (selectedPositions.isEmpty()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
when (id) {
|
||||||
|
R.id.cab_edit -> editGroup()
|
||||||
|
R.id.cab_select_all -> selectAll()
|
||||||
|
R.id.cab_delete -> askConfirmDelete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSelectableItemCount() = groups.size
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_group, parent)
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
|
||||||
|
val group = groups[position]
|
||||||
|
val view = holder.bindView(group, true) { itemView, layoutPosition ->
|
||||||
|
setupView(itemView, group)
|
||||||
|
}
|
||||||
|
bindViewHolder(holder, position, view)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount() = groups.size
|
||||||
|
|
||||||
|
fun updateItems(newItems: ArrayList<Group>) {
|
||||||
|
groups = newItems
|
||||||
|
notifyDataSetChanged()
|
||||||
|
finishActMode()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun editGroup() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun askConfirmDelete() {
|
||||||
|
ConfirmationDialog(activity) {
|
||||||
|
deleteContacts()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun deleteContacts() {
|
||||||
|
if (selectedPositions.isEmpty()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupView(view: View, group: Group) {
|
||||||
|
view.apply {
|
||||||
|
group_name.apply {
|
||||||
|
setTextColor(textColor)
|
||||||
|
text = String.format(activity.getString(R.string.groups_placeholder), group.title, group.contactsCount.toString())
|
||||||
|
setPadding(if (showContactThumbnails) smallPadding else bigPadding, smallPadding, smallPadding, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
group_tmb.beVisibleIf(showContactThumbnails)
|
||||||
|
if (showContactThumbnails) {
|
||||||
|
group_tmb.applyColorFilter(textColor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,21 +3,37 @@ package com.simplemobiletools.contacts.fragments
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.support.design.widget.CoordinatorLayout
|
import android.support.design.widget.CoordinatorLayout
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
import com.simplemobiletools.contacts.activities.MainActivity
|
import com.simplemobiletools.contacts.activities.MainActivity
|
||||||
|
import com.simplemobiletools.contacts.activities.SimpleActivity
|
||||||
|
import com.simplemobiletools.contacts.adapters.GroupsAdapter
|
||||||
|
import com.simplemobiletools.contacts.extensions.config
|
||||||
import com.simplemobiletools.contacts.helpers.ContactsHelper
|
import com.simplemobiletools.contacts.helpers.ContactsHelper
|
||||||
import com.simplemobiletools.contacts.interfaces.FragmentInterface
|
import com.simplemobiletools.contacts.interfaces.FragmentInterface
|
||||||
import com.simplemobiletools.contacts.models.Contact
|
import com.simplemobiletools.contacts.models.Contact
|
||||||
|
import kotlinx.android.synthetic.main.fragment_groups.view.*
|
||||||
|
|
||||||
class GroupsFragment(context: Context, attributeSet: AttributeSet) : CoordinatorLayout(context, attributeSet), FragmentInterface {
|
class GroupsFragment(context: Context, attributeSet: AttributeSet) : CoordinatorLayout(context, attributeSet), FragmentInterface {
|
||||||
var activity: MainActivity? = null
|
var activity: MainActivity? = null
|
||||||
override fun setupFragment(activity: MainActivity) {
|
override fun setupFragment(activity: MainActivity) {
|
||||||
|
if (this.activity == null) {
|
||||||
this.activity = activity
|
this.activity = activity
|
||||||
|
groups_fab.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
updateViewStuff()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun textColorChanged(color: Int) {
|
override fun textColorChanged(color: Int) {
|
||||||
|
(groups_list.adapter as GroupsAdapter).updateTextColor(color)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun primaryColorChanged(color: Int) {
|
override fun primaryColorChanged(color: Int) {
|
||||||
|
groups_fastscroller.updatePrimaryColor()
|
||||||
|
groups_fastscroller.updateBubblePrimaryColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun refreshContacts(contacts: ArrayList<Contact>) {
|
override fun refreshContacts(contacts: ArrayList<Contact>) {
|
||||||
@ -33,5 +49,44 @@ class GroupsFragment(context: Context, attributeSet: AttributeSet) : Coordinator
|
|||||||
storedGroup?.addContact()
|
storedGroup?.addContact()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val currAdapter = groups_list.adapter
|
||||||
|
if (currAdapter == null) {
|
||||||
|
GroupsAdapter(activity as SimpleActivity, storedGroups, groups_list, groups_fastscroller) {
|
||||||
|
|
||||||
|
}.apply {
|
||||||
|
setupDragListener(true)
|
||||||
|
addVerticalDividers(true)
|
||||||
|
groups_list.adapter = this
|
||||||
|
}
|
||||||
|
|
||||||
|
groups_fastscroller.setScrollTo(0)
|
||||||
|
groups_fastscroller.setViews(groups_list) {
|
||||||
|
val item = (groups_list.adapter as GroupsAdapter).groups.getOrNull(it)
|
||||||
|
groups_fastscroller.updateBubbleText(item?.getBubbleText() ?: "")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
(currAdapter as GroupsAdapter).apply {
|
||||||
|
showContactThumbnails = activity.config.showContactThumbnails
|
||||||
|
updateItems(storedGroups)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun showContactThumbnailsChanged(showThumbnails: Boolean) {
|
||||||
|
(groups_list.adapter as? GroupsAdapter)?.apply {
|
||||||
|
showContactThumbnails = showThumbnails
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onActivityResume() {
|
||||||
|
updateViewStuff()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateViewStuff() {
|
||||||
|
context.updateTextColors(groups_wrapper.parent as ViewGroup)
|
||||||
|
groups_fastscroller.updateBubbleColors()
|
||||||
|
groups_fastscroller.allowBubbleDisplay = context.config.showInfoBubble
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showContactThumbnailsChanged(showThumbnails: Boolean) {
|
override fun showContactThumbnailsChanged(showThumbnails: Boolean) {
|
||||||
(fragment_list.adapter as? ContactsAdapter)?.apply {
|
(fragment_list.adapter as? ContactsAdapter)?.apply {
|
||||||
showContactThumbnails = showThumbnails
|
showContactThumbnails = showThumbnails
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
|
@ -11,4 +11,6 @@ interface FragmentInterface {
|
|||||||
fun primaryColorChanged(color: Int)
|
fun primaryColorChanged(color: Int)
|
||||||
|
|
||||||
fun refreshContacts(contacts: ArrayList<Contact>)
|
fun refreshContacts(contacts: ArrayList<Contact>)
|
||||||
|
|
||||||
|
fun showContactThumbnailsChanged(showThumbnails: Boolean)
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,6 @@ package com.simplemobiletools.contacts.models
|
|||||||
|
|
||||||
data class Group(var id: Long, var title: String, var contactsCount: Int = 0) {
|
data class Group(var id: Long, var title: String, var contactsCount: Int = 0) {
|
||||||
fun addContact() = contactsCount++
|
fun addContact() = contactsCount++
|
||||||
|
|
||||||
|
fun getBubbleText() = title
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@
|
|||||||
android:layout_toRightOf="@+id/contact_name_image"
|
android:layout_toRightOf="@+id/contact_name_image"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include layout="@layout/item_group"/>
|
<include layout="@layout/item_edit_group"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -1,8 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.simplemobiletools.contacts.fragments.GroupsFragment
|
<com.simplemobiletools.contacts.fragments.GroupsFragment
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/groups_fragment"
|
android:id="@+id/groups_fragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/groups_wrapper"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
|
android:id="@+id/groups_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:scrollbars="none"
|
||||||
|
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"/>
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.FastScroller
|
||||||
|
android:id="@+id/groups_fastscroller"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:paddingLeft="@dimen/normal_margin"
|
||||||
|
android:paddingStart="@dimen/normal_margin">
|
||||||
|
|
||||||
|
<include layout="@layout/fastscroller_handle_vertical"/>
|
||||||
|
|
||||||
|
</com.simplemobiletools.commons.views.FastScroller>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyFloatingActionButton
|
||||||
|
android:id="@+id/groups_fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/activity_margin"
|
||||||
|
android:src="@drawable/ic_plus"/>
|
||||||
|
|
||||||
</com.simplemobiletools.contacts.fragments.GroupsFragment>
|
</com.simplemobiletools.contacts.fragments.GroupsFragment>
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
android:id="@+id/contact_tmb"
|
android:id="@+id/contact_tmb"
|
||||||
android:layout_width="@dimen/normal_icon_size"
|
android:layout_width="@dimen/normal_icon_size"
|
||||||
android:layout_height="@dimen/normal_icon_size"
|
android:layout_height="@dimen/normal_icon_size"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:padding="@dimen/medium_margin"
|
android:padding="@dimen/medium_margin"
|
||||||
android:src="@drawable/ic_person"/>
|
android:src="@drawable/ic_person"/>
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
android:id="@+id/contact_tmb"
|
android:id="@+id/contact_tmb"
|
||||||
android:layout_width="@dimen/normal_icon_size"
|
android:layout_width="@dimen/normal_icon_size"
|
||||||
android:layout_height="@dimen/normal_icon_size"
|
android:layout_height="@dimen/normal_icon_size"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:padding="@dimen/medium_margin"
|
android:padding="@dimen/medium_margin"
|
||||||
android:src="@drawable/ic_person"/>
|
android:src="@drawable/ic_person"/>
|
||||||
|
|
||||||
|
41
app/src/main/res/layout/item_edit_group.xml
Normal file
41
app/src/main/res/layout/item_edit_group.xml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/contact_group_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/contact_group"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_toLeftOf="@+id/contact_group_remove"
|
||||||
|
android:layout_toStartOf="@+id/contact_group_remove"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
|
android:paddingLeft="@dimen/small_margin"
|
||||||
|
android:paddingRight="@dimen/small_margin"
|
||||||
|
android:paddingTop="@dimen/normal_margin"
|
||||||
|
android:text="@string/no_groups"
|
||||||
|
android:textSize="@dimen/bigger_text_size"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/contact_group_remove"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/contact_group"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignTop="@+id/contact_group"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:layout_marginLeft="@dimen/small_margin"
|
||||||
|
android:layout_marginRight="@dimen/small_margin"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:background="@drawable/button_background"
|
||||||
|
android:padding="@dimen/medium_margin"
|
||||||
|
android:src="@drawable/ic_minus"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -1,41 +1,39 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/contact_group_holder"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/group_frame"
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/contact_group"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_toLeftOf="@+id/contact_group_remove"
|
|
||||||
android:layout_toStartOf="@+id/contact_group_remove"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingBottom="@dimen/normal_margin"
|
android:clickable="true"
|
||||||
android:paddingLeft="@dimen/small_margin"
|
android:focusable="true"
|
||||||
android:paddingRight="@dimen/small_margin"
|
android:foreground="@drawable/selector">
|
||||||
android:paddingTop="@dimen/normal_margin"
|
|
||||||
android:text="@string/no_groups"
|
<RelativeLayout
|
||||||
android:textSize="@dimen/bigger_text_size"/>
|
android:id="@+id/group_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingRight="@dimen/activity_margin">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/contact_group_remove"
|
android:id="@+id/group_tmb"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/normal_icon_size"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/normal_icon_size"
|
||||||
android:layout_alignBottom="@+id/contact_group"
|
android:layout_centerVertical="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignTop="@+id/contact_group"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_marginBottom="@dimen/medium_margin"
|
|
||||||
android:layout_marginLeft="@dimen/small_margin"
|
|
||||||
android:layout_marginRight="@dimen/small_margin"
|
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
|
||||||
android:background="@drawable/button_background"
|
|
||||||
android:padding="@dimen/medium_margin"
|
android:padding="@dimen/medium_margin"
|
||||||
android:src="@drawable/ic_minus"
|
android:src="@drawable/ic_group"/>
|
||||||
android:visibility="gone"/>
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/group_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/contact_item_height"
|
||||||
|
android:layout_toRightOf="@+id/group_tmb"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/big_text_size"
|
||||||
|
tools:text="Family"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
</FrameLayout>
|
||||||
|
19
app/src/main/res/menu/cab_groups.xml
Normal file
19
app/src/main/res/menu/cab_groups.xml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<item
|
||||||
|
android:id="@+id/cab_edit"
|
||||||
|
android:icon="@drawable/ic_rename"
|
||||||
|
android:title="@string/edit_contact"
|
||||||
|
app:showAsAction="ifRoom"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/cab_select_all"
|
||||||
|
android:icon="@drawable/ic_select_all"
|
||||||
|
android:title="@string/select_all"
|
||||||
|
app:showAsAction="ifRoom"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/cab_delete"
|
||||||
|
android:icon="@drawable/ic_delete"
|
||||||
|
android:title="@string/delete"
|
||||||
|
app:showAsAction="ifRoom"/>
|
||||||
|
</menu>
|
@ -5,4 +5,6 @@
|
|||||||
<string name="release_11">Added Address and Notes fields</string>
|
<string name="release_11">Added Address and Notes fields</string>
|
||||||
<string name="release_10">Allow storing contacts in a local database, hidden from other apps</string>
|
<string name="release_10">Allow storing contacts in a local database, hidden from other apps</string>
|
||||||
|
|
||||||
|
<string name="groups_placeholder">%1$s (%2$s)</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user