Poi editing screen edit text scroll.

This commit is contained in:
GaidamakUA 2015-09-11 15:12:16 +03:00
parent b6b6472691
commit 502bbf046c
4 changed files with 113 additions and 91 deletions

View file

@ -2,11 +2,15 @@
<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">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
@ -109,10 +113,11 @@
android:text="@string/add_tag"
android:textSize="@dimen/default_sub_text_size"
osmand:typeface="@string/font_roboto_medium"/>
</LinearLayout>
<!--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>

View file

@ -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>

View file

@ -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);

View file

@ -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);