diff --git a/sample/src/main/java/com/vipulasri/ticketview/sample/MainActivity.kt b/sample/src/main/java/com/vipulasri/ticketview/sample/MainActivity.kt
index 7cf1a7e..588b628 100644
--- a/sample/src/main/java/com/vipulasri/ticketview/sample/MainActivity.kt
+++ b/sample/src/main/java/com/vipulasri/ticketview/sample/MainActivity.kt
@@ -9,6 +9,7 @@ import com.vipulasri.ticketview.TicketView
import kotlinx.android.synthetic.main.content_main.*
import com.thebluealliance.spectrum.SpectrumDialog
import android.graphics.PorterDuff
+import android.graphics.drawable.ColorDrawable
import android.support.annotation.NonNull
import android.util.Log
import android.view.Menu
@@ -18,11 +19,9 @@ import android.widget.ImageView
import kotlinx.android.synthetic.main.item_background_options.*
import kotlinx.android.synthetic.main.item_border_options.*
import kotlinx.android.synthetic.main.item_divider_options.*
-import android.widget.RadioGroup
import kotlinx.android.synthetic.main.item_scallop_options.*
import org.adw.library.widgets.discreteseekbar.DiscreteSeekBar
import android.widget.AdapterView.OnItemSelectedListener
-import android.widget.CompoundButton
import kotlinx.android.synthetic.main.bottomsheet_ticket_attributes.*
import kotlinx.android.synthetic.main.item_corner_options.*
@@ -83,6 +82,9 @@ class MainActivity : BaseActivity() {
})
image_background_color.background.setColorFilter(ticketView.backgroundColor, PorterDuff.Mode.SRC_ATOP)
+ image_background_before_divider_color.setImageDrawable(ticketView.backgroundBeforeDivider)
+ image_background_after_divider_color.setImageDrawable(ticketView.backgroundAfterDivider)
+
image_border_color.background.setColorFilter(ticketView.borderColor, PorterDuff.Mode.SRC_ATOP)
image_divider_color.background.setColorFilter(ticketView.dividerColor, PorterDuff.Mode.SRC_ATOP)
@@ -107,6 +109,14 @@ class MainActivity : BaseActivity() {
showColorPicker(ticketView.backgroundColor, image_background_color)
}
+ image_background_before_divider_color.setOnClickListener {
+ showColorPicker(-1, image_background_before_divider_color)
+ }
+
+ image_background_after_divider_color.setOnClickListener {
+ showColorPicker(-1, image_background_after_divider_color)
+ }
+
seekBar_elevation.setOnProgressChangeListener(progressChangeListener)
//scallop properties
@@ -223,6 +233,8 @@ class MainActivity : BaseActivity() {
R.id.image_border_color -> ticketView.borderColor = color
R.id.image_divider_color -> ticketView.dividerColor = color
R.id.image_background_color -> ticketView.backgroundColor = color
+ R.id.image_background_before_divider_color -> ticketView.backgroundBeforeDivider = ColorDrawable(color)
+ R.id.image_background_after_divider_color -> ticketView.backgroundAfterDivider = ColorDrawable(color)
else -> {
//do nothing
}
diff --git a/sample/src/main/res/layout/activity_example.xml b/sample/src/main/res/layout/activity_example.xml
index 52ad57c..c2053f9 100644
--- a/sample/src/main/res/layout/activity_example.xml
+++ b/sample/src/main/res/layout/activity_example.xml
@@ -1,213 +1,213 @@
+
+
+ android:layout_height="wrap_content"
+ android:theme="@style/AppTheme.AppBarOverlay">
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ android:layout_gravity="center_horizontal"
+ android:text="@string/movie_ticket_number"
+ android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
+ android:textColor="@color/material_grey_400" />
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+ android:text="@string/movie_date"
+ android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
+ android:textColor="@color/material_grey_500" />
+
+
+
+
-
-
-
-
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical">
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical">
+
+
+
+
-
+
+
+
+
+
diff --git a/sample/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml
index 80f20c0..b52949c 100644
--- a/sample/src/main/res/layout/activity_main.xml
+++ b/sample/src/main/res/layout/activity_main.xml
@@ -1,34 +1,34 @@
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="com.vipulasri.ticketview.sample.MainActivity">
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/sample/src/main/res/layout/bottomsheet_ticket_attributes.xml b/sample/src/main/res/layout/bottomsheet_ticket_attributes.xml
index d68349f..9875061 100644
--- a/sample/src/main/res/layout/bottomsheet_ticket_attributes.xml
+++ b/sample/src/main/res/layout/bottomsheet_ticket_attributes.xml
@@ -1,115 +1,114 @@
-
+
+
+ android:layout_height="?attr/actionBarSize"
+ android:background="#F3F3F3"
+ android:gravity="center"
+ android:orientation="horizontal"
+ android:paddingLeft="10dp">
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="20dp" />
-
+
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
\ No newline at end of file
diff --git a/sample/src/main/res/layout/content_main.xml b/sample/src/main/res/layout/content_main.xml
index 8041c27..91f6c88 100644
--- a/sample/src/main/res/layout/content_main.xml
+++ b/sample/src/main/res/layout/content_main.xml
@@ -1,25 +1,25 @@
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/colorBackground"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
-
+
diff --git a/sample/src/main/res/layout/item_background_options.xml b/sample/src/main/res/layout/item_background_options.xml
index 23ae4e2..dc5f6d5 100644
--- a/sample/src/main/res/layout/item_background_options.xml
+++ b/sample/src/main/res/layout/item_background_options.xml
@@ -1,62 +1,123 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ android:layout_height="wrap_content"
+ android:layout_marginTop="5dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+ android:layout_width="80dp"
+ android:layout_height="wrap_content"
+ android:text="@string/color"
+ android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/src/main/res/layout/item_border_options.xml b/sample/src/main/res/layout/item_border_options.xml
index c34d690..0ea17a6 100644
--- a/sample/src/main/res/layout/item_border_options.xml
+++ b/sample/src/main/res/layout/item_border_options.xml
@@ -1,83 +1,85 @@
-
+
+
+
+
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+ android:layout_width="80dp"
+ android:layout_height="wrap_content"
+ android:text="@string/enable"
+ android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/src/main/res/layout/item_corner_options.xml b/sample/src/main/res/layout/item_corner_options.xml
index a987ec6..e5ae3d4 100644
--- a/sample/src/main/res/layout/item_corner_options.xml
+++ b/sample/src/main/res/layout/item_corner_options.xml
@@ -1,54 +1,55 @@
-
-
+
+
+
+
+ android:layout_height="wrap_content"
+ android:layout_marginTop="5dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+ android:layout_width="80dp"
+ android:layout_height="wrap_content"
+ android:text="@string/type"
+ android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/src/main/res/layout/item_divider_options.xml b/sample/src/main/res/layout/item_divider_options.xml
index 02c3a92..5148ae8 100644
--- a/sample/src/main/res/layout/item_divider_options.xml
+++ b/sample/src/main/res/layout/item_divider_options.xml
@@ -1,171 +1,172 @@
-
-
+
+
+
+
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+ android:layout_width="80dp"
+ android:layout_height="wrap_content"
+ android:text="@string/enable"
+ android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/src/main/res/layout/item_scallop_options.xml b/sample/src/main/res/layout/item_scallop_options.xml
index e8d0061..f0f5948 100644
--- a/sample/src/main/res/layout/item_scallop_options.xml
+++ b/sample/src/main/res/layout/item_scallop_options.xml
@@ -1,52 +1,54 @@
-
+
+
+
+
+ android:layout_height="wrap_content"
+ android:layout_marginTop="5dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+ style="@style/Label"
+ android:text="@string/radius" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/src/main/res/values/strings.xml b/sample/src/main/res/values/strings.xml
index d3c8cfa..9c75a01 100644
--- a/sample/src/main/res/values/strings.xml
+++ b/sample/src/main/res/values/strings.xml
@@ -34,6 +34,8 @@
Corners
Example
Background
+ Color before Divider
+ Color after Divider
- Normal