Skip to content

Instantly share code, notes, and snippets.

View akexorcist's full-sized avatar
🔥

Akexorcist akexorcist

🔥
View GitHub Profile
@akexorcist
akexorcist / android.yml
Last active April 3, 2021 20:33
Android CI Workflow for GitHub Actions - Build APK for UI Test
# ...
jobs:
test:
# ...
apk:
name: Generate APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@akexorcist
akexorcist / android.yml
Created April 3, 2021 20:06
Android CI Workflow for GitHub Actions - Unit Test Job
#...
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:
@akexorcist
akexorcist / android.yml
Created April 3, 2021 19:42
Android CI Workflow for GitHub Actions - Initial
name: Android CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
@akexorcist
akexorcist / android.yml
Created April 1, 2021 03:38
Android CI + FIrebase Test Labs
name: Android CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
- LinearLayout
* Orientation : Vertical
* Width : Match Parent
* Height : Match Parent
- ScrollView (Content)
* Width : Match Parent
* Height : 0dp
* Weight : 1
- LinearLayout
* Orientation : Vertical
@akexorcist
akexorcist / coupon_section.xml
Created January 21, 2021 19:42
Build Coupon UI - Implementation
<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"
@akexorcist
akexorcist / CouponLayout.kt
Created January 21, 2021 19:21
Build Coupon UI - Draw the UI with Canvas
class CouponLayout : FrameLayout {
/* ... */
override fun onDraw(canvas: Canvas?) {
super.onDraw(canvas)
canvas?.let { _ ->
canvas.drawPath(backgroundPath, backgroundPaint)
canvas.drawPath(backgroundPath, borderPaint)
}
}
}
@akexorcist
akexorcist / CouponLayout.kt
Last active January 21, 2021 19:15
Build Coupon UI - Create corner and semi circle with condition
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)
@akexorcist
akexorcist / DirectionChecking.kt
Last active January 21, 2021 19:03
Build Coupon UI - Flag direction checking
const val SEMI_CIRCLE_BOTTOM = 0x08
val semiCircleDirection = 0x0A
val isBottomSemiCicleRequired = semiCircleDirection and SEMI_CIRCLE_BOTTOM == SEMI_CIRCLE_BOTTOM
// true
@akexorcist
akexorcist / CouponLayout.kt
Last active January 21, 2021 19:13
Build Coupon UI - Setup path
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)