From 03c9867515449d46c06b1377739b2dfa429d61cb Mon Sep 17 00:00:00 2001 From: Avishkar21 Date: Thu, 14 Jan 2021 20:41:35 +0530 Subject: [PATCH] Added font family implementation for inner text --- .idea/caches/build_file_checksums.ser | Bin 0 -> 582 bytes .idea/codeStyles/Project.xml | 134 ++++++++++++++++++ .idea/jarRepositories.xml | 30 ++++ .../java/com/ebanx/swipebtn/SwipeButton.java | 5 + swipe-button/src/main/res/values/attrs.xml | 1 + 5 files changed, 170 insertions(+) create mode 100644 .idea/caches/build_file_checksums.ser create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/jarRepositories.xml diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser new file mode 100644 index 0000000000000000000000000000000000000000..568cb218eb180ff12e7f15dc3467c18af04c2950 GIT binary patch literal 582 zcmZ4UmVvdnh`~NNKUXg?FQq6yGexf?KR>5fFEb@IQ7^qHF(oHeub?PDD>b=9F91S2 zm1gFoxMk*~I%lLNXBU^|7Q2L-Ts|(GuF1r}nf0c10S0MB)~iKa}e<;rAO_ViBNt5L!r zuV0j(U!o7yrjH1dg4Cjt%+%u2LWVj9Hjv&cvOPEZ88)%JY~Y;n=7&>V2?I|OD6C*M z!W9N|GP9;LoH=63^Jtr$zg=4igJf}eWtyre&Bi| gbsf;?#DW4G?s(qXy{D}7xS$2YH<#0D^DkBa05`VBdH?_b literal 0 HcmV?d00001 diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..0d15693 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..e34606c --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java b/swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java index d8f45b2..a35a7a3 100644 --- a/swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java +++ b/swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java @@ -10,7 +10,9 @@ import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.drawable.Drawable; +import android.os.Build; import android.support.annotation.NonNull; +import android.support.annotation.RequiresApi; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.Gravity; @@ -139,6 +141,7 @@ public void setHasActivationState(boolean hasActivationState) { this.hasActivationState = hasActivationState; } + @RequiresApi(api = Build.VERSION_CODES.O) private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { hasActivationState = true; @@ -205,6 +208,8 @@ private void init(Context context, AttributeSet attrs, int defStyleAttr, int def centerText.setTextColor(typedArray.getColor(R.styleable.SwipeButton_inner_text_color, Color.WHITE)); + centerText.setTypeface(typedArray.getFont(R.styleable.SwipeButton_inner_text_font_family)); //adding font family up above API 26 + float textSize = DimentionUtils.converPixelsToSp( typedArray.getDimension(R.styleable.SwipeButton_inner_text_size, 0), context); diff --git a/swipe-button/src/main/res/values/attrs.xml b/swipe-button/src/main/res/values/attrs.xml index ecd20f7..82c02bd 100644 --- a/swipe-button/src/main/res/values/attrs.xml +++ b/swipe-button/src/main/res/values/attrs.xml @@ -21,6 +21,7 @@ +