Merge pull request #847 from Bars107/sherpafy

Created rounded corner view and shadow for tour selection view
This commit is contained in:
vshcherb 2014-08-13 12:22:38 +02:00
commit 7435deb12f
4 changed files with 140 additions and 63 deletions

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

View file

@ -1,74 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/sherpafy_tour_row" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/sherpafy_tour_row">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginTop="15dp"
android:id="@+id/AreaPreview"
android:background="@color/color_white"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginTop="15dp"
android:id="@+id/AreaPreview"
android:background="@drawable/tour_bg"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/shadow_color" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/TourImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop" >
</ImageView>
<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>
<TextView
android:id="@+id/TourName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="10dp"
android:background="@color/shadow_color"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/color_white"
android:textSize="23sp" />
</FrameLayout>
<TextView
android:id="@+id/TourName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
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
android:id="@+id/TourDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="3"
android:textSize="16sp" />
<TextView
android:id="@+id/TourDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="3"
android:textSize="16sp"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="3dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="3dp"
android:orientation="vertical">
<TextView
android:id="@+id/MoreInformation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:focusable="false"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/MoreInformation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:focusable="false"
/>
</LinearLayout>
</LinearLayout>
</FrameLayout>

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

View 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);
}
}