This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
jobs: | |
test: | |
# ... | |
apk: | |
name: Generate APK | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#... | |
jobs: | |
test: | |
name: Unit Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- LinearLayout | |
* Orientation : Vertical | |
* Width : Match Parent | |
* Height : Match Parent | |
- ScrollView (Content) | |
* Width : Match Parent | |
* Height : 0dp | |
* Weight : 1 | |
- LinearLayout | |
* Orientation : Vertical |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="60dp" | |
android:orientation="horizontal"> | |
<com.lmwn.library.ui.CouponLayout | |
android:layout_width="80dp" | |
android:layout_height="match_parent" | |
app:coupon_backgroundColor="#007565" | |
app:coupon_borderColor="#007565" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CouponLayout : FrameLayout { | |
/* ... */ | |
override fun onDraw(canvas: Canvas?) { | |
super.onDraw(canvas) | |
canvas?.let { _ -> | |
canvas.drawPath(backgroundPath, backgroundPaint) | |
canvas.drawPath(backgroundPath, borderPaint) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CouponLayout : FrameLayout { | |
private var cornerDirection = /* ... */ | |
private var semiCircleDirection = /* ... */ | |
/* ... */ | |
private fun setupPath() { | |
val isTopRightRequired = isCornerDirectionRequired(CORNER_TOP_RIGHT) | |
val isBottomRightRequired = isCornerDirectionRequired(CORNER_BOTTOM_RIGHT) | |
val isBottomLeftRequired = isCornerDirectionRequired(CORNER_BOTTOM_LEFT) | |
val isTopLeftRequired = isCornerDirectionRequired(CORNER_TOP_LEFT) | |
val isRightRequired = isSemiCircleDirectionRequired(SEMI_CIRCLE_RIGHT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const val SEMI_CIRCLE_BOTTOM = 0x08 | |
val semiCircleDirection = 0x0A | |
val isBottomSemiCicleRequired = semiCircleDirection and SEMI_CIRCLE_BOTTOM == SEMI_CIRCLE_BOTTOM | |
// true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CouponLayout : FrameLayout { | |
/* ... */ | |
private fun setupPath() { | |
path.apply { | |
reset() | |
moveTo(/* Start point */) | |
topRightCorner (areaWidth, areaHeight, borderWidth, cornerRadius) | |
rightSemiCircle (areaWidth, areaHeight, borderWidth, semiCircleRadius) | |
bottomRightCorner (areaWidth, areaHeight, borderWidth, cornerRadius) | |
bottomSemiCircle (areaWidth, areaHeight, borderWidth, semiCircleRadius) |