Added a way to hide organization field in app
This commit is contained in:
parent
f4973b3809
commit
a34ac83854
5 changed files with 16 additions and 4 deletions
|
@ -136,6 +136,7 @@
|
||||||
android:inputType="textPersonName|textCapWords"/>
|
android:inputType="textPersonName|textCapWords"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/contactOrganizationTitle"
|
||||||
android:text="@string/contact_organization"
|
android:text="@string/contact_organization"
|
||||||
style="@style/font13"
|
style="@style/font13"
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
|
|
|
@ -68,6 +68,8 @@
|
||||||
<bool name="allow_only_one_phone_number">false</bool>
|
<bool name="allow_only_one_phone_number">false</bool>
|
||||||
<bool name="allow_only_one_sip_address">false</bool>
|
<bool name="allow_only_one_sip_address">false</bool>
|
||||||
|
|
||||||
|
<bool name="display_contact_organization">true</bool>
|
||||||
|
|
||||||
<bool name="setup_cancel_move_to_back">false</bool>
|
<bool name="setup_cancel_move_to_back">false</bool>
|
||||||
|
|
||||||
<bool name="enable_call_notification">true</bool>
|
<bool name="enable_call_notification">true</bool>
|
||||||
|
|
|
@ -78,8 +78,9 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
||||||
deleteContact.setOnClickListener(this);
|
deleteContact.setOnClickListener(this);
|
||||||
|
|
||||||
organization = (TextView) view.findViewById(R.id.contactOrganization);
|
organization = (TextView) view.findViewById(R.id.contactOrganization);
|
||||||
|
boolean isOrgVisible = getResources().getBoolean(R.bool.display_contact_organization);
|
||||||
String org = contact.getOrganization();
|
String org = contact.getOrganization();
|
||||||
if (org != null && !org.isEmpty()) {
|
if (org != null && !org.isEmpty() && isOrgVisible) {
|
||||||
organization.setText(org);
|
organization.setText(org);
|
||||||
} else {
|
} else {
|
||||||
organization.setVisibility(View.GONE);
|
organization.setVisibility(View.GONE);
|
||||||
|
|
|
@ -204,9 +204,16 @@ public class ContactEditorFragment extends Fragment {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
organization = (EditText) view.findViewById(R.id.contactOrganization);
|
organization = (EditText) view.findViewById(R.id.contactOrganization);
|
||||||
if (!isNewContact) {
|
boolean isOrgVisible = getResources().getBoolean(R.bool.display_contact_organization);
|
||||||
organization.setText(contact.getOrganization());
|
if (!isOrgVisible) {
|
||||||
|
organization.setVisibility(View.GONE);
|
||||||
|
view.findViewById(R.id.contactOrganizationTitle).setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
if (!isNewContact) {
|
||||||
|
organization.setText(contact.getOrganization());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNewContact) {
|
if (!isNewContact) {
|
||||||
|
|
|
@ -501,8 +501,9 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView organization = (TextView) view.findViewById(R.id.contactOrganization);
|
TextView organization = (TextView) view.findViewById(R.id.contactOrganization);
|
||||||
|
boolean isOrgVisible = getResources().getBoolean(R.bool.display_contact_organization);
|
||||||
String org = contact.getOrganization();
|
String org = contact.getOrganization();
|
||||||
if (org != null && !org.isEmpty()) {
|
if (org != null && !org.isEmpty() && isOrgVisible) {
|
||||||
organization.setText(org);
|
organization.setText(org);
|
||||||
organization.setVisibility(View.VISIBLE);
|
organization.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue