Commit a9aa1b8c authored by Grigory Fedorov's avatar Grigory Fedorov

AccountInfoEditorFragment: birth date "Change" button removed, click on text...

AccountInfoEditorFragment: birth date "Change" button removed, click on text view used. Added button to remove birthdate.
drawer_touch renamed to ripple_background.
parent bcea6f5a
......@@ -96,6 +96,7 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
private Uri newAvatarImageUri;
private Uri photoFileUri;
private boolean removeAvatarFlag = false;
private View birthDateRemoveButton;
interface Listener {
void onVCardSavingStarted();
......@@ -167,15 +168,21 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
);
birthDate = (TextView) view.findViewById(R.id.vcard_birth_date);
View changeBirthDateButton = view.findViewById(R.id.vcard_change_birth_date);
changeBirthDateButton.setOnClickListener(new View.OnClickListener() {
birthDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
datePicker.show();
}
});
birthDateRemoveButton = view.findViewById(R.id.vcard_birth_date_remove_button);
birthDateRemoveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setBirthDate(null);
}
});
title = (EditText) view.findViewById(R.id.vcard_title);
role = (EditText) view.findViewById(R.id.vcard_role);
organization = (EditText) view.findViewById(R.id.vcard_organization_name);
......@@ -234,7 +241,7 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
avatar.setImageDrawable(AvatarManager.getInstance().getAccountAvatar(account));
birthDate.setText(vCard.getField(VCardProperty.BDAY.name()));
setBirthDate(vCard.getField(VCardProperty.BDAY.name()));
updateDatePickerDialog();
......@@ -545,6 +552,16 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
birthDate.setText(String.format(DATE_FORMAT_INT_TO_STRING, year, monthOfYear + 1, dayOfMonth));
setBirthDate(String.format(DATE_FORMAT_INT_TO_STRING, year, monthOfYear + 1, dayOfMonth));
}
public void setBirthDate(String date) {
birthDate.setText(date);
birthDate.setTextColor(getResources().getColor(android.R.color.primary_text_light));
if (date == null) {
birthDateRemoveButton.setVisibility(View.INVISIBLE);
} else {
birthDateRemoveButton.setVisibility(View.VISIBLE);
}
}
}
......@@ -195,13 +195,13 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
>
<TextView
android:layout_width="100dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/vcard_birth_date"
android:layout_gravity="center_vertical"
......@@ -210,15 +210,21 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:inputType="date"
android:paddingLeft="4dp"
android:paddingTop="16dp"
android:paddingRight="8dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:background="@drawable/ripple_background"
/>
<Button
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/change"
android:id="@+id/vcard_change_birth_date"
android:layout_marginLeft="16dp" />
android:src="@drawable/ic_close_circle_grey600_24dp"
android:padding="8dp"
android:background="@drawable/ripple_background"
android:id="@+id/vcard_birth_date_remove_button"
/>
</LinearLayout>
</LinearLayout>
......
......@@ -60,7 +60,7 @@
android:paddingRight="8dp"
android:paddingTop="16dp"
android:paddingBottom="8dp"
android:background="@drawable/drawer_touch"
android:background="@drawable/ripple_background"
android:id="@+id/muc_get_hosted_rooms"
android:contentDescription="@string/muc_get_hosted_conferences"
android:layout_gravity="bottom|right"
......@@ -113,7 +113,7 @@
android:layout_marginRight="8dp"
android:layout_marginLeft="8dp"
android:layout_alignParentRight="true"
android:background="@drawable/drawer_touch"
android:background="@drawable/ripple_background"
/>
</RelativeLayout>
......
......@@ -31,7 +31,7 @@
android:layout_height="match_parent"
android:src="@drawable/ic_close_circle_grey600_24dp"
android:background="@drawable/drawer_touch"
android:background="@drawable/ripple_background"
android:layout_gravity="center_vertical"
android:paddingRight="16dp"
android:paddingLeft="16dp"
......
......@@ -30,7 +30,7 @@
android:id="@+id/drawer_action_settings"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/drawer_touch"
android:background="@drawable/ripple_background"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp">
......@@ -56,7 +56,7 @@
android:id="@+id/drawer_action_about"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/drawer_touch"
android:background="@drawable/ripple_background"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp">
......@@ -80,7 +80,7 @@
android:id="@+id/drawer_action_exit"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/drawer_touch"
android:background="@drawable/ripple_background"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment