fix visible dividers between statistic info;
rollback gradle.properties
This commit is contained in:
parent
cab23e6426
commit
84c879e02d
3 changed files with 76 additions and 41 deletions
|
@ -3,42 +3,62 @@
|
||||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/list_header_height"
|
||||||
android:orientation="vertical">
|
android:layout_marginStart="@dimen/content_padding"
|
||||||
|
android:layout_marginLeft="@dimen/content_padding"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:layout_marginEnd="@dimen/content_padding"
|
||||||
|
android:layout_marginRight="@dimen/content_padding"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
<LinearLayout
|
||||||
android:id="@+id/value"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
|
android:id="@+id/value"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
android:textSize="@dimen/default_desc_text_size"
|
||||||
|
osmand:typeface="@string/font_roboto_medium"
|
||||||
|
tools:text="700 km" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="@dimen/context_menu_transport_icon_size"
|
||||||
|
android:layout_height="@dimen/context_menu_transport_icon_size"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="@dimen/context_menu_first_line_top_margin"
|
||||||
|
android:layout_marginLeft="@dimen/context_menu_first_line_top_margin"
|
||||||
|
tools:src="@drawable/ic_action_track_16" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:textSize="@dimen/default_desc_text_size"
|
android:textSize="@dimen/default_desc_text_size"
|
||||||
osmand:typeface="@string/font_roboto_medium"
|
tools:text="@string/distance" />
|
||||||
tools:text="700 km" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/image"
|
|
||||||
android:layout_width="@dimen/context_menu_transport_icon_size"
|
|
||||||
android:layout_height="@dimen/context_menu_transport_icon_size"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginStart="@dimen/context_menu_first_line_top_margin"
|
|
||||||
android:layout_marginLeft="@dimen/context_menu_first_line_top_margin"
|
|
||||||
tools:src="@drawable/ic_action_track_16" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<View
|
||||||
android:id="@+id/title"
|
android:id="@+id/divider"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="1dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:background="@null"
|
android:layout_marginTop="@dimen/map_small_button_margin"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:layout_marginBottom="@dimen/map_small_button_margin"
|
||||||
android:textSize="@dimen/default_desc_text_size"
|
tools:background="@color/divider_color_light" />
|
||||||
tools:text="@string/distance" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -2,9 +2,9 @@ package net.osmand.plus.track;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
@ -18,10 +18,12 @@ import androidx.annotation.DrawableRes;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.AppCompatImageView;
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.recyclerview.widget.RecyclerView.ItemDecoration;
|
import androidx.recyclerview.widget.RecyclerView.ItemDecoration;
|
||||||
|
|
||||||
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.GPXUtilities.GPXFile;
|
import net.osmand.GPXUtilities.GPXFile;
|
||||||
import net.osmand.GPXUtilities.GPXTrackAnalysis;
|
import net.osmand.GPXUtilities.GPXTrackAnalysis;
|
||||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
|
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
|
||||||
|
@ -30,6 +32,7 @@ import net.osmand.plus.OsmAndFormatter;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.UiUtilities;
|
import net.osmand.plus.UiUtilities;
|
||||||
import net.osmand.plus.activities.MapActivity;
|
import net.osmand.plus.activities.MapActivity;
|
||||||
|
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||||
import net.osmand.plus.helpers.GpxUiHelper.GPXDataSetType;
|
import net.osmand.plus.helpers.GpxUiHelper.GPXDataSetType;
|
||||||
import net.osmand.plus.myplaces.SegmentActionsListener;
|
import net.osmand.plus.myplaces.SegmentActionsListener;
|
||||||
import net.osmand.plus.routepreparationmenu.cards.BaseCard;
|
import net.osmand.plus.routepreparationmenu.cards.BaseCard;
|
||||||
|
@ -125,8 +128,10 @@ public class OverviewCard extends BaseCard {
|
||||||
|
|
||||||
final StatBlockAdapter sbAdapter = new StatBlockAdapter(items);
|
final StatBlockAdapter sbAdapter = new StatBlockAdapter(items);
|
||||||
rvOverview.setLayoutManager(new LinearLayoutManager(app, LinearLayoutManager.HORIZONTAL, false));
|
rvOverview.setLayoutManager(new LinearLayoutManager(app, LinearLayoutManager.HORIZONTAL, false));
|
||||||
rvOverview.addItemDecoration(new HorizontalDividerDecoration(app));
|
// rvOverview.addItemDecoration(new HorizontalDividerDecoration(app, nightMode));
|
||||||
rvOverview.setAdapter(sbAdapter);
|
rvOverview.setAdapter(sbAdapter);
|
||||||
|
} else {
|
||||||
|
AndroidUiHelper.updateVisibility(rvOverview, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,6 +270,10 @@ public class OverviewCard extends BaseCard {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setImageDrawable(holder.imageView, item.imageResId, item.imageColorId);
|
setImageDrawable(holder.imageView, item.imageResId, item.imageColorId);
|
||||||
|
AndroidUtils.setBackgroundColor(view.getContext(), holder.divider, nightMode, R.color.divider_color_light, R.color.divider_color_dark);
|
||||||
|
if (position == statBlocks.size() - 1) {
|
||||||
|
AndroidUiHelper.setVisibility(View.GONE, holder.divider);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,12 +282,14 @@ public class OverviewCard extends BaseCard {
|
||||||
private final TextViewEx valueText;
|
private final TextViewEx valueText;
|
||||||
private final TextView titleText;
|
private final TextView titleText;
|
||||||
private final AppCompatImageView imageView;
|
private final AppCompatImageView imageView;
|
||||||
|
private final View divider;
|
||||||
|
|
||||||
StatBlockViewHolder(View view) {
|
StatBlockViewHolder(View view) {
|
||||||
super(view);
|
super(view);
|
||||||
valueText = view.findViewById(R.id.value);
|
valueText = view.findViewById(R.id.value);
|
||||||
titleText = view.findViewById(R.id.title);
|
titleText = view.findViewById(R.id.title);
|
||||||
imageView = view.findViewById(R.id.image);
|
imageView = view.findViewById(R.id.image);
|
||||||
|
divider = view.findViewById(R.id.divider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,12 +299,8 @@ public class OverviewCard extends BaseCard {
|
||||||
private final int marginV;
|
private final int marginV;
|
||||||
private final int marginH;
|
private final int marginH;
|
||||||
|
|
||||||
public HorizontalDividerDecoration(Context context) {
|
public HorizontalDividerDecoration(Context context, boolean nightMode) {
|
||||||
int[] ATTRS = {android.R.attr.listDivider};
|
divider = new ColorDrawable(ContextCompat.getColor(context, nightMode ? R.color.divider_color_dark : R.color.divider_color_light));
|
||||||
final TypedArray ta = context.obtainStyledAttributes(ATTRS);
|
|
||||||
divider = ta.getDrawable(0);
|
|
||||||
// DrawableCompat.setTint(divider, context.getResources().getColor(R.color.divider_color_light)); //todo change drawable color
|
|
||||||
ta.recycle();
|
|
||||||
marginV = context.getResources().getDimensionPixelSize(R.dimen.map_small_button_margin);
|
marginV = context.getResources().getDimensionPixelSize(R.dimen.map_small_button_margin);
|
||||||
marginH = context.getResources().getDimensionPixelSize(R.dimen.content_padding);
|
marginH = context.getResources().getDimensionPixelSize(R.dimen.content_padding);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,24 @@
|
||||||
## For more details on how to configure your build environment visit
|
## Project-wide Gradle settings.
|
||||||
|
#
|
||||||
|
# For more details on how to configure your build environment visit
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
#
|
#
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
# Default value: -Xmx1024m -XX:MaxPermSize=256m
|
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
||||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
#
|
#
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
#Mon Dec 28 12:25:02 EET 2020
|
#Fri Apr 08 18:47:31 EEST 2016
|
||||||
|
# android.useDeprecatedNdk=true
|
||||||
|
|
||||||
|
# for enableD8=true min sdk must be > 22
|
||||||
|
# UPDATE: temporairly commented since gradle plugin updated to 3.1.3 and claims INSTALL_FAILED_DEXOPT is fixed
|
||||||
|
# UPDATE 2: D8 causes problems on arm64 devices with Android 6.0 (API 23)
|
||||||
|
# UPDATE 3: Turn on D8 to recover builds with new gradle 6.5 and pluigin 4.1.1
|
||||||
|
#android.enableD8=false
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
|
|
||||||
|
|
Loading…
Reference in a new issue