diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser new file mode 100644 index 0000000..568cb21 Binary files /dev/null and b/.idea/caches/build_file_checksums.ser differ 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 @@ +