Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
Log.d(DEBUG_TAG, "Restoring from saved state");
getStateFromBundle(savedInstanceState);
} else {
getStateFromBundle(getArguments());
initialRule = getArguments().getInt(RULE_KEY);
showTemplates = getArguments().getBoolean(SHOWTEMPLATES_KEY);
final Bundle arguments = getArguments();
getStateFromBundle(arguments);
initialRule = arguments.getInt(RULE_KEY);
showTemplates = arguments.getBoolean(SHOWTEMPLATES_KEY);
originalOpeningHoursValue = arguments.getString(VALUE_KEY);
}
if (styleRes == 0) {
styleRes = R.style.Theme_AlertDialog; // fallback
Expand Down
280 changes: 139 additions & 141 deletions lib/src/main/res/layout/openinghours.xml
Original file line number Diff line number Diff line change
@@ -1,142 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/openinghours_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="0dp"
android:orientation="vertical"
android:paddingTop="32dp"
tools:context=".OpeningHoursFragment">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="vertical"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true">
<LinearLayout
android:id="@+id/modeContainer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true">
<RadioGroup
android:id="@+id/modeGroup"
android:saveEnabled="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:layout_marginBottom="1dp"
android:layout_marginRight="0dp"
android:layout_marginLeft="0dp"
android:layout_weight="2"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:minHeight="34dp"
android:paddingLeft="0dp"
android:paddingStart="0dp"
android:paddingRight="5dp"
android:paddingEnd="5dp">
<RadioButton
android:id="@+id/use_oh"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/opening_hours_key" />
<RadioButton
android:id="@+id/use_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/text_values" />
</RadioGroup>
</LinearLayout>
<AutoCompleteTextView
android:id="@+id/openinghours_string_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:background="?attr/colorPrimary"
android:hint="@string/default_hint"
android:inputType="textNoSuggestions"
android:completionThreshold="1"
android:dropDownWidth="wrap_content"
android:maxLines="1"
android:saveEnabled="false"
android:imeOptions="actionDone" />
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="1dp"
android:fillViewport="true">
<LinearLayout
android:id="@+id/openinghours_error_messages"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</HorizontalScrollView>
<View
android:id="@+id/headerLine"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="?attr/colorAccent" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ScrollView
android:id="@+id/openinghours_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_gravity="top"
android:clickable="true"
android:contentDescription="more button"
android:src="@drawable/ic_more_vert_white_36dp"
app:backgroundTint="?attr/colorAccent"
app:fabSize="mini"
app:useCompatPadding="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:text="@string/spd_ohf_cancel"
android:textColor="?attr/colorAccent"
android:backgroundTint="?attr/colorPrimary" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/save"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:text="@string/Save"
android:textColor="?attr/colorAccent"
android:backgroundTint="?attr/colorPrimary" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/openinghours_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="0dp"
android:orientation="vertical"
android:paddingTop="32dp"
tools:context=".OpeningHoursFragment">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="vertical"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true">
<LinearLayout
android:id="@+id/modeContainer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true">
<RadioGroup
android:id="@+id/modeGroup"
android:saveEnabled="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:layout_marginBottom="1dp"
android:layout_marginRight="0dp"
android:layout_marginLeft="0dp"
android:layout_weight="2"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:minHeight="34dp"
android:paddingLeft="0dp"
android:paddingStart="0dp"
android:paddingRight="5dp"
android:paddingEnd="5dp">
<RadioButton
android:id="@+id/use_oh"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/opening_hours_key" />
<RadioButton
android:id="@+id/use_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/text_values" />
</RadioGroup>
</LinearLayout>
<AutoCompleteTextView
android:id="@+id/openinghours_string_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:background="?attr/colorPrimary"
android:hint="@string/default_hint"
android:inputType="textNoSuggestions"
android:completionThreshold="1"
android:dropDownWidth="wrap_content"
android:maxLines="1"
android:saveEnabled="false"
android:imeOptions="actionDone" />
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="1dp"
android:fillViewport="true">
<LinearLayout
android:id="@+id/openinghours_error_messages"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</HorizontalScrollView>
<View
android:id="@+id/headerLine"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="?attr/colorAccent" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ScrollView
android:id="@+id/openinghours_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_gravity="top"
android:clickable="true"
android:contentDescription="more button"
android:src="@drawable/ic_more_vert_white_36dp"
app:backgroundTint="?attr/colorAccent"
app:fabSize="mini"
app:useCompatPadding="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:text="@string/spd_ohf_cancel"
style="?android:attr/buttonBarButtonStyle" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/save"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:text="@string/Save"
style="?android:attr/buttonBarButtonStyle" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Loading