Fix fav/wpt edit layout bugs
This commit is contained in:
parent
78937746a1
commit
dd9b8d52ba
22 changed files with 140 additions and 123 deletions
|
@ -1,11 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
android:id="@+id/point_edit_layout"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/point_edit_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -31,7 +32,8 @@
|
|||
<ScrollView
|
||||
android:id="@+id/editor_scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -43,7 +45,6 @@
|
|||
android:id="@+id/main_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -171,7 +172,6 @@
|
|||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="48dp"
|
||||
android:foreground="@drawable/bg_contextmenu_shadow"
|
||||
android:foregroundGravity="top|fill_horizontal">
|
||||
|
||||
|
@ -231,76 +231,75 @@
|
|||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/buttons_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<View
|
||||
android:id="@+id/buttons_top_border"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/divider_color"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/buttons_layout"
|
||||
android:id="@+id/buttons_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/ctx_menu_info_view_bg"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/delete_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/shared_string_delete"
|
||||
android:textColor="?attr/contextMenuButtonColor"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/replace_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/update_existing"
|
||||
android:textColor="?attr/contextMenuButtonColor"
|
||||
android:visibility="gone"/>
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:id="@+id/buttons_top_border"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1"/>
|
||||
android:background="@color/divider_color"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel_button"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/buttons_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/shared_string_cancel"
|
||||
android:textColor="?attr/contextMenuButtonColor"/>
|
||||
android:background="?attr/ctx_menu_info_view_bg"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/save_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/shared_string_save"
|
||||
android:textColor="?attr/contextMenuButtonColor"/>
|
||||
<Button
|
||||
android:id="@+id/delete_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/shared_string_delete"
|
||||
android:textColor="?attr/contextMenuButtonColor"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/replace_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/update_existing"
|
||||
android:textColor="?attr/contextMenuButtonColor"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/shared_string_cancel"
|
||||
android:textColor="?attr/contextMenuButtonColor"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/save_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:text="@string/shared_string_save"
|
||||
android:textColor="?attr/contextMenuButtonColor"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
|
@ -10,6 +10,7 @@ import android.graphics.drawable.Drawable;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
|
@ -139,7 +140,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.favorites_tree, container, false);
|
||||
ExpandableListView listView = (ExpandableListView) view.findViewById(android.R.id.list);
|
||||
favouritesAdapter.synchronizeGroups();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package net.osmand.plus.base;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
|
@ -10,6 +11,7 @@ import android.support.annotation.IdRes;
|
|||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.animation.Animation;
|
||||
import android.widget.ImageView;
|
||||
|
||||
|
@ -40,6 +42,24 @@ public class BaseOsmAndFragment extends Fragment implements TransitionAnimator {
|
|||
}
|
||||
}
|
||||
if (!isFullScreenAllowed() && activity instanceof MapActivity) {
|
||||
View view = getView();
|
||||
if (view != null) {
|
||||
ViewTreeObserver vto = view.getViewTreeObserver();
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
|
||||
View view = getView();
|
||||
if (view != null) {
|
||||
ViewTreeObserver obs = view.getViewTreeObserver();
|
||||
obs.removeOnGlobalLayoutListener(this);
|
||||
view.requestLayout();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
((MapActivity) activity).exitFromFullScreen();
|
||||
}
|
||||
}
|
||||
|
@ -115,15 +135,15 @@ public class BaseOsmAndFragment extends Fragment implements TransitionAnimator {
|
|||
return iconsCache;
|
||||
}
|
||||
|
||||
protected Drawable getPaintedContentIcon(@DrawableRes int id, @ColorInt int color){
|
||||
protected Drawable getPaintedContentIcon(@DrawableRes int id, @ColorInt int color) {
|
||||
return getIconsCache().getPaintedIcon(id, color);
|
||||
}
|
||||
|
||||
protected Drawable getIcon(@DrawableRes int id, @ColorRes int colorId){
|
||||
protected Drawable getIcon(@DrawableRes int id, @ColorRes int colorId) {
|
||||
return getIconsCache().getIcon(id, colorId);
|
||||
}
|
||||
|
||||
protected Drawable getContentIcon(@DrawableRes int id){
|
||||
protected Drawable getContentIcon(@DrawableRes int id) {
|
||||
return getIconsCache().getThemedIcon(id);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.graphics.Shader.TileMode;
|
|||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -24,7 +25,7 @@ public abstract class OsmandExpandableListFragment extends BaseOsmAndFragment
|
|||
protected ExpandableListAdapter adapter;
|
||||
|
||||
@Override
|
||||
public View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull android.view.LayoutInflater inflater, android.view.ViewGroup container, Bundle savedInstanceState) {
|
||||
View v = createView(inflater, container);
|
||||
listView = (ExpandableListView) v.findViewById(android.R.id.list);
|
||||
listView.setOnChildClickListener(this);
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.graphics.Typeface;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.support.v7.app.ActionBar;
|
||||
|
@ -88,7 +89,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
|||
private ActionMode actionMode;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.local_index, container, false);
|
||||
|
||||
getDownloadActivity().setSupportProgressBarIndeterminateVisibility(false);
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.os.AsyncTask;
|
|||
import android.os.Bundle;
|
||||
import android.os.StatFs;
|
||||
import android.provider.Settings.Secure;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
@ -118,7 +119,7 @@ public class FirstUsageWizardFragment extends BaseOsmAndFragment implements OsmA
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
view = inflater.inflate(R.layout.first_usage_wizard_fragment, container, false);
|
||||
AndroidUtils.addStatusBarPadding21v(getActivity(), view);
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppList
|
|||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_live_updates, container, false);
|
||||
listView = (ExpandableListView) view.findViewById(android.R.id.list);
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.os.AsyncTask;
|
|||
import android.os.Bundle;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
|
@ -88,7 +89,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
|
|||
private int textColorSecondary;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_reports, container, false);
|
||||
monthReportsSpinner = (Spinner) view.findViewById(R.id.monthReportsSpinner);
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.content.res.Resources;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
|
@ -93,6 +94,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
|||
|
||||
private MapContextMenu menu;
|
||||
private OnLayoutChangeListener containerLayoutListener;
|
||||
private boolean forceUpdateLayout;
|
||||
|
||||
private int menuTopViewHeight;
|
||||
private int menuTopShadowAllHeight;
|
||||
|
@ -133,7 +135,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
|||
private boolean created;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
processScreenHeight(container);
|
||||
|
@ -628,7 +630,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
|||
@Override
|
||||
public void onLayoutChange(View view, int left, int top, int right, int bottom,
|
||||
int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
if (bottom != oldBottom) {
|
||||
if (forceUpdateLayout || bottom != oldBottom) {
|
||||
forceUpdateLayout = false;
|
||||
processScreenHeight(view.getParent());
|
||||
runLayoutListener();
|
||||
}
|
||||
|
@ -1748,6 +1751,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
|||
public void setFragmentVisibility(boolean visible) {
|
||||
if (view != null) {
|
||||
if (visible) {
|
||||
forceUpdateLayout = true;
|
||||
view.setVisibility(View.VISIBLE);
|
||||
if (mapCenter != null) {
|
||||
map.setLatLon(mapCenter.getLatitude(), mapCenter.getLongitude());
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.osmand.plus.mapcontextmenu.builders.cards.dialogs;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
|
@ -39,7 +40,7 @@ public class ContextMenuCardDialogFragment extends BaseOsmAndFragment {
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.context_menu_card_dialog, container, false);
|
||||
AndroidUtils.addStatusBarPadding21v(getActivity(), view);
|
||||
if (dialog.getType() == ContextMenuCardDialog.CardDialogType.MAPILLARY) {
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.app.Activity;
|
|||
import android.content.DialogInterface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -52,7 +53,7 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||
if (view != null && editor.isNew()) {
|
||||
Button replaceButton = (Button) view.findViewById(R.id.replace_button);
|
||||
|
|
|
@ -3,11 +3,11 @@ package net.osmand.plus.mapcontextmenu.editors;
|
|||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.TypedValue;
|
||||
|
@ -15,12 +15,10 @@ import android.view.LayoutInflater;
|
|||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
|
@ -28,7 +26,6 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.base.BaseOsmAndFragment;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.widgets.AutoCompleteTextViewEx;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
|
@ -40,11 +37,10 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
|
|||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
view = inflater.inflate(R.layout.point_editor_fragment, container, false);
|
||||
AndroidUtils.addStatusBarPadding21v(getActivity(), view);
|
||||
|
||||
getEditor().updateLandscapePortrait();
|
||||
getEditor().updateNightMode();
|
||||
|
@ -135,36 +131,6 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
|
|||
descriptionEdit.setText(getDescriptionInitValue());
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
view.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
if (descriptionEdit.isFocused()) {
|
||||
ScrollView scrollView = (ScrollView) view.findViewById(R.id.editor_scroll_view);
|
||||
scrollView.scrollTo(0, bottom);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 21 && AndroidUiHelper.isOrientationPortrait(getActivity())) {
|
||||
Rect rect = new Rect();
|
||||
getActivity().getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
|
||||
int heightDiff = getResources().getDisplayMetrics().heightPixels - rect.bottom;
|
||||
view.findViewById(R.id.buttons_container).setPadding(0, 0, 0, heightDiff);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ViewTreeObserver vto = view.getViewTreeObserver();
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
if (descriptionEdit.isFocused()) {
|
||||
ScrollView scrollView = (ScrollView) view.findViewById(R.id.editor_scroll_view);
|
||||
scrollView.scrollTo(0, view.getBottom());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ImageView nameImage = (ImageView) view.findViewById(R.id.name_image);
|
||||
nameImage.setImageDrawable(getNameIcon());
|
||||
ImageView categoryImage = (ImageView) view.findViewById(R.id.category_image);
|
||||
|
@ -228,6 +194,11 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
|
|||
return R.color.status_bar_light;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isFullScreenAllowed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void hideKeyboard() {
|
||||
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||
if (inputMethodManager != null) {
|
||||
|
@ -250,7 +221,9 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
|
||||
protected abstract boolean wasSaved();
|
||||
|
||||
protected abstract void save(boolean needDismiss);
|
||||
|
||||
protected abstract void delete(boolean needDismiss);
|
||||
|
||||
static int getResIdFromAttribute(final Context ctx, final int attr) {
|
||||
|
@ -262,6 +235,7 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
|
||||
public abstract PointEditor getEditor();
|
||||
|
||||
public abstract String getToolbarTitle();
|
||||
|
||||
public void setCategory(String name) {
|
||||
|
@ -279,7 +253,7 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
|
||||
protected MapActivity getMapActivity() {
|
||||
return (MapActivity)getActivity();
|
||||
return (MapActivity) getActivity();
|
||||
}
|
||||
|
||||
protected OsmandApplication getMyApplication() {
|
||||
|
@ -307,15 +281,19 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
|
|||
public String getNameCaption() {
|
||||
return getMapActivity().getResources().getString(R.string.shared_string_name);
|
||||
}
|
||||
|
||||
public String getCategoryCaption() {
|
||||
return getMapActivity().getResources().getString(R.string.favourites_edit_dialog_category);
|
||||
}
|
||||
|
||||
public abstract String getNameInitValue();
|
||||
|
||||
public abstract String getCategoryInitValue();
|
||||
|
||||
public abstract String getDescriptionInitValue();
|
||||
|
||||
public abstract Drawable getNameIcon();
|
||||
|
||||
public abstract Drawable getCategoryIcon();
|
||||
|
||||
public String getNameTextValue() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.osmand.plus.mapcontextmenu.other;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -27,7 +28,7 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package net.osmand.plus.mapcontextmenu.other;
|
|||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -29,7 +30,7 @@ public class TrackDetailsMenuFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.app.DatePickerDialog;
|
|||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.AppCompatImageView;
|
||||
import android.support.v7.widget.AppCompatTextView;
|
||||
|
@ -48,7 +49,7 @@ public class MapillaryFiltersFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
final MapActivity mapActivity = (MapActivity) getActivity();
|
||||
final OsmandSettings settings = getSettings();
|
||||
final MapillaryPlugin plugin = OsmandPlugin.getPlugin(MapillaryPlugin.class);
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.os.AsyncTask;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
@ -94,7 +95,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
final MapActivity mapActivity = getMapActivity();
|
||||
markersHelper = mapActivity.getMyApplication().getMapMarkersHelper();
|
||||
planRouteContext = markersHelper.getPlanRouteContext();
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.os.AsyncTask;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
|
@ -122,7 +123,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
final MapActivity mapActivity = (MapActivity) getActivity();
|
||||
final MeasurementToolLayer measurementLayer = mapActivity.getMapLayers().getMeasurementToolLayer();
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import android.os.AsyncTask;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
|
@ -300,7 +301,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View v = inflater.inflate(R.layout.available_gpx, container, false);
|
||||
listView = (ExpandableListView) v.findViewById(android.R.id.list);
|
||||
setHasOptionsMenu(true);
|
||||
|
|
|
@ -190,7 +190,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment {
|
|||
};
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
mainView = inflater.inflate(R.layout.track_points_tree, container, false);
|
||||
ExpandableListView listView = (ExpandableListView) mainView.findViewById(android.R.id.list);
|
||||
setHasOptionsMenu(true);
|
||||
|
|
|
@ -2,6 +2,7 @@ package net.osmand.plus.osmedit;
|
|||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -53,7 +54,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
final View view = inflater.inflate(R.layout.fragment_edit_poi_advanced, container, false);
|
||||
|
||||
deleteDrawable = getPaintedContentIcon(R.drawable.ic_action_remove_dark,
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.osmand.plus.osmedit;
|
|||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
|
@ -45,7 +46,7 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_edit_poi_normal, container, false);
|
||||
|
||||
TypedValue typedValue = new TypedValue();
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.content.res.Resources;
|
|||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
|
@ -52,7 +53,7 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
View view = inflater.inflate(R.layout.quick_action_list, container, false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue