mirror of
https://github.com/Skysamara/airshot_a.git
synced 2025-12-06 06:16:05 +00:00
fix white border
This commit is contained in:
parent
2cb5a3825a
commit
930b93f91b
@ -41,7 +41,6 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
// Включаем bluetooth
|
||||
// TODO Bluetooth включается, но сообщение и иконка неправильные
|
||||
turnOnBtn.setOnClickListener {
|
||||
if (bAdapter.isEnabled) {
|
||||
// Уже включен
|
||||
|
||||
@ -22,24 +22,28 @@ class Shots {
|
||||
}
|
||||
|
||||
fun draw(canvas: Canvas?, screenWidth: Int, screenHeight: Int) {
|
||||
val paint: Paint = Paint()
|
||||
paint.apply {
|
||||
val paintWite: Paint = Paint()
|
||||
paintWite.apply {
|
||||
style = Paint.Style.FILL // стиль Заливка
|
||||
color = Color.WHITE // белая кайма вокруг
|
||||
}
|
||||
val paintBlack: Paint = Paint()
|
||||
|
||||
paintBlack.apply {
|
||||
style = Paint.Style.FILL // стиль Заливка
|
||||
color = Color.BLACK // белая кайма вокруг
|
||||
}
|
||||
|
||||
randomizeShots(screenWidth, screenHeight)
|
||||
for (shot in arrayOfShots) {
|
||||
val x = shot.x
|
||||
val y = shot.y
|
||||
var radius: Int = (screenWidth + screenHeight) / 100
|
||||
canvas!!.drawCircle(x.toFloat(), y.toFloat(), radius.toFloat(), paint)
|
||||
|
||||
paint.apply {
|
||||
color = Color.BLACK // закрашиваем холст белым цветом
|
||||
}
|
||||
var radius: Int = (screenWidth + screenHeight) / 100
|
||||
canvas!!.drawCircle(x.toFloat(), y.toFloat(), radius.toFloat(), paintWite)
|
||||
|
||||
radius = (screenWidth + screenHeight) / 120
|
||||
canvas.drawCircle(x.toFloat(), y.toFloat(), radius.toFloat(), paint)
|
||||
canvas.drawCircle(x.toFloat(), y.toFloat(), radius.toFloat(), paintBlack)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -13,18 +13,6 @@ class Target(context: Context?) : View(context) {
|
||||
private val paint: Paint = Paint()
|
||||
private val shots:Shots = Shots()
|
||||
|
||||
// override fun setOnTouchListener(l: OnTouchListener?) {
|
||||
//// super.setOnTouchListener(l)
|
||||
//// invalidate()
|
||||
// }
|
||||
//
|
||||
// override fun setOnClickListener(l: OnClickListener?) {
|
||||
//// super.setOnClickListener(l)
|
||||
//// invalidate()
|
||||
// }
|
||||
|
||||
|
||||
|
||||
override fun onDraw(canvas: Canvas?) {
|
||||
super.onDraw(canvas)
|
||||
val screenWidth: Int = getWidth()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user