-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c49c5b6
commit 2469249
Showing
15 changed files
with
230 additions
and
88 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
jdk: | ||
- openjdk11 | ||
before_install: | ||
- ./scripts/prepareJitpackEnvironment.sh |
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
7 changes: 7 additions & 0 deletions
7
spinwill/src/main/java/com/example/spinwill/adapter/WillPaintAdapter.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example.spinwill.adapter | ||
|
||
import android.graphics.Paint | ||
|
||
interface WillPaintAdapter { | ||
fun setPaintProperties(paint: Paint) | ||
} |
33 changes: 28 additions & 5 deletions
33
spinwill/src/main/java/com/example/spinwill/models/WillPaintProperties.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
package com.example.spinwill.models | ||
|
||
import android.graphics.Paint | ||
import com.example.spinwill.adapter.WillPaintAdapter | ||
|
||
data class WillPaintProperties( | ||
val archPaint: Paint = Paint(), | ||
val textPaint: Paint = Paint(), | ||
val overlayTextPaint: Paint = Paint(), | ||
val separationArchPaint: Paint = Paint(), | ||
val bitmapPaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG or Paint.DITHER_FLAG or Paint.FILTER_BITMAP_FLAG) | ||
val archPaint: Paint = Paint().apply { | ||
isAntiAlias = true | ||
isDither = true | ||
style = Paint.Style.FILL_AND_STROKE | ||
}, | ||
val textPaint: Paint = Paint().apply { | ||
isAntiAlias = true | ||
isDither = true | ||
letterSpacing = 0.1f | ||
}, | ||
val overlayTextPaint: Paint = Paint().apply { | ||
isAntiAlias = true | ||
isDither = true | ||
letterSpacing = 0.1f | ||
}, | ||
val separationArchPaint: Paint = Paint().apply { | ||
style = Paint.Style.STROKE | ||
isAntiAlias = true | ||
isDither = true | ||
}, | ||
val bitmapPaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG or Paint.DITHER_FLAG or Paint.FILTER_BITMAP_FLAG), | ||
|
||
var archPaintAdapter: WillPaintAdapter? = null, | ||
var textPaintAdapter: WillPaintAdapter? = null, | ||
var overlayTextPaintAdapter: WillPaintAdapter? = null, | ||
var separationArchPaintAdapter: WillPaintAdapter? = null, | ||
var bitmapPaintAdapter: WillPaintAdapter? = null | ||
) |
46 changes: 46 additions & 0 deletions
46
spinwill/src/main/java/com/example/spinwill/ui/SpinWillView1.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.example.spinwill.ui | ||
|
||
import android.content.Context | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.widget.FrameLayout | ||
import androidx.annotation.ColorRes | ||
import androidx.annotation.IdRes | ||
import androidx.constraintlayout.widget.ConstraintLayout | ||
import com.example.spinwill.R | ||
import com.example.spinwill.ui.adapters.WillItemUiAdapter | ||
|
||
class SpinWillView1<T> constructor( | ||
context: Context | ||
) : ConstraintLayout(context) { | ||
|
||
private lateinit var willView1: WillView1<T> | ||
|
||
init { | ||
val parentView = | ||
LayoutInflater.from(context).inflate(R.layout.layout_spinwillview1, null, false) | ||
willView1 = WillView1<T>(context, null) | ||
val parentLayout: FrameLayout = parentView.findViewById(R.id.container) | ||
parentLayout.addView(willView1) | ||
addView(parentView) | ||
postInvalidate() | ||
} | ||
|
||
fun setItems(data: List<T>) { | ||
willView1.setItems(data) | ||
willView1.invalidate() | ||
} | ||
|
||
fun setItemAdapter(willItemUiAdapter: WillItemUiAdapter<T>) { | ||
willView1.setItemAdapter(willItemUiAdapter) | ||
willView1.invalidate() | ||
} | ||
|
||
fun getWillView(): WillView1<T> { | ||
return willView1 | ||
} | ||
|
||
fun setTextColor(@IdRes color: Int) { | ||
willView1.paintProps.textPaint.color = color | ||
} | ||
} |
Oops, something went wrong.