diff --git a/OsmAnd/res/layout/note.xml b/OsmAnd/res/layout/note.xml index 5898e02b07..30f760d9b2 100644 --- a/OsmAnd/res/layout/note.xml +++ b/OsmAnd/res/layout/note.xml @@ -46,6 +46,7 @@ result, LoadGpxTask loadTask, List progress, String gpxSubfolder) { + GpxSelectionHelper sgpx = app.getSelectedGpxHelper(); for (File gpxFile : listFilesSorted(mapPath)) { if (gpxFile.isDirectory()) { String sub = gpxSubfolder.length() == 0 ? gpxFile.getName() : gpxSubfolder + "/" + gpxFile.getName(); @@ -633,6 +632,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { GpxInfo info = new GpxInfo(); info.subfolder = gpxSubfolder; info.file = gpxFile; + SelectedGpxFile ssgpx = sgpx.getSelectedFileByName(gpxFile.getAbsolutePath()); + if(ssgpx != null ) { + info.analysis = ssgpx.getTrackAnalysis(); + } result.add(info); progress.add(info); if (progress.size() > 7) { @@ -881,7 +884,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { DirectionsDialogs.setupPopUpMenuIcon(optionsMenu); Drawable showIcon = getResources().getDrawable(R.drawable.ic_show_on_map); if (light) { - showIcon.mutate().setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY); + showIcon = showIcon.mutate(); + showIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY); } MenuItem item = optionsMenu.getMenu().add(R.string.show_gpx_route) .setIcon(showIcon); @@ -918,8 +922,13 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { final OsmEditingPlugin osmEditingPlugin = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class); if (osmEditingPlugin != null && osmEditingPlugin.isActive()) { + Drawable exportIcon = getResources().getDrawable(R.drawable.ic_action_export); + if (light) { + exportIcon = exportIcon.mutate(); + exportIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY); + } item = optionsMenu.getMenu().add(R.string.export) - .setIcon(light ? R.drawable.ic_action_gup_light : R.drawable.ic_action_gup_dark); + .setIcon(exportIcon); item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { diff --git a/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java index 3ce25950f2..27a4cf7d0d 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java @@ -4,6 +4,8 @@ import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; +import android.graphics.PorterDuff.Mode; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.support.annotation.Nullable; @@ -124,11 +126,15 @@ public class NotesFragment extends ListFragment { DirectionsDialogs.setupPopUpMenuIcon(optionsMenu); MenuItem item; boolean isPhoto = recording.isPhoto(); - final int playIcon; + Drawable playIcon; if (isPhoto) { - playIcon = light ? R.drawable.ic_action_eye_light : R.drawable.ic_action_eye_dark; + playIcon = getResources().getDrawable(R.drawable.ic_action_view); + if(light) { + playIcon = playIcon.mutate(); + playIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), Mode.MULTIPLY); + } } else { - playIcon = light ? R.drawable.ic_play_light : R.drawable.ic_play_dark; + playIcon = getResources().getDrawable(light ? R.drawable.ic_play_light : R.drawable.ic_play_dark); } item = optionsMenu.getMenu().add(isPhoto ? R.string.watch : R.string.recording_context_menu_play) .setIcon(playIcon); @@ -140,8 +146,13 @@ public class NotesFragment extends ListFragment { } }); + Drawable showOnMap = getResources().getDrawable(R.drawable.ic_show_on_map); + if(light) { + showOnMap = showOnMap.mutate(); + showOnMap.setColorFilter(getResources().getColor(R.color.icon_color_light), Mode.MULTIPLY); + } item = optionsMenu.getMenu().add(R.string.search_shown_on_map) - .setIcon(light ? R.drawable.ic_action_map_marker_light : R.drawable.ic_action_map_marker_dark); + .setIcon(showOnMap); item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { diff --git a/OsmAnd/src/net/osmand/plus/views/controls/PagerSlidingTabStrip.java b/OsmAnd/src/net/osmand/plus/views/controls/PagerSlidingTabStrip.java index 8994c77ef9..f39c5b62a4 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/PagerSlidingTabStrip.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/PagerSlidingTabStrip.java @@ -22,9 +22,12 @@ import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.database.DataSetObserver; import android.graphics.Canvas; +import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.Style; import android.graphics.Typeface; +import android.graphics.drawable.ColorDrawable; +import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; @@ -45,9 +48,9 @@ import android.widget.TextView; import net.osmand.plus.R; import net.osmand.plus.helpers.FontCache; - import java.util.Locale; +@SuppressLint("NewApi") public class PagerSlidingTabStrip extends HorizontalScrollView { private static final float OPAQUE = 1.0f; @@ -68,6 +71,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { android.R.attr.textColor, android.R.attr.paddingLeft, android.R.attr.paddingRight, + android.R.attr.colorPrimary, }; // @formatter:on @@ -79,6 +83,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { private static final int TEXT_COLOR_INDEX = 2; private static final int PADDING_LEFT_INDEX = 3; private static final int PADDING_RIGHT_INDEX = 4; + private static final int COLOR_PRIMARY= 5; private LinearLayout.LayoutParams defaultTabLayoutParams; private LinearLayout.LayoutParams expandedTabLayoutParams; @@ -99,10 +104,12 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { private Paint dividerPaint; private int indicatorColor; + private int indicatorBgColor; private int indicatorHeight = 2; private int underlineHeight = 0; private int underlineColor; + private int dividerWidth = 0; private int dividerPadding = 0; @@ -165,6 +172,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { underlineColor = textPrimaryColor; dividerColor = textPrimaryColor; indicatorColor = textPrimaryColor; + indicatorBgColor = a.getColor(TEXT_COLOR_PRIMARY, Color.TRANSPARENT); int paddingLeft = a.getDimensionPixelSize(PADDING_LEFT_INDEX, padding); int paddingRight = a.getDimensionPixelSize(PADDING_RIGHT_INDEX, padding); a.recycle(); @@ -188,13 +196,11 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { scrollOffset = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsScrollOffset, scrollOffset); textAllCaps = a.getBoolean(R.styleable.PagerSlidingTabStrip_pstsTextAllCaps, textAllCaps); isPaddingMiddle = a.getBoolean(R.styleable.PagerSlidingTabStrip_pstsPaddingMiddle, isPaddingMiddle); - tabTypefaceStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextStyle, Typeface.BOLD); - tabTypefaceSelectedStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextSelectedStyle, Typeface.BOLD); + tabTypefaceStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextStyle, Typeface.NORMAL); + tabTypefaceSelectedStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextSelectedStyle, Typeface.NORMAL); tabTextAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextAlpha, HALF_TRANSP); tabTextSelectedAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextSelectedAlpha, OPAQUE); - if (!isInEditMode()) { - tabTypeface = FontCache.getRobotoMedium(context); - } + tabTypeface = FontCache.getRobotoMedium(context); a.recycle(); setMarginBottomTabContainer(); @@ -387,6 +393,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { private OnGlobalLayoutListener firstTabGlobalLayoutListener = new OnGlobalLayoutListener() { + @SuppressLint("NewApi") @Override public void onGlobalLayout() { View view = tabsContainer.getChildAt(0); @@ -414,13 +421,19 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { } final int height = getHeight(); + // draw underline + if (indicatorBgColor != Color.TRANSPARENT) { + rectPaint.setColor(indicatorBgColor); // underlineColor + canvas.drawRect(padding, height - indicatorHeight, tabsContainer.getWidth() + padding, height, rectPaint); + } // draw indicator line - rectPaint.setColor(indicatorColor); Pair lines = getIndicatorCoordinates(); + rectPaint.setColor(indicatorColor); // indicatorColor canvas.drawRect(lines.first + padding, height - indicatorHeight, lines.second + padding, height, rectPaint); // draw underline - rectPaint.setColor(underlineColor); + rectPaint.setColor(underlineColor); //underlineColor canvas.drawRect(padding, height - underlineHeight, tabsContainer.getWidth() + padding, height, rectPaint); + // draw divider if (dividerWidth != 0) { dividerPaint.setStrokeWidth(dividerWidth);