Skip to content

Commit 120eecc

Browse files
Update README.md
1 parent 78ff85a commit 120eecc

File tree

8 files changed

+83
-6
lines changed

8 files changed

+83
-6
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@ using previous searches using a database, domain with ViewModel.
104104
|<h3>5-4-3 Centroid, Zoom, Pan, Rotation</h3><br/>Use AwaitPointerEventScope to calculate centroid position and size, zoom, pan, and rotation.<br><br>• AwaitPointerEventScope<br>• centroid<br>• pan<br>• zoom<br>|<img src ="/./screenshots/tutorial5_4_3.gif" width=320> |
105105
| | |
106106

107+
### Graphic
108+
109+
|Tutorial|Preview|
110+
|:-------|-------|
111+
|<h3>6-1-1 Canvas Basics 1</h3><br/>Use canvas draw basic shapes like line, circle, rectangle, and points with different attributes such as style, stroke cap, brush.<br><br>• clickable<br>• Indication<br>• rememberRipple<br>• InteractionSource<br>• pointerInput<br>• pointerInteropFilter<br>|<img src ="/./screenshots/tutorial6_1_1.gif" width=320> |
112+
| | |
113+
|<h3>6-1-2 Canvas Basics 2</h3><br/>Use canvas to draw arc, with path effect, stroke cap, stroke join, miter and other attributes and draw images with src, dst attributes.<br><br>• pointerInput<br>• pointerInteropFilter<br>• detectTapGestures<br>• detectDragGestures<br>• onPress<br>• onDoubleTap<br>|<img src ="/./screenshots/tutorial6_1_2.gif" width=320> |
114+
| | |
115+
|<h3>6-1-3 Canvas Basics 3</h3><br/>Use canvas to draw path using absolute and relative positions, adding arc to path, drawing custom paths, progress, polygons, quads, and cubic.<br><br>• pointerInput<br>• detectTransformGestures<br>• centroid<br>• pan<br>• zoom<br>|<img src ="/./screenshots/tutorial6_1_3.gif" width=320> |
116+
| | |
117+
|<h3>6-2 Blend(Porter-Duff) Modes</h3><br/>Use blend(Porter-Duff) modes to change drawing source/destination
118+
or clip based on blend mode..<br><br>• AwaitPointerEventScope<br>• PointerInputChange<br>• awaitFirstDown<br>• waitForUpOrCancellation<br>• awaitPointerEvent<br>• awaitTouchSlopOrCancellation<br>• awaitDragOrCancellation<br>|<img src ="/./screenshots/tutorial6_2.gif" width=320> |
119+
| | |
120+
121+
107122
### Resources and References
108123
[Codelab Jetpack Compose Basics](https://developer.android.com/codelabs/jetpack-compose-basics)
109124
<br>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.smarttoolfactory.tutorial1_1basics.chapter6_graphics
2+
3+
import androidx.compose.runtime.Composable
4+
5+
@Composable
6+
fun Tutorial6_4Screen1() {
7+
TutorialContent()
8+
}
9+
10+
@Composable
11+
private fun TutorialContent() {
12+
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.smarttoolfactory.tutorial1_1basics.chapter6_graphics
2+
3+
import androidx.compose.runtime.Composable
4+
5+
@Composable
6+
fun Tutorial6_4Screen2() {
7+
TutorialContent()
8+
}
9+
10+
@Composable
11+
private fun TutorialContent() {
12+
13+
}

Tutorial1-1Basics/src/main/java/com/smarttoolfactory/tutorial1_1basics/tutorial_list/TutorialList.kt

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ import com.smarttoolfactory.tutorial1_1basics.chapter2_material_widgets.*
1414
import com.smarttoolfactory.tutorial1_1basics.chapter3_layout.*
1515
import com.smarttoolfactory.tutorial1_1basics.chapter4_state.*
1616
import com.smarttoolfactory.tutorial1_1basics.chapter5_gesture.*
17-
import com.smarttoolfactory.tutorial1_1basics.chapter6_graphics.Tutorial6_1Screen1
18-
import com.smarttoolfactory.tutorial1_1basics.chapter6_graphics.Tutorial6_1Screen2
19-
import com.smarttoolfactory.tutorial1_1basics.chapter6_graphics.Tutorial6_2Screen
17+
import com.smarttoolfactory.tutorial1_1basics.chapter6_graphics.*
2018
import com.smarttoolfactory.tutorial1_1basics.model.TutorialSectionModel
2119
import com.smarttoolfactory.tutorial1_1basics.ui.GestureListColor
2220
import com.smarttoolfactory.tutorial1_1basics.ui.GraphicsListColor
@@ -970,11 +968,27 @@ fun createGraphicsTutorialList(): List<TutorialSectionModel> {
970968

971969
val tutorial6_1_2 = TutorialSectionModel(
972970
title = "6-1-2 Canvas Basics2",
973-
description = "Use canvas to draw arc, image, path with path effect, stroke cap, " +
974-
"stroke join, miter and other attributes",
971+
description = "Use canvas to draw arc, with path effect, stroke cap, " +
972+
"stroke join, miter and other attributes and draw images with src, dst attributes",
975973
action = {
976974
Tutorial6_1Screen2()
977975
},
976+
tags = listOf(
977+
TAG_COMPOSE,
978+
TAG_CANVAS,
979+
TAG_DRAW_SCOPE,
980+
TAG_PATH_EFFECT
981+
),
982+
tagColor = GraphicsListColor
983+
)
984+
985+
val tutorial6_1_3 = TutorialSectionModel(
986+
title = "6-1-3 Canvas Basics3",
987+
description = "Use canvas to draw path using absolute and relative positions, adding " +
988+
"arc to path, drawing custom paths, progress, polygons, quads, and cubic. ",
989+
action = {
990+
Tutorial6_1Screen3()
991+
},
978992
tags = listOf(
979993
TAG_COMPOSE,
980994
TAG_CANVAS,
@@ -1002,9 +1016,31 @@ fun createGraphicsTutorialList(): List<TutorialSectionModel> {
10021016
tagColor = GraphicsListColor
10031017
)
10041018

1019+
val tutorial6_4 = TutorialSectionModel(
1020+
title = "6-4-1 Draw with Touch",
1021+
description = "Draw to canvas using touch down, move and up events",
1022+
action = {
1023+
Tutorial6_4Screen1()
1024+
},
1025+
tags = listOf(
1026+
TAG_COMPOSE,
1027+
TAG_CANVAS,
1028+
TAG_DRAW_SCOPE,
1029+
TAG_PATH,
1030+
TAG_POINTER_INPUT,
1031+
TAG_AWAIT_POINTER_EVENT_SCOPE,
1032+
TAG_POINTER_INPUT_CHANGE,
1033+
TAG_AWAIT_FIRST_DOWN,
1034+
1035+
),
1036+
tagColor = GraphicsListColor
1037+
)
1038+
10051039
return listOf(
10061040
tutorial6_1_1,
10071041
tutorial6_1_2,
1008-
tutorial6_2
1042+
tutorial6_1_3,
1043+
tutorial6_2,
1044+
tutorial6_4
10091045
)
10101046
}

screenshots/tutorial6_1_1.gif

887 KB
Loading

screenshots/tutorial6_1_2.gif

828 KB
Loading

screenshots/tutorial6_1_3.gif

972 KB
Loading

screenshots/tutorial6_2.gif

2.05 MB
Loading

0 commit comments

Comments
 (0)