* #33930: v3 design integrated
diff --git a/res/drawable/call_button.xml b/res/drawable/call_button.xml
index 7b25fee..7e07ee4 100644
--- a/res/drawable/call_button.xml
+++ b/res/drawable/call_button.xml
@@ -2,14 +2,10 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true"><shape android:shape="oval">
- <solid android:color="@color/sfl_dark_blue" />
-
- <stroke android:width="3dp" android:color="@color/sfl_action_blue" />
+ <solid android:color="@color/sfl_light_blue" />
</shape></item>
<item><shape android:shape="oval">
- <solid android:color="@color/sfl_light_blue" />
-
- <stroke android:width="3dp" android:color="@color/sfl_action_blue" />
+ <solid android:color="@color/sfl_dark_blue" />
</shape></item>
</selector>
\ No newline at end of file
diff --git a/res/drawable/dialer_selector.xml b/res/drawable/dialer_selector.xml
index 16a4dfa..c0066b9 100644
--- a/res/drawable/dialer_selector.xml
+++ b/res/drawable/dialer_selector.xml
@@ -5,22 +5,16 @@
<solid android:color="@color/sfl_light_blue" />
<padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
-
- <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" />
</shape></item>
<item android:state_focused="true"><shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/sfl_light_blue" />
<padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
-
- <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" />
</shape></item>
<item><shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/sfl_light_blue" />
<padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
-
- <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" />
</shape></item>
-</selector>
+</selector>
\ No newline at end of file
diff --git a/res/drawable/item_keyboard_choice_selector.xml b/res/drawable/item_keyboard_choice_selector.xml
new file mode 100644
index 0000000..87d91c7
--- /dev/null
+++ b/res/drawable/item_keyboard_choice_selector.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true"><shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="@color/sfl_light_blue" />
+
+ <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
+ </shape></item>
+ <item android:state_focused="true"><shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="@color/sfl_light_blue" />
+
+ <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
+ </shape></item>
+ <item><shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="@color/sfl_blue_0" />
+
+ <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
+ </shape></item>
+
+</selector>
\ No newline at end of file
diff --git a/res/layout/clearable_edit_text.xml b/res/layout/clearable_edit_text.xml
index 62e282c..0f29aaf 100644
--- a/res/layout/clearable_edit_text.xml
+++ b/res/layout/clearable_edit_text.xml
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content"
+ android:background="@drawable/dialer_selector" >
<EditText
android:id="@+id/clearable_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:background="#00000000"
android:hint="@string/dial_hint"
android:imeActionLabel="@string/dial_action_call"
android:imeOptions="actionGo"
@@ -18,9 +20,18 @@
android:id="@+id/clearable_button_clear"
android:layout_width="30dip"
android:layout_height="30dip"
+ android:layout_alignBaseline="@+id/clearable_edit"
android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
android:layout_marginRight="5dip"
android:background="@drawable/ic_action_remove" />
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/clearable_edit"
+ android:layout_marginTop="10dp"
+ android:background="@color/darker_gray" />
+
</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/frag_dialing.xml b/res/layout/frag_dialing.xml
index bfd57e7..b0c4a76 100644
--- a/res/layout/frag_dialing.xml
+++ b/res/layout/frag_dialing.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="9dp"
+ android:layout_marginTop="15dp"
+ android:layout_marginRight="15dp"
+ android:layout_marginLeft="15dp"
android:background="@color/lighter_gray"
android:padding="5dp" >
@@ -10,49 +12,62 @@
android:id="@+id/textField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:background="@drawable/dialer_selector" />
+ android:layout_alignParentTop="true" />
- <LinearLayout
- android:id="@+id/keyboard_choice"
- android:layout_width="wrap_content"
+ <RelativeLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textField"
android:layout_alignRight="@+id/textField"
- android:layout_below="@+id/textField"
- android:layout_marginBottom="15dp"
- android:layout_marginTop="15dp"
- android:weightSum="2" >
+ android:layout_below="@+id/textField" >
+
+ <ImageView
+ android:id="@+id/fake_padding"
+ android:layout_width="match_parent"
+ android:layout_height="30dp"
+ android:background="@color/sfl_light_blue" />
+
+ <LinearLayout
+ android:id="@+id/keyboard_choice"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/fake_padding"
+ android:layout_marginBottom="15dp"
+ android:weightSum="100" >
+
+ <ImageButton
+ android:id="@+id/numeric_keyboard"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="30"
+ android:background="@drawable/item_keyboard_choice_selector"
+ android:contentDescription="@string/dial_numeric_pad"
+ android:src="@drawable/ic_action_dial_pad_light" />
+
+ <org.sflphone.views.CircularImageView
+ android:id="@+id/fake_dar_band"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="40"
+ android:background="@drawable/item_keyboard_choice_selector" />
+
+ <ImageButton
+ android:id="@+id/alphabetic_keyboard"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="30"
+ android:background="@drawable/item_keyboard_choice_selector"
+ android:contentDescription="@string/dial_alphabetic_pad"
+ android:src="@drawable/ic_action_keyboard_light" />
+ </LinearLayout>
<ImageButton
- android:id="@+id/numeric_keyboard"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:background="@drawable/item_generic_selector"
- android:contentDescription="@string/dial_numeric_pad"
- android:layout_marginRight="5dp"
- android:src="@drawable/ic_action_dial_pad" />
-
- <ImageButton
- android:id="@+id/alphabetic_keyboard"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_marginLeft="5dp"
- android:background="@drawable/item_generic_selector"
- android:contentDescription="@string/dial_alphabetic_pad"
- android:src="@drawable/ic_action_keyboard" />
- </LinearLayout>
-
- <ImageButton
- android:id="@+id/buttonCall"
- android:layout_width="100dp"
- android:layout_height="100dp"
- android:layout_below="@+id/keyboard_choice"
- android:layout_centerHorizontal="true"
- android:background="@drawable/call_button"
- android:gravity="center_vertical"
- android:src="@drawable/ic_action_call" />
+ android:id="@+id/buttonCall"
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_centerHorizontal="true"
+ android:background="@drawable/call_button"
+ android:src="@drawable/ic_action_call" />
+ </RelativeLayout>
</RelativeLayout>
\ No newline at end of file
diff --git a/src/org/sflphone/views/CircularImageView.java b/src/org/sflphone/views/CircularImageView.java
new file mode 100644
index 0000000..9213685
--- /dev/null
+++ b/src/org/sflphone/views/CircularImageView.java
@@ -0,0 +1,151 @@
+package org.sflphone.views;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapShader;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Shader;
+import android.graphics.drawable.BitmapDrawable;
+import android.util.AttributeSet;
+import android.widget.ImageView;
+
+public class CircularImageView extends ImageView
+{
+ private int borderWidth = 4;
+ private int viewWidth;
+ private int viewHeight;
+ private Bitmap image;
+ private Paint paint;
+ private Paint paintBorder;
+ private BitmapShader shader;
+
+ public CircularImageView(Context context)
+ {
+ super(context);
+ setup();
+ }
+
+ public CircularImageView(Context context, AttributeSet attrs)
+ {
+ super(context, attrs);
+ setup();
+ }
+
+ public CircularImageView(Context context, AttributeSet attrs, int defStyle)
+ {
+ super(context, attrs, defStyle);
+ setup();
+ }
+
+ private void setup()
+ {
+ // init paint
+ paint = new Paint();
+ paint.setAntiAlias(true);
+
+ paintBorder = new Paint();
+ setBorderColor(Color.WHITE);
+ paintBorder.setAntiAlias(true);
+ this.setLayerType(LAYER_TYPE_SOFTWARE, paintBorder);
+ paintBorder.setShadowLayer(4.0f, 0.0f, 2.0f, Color.BLACK);
+ }
+
+ public void setBorderWidth(int borderWidth)
+ {
+ this.borderWidth = borderWidth;
+ this.invalidate();
+ }
+
+ public void setBorderColor(int borderColor)
+ {
+ if (paintBorder != null)
+ paintBorder.setColor(borderColor);
+
+ this.invalidate();
+ }
+
+ private void loadBitmap()
+ {
+ BitmapDrawable bitmapDrawable = (BitmapDrawable) this.getDrawable();
+
+ if (bitmapDrawable != null)
+ image = bitmapDrawable.getBitmap();
+ }
+
+ @SuppressLint("DrawAllocation")
+ @Override
+ public void onDraw(Canvas canvas)
+ {
+ // load the bitmap
+ loadBitmap();
+
+ // init shader
+ if (image != null)
+ {
+ shader = new BitmapShader(Bitmap.createScaledBitmap(image, canvas.getWidth(), canvas.getHeight(), false), Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
+ paint.setShader(shader);
+ int circleCenter = viewWidth / 2;
+
+ // circleCenter is the x or y of the view's center
+ // radius is the radius in pixels of the cirle to be drawn
+ // paint contains the shader that will texture the shape
+ canvas.drawCircle(circleCenter + borderWidth, circleCenter + borderWidth, circleCenter + borderWidth - 4.0f, paintBorder);
+ canvas.drawCircle(circleCenter + borderWidth, circleCenter + borderWidth, circleCenter - 4.0f, paint);
+ }
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
+ {
+ int width = measureWidth(widthMeasureSpec);
+ int height = measureHeight(heightMeasureSpec, widthMeasureSpec);
+
+ viewWidth = width - (borderWidth * 2);
+ viewHeight = height - (borderWidth * 2);
+
+ setMeasuredDimension(width, height);
+ }
+
+ private int measureWidth(int measureSpec)
+ {
+ int result = 0;
+ int specMode = MeasureSpec.getMode(measureSpec);
+ int specSize = MeasureSpec.getSize(measureSpec);
+
+ if (specMode == MeasureSpec.EXACTLY)
+ {
+ // We were told how big to be
+ result = specSize;
+ }
+ else
+ {
+ // Measure the text
+ result = viewWidth;
+ }
+
+ return result;
+ }
+
+ private int measureHeight(int measureSpecHeight, int measureSpecWidth)
+ {
+ int result = 0;
+ int specMode = MeasureSpec.getMode(measureSpecHeight);
+ int specSize = MeasureSpec.getSize(measureSpecHeight);
+
+ if (specMode == MeasureSpec.EXACTLY)
+ {
+ // We were told how big to be
+ result = specSize;
+ }
+ else
+ {
+ // Measure the text (beware: ascent is a negative number)
+ result = viewHeight;
+ }
+
+ return (result + 2);
+ }
+}
\ No newline at end of file