This commit is contained in:
Alexey Kulish 2016-10-19 12:49:58 +03:00
parent 82d0defa50
commit 06c5e37b06
7 changed files with 93 additions and 43 deletions

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:background="?attr/bg_color"
android:minHeight="48dp"
android:clickable="false"
@ -59,6 +60,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/TextAppearance.ListItemCategoryTitle"
android:textSize="@dimen/default_desc_text_size"
android:visibility="gone"
tools:text="Live updates"/>
@ -67,8 +69,10 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_medium"
osmand:textAllCapsCompat="true"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_sub_text_size"
android:visibility="visible"
tools:text="SHOW ALL"/>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60dp"
@ -19,15 +20,15 @@
android:tint="?attr/color_dialog_buttons"
android:src="@drawable/ic_action_search_dark"/>
<android.support.v7.widget.AppCompatTextView
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:textColor="?attr/color_dialog_buttons"
android:textStyle="bold"
android:textSize="@dimen/default_sub_text_size"
android:textAllCaps="true"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"
android:text="@string/custom_search"/>
</LinearLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
@ -54,20 +55,35 @@
</android.support.design.widget.AppBarLayout>
<ListView
android:id="@android:id/list"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="@null"
android:dividerHeight="0dp"
android:drawSelectorOnTop="true"/>
android:layout_weight="1">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null"
android:dividerHeight="0dp"
android:drawSelectorOnTop="true"/>
<ImageView
android:id="@+id/bottomBarShadow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:scaleType="fitXY"
android:src="@drawable/bg_shadow_onmap"
android:visibility="gone"/>
</FrameLayout>
<LinearLayout
android:id="@+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/dashboard_map_toolbar"
android:minHeight="52dp"
android:background="?attr/color_dialog_buttons"
android:visibility="gone"
tools:visibility="visible">
@ -89,17 +105,17 @@
android:textSize="@dimen/default_desc_text_size"
tools:text="Selected: 3 categories"/>
<android.support.v7.widget.AppCompatTextView
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/barButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAllCaps="true"
android:textStyle="bold"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:textColor="@color/color_white"
android:textSize="@dimen/default_desc_text_size"
android:textSize="@dimen/default_sub_text_size"
osmand:typeface="@string/font_roboto_medium"
osmand:textAllCapsCompat="true"
android:text="@string/shared_string_show"/>
</LinearLayout>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -11,13 +12,15 @@
android:paddingTop="8dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_desc_text_size"
tools:text="Amsterdam"/>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_sub_text_size"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"
tools:text="Amsterdam"/>
</LinearLayout>

View file

@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
@ -72,29 +73,48 @@
</android.support.design.widget.AppBarLayout>
<ListView
android:id="@android:id/list"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="@null"
android:dividerHeight="0dp"
android:drawSelectorOnTop="true"/>
android:layout_weight="1">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null"
android:dividerHeight="0dp"
android:drawSelectorOnTop="true"/>
<ImageView
android:id="@+id/bottomButtonShadow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:scaleType="fitXY"
android:src="@drawable/bg_shadow_onmap"
android:visibility="gone"/>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/color_dialog_buttons">
<android.support.v7.widget.AppCompatButton
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/bottomButton"
android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
android:layout_height="52dp"
android:background="?attr/selectableItemBackground"
android:paddingLeft="14dp"
android:paddingRight="14dp"
android:gravity="center"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/color_white"
android:textSize="@dimen/default_sub_text_size"
android:text="@string/apply_filters"
android:textColor="@color/color_white"/>
osmand:typeface="@string/font_roboto_medium"
osmand:textAllCapsCompat="true"/>
</LinearLayout>

View file

@ -19,10 +19,8 @@ import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.osm.PoiCategory;
import net.osmand.osm.PoiType;
import net.osmand.plus.IconsCache;
@ -53,9 +51,10 @@ public class QuickSearchCustomPoiFragment extends DialogFragment {
private String filterId;
private PoiUIFilter filter;
private PoiFiltersHelper helper;
private View bottomBarShadow;
private View bottomBar;
private AppCompatTextView barTitle;
private AppCompatTextView barButton;
private TextView barTitle;
private TextView barButton;
private boolean editMode;
@ -129,9 +128,10 @@ public class QuickSearchCustomPoiFragment extends DialogFragment {
}
});
bottomBarShadow = view.findViewById(R.id.bottomBarShadow);
bottomBar = view.findViewById(R.id.bottomBar);
barTitle = (AppCompatTextView) view.findViewById(R.id.barTitle);
barButton = (AppCompatTextView) view.findViewById(R.id.barButton);
barTitle = (TextView) view.findViewById(R.id.barTitle);
barButton = (TextView) view.findViewById(R.id.barButton);
bottomBar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -238,7 +238,8 @@ public class QuickSearchCustomPoiFragment extends DialogFragment {
} else {
iconView.setImageDrawable(null);
}
secondaryIconView.setImageDrawable(ic.getThemedIcon(R.drawable.ic_action_additional_option));
secondaryIconView.setImageDrawable(
ic.getIcon(R.drawable.ic_action_additional_option, app.getSettings().isLightContent() ? R.color.icon_color_light : 0));
check.setOnCheckedChangeListener(null);
check.setChecked(filter.isTypeAccepted(category));
String textString = category.getTranslation();
@ -287,9 +288,11 @@ public class QuickSearchCustomPoiFragment extends DialogFragment {
helper.editPoiFilter(filter);
if (!editMode) {
if (filter.isEmpty()) {
bottomBarShadow.setVisibility(View.GONE);
bottomBar.setVisibility(View.GONE);
} else {
barTitle.setText(getContext().getString(R.string.selected_categories) + ": " + filter.getAcceptedTypesCount());
bottomBarShadow.setVisibility(View.VISIBLE);
bottomBar.setVisibility(View.VISIBLE);
}
}

View file

@ -75,7 +75,8 @@ public class QuickSearchPoiFilterFragment extends DialogFragment {
private String nameFilterText = "";
private String nameFilterTextOrig = "";
private EditText editText;
private AppCompatButton applyFilterButton;
private TextView applyFilterButton;
private View applyFilterButtonShadow;
private Set<String> selectedPoiAdditionals = new TreeSet<>();
private Set<String> selectedPoiAdditionalsOrig = new TreeSet<>();
private ArrayList<String> collapsedCategories = new ArrayList<>();
@ -278,7 +279,8 @@ public class QuickSearchPoiFilterFragment extends DialogFragment {
}
});
applyFilterButton = (AppCompatButton) view.findViewById(R.id.bottomButton);
applyFilterButtonShadow = view.findViewById(R.id.bottomButtonShadow);
applyFilterButton = (TextView) view.findViewById(R.id.bottomButton);
applyFilterButton.setText(app.getString(R.string.apply_filters));
applyFilterButton.setOnClickListener(new View.OnClickListener() {
@Override
@ -306,6 +308,7 @@ public class QuickSearchPoiFilterFragment extends DialogFragment {
private void updateApplyButton() {
boolean hasChanges = !nameFilterText.equals(nameFilterTextOrig) || !selectedPoiAdditionals.equals(selectedPoiAdditionalsOrig);
applyFilterButton.setVisibility(hasChanges ? View.VISIBLE : View.GONE);
applyFilterButtonShadow.setVisibility(hasChanges ? View.VISIBLE : View.GONE);
}
private void deleteFilter() {