Poi editing screen edit text scroll.
This commit is contained in:
parent
b6b6472691
commit
502bbf046c
4 changed files with 113 additions and 91 deletions
|
@ -2,117 +2,122 @@
|
|||
<android.support.v4.widget.NestedScrollView
|
||||
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="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:theme="?attr/new_app_theme">
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="14dp"
|
||||
android:layout_marginRight="14dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:background="?attr/bg_card"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="37dp"
|
||||
android:gravity="center">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="14dp"
|
||||
android:layout_marginRight="14dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:background="?attr/bg_card"
|
||||
android:orientation="vertical">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:text="@string/tag_poi_name"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="37dp"
|
||||
android:gravity="center">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:text="@string/tag_poi_name"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"/>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/nameTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:text="poi name"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/nameTextView"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:text="poi name"/>
|
||||
</LinearLayout>
|
||||
android:layout_height="37dp"
|
||||
android:gravity="center">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/amenityTagTextView"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:text="@string/tag_poi_amenity"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"/>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/amenityTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:text="landmark"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/editTagsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="37dp"
|
||||
android:gravity="center">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:saveEnabled="false"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/amenityTagTextView"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:text="@string/tag_poi_amenity"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"/>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/amenityTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:text="landmark"/>
|
||||
</LinearLayout>
|
||||
<net.osmand.plus.widgets.ButtonEx
|
||||
android:id="@+id/addTagButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/add_tag"
|
||||
android:textSize="@dimen/default_sub_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/editTagsList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:saveEnabled="false"/>
|
||||
|
||||
<net.osmand.plus.widgets.ButtonEx
|
||||
android:id="@+id/addTagButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/add_tag"
|
||||
android:textSize="@dimen/default_sub_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
<!--XXX due to bug in NestedScroolView-->
|
||||
<Space
|
||||
android:id="@+id/screenFiller"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp"/>
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent"/>
|
||||
</FrameLayout>
|
||||
</android.support.v4.widget.NestedScrollView>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -126,8 +126,9 @@
|
|||
|
||||
<!--XXX due to bug in NestedScrollView-->
|
||||
<Space
|
||||
android:id="@+id/screenFiller"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp"
|
||||
tools:visibility="gone"/>
|
||||
android:layout_height="match_parent"
|
||||
tools:visibility="visible"/>
|
||||
</RelativeLayout>
|
||||
</android.support.v4.widget.NestedScrollView>
|
|
@ -2,6 +2,7 @@ package net.osmand.plus.osmedit;
|
|||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
|
@ -9,6 +10,7 @@ import android.support.v4.app.Fragment;
|
|||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.Display;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -54,6 +56,12 @@ public class AdvancedDataFragment extends Fragment {
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
final View view = inflater.inflate(R.layout.fragment_edit_poi_advanced, container, false);
|
||||
|
||||
Display display = getActivity().getWindowManager().getDefaultDisplay();
|
||||
Point size = new Point();
|
||||
display.getSize(size);
|
||||
int height = size.y;
|
||||
view.findViewById(R.id.screenFiller).setMinimumHeight(height);
|
||||
|
||||
deleteDrawable = ((OsmandApplication) getActivity().getApplication()).getIconsCache()
|
||||
.getPaintedContentIcon(R.drawable.ic_action_remove_dark,
|
||||
getActivity().getResources().getColor(R.color.dash_search_icon_dark));
|
||||
|
@ -205,7 +213,7 @@ public class AdvancedDataFragment extends Fragment {
|
|||
editPoiData.notifyDatasetChanged(mTagsChangedListener);
|
||||
}
|
||||
});
|
||||
final Set<String> tagKeys = new TreeSet<String>();
|
||||
final Set<String> tagKeys = new TreeSet<>();
|
||||
for (OSMSettings.OSMTagKey t : OSMSettings.OSMTagKey.values()) {
|
||||
if ((t != OSMSettings.OSMTagKey.NAME) && (t != OSMSettings.OSMTagKey.OPENING_HOURS) && (t != OSMSettings.OSMTagKey.PHONE)
|
||||
&& (t != OSMSettings.OSMTagKey.WEBSITE)) {
|
||||
|
@ -213,7 +221,7 @@ public class AdvancedDataFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
ArrayAdapter<Object> adapter = new ArrayAdapter<Object>(linearLayout.getContext(),
|
||||
ArrayAdapter<Object> adapter = new ArrayAdapter<>(linearLayout.getContext(),
|
||||
R.layout.list_textview, tagKeys.toArray());
|
||||
tagEditText.setAdapter(adapter);
|
||||
tagEditText.setThreshold(1);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package net.osmand.plus.osmedit;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
|
@ -7,6 +8,7 @@ import android.support.v4.app.Fragment;
|
|||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.Display;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -54,6 +56,12 @@ public class BasicDataFragment extends Fragment {
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_edit_poi_normal, container, false);
|
||||
|
||||
Display display = getActivity().getWindowManager().getDefaultDisplay();
|
||||
Point size = new Point();
|
||||
display.getSize(size);
|
||||
int height = size.y;
|
||||
view.findViewById(R.id.screenFiller).setMinimumHeight(height);
|
||||
|
||||
IconsCache iconsCache = getMyApplication().getIconsCache();
|
||||
int iconColor = getResources().getColor(R.color.dash_search_icon_dark);
|
||||
|
||||
|
|
Loading…
Reference in a new issue