Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
bec8b4b3
Commit
bec8b4b3
authored
Aug 06, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VCard editing: address (home and work) added.
parent
9c88882d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
237 additions
and
0 deletions
+237
-0
AccountInfoEditorFragment.java
...java/com/xabber/android/ui/AccountInfoEditorFragment.java
+63
-0
account_info_editor_fragment.xml
app/src/main/res/layout/account_info_editor_fragment.xml
+174
-0
No files found.
app/src/main/java/com/xabber/android/ui/AccountInfoEditorFragment.java
View file @
bec8b4b3
...
...
@@ -29,6 +29,7 @@ import com.xabber.android.data.extension.vcard.OnVCardListener;
import
com.xabber.android.data.extension.vcard.OnVCardSaveListener
;
import
com.xabber.android.data.extension.vcard.VCardManager
;
import
com.xabber.xmpp.address.Jid
;
import
com.xabber.xmpp.vcard.AddressProperty
;
import
com.xabber.xmpp.vcard.TelephoneType
;
import
com.xabber.xmpp.vcard.VCardProperty
;
...
...
@@ -98,6 +99,20 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
private
boolean
removeAvatarFlag
=
false
;
private
View
birthDateRemoveButton
;
private
TextView
account_jid
;
private
EditText
addressHomePostOfficeBox
;
private
EditText
addressHomePostExtended
;
private
EditText
addressHomePostStreet
;
private
EditText
addressHomeLocality
;
private
EditText
addressHomeRegion
;
private
EditText
addressHomeCountry
;
private
EditText
addressHomePostalCode
;
private
EditText
addressWorkPostOfficeBox
;
private
EditText
addressWorkPostExtended
;
private
EditText
addressWorkPostStreet
;
private
EditText
addressWorkLocality
;
private
EditText
addressWorkRegion
;
private
EditText
addressWorkCountry
;
private
EditText
addressWorkPostalCode
;
interface
Listener
{
void
onVCardSavingStarted
();
...
...
@@ -200,6 +215,22 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
emailHome
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_email_home
);
emailWork
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_email_work
);
addressHomePostOfficeBox
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_home_post_office_box
);
addressHomePostExtended
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_home_post_extended
);
addressHomePostStreet
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_home_post_street
);
addressHomeLocality
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_home_locality
);
addressHomeRegion
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_home_region
);
addressHomeCountry
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_home_country
);
addressHomePostalCode
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_home_postal_code
);
addressWorkPostOfficeBox
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_work_post_office_box
);
addressWorkPostExtended
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_work_post_extended
);
addressWorkPostStreet
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_work_post_street
);
addressWorkLocality
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_work_locality
);
addressWorkRegion
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_work_region
);
addressWorkCountry
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_work_country
);
addressWorkPostalCode
=
(
EditText
)
view
.
findViewById
(
R
.
id
.
vcard_address_work_postal_code
);
setFieldsFromVCard
();
return
view
;
...
...
@@ -274,6 +305,22 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
emailHome
.
setText
(
vCard
.
getEmailHome
());
emailWork
.
setText
(
vCard
.
getEmailWork
());
addressHomePostOfficeBox
.
setText
(
vCard
.
getAddressFieldHome
(
AddressProperty
.
POBOX
.
name
()));
addressHomePostExtended
.
setText
(
vCard
.
getAddressFieldHome
(
AddressProperty
.
EXTADR
.
name
()));
addressHomePostStreet
.
setText
(
vCard
.
getAddressFieldHome
(
AddressProperty
.
STREET
.
name
()));
addressHomeLocality
.
setText
(
vCard
.
getAddressFieldHome
(
AddressProperty
.
LOCALITY
.
name
()));
addressHomeRegion
.
setText
(
vCard
.
getAddressFieldHome
(
AddressProperty
.
REGION
.
name
()));
addressHomeCountry
.
setText
(
vCard
.
getAddressFieldHome
(
AddressProperty
.
CTRY
.
name
()));
addressHomePostalCode
.
setText
(
vCard
.
getAddressFieldHome
(
AddressProperty
.
PCODE
.
name
()));
addressWorkPostOfficeBox
.
setText
(
vCard
.
getAddressFieldWork
(
AddressProperty
.
POBOX
.
name
()));
addressWorkPostExtended
.
setText
(
vCard
.
getAddressFieldWork
(
AddressProperty
.
EXTADR
.
name
()));
addressWorkPostStreet
.
setText
(
vCard
.
getAddressFieldWork
(
AddressProperty
.
STREET
.
name
()));
addressWorkLocality
.
setText
(
vCard
.
getAddressFieldWork
(
AddressProperty
.
LOCALITY
.
name
()));
addressWorkRegion
.
setText
(
vCard
.
getAddressFieldWork
(
AddressProperty
.
REGION
.
name
()));
addressWorkCountry
.
setText
(
vCard
.
getAddressFieldWork
(
AddressProperty
.
CTRY
.
name
()));
addressWorkPostalCode
.
setText
(
vCard
.
getAddressFieldWork
(
AddressProperty
.
PCODE
.
name
()));
}
public
void
updateDatePickerDialog
()
{
...
...
@@ -461,6 +508,22 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
vCard
.
setEmailHome
(
getValueFromEditText
(
emailHome
));
vCard
.
setEmailWork
(
getValueFromEditText
(
emailWork
));
vCard
.
setAddressFieldHome
(
AddressProperty
.
POBOX
.
name
(),
getValueFromEditText
(
addressHomePostOfficeBox
));
vCard
.
setAddressFieldHome
(
AddressProperty
.
EXTADR
.
name
(),
getValueFromEditText
(
addressHomePostExtended
));
vCard
.
setAddressFieldHome
(
AddressProperty
.
STREET
.
name
(),
getValueFromEditText
(
addressHomePostStreet
));
vCard
.
setAddressFieldHome
(
AddressProperty
.
LOCALITY
.
name
(),
getValueFromEditText
(
addressHomeLocality
));
vCard
.
setAddressFieldHome
(
AddressProperty
.
REGION
.
name
(),
getValueFromEditText
(
addressHomeRegion
));
vCard
.
setAddressFieldHome
(
AddressProperty
.
CTRY
.
name
(),
getValueFromEditText
(
addressHomeCountry
));
vCard
.
setAddressFieldHome
(
AddressProperty
.
PCODE
.
name
(),
getValueFromEditText
(
addressHomePostalCode
));
vCard
.
setAddressFieldWork
(
AddressProperty
.
POBOX
.
name
(),
getValueFromEditText
(
addressWorkPostOfficeBox
));
vCard
.
setAddressFieldWork
(
AddressProperty
.
EXTADR
.
name
(),
getValueFromEditText
(
addressWorkPostExtended
));
vCard
.
setAddressFieldWork
(
AddressProperty
.
STREET
.
name
(),
getValueFromEditText
(
addressWorkPostStreet
));
vCard
.
setAddressFieldWork
(
AddressProperty
.
LOCALITY
.
name
(),
getValueFromEditText
(
addressWorkLocality
));
vCard
.
setAddressFieldWork
(
AddressProperty
.
REGION
.
name
(),
getValueFromEditText
(
addressWorkRegion
));
vCard
.
setAddressFieldWork
(
AddressProperty
.
CTRY
.
name
(),
getValueFromEditText
(
addressWorkCountry
));
vCard
.
setAddressFieldWork
(
AddressProperty
.
PCODE
.
name
(),
getValueFromEditText
(
addressWorkPostalCode
));
}
public
void
saveVCard
()
{
...
...
app/src/main/res/layout/account_info_editor_fragment.xml
View file @
bec8b4b3
...
...
@@ -538,6 +538,180 @@
</LinearLayout>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:minHeight=
"72dp"
>
<ImageView
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"32dp"
android:layout_marginTop=
"24dp"
android:src=
"@drawable/ic_vcard_address_24dp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginRight=
"16dp"
android:layout_marginTop=
"8dp"
android:layout_marginBottom=
"8dp"
>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_pobox"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_home_post_office_box"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_extadr"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_home_post_extended"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_street"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_home_post_street"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_locality"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_home_locality"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_region"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_home_region"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_pcode"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_home_postal_code"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_ctry"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_home_country"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"?android:attr/textColorSecondary"
android:singleLine=
"true"
android:text=
"@string/vcard_type_home"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_pobox"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_work_post_office_box"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
android:layout_marginTop=
"16dp"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_extadr"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_work_post_extended"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_street"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_work_post_street"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_locality"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_work_locality"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_region"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_work_region"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_pcode"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_work_postal_code"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/vcard_address_ctry"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/vcard_address_work_country"
android:inputType=
"textPostalAddress"
android:singleLine=
"true"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"?android:attr/textColorSecondary"
android:singleLine=
"true"
android:text=
"@string/vcard_type_work"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment