All Projects → dev-myatminsoe → Mdetect

dev-myatminsoe / Mdetect

Licence: mit

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Mdetect

Unicode 9.0.0
JavaScript-compatible Unicode data. Arrays of code points, arrays of symbols, and regular expressions for Unicode v9.0.0’s categories, scripts, blocks, bidi, and other properties.
Stars: ✭ 15 (-72.22%)
Mutual labels:  unicode
Unicode 8.0.0
JavaScript-compatible Unicode data. Arrays of code points, arrays of symbols, and regular expressions for Unicode v8.0.0’s categories, scripts, blocks, bidi, and other properties.
Stars: ✭ 38 (-29.63%)
Mutual labels:  unicode
Open Relay
Free and open source fonts from Kreative Software
Stars: ✭ 48 (-11.11%)
Mutual labels:  unicode
Php Confusable Homoglyphs
A PHP port of https://github.com/vhf/confusable_homoglyphs
Stars: ✭ 27 (-50%)
Mutual labels:  unicode
Unidump
hexdump(1) for Unicode data
Stars: ✭ 31 (-42.59%)
Mutual labels:  unicode
Icu
The new home of the ICU project source code.
Stars: ✭ 1,011 (+1772.22%)
Mutual labels:  unicode
Myanmar Unicode Fonts
Fonts preview for list of Myanmar Unicode fonts
Stars: ✭ 14 (-74.07%)
Mutual labels:  unicode
Keytokey
Rust keyboard firmware library
Stars: ✭ 54 (+0%)
Mutual labels:  unicode
Unicode Bidirectional
A Javascript implementation of the Unicode 9.0.0 Bidirectional Algorithm
Stars: ✭ 35 (-35.19%)
Mutual labels:  unicode
Font Awesome Php
A PHP library for Font Awesome 4.7.
Stars: ✭ 47 (-12.96%)
Mutual labels:  unicode
Tcodeedit
Lightweight and syntax hilighted UNICODE editor
Stars: ✭ 27 (-50%)
Mutual labels:  unicode
Unicode 10.0.0
JavaScript-compatible Unicode data. Arrays of code points, arrays of symbols, and regular expressions for Unicode v10.0.0’s categories, scripts, blocks, bidi, and other properties.
Stars: ✭ 30 (-44.44%)
Mutual labels:  unicode
Phobos
The standard library of the D programming language
Stars: ✭ 1,038 (+1822.22%)
Mutual labels:  unicode
Pysamesame
This is a python version of samesame repo to generate homograph strings
Stars: ✭ 20 (-62.96%)
Mutual labels:  unicode
Sheenbidi
A sophisticated implementation of Unicode Bidirectional Algorithm
Stars: ✭ 52 (-3.7%)
Mutual labels:  unicode
Utf8.h
📚 single header utf8 string functions for C and C++
Stars: ✭ 875 (+1520.37%)
Mutual labels:  unicode
Unicode Tr51
Emoji data extracted from Unicode Technical Report #51.
Stars: ✭ 38 (-29.63%)
Mutual labels:  unicode
Awesome Emoji Picker
Add-on/WebExtension that provides a modern emoji picker that you can use to find and copy/insert emoji into the active web page.
Stars: ✭ 54 (+0%)
Mutual labels:  unicode
Weird Json
A collection of strange encoded JSONs. For connoisseurs.
Stars: ✭ 53 (-1.85%)
Mutual labels:  unicode
Unicode Confusable
Unicode::Confusable.confusable? "ℜսᖯʏ", "Ruby"
Stars: ✭ 47 (-12.96%)
Mutual labels:  unicode

MDetect

MDetect is yet another library for displaying Burmese texts for Android.

Zawgyi device and Unicode device

How it works

MDetect detects the device's font i.e. whether the user is using Unicode or Zawgyi by drawing က္က and compare the width with က. It doesnt embed any font and convert the text to Zawgyi if the user is using Zawgyi and it doesn't effect the performance of the app much.

Download

Gradle:

compile 'myatminsoe.mdetect.android:mdetect-android:3.2'

or Maven:

<dependency>
  <groupId>myatminsoe.mdetect.android</groupId>
  <artifactId>mdetect-android</artifactId>
  <version>3.2</version>
  <type>pom</type>
</dependency>

How to use

Kotlin

Initialize MDetect on your Application class onCreate.

override fun onCreate() {
    super.onCreate()
    MDetect.init(this)
}

MDetect can be used for deciding whether the user is using Unicode.

if (MDetect.isUnicode()){
  //user is using Unicode
} else {
  //user is using Zawgyi or showing squares
}

Java

Initialize MDetect on your Application class onCreate.

@Override
public void onCreate() {
    super.onCreate();
    MDetect.INSTANCE.init(this);
}

MDetect can be used for deciding whether the user is using Unicode.

if (MDetect.INSTANCE.isUnicode()){
  //user is using Unicode
} else {
  //user is using Zawgyi or showing squares
}

MDetect have custom views for TextView, EditText and Button

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_horizontal"
    android:orientation="vertical"
    android:padding="16dp"
    >

  <me.myatminsoe.mdetect.MMTextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:padding="8dp"
      android:text="@string/myanmar_textview"
      android:textColor="@color/grey_900"
      />

  <me.myatminsoe.mdetect.MMEditText
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:hint="@string/myanmar_edittext"
      android:padding="8dp"
      />

  <me.myatminsoe.mdetect.MMButtonView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:onClick="showMyanmarToast"
      android:padding="8dp"
      android:text="@string/myanmar_button"
      />

</LinearLayout>

Setting and Getting Text for custom views

use setMMText() and getMMText() instead of setText() and getText() for custom views.

Getting Text

Kotlin

MDetect.getText("မင်္ဂလာပါ") //return မဂၤလာပါ is the device is using zawgyi

Java

MDetect.INSTANCE.getText("မင်္ဂလာပါ") //return မဂၤလာပါ is the device is using zawgyi

Toast

Kotlin

MMToast.showShortToast(this, "မင်္ဂလာပါ")
MMToast.showLongToast(this, "မင်္ဂလာပါ")

Java

MMToast.INSTANCE.showShortToast(this, "မင်္ဂလာပါ")
MMToast.INSTANCE.showLongToast(this, "မင်္ဂလာပါ")

Zawgyi <-> Unicode Converter

MDetect use Rabbit Converter for converting Zawgyi and Unicode and you can also use the features from Rabbit Converter.

Kotlin

val uniSt = Rabbit.zg2uni("ေနေကာင္းလား"); //နေကောင်းလား
val zgSt = Rabbit.uni2zg("နေကောင်းလား"); //ေနေကာင္းလား

Java

String uniSt = Rabbit.zg2uni("ေနေကာင္းလား"); //နေကောင်းလား
String zgSt = Rabbit.uni2zg("နေကောင်းလား"); //ေနေကာင္းလား

See the sample app for more detail.

License

MIT License

Copyright (c) 2016 Myat Min Soe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].