Merge pull request #847 from Bars107/sherpafy
Created rounded corner view and shadow for tour selection view
This commit is contained in:
commit
7435deb12f
4 changed files with 140 additions and 63 deletions
8
OsmAnd/res/drawable/tour_bg.xml
Normal file
8
OsmAnd/res/drawable/tour_bg.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="#FFFFFF"/>
|
||||||
|
<stroke android:width="1dip" android:color="@color/sherpafy_add_text" />
|
||||||
|
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
|
||||||
|
android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
|
||||||
|
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
|
||||||
|
</shape>
|
|
@ -1,74 +1,79 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/sherpafy_tour_row" >
|
android:background="@drawable/sherpafy_tour_row">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="15dp"
|
android:layout_marginBottom="15dp"
|
||||||
android:layout_marginLeft="14dp"
|
android:layout_marginLeft="14dp"
|
||||||
android:layout_marginRight="14dp"
|
android:layout_marginRight="14dp"
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:id="@+id/AreaPreview"
|
android:id="@+id/AreaPreview"
|
||||||
android:background="@color/color_white"
|
android:background="@drawable/tour_bg"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:background="@color/shadow_color" >
|
|
||||||
|
<net.osmand.plus.views.CustomImageView
|
||||||
|
android:layout_marginLeft="1dp"
|
||||||
|
android:layout_marginRight="1dp"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:id="@+id/TourImage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop">
|
||||||
|
</net.osmand.plus.views.CustomImageView>
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:id="@+id/TourImage"
|
android:id="@+id/TourName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="centerCrop" >
|
android:layout_gravity="bottom"
|
||||||
</ImageView>
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="6dp"
|
||||||
|
android:background="@color/shadow_color"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/color_white"
|
||||||
|
android:textSize="23sp"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/TourName"
|
android:id="@+id/TourDescription"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginRight="5dp"
|
||||||
android:background="@color/shadow_color"
|
android:layout_marginTop="5dp"
|
||||||
android:ellipsize="end"
|
android:layout_weight="1"
|
||||||
android:maxLines="1"
|
android:ellipsize="end"
|
||||||
android:textColor="@color/color_white"
|
android:maxLines="3"
|
||||||
android:textSize="23sp" />
|
android:textSize="16sp"/>
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/TourDescription"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginLeft="14dp"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginRight="14dp"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginBottom="3dp"
|
||||||
android:layout_weight="1"
|
android:orientation="vertical">
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="3"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:layout_width="fill_parent"
|
android:id="@+id/MoreInformation"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_marginLeft="14dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="14dp"
|
android:textSize="14sp"
|
||||||
android:layout_marginTop="5dp"
|
android:focusable="false"
|
||||||
android:layout_marginBottom="3dp"
|
/>
|
||||||
android:orientation="vertical" >
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/MoreInformation"
|
</LinearLayout>
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:focusable="false"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
26
OsmAnd/res/layout/waypoint_header.xml
Normal file
26
OsmAnd/res/layout/waypoint_header.xml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView android:id="@+id/header_text"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textSize="18sp"/>
|
||||||
|
|
||||||
|
<ImageButton android:id="@+id/all_points"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
style="@style/Widget.Sherlock.ActionButton"
|
||||||
|
android:src="@drawable/ic_action_core_overflow_dark"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
38
OsmAnd/src/net/osmand/plus/views/CustomImageView.java
Normal file
38
OsmAnd/src/net/osmand/plus/views/CustomImageView.java
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
package net.osmand.plus.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Path;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Denis on 13.08.2014.
|
||||||
|
*/
|
||||||
|
public class CustomImageView extends ImageView {
|
||||||
|
|
||||||
|
public static float radius = 13.0f;
|
||||||
|
|
||||||
|
public CustomImageView(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomImageView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
//float radius = 36.0f;
|
||||||
|
Path clipPath = new Path();
|
||||||
|
RectF rect = new RectF(0, 0, this.getWidth(), this.getHeight());
|
||||||
|
clipPath.addRoundRect(rect, radius, radius, Path.Direction.CW);
|
||||||
|
canvas.clipPath(clipPath);
|
||||||
|
super.onDraw(canvas);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue