Skip to content

Commit 02676c2

Browse files
committed
docs: update docs and resources to latest
1 parent 24ad39c commit 02676c2

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ To use the library you can install it from [github packages](#github-packages-in
105105
// ....
106106
dependencies {
107107
// ....
108-
implementation("com.yoimerdr.android:virtualjoystick:1.0.0")
108+
implementation("com.yoimerdr.android:virtualjoystick:x.x.x")
109109
}
110110
```
111111

@@ -114,7 +114,7 @@ To use the library you can install it from [github packages](#github-packages-in
114114
// ....
115115
dependencies {
116116
// ....
117-
implementation("com.yoimerdr.android:virtualjoystick:1.0.0")
117+
implementation("com.yoimerdr.android:virtualjoystick:x.x.x")
118118
}
119119
```
120120

@@ -130,15 +130,15 @@ To use the library you can install it from [github packages](#github-packages-in
130130
// ....
131131
dependencies {
132132
// ....
133-
implementation(files("libs/yoimerdr/android/virtualjoystick/1.0.0/virtualjoystick-1.0.0.aar"))
133+
implementation(files("libs/yoimerdr/android/virtualjoystick/x.x.x/virtualjoystick-x.x.x.aar"))
134134
}
135135
```
136136
* Groovy
137137
```gradle
138138
// ....
139139
dependencies {
140140
// ....
141-
implementation files('libs/yoimerdr/android/virtualjoystick/1.0.0/virtualjoystick-1.0.0.aar')
141+
implementation files('libs/yoimerdr/android/virtualjoystick/x.x.x/virtualjoystick-x.x.x.aar')
142142
}
143143
```
144144
You can read a litter more about how to install an aar library [here](https://developer.android.com/studio/projects/android-library#psd-add-aar-jar-dependency)
@@ -170,10 +170,25 @@ And use it.
170170
```kotlin
171171
// ....
172172
val joystick = findViewById<JoystickView>(R.id.vJoystick)
173-
joystick.setMoveListener {
174173

174+
// listener for moving
175+
joystick.setMoveStartListener { direction ->
176+
// Do something when the user starts to move (tap down) the joystick
177+
}
178+
joystick.setMoveListener { direction ->
179+
// Do something when the user moves (or hold down) the joystick
180+
}
181+
joystick.setMoveEndListener {
182+
// Do something when the user stops moving (tap up) the joystick
183+
}
184+
185+
// force the joystick to move
186+
btnExample.setOnClickListener {
187+
// to specific a direction
188+
joystick.move(Control.Direction.UP, 1f) // direction and intensity (0f to 1f)
189+
// to specific position
190+
joystick.move(200, 200)
175191
}
176-
// ....
177192
```
178193

179194
### Usage customization
@@ -186,26 +201,28 @@ If you use the JoystickView view in a layout (xml), you could place values to so
186201
* **moveInterval**
187202

188203
It is an interval (integer) of time (ms) for which passed, to consider the touch on the joystick as maintained.
189-
For now, it has a bad name, it will be changed in future versions.
190204
* **invalidRadius**
191205

192-
It is a dimension value to be taken into account when obtaining control direction.
206+
It is a dimension value to be consider a dead zone when obtaining control direction.
193207
In other words, if the distance between the touch made by the user and the center of the JoystickView does not exceed this value,
194208
the joystick direction is considered as NONE.
195209

196210
* **controlType**
197211

198-
It is an enum that determines that the already defined ControlDrawer will be used as the initial drawer of the joystick.
212+
It is an enumeration that determines that the already defined Drawer will be used as the joystick's initial setting.
199213
For now, it can be any of the following values:
200214
* arc
201215

202-
The drawer to be used will be CircleControlDrawer
216+
The drawer to be used will be CircleDrawer
203217
* arc
204218

205-
The drawer to be used will be ArcControlDrawer
219+
The drawer to be used will be ArcDrawer
206220
* circe_arc
207221

208-
The drawer to be used will be CircleArcControlDrawer
222+
The drawer to be used will be CircleArcDrawer
223+
* wedge
224+
225+
The drawer to be used will be WedgeDrawer
209226

210227
* **directionType**
211228
It is an enum that determines how many directions the joystick will be able to pass to its listener.
@@ -245,7 +262,7 @@ To see how the joystick looks like with different configurations you could clone
245262
and run the application, but if you don't want to do that, here is a video that will show you how it looks like with some configuration changes.
246263

247264
<div style="text-align: center">
248-
<img src="./sample/joystick_app.gif" height="772" alt="joystick sample app"/>
265+
<img src="./sample/joystick_demo.gif" height="772" alt="joystick sample app"/>
249266
</div>
250267

251268

sample/joystick_demo.gif

13.9 MB
Loading

virtualjoystick/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ class PathFileBuilder(first: Any) {
6262
}
6363

6464
class LibraryProperties {
65-
var compileSdk = 34
65+
var compileSdk = 35
6666
var group = "com.yoimerdr.android"
6767
var name = "virtualjoystick"
68-
var version = "2.0.0"
68+
var version = "3.0.0"
6969
var copyright = "© 2024 Yoimer Davila"
7070
var minSdk = 21
7171

0 commit comments

Comments
 (0)