Code Monkey home page Code Monkey logo

tajweedparser's Introduction

TajweedParser

Tajweed Quran Parser for Android bassed on quran-tajweed

Deprecated

This library deprecated is in favor of QuranX, and no longer maintained please migrate to TajweedProcessor of QuranX.

Setup

Step 1

add to your project build.gradle at the end of repositories

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

Step 2

add the dependency to the build.gradle app module:

implementation 'com.github.vipafattal:TajweedParser:1.0.1'

Usage

The library is based on https://alquran.cloud/api, on edition quran-tajweed.Once you have quran-tajweed inside the app you can call TajweedHelper.getStyledAyah(Aya.text) to return a Spannable text. Use TextView widgets with Spannable text.

val ayaTextView: TextView = findViewById(R.id.ayahText)
ayaTextView.text = TajweedHelper.getStyledAyah(aya.text)

You can also change the colors by creating a class of MetaColors and overriding the color properties:

val metaColors = MetaColors(hsl = "#FF6200EE", ikhafa = "#D50000")
TajweedHelper.setTajweedMetasColor(metaColors)

then use setTajweedMetasColor(MetaColors) to force library to use your custom colors.

TajweedHelper.setTajweedMetasColor(customMetaColors)

Full Example

See the app module for full example.

You can also download the apk from this link.

Styles

This table of the Tajweed metas of the quran-tajweed (obtained from link):

The Library Functionality

This library takes the output of the Tajweed edition, and creates a Spannalbe Android Widget friendly text. It uses the table below to parse what the API returns and converts it to something you can use with TextViews widgets.

Type Identifier Colour Variable Name Description
hamza-wasl [h #AAAAAA hsl Hamzat ul Wasl
silent [s #AAAAAA hsl Silent
laam-shamsiyah [l #AAAAAA hsl Lam Shamsiyyah
madda-normal [n #537FFF madda_normal Normal Prolongation: 2 Vowels
madda-permissible [p #4050FF madda_permissible Permissible Prolongation: 2, 4, 6 Vowels
madda-necesssary [m #000EBC madda_necessary Necessary Prolongation: 6 Vowels
qalaqah [q #DD0008 qlq Qalaqah
madda-obligatory [o #2144C1 madda_pbligatory Obligatory Prolongation: 4-5 Vowels
ikhafa-shafawi [c #D500B7 ikhf_shfw Ikhafa' Shafawi - With Meem
ikhafa [f #9400A8 ikhf Ikhafa'
idgham-shafawi [w #58B800 idghm_shfw Idgham Shafawi - With Meem
iqlab [i #26BFFD iqlb Iqlab
idgham-without-ghunnah [a #169777 idgh_ghn Idgham - With Ghunnah
idgham-without-ghunnah [u #169200 idgh_w_ghn Idgham - Without Ghunnah
idgham-mutajanisayn [d #A1A1A1 idgh_mus Idgham - Mutajanisayn
idgham-mutaqaribayn [b #A1A1A1 idgh_mus Idgham - Mutaqaribayn
ghunnah [g #FF7E1E ghn Ghunnah: 2 Vowels MIMM/NOON with SHADEH

for more information go to see the docs at link1 and link2.

Credits

Big thanks for Meezaan for help and the useful API.

tajweedparser's People

Contributors

vipafattal avatar

Forkers

publicfork

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.