Code Monkey home page Code Monkey logo

android-word-tracing-sdk's Introduction

Android Word Tracing SDK

Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin. It supports all kind of shapes and all language letters e.g. english, arabic, Urdu, hindi etc.

Demo

Getting Started

Step 1: Include it in your settings.gradle

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2: Include it in app gradle

	        implementation 'com.github.farimarwat:android-word-tracing-sdk:1.1'

XML Example

 <pk.farimarwat.abckids.TracingLetterView
       android:id="@+id/tlview"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       app:layout_constraintStart_toStartOf="parent"
       app:layout_constraintEnd_toEndOf="parent"
       app:layout_constraintTop_toTopOf="parent"
       
       />

Custom Attributes

Attribute Details
app:tlv_segmentfillimage Drawable image for fill while moving finger
app:tlv_segmentfillcolor Fill color while moving finger (Note: Use either fill color or image)
app:tlv_indicator Drawable png image e.g. hand indication image
app:tlv_segmentbordercolor Border color for shape
app:tlv_segmentbackgroundcolor Background color for shape
app:tlv_segmentdot Dots color on shape
app:tlv_segmentsize Segment size for shape

Kotlin Code

val width = 420
val height = 420

binding.tlview.setLetter("A",width,height)

binding.tlview.addListener(object :AbcdkidsListener{
            override fun onDotTouched(progress: Float) {
                Log.e(TAG,"Progress: ${progress}")
            }

            override fun onSegmentFinished() {
                Log.e(TAG,"Segment Finished")
            }

            override fun onTraceFinished() {
                Log.e(TAG,"Tracing completed")
            }

        })

Supported letters at the moment A, B, C, D, E, F,P, R,U

Note: Due to short time I have included limited letters. I will gradually update letters Or you have made some shapes/letters then share it with me so I include it in next release

Custom Shape/letters

If you want to build your own custom shape/letter(of any language) then you have to familiar with canvas PATH in android. It is as simple as ABC. Just create a path and use as below. For instance I want to make letter 'A' which has 3 segments:

      val path = Path()
       path.moveTo(width*0.19f,height*0.9f)
        path.lineTo(width*0.45f,height*0.08f)

        path.moveTo(width*0.46f,height*0.08f)
        path.lineTo(width*0.76f,height*0.9f)

        path.moveTo(width*0.32f,height*0.62f)
        path.lineTo(width*0.62f,height*0.62f)
		
        binding.tlview.setLetter(path)

Rules for custom shapes/letters

I have built all the letters using width and height 420,420. If you change the size then you may face unexpacted result in your shapes/letters. Another point to note that if you move finger and the fill does not hide the end then your path is wrong. So every thing is the PATH creation and do not blam the library.

android-word-tracing-sdk's People

Contributors

farimarwat avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.