Skip to content

Commit

Permalink
chore: make Create and Update Event screens more similar to EventBrite (
Browse files Browse the repository at this point in the history
  • Loading branch information
mooocer authored and Masquerade0097 committed Aug 6, 2018
1 parent e198c21 commit 3224037
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ private void setupPlacePicker() {
if ("YOUR_API_KEY".equals(placesApiKey)) {
Timber.d("Add Google Places API key in AndroidManifest.xml file to use Place Picker.");
binding.buttonPlacePicker.setVisibility(View.GONE);
binding.layoutLatitude.setVisibility(View.VISIBLE);
binding.layoutLongitude.setVisibility(View.VISIBLE);
showLocationLayouts();
}
} catch (PackageManager.NameNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ private void setupPlacePicker() {
if ("YOUR_API_KEY".equals(placesApiKey)) {
Timber.d("Add Google Places API key in AndroidManifest.xml file to use Place Picker.");
binding.form.buttonPlacePicker.setVisibility(View.GONE);
binding.form.layoutLatitude.setVisibility(View.VISIBLE);
binding.form.layoutLongitude.setVisibility(View.VISIBLE);
showLocationLayouts();
}
} catch (PackageManager.NameNotFoundException e) {
Expand Down
337 changes: 116 additions & 221 deletions app/src/main/res/layout/event_create_form.xml

Large diffs are not rendered by default.

123 changes: 61 additions & 62 deletions app/src/main/res/layout/event_details_step_one.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,67 @@
</android.support.design.widget.TextInputLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="@dimen/spacing_big"
android:layout_marginStart="@dimen/spacing_big"
android:padding="@dimen/spacing_extra_small">

<CheckBox
android:id="@+id/organizer_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onCheckedChanged="@{ (switch, checked) -> event.setHasOrganizerInfo(checked) }"
android:text="@string/add_organizer_information" />

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="@{ organizerInfo.checked ? View.VISIBLE : View.GONE }">

<android.support.design.widget.TextInputEditText
android:id="@+id/organizer_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/organizer_name"
android:inputType="textMultiLine"
android:text="@={ event.organizerName }" />

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="@{ organizerInfo.checked ? View.VISIBLE : View.GONE }">

<android.support.design.widget.TextInputEditText
android:id="@+id/organizer_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/organizer_description"
android:inputType="textMultiLine"
android:text="@={ event.organizerDescription }" />

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.design.widget.TextInputEditText
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/description"
android:inputType="textMultiLine"
android:text="@={ event.description }" />

</android.support.design.widget.TextInputLayout>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -205,68 +266,6 @@
</android.support.design.widget.TextInputLayout>
</LinearLayout>

<LinearLayout
android:id="@+id/layout_latitude"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/latitude"
android:padding="@dimen/spacing_extra_small"
app:srcCompat="@drawable/ic_location" />

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/spacing_extra_small">

<android.support.design.widget.TextInputEditText
android:id="@+id/latitude"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/latitude"
android:inputType="numberDecimal"
android:text="@={ BindingAdapters.doubleToStr(event.latitude) }" />

</android.support.design.widget.TextInputLayout>
</LinearLayout>

<LinearLayout
android:id="@+id/layout_longitude"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/longitude"
android:padding="@dimen/spacing_extra_small"
app:srcCompat="@drawable/ic_location" />

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/spacing_extra_small">

<android.support.design.widget.TextInputEditText
android:id="@+id/longitude"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/longitude"
android:inputType="numberDecimal"
android:text="@={ BindingAdapters.doubleToStr(event.longitude) }" />

</android.support.design.widget.TextInputLayout>
</LinearLayout>

<CheckBox
android:id="@+id/map_shown"
android:layout_width="wrap_content"
Expand Down
29 changes: 0 additions & 29 deletions app/src/main/res/layout/event_details_step_three.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,35 +169,6 @@
android:text="@string/others"
android:textSize="@dimen/text_size_normal" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/description"
android:padding="@dimen/spacing_extra_small"
app:srcCompat="@drawable/ic_info" />

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/spacing_extra_small">

<android.support.design.widget.TextInputEditText
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/description"
android:inputType="textMultiLine|textCapSentences"
android:text="@={ event.description }" />

</android.support.design.widget.TextInputLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
88 changes: 0 additions & 88 deletions app/src/main/res/layout/event_details_step_two.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,94 +77,6 @@
</android.support.design.widget.TextInputLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/spacing_normal"
android:divider="?android:dividerHorizontal"
android:orientation="vertical"
android:showDividers="beginning">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_normal"
android:padding="@dimen/spacing_extra_small"
android:text="@string/organizer_details"
android:textSize="@dimen/text_size_normal"
android:textStyle="bold"/>

<CheckBox
android:id="@+id/organizer_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onCheckedChanged="@{ (switch, checked) -> event.setHasOrganizerInfo(checked) }"
android:padding="@dimen/spacing_extra_small"
android:text="@string/add_organizer_information" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="@{ organizerInfo.checked ? View.VISIBLE : View.GONE }">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/organizer_name"
android:padding="@dimen/spacing_extra_small"
app:srcCompat="@drawable/ic_person"
android:textStyle="bold"/>

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/spacing_extra_small">

<android.support.design.widget.TextInputEditText
android:id="@+id/organizer_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/organizer_name"
android:inputType="textMultiLine|textCapSentences"
android:text="@={ event.organizerName }" />

</android.support.design.widget.TextInputLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="@{ organizerInfo.checked ? View.VISIBLE : View.GONE }">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/organizer_description"
android:padding="@dimen/spacing_extra_small"
app:srcCompat="@drawable/ic_info"
android:textStyle="bold"/>

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/spacing_extra_small">

<android.support.design.widget.TextInputEditText
android:id="@+id/organizer_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/organizer_description"
android:inputType="textCapSentences|textMultiLine"
android:text="@={ event.organizerDescription }" />

</android.support.design.widget.TextInputLayout>
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<string name="date_and_time">Date and Time</string>
<string name="timezone">Timezone</string>
<string name="location_details">Location Details</string>
<string name="show_map">Show Map</string>
<string name="show_map">Show map on public page</string>
<string name="latitude">Latitude</string>
<string name="longitude">Longitude</string>
<string name="location_name">Location Name</string>
Expand Down Expand Up @@ -163,7 +163,7 @@
<string name="published">Published</string>
<string name="draft">Draft</string>
<string name="others">Others</string>
<string name="description">Description</string>
<string name="description">Briefly describe your event</string>
<string name="external_event_url">External Event Url</string>
<string name="code_of_conduct">Code of Conduct</string>
<string name="enable_tax">Enable Tax</string>
Expand Down

0 comments on commit 3224037

Please sign in to comment.