-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jing KE
committed
Apr 15, 2019
1 parent
cf97f2e
commit bfb2fa2
Showing
29 changed files
with
1,086 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
Interactive Math Pad | ||
==================== | ||
|
||
![preview](https://raw.githubusercontent.com/jingkecn/myscript-iink-codelabs-android-kotlin/master/docs/images/app/math-pad/preview.gif) | ||
This is a reproduction of [MyScript MathPad](https://www.myscript.com/retired-apps) on Android platform, based on [MyScript Interactive Ink SDK](https://www.myscript.com/interactive-ink). | ||
|
||
> [!INFO] | ||
> This is a reproduction of the retired MyScript MathPad for Android. | ||
![preview](docs/images/preview.gif) | ||
|
||
> [!ACKNOWLEDGEMENTS] | ||
> | ||
> - [1] [MyScript Interactive Ink](https://www.myscript.com/interactive-ink)® | ||
> - [2] [中國色](http://zhongguose.com/) | ||
> | ||
> [!DISCLAIMER] | ||
> The software is for your study and reference only and the developer will not be responsible for its content. | ||
> **The software is for your study and reference only and the developer will not be responsible for its content.** | ||
LICENSE | ||
------- | ||
|
||
[MIT License](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) MyScript. All rights reserved. | ||
*/ | ||
|
||
package com.myscript.iink.extensions | ||
|
||
import android.content.ClipData | ||
import android.content.ClipboardManager | ||
import android.content.Context | ||
import android.support.annotation.NonNull | ||
import android.widget.Toast | ||
import com.myscript.iink.Editor | ||
import com.myscript.iink.MimeType | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
|
||
fun Editor.convert() = | ||
getSupportedTargetConversionStates(null).firstOrNull()?.let { convert(null, it) } | ||
|
||
fun Editor.copyToClipboard(@NonNull context: Context, type: MimeType) = | ||
export_(null, type).let { | ||
GlobalScope.launch(Dispatchers.Main) { | ||
(context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager)?.run { | ||
primaryClip = ClipData.newPlainText(type.name, it) | ||
Toast.makeText( | ||
context, | ||
"String ($type) copied to clipboard:\n$it", | ||
Toast.LENGTH_LONG | ||
).show() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.