diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ec96dd0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+.externalNativeBuild
\ No newline at end of file
diff --git a/.gradle/2.14.1/taskArtifacts/cache.properties b/.gradle/2.14.1/taskArtifacts/cache.properties
deleted file mode 100644
index c564692..0000000
--- a/.gradle/2.14.1/taskArtifacts/cache.properties
+++ /dev/null
@@ -1 +0,0 @@
-#Fri Dec 15 09:21:54 ICT 2017
diff --git a/.gradle/2.14.1/taskArtifacts/cache.properties.lock b/.gradle/2.14.1/taskArtifacts/cache.properties.lock
deleted file mode 100644
index a8e4a71..0000000
Binary files a/.gradle/2.14.1/taskArtifacts/cache.properties.lock and /dev/null differ
diff --git a/.gradle/2.14.1/taskArtifacts/fileHashes.bin b/.gradle/2.14.1/taskArtifacts/fileHashes.bin
deleted file mode 100644
index 5c3bd9a..0000000
Binary files a/.gradle/2.14.1/taskArtifacts/fileHashes.bin and /dev/null differ
diff --git a/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin b/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin
deleted file mode 100644
index 44d4cda..0000000
Binary files a/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin and /dev/null differ
diff --git a/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin b/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin
deleted file mode 100644
index fd4ea3d..0000000
Binary files a/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin and /dev/null differ
diff --git a/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin b/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin
deleted file mode 100644
index 4b50aef..0000000
Binary files a/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin and /dev/null differ
diff --git a/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index d2da816..0000000
Binary files a/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index d354ee9..0000000
Binary files a/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index 041fd6e..0000000
Binary files a/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index 86c020e..0000000
Binary files a/.gradle/2.14.1/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index e390690..0000000
Binary files a/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index e95696c..0000000
Binary files a/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index 1de42a2..0000000
Binary files a/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index ea7a25e..0000000
Binary files a/.gradle/2.14.1/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/3.3/taskArtifacts/fileHashes.bin b/.gradle/3.3/taskArtifacts/fileHashes.bin
deleted file mode 100644
index edd6b22..0000000
Binary files a/.gradle/3.3/taskArtifacts/fileHashes.bin and /dev/null differ
diff --git a/.gradle/3.3/taskArtifacts/fileSnapshots.bin b/.gradle/3.3/taskArtifacts/fileSnapshots.bin
deleted file mode 100644
index 141efa0..0000000
Binary files a/.gradle/3.3/taskArtifacts/fileSnapshots.bin and /dev/null differ
diff --git a/.gradle/3.3/taskArtifacts/taskArtifacts.bin b/.gradle/3.3/taskArtifacts/taskArtifacts.bin
deleted file mode 100644
index f9da3e0..0000000
Binary files a/.gradle/3.3/taskArtifacts/taskArtifacts.bin and /dev/null differ
diff --git a/.gradle/3.3/taskArtifacts/taskArtifacts.lock b/.gradle/3.3/taskArtifacts/taskArtifacts.lock
deleted file mode 100644
index b7735cf..0000000
Binary files a/.gradle/3.3/taskArtifacts/taskArtifacts.lock and /dev/null differ
diff --git a/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index d827246..0000000
Binary files a/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index ecbd492..0000000
Binary files a/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index 24f3c3d..0000000
Binary files a/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index c85989e..0000000
Binary files a/.gradle/3.3/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index 7fd3e4c..0000000
Binary files a/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index 87262d2..0000000
Binary files a/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index 41f7b25..0000000
Binary files a/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index 2538dca..0000000
Binary files a/.gradle/3.3/tasks/_ultimatetablayout_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/4.1/fileChanges/last-build.bin b/.gradle/4.1/fileChanges/last-build.bin
deleted file mode 100644
index f76dd23..0000000
Binary files a/.gradle/4.1/fileChanges/last-build.bin and /dev/null differ
diff --git a/.gradle/4.1/fileContent/fileContent.lock b/.gradle/4.1/fileContent/fileContent.lock
deleted file mode 100644
index 9196622..0000000
Binary files a/.gradle/4.1/fileContent/fileContent.lock and /dev/null differ
diff --git a/.gradle/4.1/fileHashes/fileHashes.bin b/.gradle/4.1/fileHashes/fileHashes.bin
deleted file mode 100644
index 7b761e0..0000000
Binary files a/.gradle/4.1/fileHashes/fileHashes.bin and /dev/null differ
diff --git a/.gradle/4.1/fileHashes/fileHashes.lock b/.gradle/4.1/fileHashes/fileHashes.lock
deleted file mode 100644
index a93a5a7..0000000
Binary files a/.gradle/4.1/fileHashes/fileHashes.lock and /dev/null differ
diff --git a/.gradle/4.1/fileHashes/resourceHashesCache.bin b/.gradle/4.1/fileHashes/resourceHashesCache.bin
deleted file mode 100644
index 1f660a0..0000000
Binary files a/.gradle/4.1/fileHashes/resourceHashesCache.bin and /dev/null differ
diff --git a/.gradle/4.1/javaCompile/classAnalysis.bin b/.gradle/4.1/javaCompile/classAnalysis.bin
deleted file mode 100644
index 8cb78b7..0000000
Binary files a/.gradle/4.1/javaCompile/classAnalysis.bin and /dev/null differ
diff --git a/.gradle/4.1/javaCompile/jarAnalysis.bin b/.gradle/4.1/javaCompile/jarAnalysis.bin
deleted file mode 100644
index 5b463eb..0000000
Binary files a/.gradle/4.1/javaCompile/jarAnalysis.bin and /dev/null differ
diff --git a/.gradle/4.1/javaCompile/javaCompile.lock b/.gradle/4.1/javaCompile/javaCompile.lock
deleted file mode 100644
index 288e3d1..0000000
Binary files a/.gradle/4.1/javaCompile/javaCompile.lock and /dev/null differ
diff --git a/.gradle/4.1/javaCompile/taskHistory.bin b/.gradle/4.1/javaCompile/taskHistory.bin
deleted file mode 100644
index 50c4543..0000000
Binary files a/.gradle/4.1/javaCompile/taskHistory.bin and /dev/null differ
diff --git a/.gradle/4.1/javaCompile/taskJars.bin b/.gradle/4.1/javaCompile/taskJars.bin
deleted file mode 100644
index 2c5ea7d..0000000
Binary files a/.gradle/4.1/javaCompile/taskJars.bin and /dev/null differ
diff --git a/.gradle/4.1/taskHistory/fileSnapshots.bin b/.gradle/4.1/taskHistory/fileSnapshots.bin
deleted file mode 100644
index 4cdd4ed..0000000
Binary files a/.gradle/4.1/taskHistory/fileSnapshots.bin and /dev/null differ
diff --git a/.gradle/4.1/taskHistory/taskHistory.bin b/.gradle/4.1/taskHistory/taskHistory.bin
deleted file mode 100644
index 96f7b90..0000000
Binary files a/.gradle/4.1/taskHistory/taskHistory.bin and /dev/null differ
diff --git a/.gradle/4.1/taskHistory/taskHistory.lock b/.gradle/4.1/taskHistory/taskHistory.lock
deleted file mode 100644
index d3c7eec..0000000
Binary files a/.gradle/4.1/taskHistory/taskHistory.lock and /dev/null differ
diff --git a/.gradle/buildOutputCleanup/built.bin b/.gradle/buildOutputCleanup/built.bin
deleted file mode 100644
index e69de29..0000000
diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties
deleted file mode 100644
index 0a90fee..0000000
--- a/.gradle/buildOutputCleanup/cache.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-#Thu Dec 14 13:41:12 ICT 2017
-gradle.version=4.1
diff --git a/.gradle/buildOutputCleanup/cache.properties.lock b/.gradle/buildOutputCleanup/cache.properties.lock
deleted file mode 100644
index 40fdece..0000000
--- a/.gradle/buildOutputCleanup/cache.properties.lock
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_animated_vector_drawable_25_3_1.xml b/.idea/libraries/com_android_support_animated_vector_drawable_25_3_1.xml
deleted file mode 100644
index 676b5de..0000000
--- a/.idea/libraries/com_android_support_animated_vector_drawable_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_appcompat_v7_25_3_1.xml b/.idea/libraries/com_android_support_appcompat_v7_25_3_1.xml
deleted file mode 100644
index c012bbd..0000000
--- a/.idea/libraries/com_android_support_appcompat_v7_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_constraint_constraint_layout_1_0_2.xml b/.idea/libraries/com_android_support_constraint_constraint_layout_1_0_2.xml
deleted file mode 100644
index 76fa359..0000000
--- a/.idea/libraries/com_android_support_constraint_constraint_layout_1_0_2.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_constraint_constraint_layout_solver_1_0_2_jar.xml b/.idea/libraries/com_android_support_constraint_constraint_layout_solver_1_0_2_jar.xml
deleted file mode 100644
index 2e7dc57..0000000
--- a/.idea/libraries/com_android_support_constraint_constraint_layout_solver_1_0_2_jar.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_support_annotations_25_3_1_jar.xml b/.idea/libraries/com_android_support_support_annotations_25_3_1_jar.xml
deleted file mode 100644
index 4eaaa2a..0000000
--- a/.idea/libraries/com_android_support_support_annotations_25_3_1_jar.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_support_compat_25_3_1.xml b/.idea/libraries/com_android_support_support_compat_25_3_1.xml
deleted file mode 100644
index 9896aec..0000000
--- a/.idea/libraries/com_android_support_support_compat_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_support_core_ui_25_3_1.xml b/.idea/libraries/com_android_support_support_core_ui_25_3_1.xml
deleted file mode 100644
index dec14ba..0000000
--- a/.idea/libraries/com_android_support_support_core_ui_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_support_core_utils_25_3_1.xml b/.idea/libraries/com_android_support_support_core_utils_25_3_1.xml
deleted file mode 100644
index 62b8693..0000000
--- a/.idea/libraries/com_android_support_support_core_utils_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_support_fragment_25_3_1.xml b/.idea/libraries/com_android_support_support_fragment_25_3_1.xml
deleted file mode 100644
index f7ea12f..0000000
--- a/.idea/libraries/com_android_support_support_fragment_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_support_media_compat_25_3_1.xml b/.idea/libraries/com_android_support_support_media_compat_25_3_1.xml
deleted file mode 100644
index f02c8e3..0000000
--- a/.idea/libraries/com_android_support_support_media_compat_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_support_v4_25_3_1.xml b/.idea/libraries/com_android_support_support_v4_25_3_1.xml
deleted file mode 100644
index c6ff8cb..0000000
--- a/.idea/libraries/com_android_support_support_v4_25_3_1.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_support_vector_drawable_25_3_1.xml b/.idea/libraries/com_android_support_support_vector_drawable_25_3_1.xml
deleted file mode 100644
index 85fd463..0000000
--- a/.idea/libraries/com_android_support_support_vector_drawable_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_test_espresso_espresso_core_2_2_2.xml b/.idea/libraries/com_android_support_test_espresso_espresso_core_2_2_2.xml
deleted file mode 100644
index 4df8ddf..0000000
--- a/.idea/libraries/com_android_support_test_espresso_espresso_core_2_2_2.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_test_espresso_espresso_idling_resource_2_2_2.xml b/.idea/libraries/com_android_support_test_espresso_espresso_idling_resource_2_2_2.xml
deleted file mode 100644
index 11011a8..0000000
--- a/.idea/libraries/com_android_support_test_espresso_espresso_idling_resource_2_2_2.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_test_exposed_instrumentation_api_publish_0_5.xml b/.idea/libraries/com_android_support_test_exposed_instrumentation_api_publish_0_5.xml
deleted file mode 100644
index 778a244..0000000
--- a/.idea/libraries/com_android_support_test_exposed_instrumentation_api_publish_0_5.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_test_rules_0_5.xml b/.idea/libraries/com_android_support_test_rules_0_5.xml
deleted file mode 100644
index a6f807c..0000000
--- a/.idea/libraries/com_android_support_test_rules_0_5.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_android_support_test_runner_0_5.xml b/.idea/libraries/com_android_support_test_runner_0_5.xml
deleted file mode 100644
index 91cf943..0000000
--- a/.idea/libraries/com_android_support_test_runner_0_5.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_google_code_findbugs_jsr305_2_0_1_jar.xml b/.idea/libraries/com_google_code_findbugs_jsr305_2_0_1_jar.xml
deleted file mode 100644
index 6343119..0000000
--- a/.idea/libraries/com_google_code_findbugs_jsr305_2_0_1_jar.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/com_squareup_javawriter_2_1_1_jar.xml b/.idea/libraries/com_squareup_javawriter_2_1_1_jar.xml
deleted file mode 100644
index cdb8c22..0000000
--- a/.idea/libraries/com_squareup_javawriter_2_1_1_jar.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/javax_annotation_javax_annotation_api_1_2_jar.xml b/.idea/libraries/javax_annotation_javax_annotation_api_1_2_jar.xml
deleted file mode 100644
index 1e0af3e..0000000
--- a/.idea/libraries/javax_annotation_javax_annotation_api_1_2_jar.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/javax_inject_javax_inject_1_jar.xml b/.idea/libraries/javax_inject_javax_inject_1_jar.xml
deleted file mode 100644
index b028368..0000000
--- a/.idea/libraries/javax_inject_javax_inject_1_jar.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/junit_junit_4_12_jar.xml b/.idea/libraries/junit_junit_4_12_jar.xml
deleted file mode 100644
index a026090..0000000
--- a/.idea/libraries/junit_junit_4_12_jar.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/org_hamcrest_hamcrest_core_1_3_jar.xml b/.idea/libraries/org_hamcrest_hamcrest_core_1_3_jar.xml
deleted file mode 100644
index 8bc8974..0000000
--- a/.idea/libraries/org_hamcrest_hamcrest_core_1_3_jar.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/org_hamcrest_hamcrest_integration_1_3_jar.xml b/.idea/libraries/org_hamcrest_hamcrest_integration_1_3_jar.xml
deleted file mode 100644
index 6fd1927..0000000
--- a/.idea/libraries/org_hamcrest_hamcrest_integration_1_3_jar.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/org_hamcrest_hamcrest_library_1_3_jar.xml b/.idea/libraries/org_hamcrest_hamcrest_library_1_3_jar.xml
deleted file mode 100644
index 5225e0e..0000000
--- a/.idea/libraries/org_hamcrest_hamcrest_library_1_3_jar.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index d0a3f9b..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,3801 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DEFAULT_WIDTH_UNDER_LINE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1503885173801
-
-
- 1503885173801
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 1dd169d..5498d8d 100644
--- a/README.md
+++ b/README.md
@@ -87,26 +87,27 @@ To use this UltimateTabLayout in your layout simply copy and paste the xml below
There are several other attributes that can be used to configure color text, icon, background tab, size.
-| Attrrs | | type | option |
-| --------------------|:-------------------------:|---------|--------------------------------------------------|
-| tab_style | style of tab layout |enum |sliding or fixed |
-| tab_text_size | size of text |float | |
-| tab_text_color | color of text |reference| |
-| tab_under_line_show | visible of under line |boolean | |
-| tab_under_line_color| color of under line |color | |
-| tab_width | width of each tab |dimension| |
-| tab_height | height of each tab |dimension| |
-| tab_padding_top | padding top in tab |dimension| |
-| tab_padding_bottom | padding bottom in tab |dimension| |
-| tab_padding_left | padding left in tab |dimension| |
-|tab_padding_righ | padding right in tab |dimension| |
-|tab_width_icon | width of icon |dimension| |
-|tab_height_icon | height of icon |dimension| |
-|tab_position_icon | posistion of icon for text|enum |icon_left or icon_right or icon_top or icon_bottom|
-|tab_padding_icon | padding icon for text |dimension| |
-|tab_orientation | orientation of each tab |enum |vertical or horizontal |
-|tab_height_under_line| height of under line |dimension|update version 1.2.3 |
-|tab_resource_font | assets from resource' font|string |update version 1.2.4 |
+| Attrrs | | type | option |
+| --------------------|:-------------------------:|---------|--------------------------------------------------------|
+| tab_style | style of tab layout |enum |sliding or fixed |
+| tab_text_size | size of text |float | |
+| tab_text_color | color of text |reference| |
+| tab_under_line_show | visible of under line |boolean | |
+| tab_under_line_color| color of under line |color | |
+| tab_width | width of each tab |dimension| |
+| tab_height | height of each tab |dimension| |
+| tab_padding_top | padding top in tab |dimension| |
+| tab_padding_bottom | padding bottom in tab |dimension| |
+| tab_padding_left | padding left in tab |dimension| |
+|tab_padding_righ | padding right in tab |dimension| |
+|tab_width_icon | width of icon |dimension| |
+|tab_height_icon | height of icon |dimension| |
+|tab_position_icon | posistion of icon for text|enum |icon_left or icon_right or icon_top or icon_bottom |
+|tab_padding_icon | padding icon for text |dimension| |
+|tab_orientation | orientation of each tab |enum |vertical or horizontal |
+|tab_height_under_line| height of under line |dimension|update version 1.2.3 |
+|tab_resource_font | assets from resource' font|string |update version 1.2.4 |
+|tab_background | tabs background |drawable |update version 1.2.6? (see activity_main_with_backgroud)|
* Tip: only use for style's fixed.
If you want to auto align, you will tab_width = "0dp" with tab_orientation = "horizontal"
or tab_height = "0dp" with tab_orientation = "vertical"
diff --git a/app/src/main/res/layout/activity_main_vertical.xml b/app/src/main/res/layout/activity_main_vertical.xml
new file mode 100644
index 0000000..d94e58c
--- /dev/null
+++ b/app/src/main/res/layout/activity_main_vertical.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main_with_background.xml b/app/src/main/res/layout/activity_main_with_background.xml
new file mode 100644
index 0000000..53c5839
--- /dev/null
+++ b/app/src/main/res/layout/activity_main_with_background.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/generated/mockable-android-25.jar b/build/generated/mockable-android-25.jar
deleted file mode 100644
index 18985c8..0000000
Binary files a/build/generated/mockable-android-25.jar and /dev/null differ
diff --git a/build/intermediates/dex-cache/cache.xml b/build/intermediates/dex-cache/cache.xml
deleted file mode 100644
index 828d14a..0000000
--- a/build/intermediates/dex-cache/cache.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
diff --git a/local.properties b/local.properties
deleted file mode 100644
index 3bbd52d..0000000
--- a/local.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-## This file is automatically generated by Android Studio.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must *NOT* be checked into Version Control Systems,
-# as it contains information specific to your local configuration.
-#
-# Location of the SDK. This is only used by Gradle.
-# For customization when using a Version Control System, please read the
-# header note.
-#Mon Aug 28 08:52:53 ICT 2017
-sdk.dir=/Users/tranquanghung/Library/Android/sdk
diff --git a/ultimatetablayout/build.gradle b/ultimatetablayout/build.gradle
index 61945f6..fb3266e 100644
--- a/ultimatetablayout/build.gradle
+++ b/ultimatetablayout/build.gradle
@@ -27,5 +27,6 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
+ compile 'com.android.support:support-annotations:25.3.1'
testCompile 'junit:junit:4.12'
}
diff --git a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/FixTabView.java b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/FixTabView.java
index e8d93ca..c39b520 100644
--- a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/FixTabView.java
+++ b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/FixTabView.java
@@ -80,8 +80,43 @@ public void onPageScrollStateChanged(int state) {
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
+ if(tabModel.isTabUnderLineShow()){
+ if(tabModel.getTabOrientation() == UltimateTabLayout.VERTICAL){
+ drawVerticalUnderline(canvas);
+ }else {
+ drawHorizontalUnderline(canvas);
+ }
+ }
+
+ }
+
+ protected void drawVerticalUnderline(Canvas canvas){
+ try{
+ int count = getChildCount();
+
+ View currentChildView = getChildAt(current);
+
+ float top = currentChildView.getTop();
+ float bottom = currentChildView.getBottom();
+ float left = currentChildView.getLeft();
+ float right = currentChildView.getRight();
+ int width = currentChildView.getWidth();
+ int height = currentChildView.getHeight();
+
+ if(positionOffSet > 0 && current < count - 1){
+ final float nextTabTop = top + height;
+ top = positionOffSet * nextTabTop + (1f - positionOffSet) * top;
+ bottom = top + height;
+ }
+
+ canvas.drawRect(left + width - tabModel.getTabHeightUnderLine(), top, left + right, bottom, mPaintUnderLine);
+ }catch (NullPointerException e){
+ e.printStackTrace();
+ }
+ }
+
+ protected void drawHorizontalUnderline(Canvas canvas){
try {
- if (!tabModel.isTabUnderLineShow() || tabModel.getTabOrientation() == UltimateTabLayout.VERTICAL) return;
int count = getChildCount();
View currentChildView = getChildAt(current);
@@ -91,7 +126,6 @@ protected void onDraw(Canvas canvas) {
int width = currentChildView.getWidth();
int height = currentChildView.getHeight();
-// Log.e("TAG", "Left: " + left + "/right: " + right + "/width: " + width + "/height: " + height);
if (positionOffSet > 0f && current < count - 1) {
final float nextTabLeft = left + width;
left = positionOffSet * nextTabLeft + (1f - positionOffSet) * left;
@@ -102,7 +136,6 @@ protected void onDraw(Canvas canvas) {
} catch (NullPointerException e){
e.printStackTrace();
}
-
}
public void setViewPager(final ViewPager viewPager, IFTabAdapter tabAdapterIF){
@@ -137,6 +170,7 @@ public void setViewPager(final ViewPager viewPager, IFTabAdapter tabAdapterIF){
tabView.setHeight((int)tabModel.getTabHeight());
tabView.setWidth((int)tabModel.getTabWidth());
tabView.setTabResourceFont(tabModel.getTabResourceFont());
+ tabView.setTabBackground(tabModel.getTabBackground());
tabView.setCurrentPos(i);
tabView.setOnClickTabListener(new OnClickTabListener() {
@Override
diff --git a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/HorizontalSlingTabView.java b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/HorizontalSlingTabView.java
index 76982b7..7ec266a 100644
--- a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/HorizontalSlingTabView.java
+++ b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/HorizontalSlingTabView.java
@@ -108,8 +108,14 @@ public void onPageScrollStateChanged(int state) {
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
+ if(tabModel.isTabUnderLineShow()){
+ drawHorizontalUnderline(canvas);
+ }
+
+ }
+
+ protected void drawHorizontalUnderline(Canvas canvas){
try {
- if (!tabModel.isTabUnderLineShow()) return;
int count = containerView.getChildCount();
View currentChildView = containerView.getChildAt(current);
@@ -119,7 +125,6 @@ protected void onDraw(Canvas canvas) {
int width = currentChildView.getWidth();
int height = currentChildView.getHeight();
-// Log.e("TAG", "Left: " + left + "/right: " + right + "/width: " + width + "/height: " + height);
if (positionOffSet > 0f && current < count - 1) {
final float nextTabLeft = left + width;
left = positionOffSet * nextTabLeft + (1f - positionOffSet) * left;
@@ -130,7 +135,6 @@ protected void onDraw(Canvas canvas) {
} catch (NullPointerException e){
e.printStackTrace();
}
-
}
public void setViewPager(final ViewPager viewPager, IFTabAdapter tabAdapterIF){
@@ -156,6 +160,7 @@ public void setViewPager(final ViewPager viewPager, IFTabAdapter tabAdapterIF){
tabView.setHeight(tabModel.getTabHeight());
tabView.setWidth(tabModel.getTabWidth());
tabView.setTabResourceFont(tabModel.getTabResourceFont());
+ tabView.setTabBackground(tabModel.getTabBackground());
tabView.setCurrentPos(i);
tabView.setOnClickTabListener(new OnClickTabListener() {
@Override
diff --git a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/TabModel.java b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/TabModel.java
index 6d79764..368a2ef 100644
--- a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/TabModel.java
+++ b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/TabModel.java
@@ -30,6 +30,8 @@ public class TabModel {
private String tabResourceFont; // update version 1.2.4
+ private int tabBackground;
+
public TabModel(Builder builder){
this.tabTextSize = builder.tabTextSize;
this.tabTextColor = builder.tabTextColor;
@@ -54,6 +56,8 @@ public TabModel(Builder builder){
this.tabOrientation = builder.tabOrientation;
this.tabResourceFont = builder.tabResourceFont;
+
+ this.tabBackground = builder.tabBackground;
}
public static class Builder {
@@ -81,6 +85,8 @@ public static class Builder {
private String tabResourceFont; // update version 1.2.4
+ private int tabBackground;
+
public Builder(boolean tabUnderLineShow, int tabHeightUnderLine, int tabOrientation) {
this.tabUnderLineShow = tabUnderLineShow;
this.tabHeightUnderLine = tabHeightUnderLine;
@@ -152,6 +158,11 @@ public Builder setTabResourceFont(String tabResourceFont) {
return this;
}
+ public Builder setTabBackground(int tabBackground){
+ this.tabBackground = tabBackground;
+ return this;
+ }
+
public TabModel build(){
return new TabModel(this);
}
@@ -218,6 +229,10 @@ public int getTabOrientation() {
return tabOrientation;
}
+ public int getTabBackground(){
+ return tabBackground;
+ }
+
public String getTabResourceFont() {
return tabResourceFont;
}
diff --git a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/TabView.java b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/TabView.java
index 20f87ff..fe603d4 100644
--- a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/TabView.java
+++ b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/TabView.java
@@ -59,6 +59,9 @@ public class TabView extends LinearLayout implements View.OnClickListener {
private String tabResourceFont;
+ @DrawableRes
+ private int tabBackground;
+
private int currentPos;
private OnClickTabListener onClickTabListener;
@@ -120,6 +123,10 @@ public void init(Context context){
}
}
+ if(tabBackground != 0){
+ setBackgroundResource(tabBackground);
+ }
+
switch (positionIcon){
case 0:
@@ -238,6 +245,10 @@ public void setTabResourceFont(String tabResourceFont) {
this.tabResourceFont = tabResourceFont;
}
+ public void setTabBackground(int tabBackground){
+ this.tabBackground = tabBackground;
+ }
+
public void setOnClickTabListener(OnClickTabListener onClickTabListener) {
this.onClickTabListener = onClickTabListener;
}
diff --git a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/UltimateTabLayout.java b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/UltimateTabLayout.java
index 49b954e..705baf6 100644
--- a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/UltimateTabLayout.java
+++ b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/UltimateTabLayout.java
@@ -55,6 +55,8 @@ public class UltimateTabLayout extends FrameLayout {
private String tabResourceFont; // update version 1.2.4
+ private int tabBackground;
+
private Paint mPaintUnderLine;
private Context context;
@@ -105,6 +107,8 @@ private void init(Context context, AttributeSet attrs, int def){
tabResourceFont = ta.getString(R.styleable.UltimateTabLayout_tab_resource_font);
+ tabBackground = ta.getResourceId(R.styleable.UltimateTabLayout_tab_background, 0);
+
mPaintUnderLine = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaintUnderLine.setColor(tabUnderLineColor);
@@ -128,6 +132,7 @@ public void setViewPager(final ViewPager viewPager, IFTabAdapter tabAdapterIF){
.setTabTextColor(tabTextColor)
.setTabTextSize(tabTextSize)
.setTabResourceFont(tabResourceFont)
+ .setTabBackground(tabBackground)
.build();
@@ -230,4 +235,8 @@ public void setHeightUnderLine(float heightUnderLine) {
public void setTabResourceFont(String tabResourceFont) {
this.tabResourceFont = tabResourceFont;
}
+
+ public void setTabBackground(int tabBackground) {
+ this.tabBackground = tabBackground;
+ }
}
diff --git a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/VerticalSlingTabView.java b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/VerticalSlingTabView.java
index ebc1bf3..5f67e64 100644
--- a/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/VerticalSlingTabView.java
+++ b/ultimatetablayout/src/main/java/com/athbk/ultimatetablayout/VerticalSlingTabView.java
@@ -95,29 +95,34 @@ public void onPageScrollStateChanged(int state) {
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
- try {
- if (!tabModel.isTabUnderLineShow() || tabModel.getTabOrientation() == UltimateTabLayout.VERTICAL) return;
+ if(tabModel.isTabUnderLineShow()){
+ drawVerticalUnderline(canvas);
+ }
+ }
+
+ protected void drawVerticalUnderline(Canvas canvas){
+ try{
int count = containerView.getChildCount();
View currentChildView = containerView.getChildAt(current);
+ float top = currentChildView.getTop();
+ float bottom = currentChildView.getBottom();
float left = currentChildView.getLeft();
float right = currentChildView.getRight();
int width = currentChildView.getWidth();
int height = currentChildView.getHeight();
-// Log.e("TAG", "Left: " + left + "/right: " + right + "/width: " + width + "/height: " + height);
- if (positionOffSet > 0f && current < count - 1) {
- final float nextTabLeft = left + width;
- left = positionOffSet * nextTabLeft + (1f - positionOffSet) * left;
- right = left + width;
+ if(positionOffSet > 0 && current < count - 1){
+ final float nextTabTop = top + height;
+ top = positionOffSet * nextTabTop + (1f - positionOffSet) * top;
+ bottom = top + height;
}
- canvas.drawRect(left, height - tabModel.getTabHeightUnderLine(), right, height, mPaintUnderLine);
- } catch (NullPointerException e){
+ canvas.drawRect(left + width - tabModel.getTabHeightUnderLine(), top, left + right, bottom, mPaintUnderLine);
+ }catch (NullPointerException e){
e.printStackTrace();
}
-
}
public void setViewPager(final ViewPager viewPager, IFTabAdapter tabAdapterIF){
@@ -150,6 +155,7 @@ public void setViewPager(final ViewPager viewPager, IFTabAdapter tabAdapterIF){
tabView.setHeight(tabModel.getTabHeight());
tabView.setWidth(tabModel.getTabWidth());
tabView.setTabResourceFont(tabModel.getTabResourceFont());
+ tabView.setTabBackground(tabModel.getTabBackground());
tabView.setCurrentPos(i);
tabView.setOnClickTabListener(new OnClickTabListener() {
@Override
diff --git a/ultimatetablayout/src/main/res/values/attrs.xml b/ultimatetablayout/src/main/res/values/attrs.xml
index ee18a46..325d47e 100644
--- a/ultimatetablayout/src/main/res/values/attrs.xml
+++ b/ultimatetablayout/src/main/res/values/attrs.xml
@@ -38,5 +38,6 @@
+
\ No newline at end of file
diff --git a/ultimatetablayout/ultimatetablayout.iml b/ultimatetablayout/ultimatetablayout.iml
index a89de05..a4b197d 100644
--- a/ultimatetablayout/ultimatetablayout.iml
+++ b/ultimatetablayout/ultimatetablayout.iml
@@ -63,13 +63,6 @@
-
-
-
-
-
-
-
@@ -77,6 +70,13 @@
+
+
+
+
+
+
+