├── .gitignore ├── LICENSE.txt ├── MathKeyboard ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── iconfont │ │ ├── iconfont.ttf │ │ └── iconfont2.ttf │ ├── java │ └── com │ │ └── tianshaokai │ │ └── mathkeyboard │ │ ├── KeyboardFragment.java │ │ ├── manager │ │ ├── Assembles.java │ │ ├── ConvertResult.java │ │ ├── LateXConfig.java │ │ ├── Latex2View.java │ │ ├── LatexConstant.java │ │ ├── MathFormula.java │ │ ├── MathFormulaFactory.java │ │ ├── Parser.java │ │ ├── SelectedStruct.java │ │ ├── View2Latex.java │ │ └── ViewAssembleManager.java │ │ ├── utils │ │ ├── AFCallback.java │ │ ├── AFImageGetter.java │ │ ├── AFTagHandler.java │ │ ├── BitmapUtil.java │ │ ├── CallbackBase.java │ │ ├── DisplayUtils.java │ │ ├── FileUtil.java │ │ ├── HtmlUtil.java │ │ ├── LatexUtil.java │ │ ├── RichText.java │ │ ├── RichTextManager.java │ │ ├── StringUtil.java │ │ └── UUIDUtil.java │ │ └── widget │ │ ├── AbsoluteValueView.java │ │ ├── AngleView.java │ │ ├── ArcView.java │ │ ├── BorderTextView.java │ │ ├── CustomTextView.java │ │ ├── EditView.java │ │ ├── Equation3View.java │ │ ├── EquationView.java │ │ ├── FormulaView.java │ │ ├── FractionView.java │ │ ├── LineView.java │ │ ├── MyArcView.java │ │ ├── Power10View.java │ │ ├── PowerView.java │ │ ├── SCTView.java │ │ ├── SimpleSymbolView.java │ │ ├── Sqrt2View.java │ │ ├── SqrtView.java │ │ ├── SubScriptView.java │ │ ├── SumView.java │ │ └── SuperiorView.java │ └── res │ ├── anim │ ├── bottom_view_anim_enter.xml │ ├── bottom_view_anim_exit.xml │ ├── update_app_window_in.xml │ └── update_app_window_out.xml │ ├── drawable-xxxhdpi │ ├── icon_sqrt.png │ └── icon_sum.png │ ├── drawable │ ├── btn_latter_keyboard_bg.xml │ ├── ic_launcher_background.xml │ ├── selected_tv.xml │ ├── shape_dotted_stroke.xml │ ├── textview_bg_normal.xml │ ├── textview_bg_press.xml │ ├── textview_normal.xml │ └── textview_selected.xml │ ├── layout │ ├── layout_keyboard_algebra.xml │ ├── layout_keyboard_default.xml │ ├── layout_keyboard_geometry.xml │ ├── layout_keyboard_latter.xml │ ├── layout_keybord_dialog_fragment.xml │ ├── layout_latex_absolute_value_1.xml │ ├── layout_latex_absolute_value_2.xml │ ├── layout_latex_absolute_value_3.xml │ ├── layout_latex_angle_1.xml │ ├── layout_latex_angle_2.xml │ ├── layout_latex_angle_3.xml │ ├── layout_latex_arc_1.xml │ ├── layout_latex_arc_2.xml │ ├── layout_latex_equation3_1.xml │ ├── layout_latex_equation3_2.xml │ ├── layout_latex_equation3_3.xml │ ├── layout_latex_equation_1.xml │ ├── layout_latex_equation_2.xml │ ├── layout_latex_equation_3.xml │ ├── layout_latex_formula_text.xml │ ├── layout_latex_fraction_1.xml │ ├── layout_latex_fraction_2.xml │ ├── layout_latex_fraction_3.xml │ ├── layout_latex_line_1.xml │ ├── layout_latex_line_2.xml │ ├── layout_latex_line_3.xml │ ├── layout_latex_power10_1.xml │ ├── layout_latex_power10_2.xml │ ├── layout_latex_power10_3.xml │ ├── layout_latex_power_1.xml │ ├── layout_latex_power_2.xml │ ├── layout_latex_power_3.xml │ ├── layout_latex_power_4.xml │ ├── layout_latex_sct_1.xml │ ├── layout_latex_sct_2.xml │ ├── layout_latex_sct_3.xml │ ├── layout_latex_sqrt_1.xml │ ├── layout_latex_sqrt_2.xml │ ├── layout_latex_sqrt_3.xml │ ├── layout_latex_sqrt_square_1.xml │ ├── layout_latex_sqrt_square_2.xml │ ├── layout_latex_sqrt_square_3.xml │ ├── layout_latex_subscript_1.xml │ ├── layout_latex_subscript_2.xml │ ├── layout_latex_subscript_3.xml │ ├── layout_latex_sum_1.xml │ ├── layout_latex_sum_2.xml │ ├── layout_latex_sum_3.xml │ ├── layout_latex_superior_1.xml │ ├── layout_latex_superior_2.xml │ └── layout_latex_superior_3.xml │ └── values │ ├── attrs.xml │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── README.md ├── ScreenShot ├── 1.png ├── 2.png ├── 3.png └── 4.png ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── tianshaokai │ │ └── app │ │ └── KeyboardActivity.java │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── layout │ └── activity_keyboard.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jlatexmath ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── DefaultTeXFont.xml │ ├── GlueSettings.xml │ ├── TeXFormulaSettings.xml │ ├── TeXSymbols.xml │ └── fonts │ │ ├── base │ │ ├── jlm_amsfonts.map.xml │ │ ├── jlm_amssymb.map.xml │ │ ├── jlm_base.map.xml │ │ ├── jlm_cmex10.xml │ │ ├── jlm_cmmi10.xml │ │ ├── jlm_cmmi10_unchanged.xml │ │ ├── jlm_cmmib10.xml │ │ ├── jlm_cmmib10_unchanged.xml │ │ └── jlm_moustache.xml │ │ ├── euler │ │ ├── jlm_eufb10.xml │ │ └── jlm_eufm10.xml │ │ ├── jlm_cmbsy10.ttf │ │ ├── jlm_cmbx10.ttf │ │ ├── jlm_cmbxti10.ttf │ │ ├── jlm_cmex10.ttf │ │ ├── jlm_cmmi10.ttf │ │ ├── jlm_cmmib10.ttf │ │ ├── jlm_cmr10.ttf │ │ ├── jlm_cmss10.ttf │ │ ├── jlm_cmssbx10.ttf │ │ ├── jlm_cmssi10.ttf │ │ ├── jlm_cmsy10.ttf │ │ ├── jlm_cmti10.ttf │ │ ├── jlm_cmtt10.ttf │ │ ├── jlm_cyrillic.map.xml │ │ ├── jlm_dsrom10.ttf │ │ ├── jlm_eufb10.ttf │ │ ├── jlm_eufm10.ttf │ │ ├── jlm_fcmbipg.ttf │ │ ├── jlm_fcmbipg.xml │ │ ├── jlm_fcmbpg.ttf │ │ ├── jlm_fcmbpg.xml │ │ ├── jlm_fcmripg.ttf │ │ ├── jlm_fcmripg.xml │ │ ├── jlm_fcmrpg.ttf │ │ ├── jlm_fcmrpg.xml │ │ ├── jlm_fcsbpg.ttf │ │ ├── jlm_fcsbpg.xml │ │ ├── jlm_fcsropg.ttf │ │ ├── jlm_fcsropg.xml │ │ ├── jlm_fcsrpg.ttf │ │ ├── jlm_fcsrpg.xml │ │ ├── jlm_fctrpg.ttf │ │ ├── jlm_fctrpg.xml │ │ ├── jlm_greek.map.xml │ │ ├── jlm_jlmbi10.ttf │ │ ├── jlm_jlmbx10.ttf │ │ ├── jlm_jlmi10.ttf │ │ ├── jlm_jlmr10.ttf │ │ ├── jlm_jlmsb10.ttf │ │ ├── jlm_jlmsbi10.ttf │ │ ├── jlm_jlmsi10.ttf │ │ ├── jlm_jlmss10.ttf │ │ ├── jlm_jlmtt10.ttf │ │ ├── jlm_msam10.ttf │ │ ├── jlm_msbm10.ttf │ │ ├── jlm_rsfs10.ttf │ │ ├── jlm_special.ttf │ │ ├── jlm_stmary10.ttf │ │ ├── jlm_wnbx10.ttf │ │ ├── jlm_wnbx10.xml │ │ ├── jlm_wnbxti10.ttf │ │ ├── jlm_wnbxti10.xml │ │ ├── jlm_wnr10.ttf │ │ ├── jlm_wnr10.xml │ │ ├── jlm_wnss10.ttf │ │ ├── jlm_wnss10.xml │ │ ├── jlm_wnssbx10.ttf │ │ ├── jlm_wnssbx10.xml │ │ ├── jlm_wnssi10.ttf │ │ ├── jlm_wnssi10.xml │ │ ├── jlm_wnti10.ttf │ │ ├── jlm_wnti10.xml │ │ ├── jlm_wntt10.ttf │ │ ├── jlm_wntt10.xml │ │ ├── language_cyrillic.xml │ │ ├── language_greek.xml │ │ ├── latin │ │ ├── jlm_cmr10.xml │ │ ├── jlm_jlmbi10.xml │ │ ├── jlm_jlmbx10.xml │ │ ├── jlm_jlmi10.xml │ │ ├── jlm_jlmr10.xml │ │ ├── jlm_jlmr10_unchanged.xml │ │ ├── jlm_jlmsb10.xml │ │ ├── jlm_jlmsbi10.xml │ │ ├── jlm_jlmsi10.xml │ │ ├── jlm_jlmss10.xml │ │ ├── jlm_jlmtt10.xml │ │ └── optional │ │ │ ├── jlm_cmbx10.ttf │ │ │ ├── jlm_cmbx10.xml │ │ │ ├── jlm_cmbxti10.ttf │ │ │ ├── jlm_cmbxti10.xml │ │ │ ├── jlm_cmss10.ttf │ │ │ ├── jlm_cmss10.xml │ │ │ ├── jlm_cmssbx10.ttf │ │ │ ├── jlm_cmssbx10.xml │ │ │ ├── jlm_cmssi10.ttf │ │ │ ├── jlm_cmssi10.xml │ │ │ ├── jlm_cmti10.ttf │ │ │ ├── jlm_cmti10.xml │ │ │ ├── jlm_cmti10_unchanged.xml │ │ │ ├── jlm_cmtt10.ttf │ │ │ └── jlm_cmtt10.xml │ │ ├── licences │ │ ├── Knuth_License.txt │ │ ├── License_for_dsrom.txt │ │ └── OFL.txt │ │ ├── mappings_cyrillic.xml │ │ ├── mappings_greek.xml │ │ ├── maths │ │ ├── jlm_cmbsy10.xml │ │ ├── jlm_cmsy10.xml │ │ ├── jlm_msam10.xml │ │ ├── jlm_msbm10.xml │ │ ├── jlm_rsfs10.xml │ │ ├── jlm_special.map.xml │ │ ├── jlm_special.xml │ │ ├── jlm_stmary10.xml │ │ ├── jlm_stmaryrd.map.xml │ │ └── optional │ │ │ └── jlm_dsrom10.xml │ │ ├── symbols_cyrillic.xml │ │ └── symbols_greek.xml │ └── java │ └── com │ └── tianshaokai │ └── jlatexmath │ ├── cache │ └── JLaTeXMathCache.java │ ├── core │ ├── AccentedAtom.java │ ├── AjLatexMath.java │ ├── AlphabetRegistration.java │ ├── AlphabetRegistrationException.java │ ├── ArrayOfAtoms.java │ ├── Atom.java │ ├── BigDelimiterAtom.java │ ├── BigOperatorAtom.java │ ├── BoldAtom.java │ ├── Box.java │ ├── BreakFormula.java │ ├── BreakMarkAtom.java │ ├── CedillaAtom.java │ ├── Char.java │ ├── CharAtom.java │ ├── CharBox.java │ ├── CharFont.java │ ├── CharSymbol.java │ ├── ColorAtom.java │ ├── CumulativeScriptsAtom.java │ ├── DdotsAtom.java │ ├── DefaultTeXFont.java │ ├── DefaultTeXFontParser.java │ ├── DelimiterFactory.java │ ├── DelimiterMappingNotFoundException.java │ ├── DoubleFramedAtom.java │ ├── Dummy.java │ ├── EmptyAtom.java │ ├── EmptyFormulaException.java │ ├── Extension.java │ ├── FBoxAtom.java │ ├── FcscoreAtom.java │ ├── FcscoreBox.java │ ├── FencedAtom.java │ ├── FixedCharAtom.java │ ├── FontAlreadyLoadedException.java │ ├── FontInfo.java │ ├── FormulaNotFoundException.java │ ├── FractionAtom.java │ ├── FramedBox.java │ ├── GeoGebraLogoAtom.java │ ├── GeoGebraLogoBox.java │ ├── Glue.java │ ├── GlueBox.java │ ├── GlueSettingsParser.java │ ├── GraphicsAtom.java │ ├── GraphicsBox.java │ ├── HdotsforAtom.java │ ├── HlineAtom.java │ ├── HorizontalBox.java │ ├── HorizontalRule.java │ ├── IJAtom.java │ ├── IddotsAtom.java │ ├── Insets.java │ ├── InvalidAtomTypeException.java │ ├── InvalidDelimiterException.java │ ├── InvalidDelimiterTypeException.java │ ├── InvalidMatrixException.java │ ├── InvalidSymbolTypeException.java │ ├── InvalidTeXFormulaException.java │ ├── InvalidUnitException.java │ ├── ItAtom.java │ ├── JMathTeXException.java │ ├── JavaFontRenderingAtom.java │ ├── JavaFontRenderingBox.java │ ├── LCaronAtom.java │ ├── LaTeXAtom.java │ ├── LapedAtom.java │ ├── MacroInfo.java │ ├── MathAtom.java │ ├── MatrixAtom.java │ ├── Metrics.java │ ├── MiddleAtom.java │ ├── MonoScaleAtom.java │ ├── MulticolumnAtom.java │ ├── MultlineAtom.java │ ├── NewCommandMacro.java │ ├── NewEnvironmentMacro.java │ ├── NthRoot.java │ ├── OgonekAtom.java │ ├── OvalAtom.java │ ├── OvalBox.java │ ├── OverBar.java │ ├── OverUnderBox.java │ ├── OverUnderDelimiter.java │ ├── OverlinedAtom.java │ ├── ParseException.java │ ├── ParseOption.java │ ├── PhantomAtom.java │ ├── PredefMacroInfo.java │ ├── PredefMacros.java │ ├── PredefinedCommands.java │ ├── PredefinedTeXFormulaParser.java │ ├── PredefinedTeXFormulas.java │ ├── RaiseAtom.java │ ├── ReflectAtom.java │ ├── ReflectBox.java │ ├── ResizeAtom.java │ ├── ResourceParseException.java │ ├── RomanAtom.java │ ├── RotateAtom.java │ ├── RotateBox.java │ ├── Row.java │ ├── RowAtom.java │ ├── RuleAtom.java │ ├── ScaleAtom.java │ ├── ScaleBox.java │ ├── ScriptsAtom.java │ ├── ShadowAtom.java │ ├── ShadowBox.java │ ├── SmallCapAtom.java │ ├── SmashedAtom.java │ ├── SpaceAtom.java │ ├── SsAtom.java │ ├── StrikeThroughAtom.java │ ├── StrutBox.java │ ├── StyleAtom.java │ ├── SymbolAtom.java │ ├── SymbolMappingNotFoundException.java │ ├── SymbolNotFoundException.java │ ├── TStrokeAtom.java │ ├── TeXConstants.java │ ├── TeXEnvironment.java │ ├── TeXFont.java │ ├── TeXFormula.java │ ├── TeXFormulaParser.java │ ├── TeXFormulaSettingsParser.java │ ├── TeXIcon.java │ ├── TeXParser.java │ ├── TeXSymbolParser.java │ ├── TextCircledAtom.java │ ├── TextStyleAtom.java │ ├── TextStyleMappingNotFoundException.java │ ├── TtAtom.java │ ├── TypedAtom.java │ ├── URLAlphabetRegistration.java │ ├── UnderOverArrowAtom.java │ ├── UnderOverAtom.java │ ├── UnderlinedAtom.java │ ├── UnderscoreAtom.java │ ├── VCenteredAtom.java │ ├── VRowAtom.java │ ├── VdotsAtom.java │ ├── VerticalBox.java │ ├── VlineAtom.java │ ├── XArrowAtom.java │ ├── XLeftRightArrowFactory.java │ ├── XMLResourceParseException.java │ └── tcaronAtom.java │ ├── cyrillic │ └── CyrillicRegistration.java │ ├── dynamic │ ├── DynamicAtom.java │ ├── ExternalConverter.java │ └── ExternalConverterFactory.java │ └── greek │ └── GreekRegistration.java └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /MathKeyboard/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /MathKeyboard/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | minSdkVersion 19 7 | targetSdkVersion 28 8 | versionCode 1 9 | versionName "1.0" 10 | } 11 | buildTypes { 12 | release { 13 | minifyEnabled false 14 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 15 | } 16 | } 17 | } 18 | 19 | dependencies { 20 | implementation fileTree(include: ['*.jar'], dir: 'libs') 21 | implementation 'com.android.support:appcompat-v7:28.0.0' 22 | implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' 23 | implementation "io.reactivex.rxjava2:rxjava:2.2.4" 24 | implementation 'com.github.bumptech.glide:glide:4.8.0' 25 | annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0' 26 | implementation 'org.jsoup:jsoup:1.9.2' 27 | implementation project(':jlatexmath') 28 | } 29 | -------------------------------------------------------------------------------- /MathKeyboard/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/assets/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/MathKeyboard/src/main/assets/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /MathKeyboard/src/main/assets/iconfont/iconfont2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/MathKeyboard/src/main/assets/iconfont/iconfont2.ttf -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/Assembles.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.manager; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | import com.tianshaokai.mathkeyboard.widget.FormulaView; 7 | import com.tianshaokai.mathkeyboard.widget.SimpleSymbolView; 8 | 9 | 10 | /** 11 | * latex组装器 12 | */ 13 | 14 | public class Assembles { 15 | private static Assembles instants; 16 | 17 | public Assembles() { 18 | 19 | } 20 | 21 | public static Assembles getInstants() { 22 | synchronized (Assembles.class) { 23 | if (instants == null) { 24 | instants = new Assembles(); 25 | } 26 | } 27 | 28 | return instants; 29 | } 30 | 31 | public FormulaView addMathFormula(Context context, MathFormula mathFormula) { 32 | if (ViewAssembleManager.getInstance().getSelectedViewLevel() > 3) { 33 | Toast.makeText(context, "不能在添加子节点,已经达到最深层次", Toast.LENGTH_SHORT); 34 | return null; 35 | } 36 | SelectedStruct selectedStruct = ViewAssembleManager.getInstance().getSelectedStruct(); 37 | FormulaView viewGroup = new MathFormulaFactory().newInstance(context, mathFormula, 38 | ViewAssembleManager.getInstance().getSelectedViewLevel()); 39 | ViewAssembleManager.getInstance().addMathFormula(viewGroup, selectedStruct); 40 | return viewGroup; 41 | } 42 | 43 | public SimpleSymbolView addSimpleSymbol(Context context, String content) { 44 | SimpleSymbolView symbolView = new MathFormulaFactory().newInstance(context, content, 45 | ViewAssembleManager.getInstance().getSelectedViewLevelForSymbol()); 46 | ViewAssembleManager.getInstance().addSimpleSymbol(symbolView); 47 | return symbolView; 48 | } 49 | 50 | public void deleteMathFormula(Context context) { 51 | ViewAssembleManager.getInstance().deleteMathFormula(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/ConvertResult.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.manager; 2 | 3 | /** 4 | * 转换结果 5 | */ 6 | 7 | public class ConvertResult { 8 | public boolean isSuccess = false; 9 | public String message = ""; 10 | } 11 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/Latex2View.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.manager; 2 | 3 | /** 4 | * latex转view 5 | */ 6 | 7 | public class Latex2View { 8 | 9 | public static MathFormula getFormulaType(String latex) { 10 | if (latex.equals(LatexConstant.Fraction)) { 11 | return MathFormula.Fraction; 12 | } else if (latex.equals(LatexConstant.Sqrt)) { 13 | return MathFormula.Sqrt; 14 | } 15 | 16 | return null; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/MathFormula.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.manager; 2 | 3 | /** 4 | * 数学公式列举 5 | */ 6 | public enum MathFormula { 7 | UnKnow, //未知 8 | Fraction, //分数 9 | 10 | Sqrt, //根号 11 | Sqrt2, //根号开平方 12 | 13 | Power, //幂次方 14 | Power2, //二次方 15 | PowerX2, //X的二次方 16 | Power10, //10的幂次方 17 | 18 | Sum, //求和 19 | 20 | Sine, //正弦 21 | Cosine, //余弦 22 | Tangent, //tan 23 | 24 | PIR2, //πr² 25 | 26 | Equation, //方程式 27 | Equation_3, //三项方程式 28 | AbsoluteValue, //绝对值 29 | SubScript, //下标 30 | SubScriptX1, //下标x1 31 | SubScriptX2, //下标x1 32 | 33 | Angle, //三角 34 | 35 | Circ, //度数 36 | Minute, //分 37 | Second, //秒 38 | 39 | 40 | Arc //弧 41 | 42 | } -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/SelectedStruct.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.manager; 2 | 3 | /** 4 | * 被选中元素,结构体 5 | * 6 | * 可能出现情况: 7 | * 1. latexView, clickView为null,即没有选中元素,则必存在光标,index必不为-1 8 | * 此中情况,只有在光标插入到根节点时出现 9 | * 2. latexView, clickView不为null, 即有选中元素或者非一级光标,分两种情况: 10 | * a. index为-1,则选中的是公式元素 11 | * b. index不为-1,则是插入的光标 12 | */ 13 | 14 | public class SelectedStruct { 15 | 16 | //公式名称,被选中元素名称 17 | private String selectedLatexView, selectedClickView; 18 | private boolean isRootSelected = false; 19 | //插入位置,现在光标所在位置 20 | private int index = -1; 21 | 22 | public SelectedStruct() { 23 | 24 | } 25 | 26 | 27 | public String getSelectedLatexView() { 28 | return selectedLatexView; 29 | } 30 | 31 | public void setSelectedLatexView(String selectedLatexView) { 32 | this.selectedLatexView = selectedLatexView; 33 | } 34 | 35 | public String getSelectedClickView() { 36 | return selectedClickView; 37 | } 38 | 39 | public void setSelectedClickView(String selectedClickView) { 40 | this.selectedClickView = selectedClickView; 41 | } 42 | 43 | public int getIndex() { 44 | return index; 45 | } 46 | 47 | public void setIndex(int index) { 48 | this.index = index; 49 | } 50 | 51 | public boolean isRootSelected() { 52 | return isRootSelected; 53 | } 54 | 55 | public void setRootSelected(boolean rootSelected) { 56 | isRootSelected = rootSelected; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/View2Latex.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.manager; 2 | 3 | import com.tianshaokai.mathkeyboard.widget.FormulaView; 4 | import com.tianshaokai.mathkeyboard.widget.FractionView; 5 | import com.tianshaokai.mathkeyboard.widget.Sqrt2View; 6 | import com.tianshaokai.mathkeyboard.widget.SqrtView; 7 | 8 | /** 9 | * view 转 latex 10 | */ 11 | 12 | public class View2Latex { 13 | 14 | public static String getLatexName(FormulaView formulaView) { 15 | String className = formulaView.getClass().getSimpleName(); 16 | if (className.equals(FractionView.class.getSimpleName())) { 17 | return LatexConstant.Fraction; 18 | } else if (className.equals(SqrtView.class.getSimpleName())) { 19 | return LatexConstant.Sqrt; 20 | } else if (className.equals(Sqrt2View.class.getSimpleName())) { 21 | return LatexConstant.Sqrt; 22 | } 23 | 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/AFCallback.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.utils; 2 | 3 | /** 4 | * 回调基类 5 | */ 6 | public interface AFCallback extends CallbackBase { 7 | 8 | void onStart(String uuid); 9 | 10 | void onProcess(int process); 11 | } 12 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/CallbackBase.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.utils; 2 | 3 | public interface CallbackBase { 4 | 5 | void onSuccess(T entity); 6 | 7 | void onFailed(String errMsg); 8 | } 9 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/DisplayUtils.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.utils; 2 | 3 | import android.content.Context; 4 | import android.util.DisplayMetrics; 5 | 6 | public class DisplayUtils { 7 | 8 | 9 | public static DisplayMetrics getDisplayMetrics(Context context) { 10 | return context.getResources().getDisplayMetrics(); 11 | } 12 | 13 | public static float getDensity(Context context) { 14 | return getDisplayMetrics(context).density; 15 | } 16 | 17 | public static float getFontDensity(Context context) { 18 | return getDisplayMetrics(context).scaledDensity; 19 | } 20 | 21 | 22 | /** 23 | * 获取屏幕宽度 24 | * 25 | * @return 26 | */ 27 | public static int getScreenWidth(Context context) { 28 | return getDisplayMetrics(context).widthPixels; 29 | } 30 | 31 | /** 32 | * 获取屏幕高度 33 | * 34 | * @return 35 | */ 36 | public static int getScreenHeight(Context context) { 37 | return getDisplayMetrics(context).heightPixels; 38 | } 39 | 40 | /** 41 | * 单位转换: dp -> px 42 | * 43 | * @param dp 44 | * @return 45 | */ 46 | public static int dp2px(Context context, float dp) { 47 | return (int) (getDensity(context) * dp + 0.5); 48 | } 49 | 50 | /** 51 | * 单位转换:px -> dp 52 | * 53 | * @param px 54 | * @return 55 | */ 56 | public static int px2dp(Context context, float px) { 57 | return (int) (px / getDensity(context) + 0.5); 58 | } 59 | 60 | /** 61 | * 单位转换: sp -> px 62 | * 63 | * @param sp 64 | * @return 65 | */ 66 | public static int sp2px(Context context, float sp) { 67 | return (int) (getFontDensity(context) * sp + 0.5); 68 | } 69 | 70 | /** 71 | * 单位转换:px -> sp 72 | * 73 | * @param px 74 | * @return 75 | */ 76 | public static int px2sp(Context context, float px) { 77 | return (int) (px / getFontDensity(context) + 0.5); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/HtmlUtil.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.utils; 2 | 3 | import org.jsoup.Jsoup; 4 | import org.jsoup.nodes.Attributes; 5 | import org.jsoup.nodes.Document; 6 | import org.jsoup.nodes.Element; 7 | import org.jsoup.select.Elements; 8 | 9 | import java.util.HashMap; 10 | import java.util.Iterator; 11 | import java.util.regex.Matcher; 12 | import java.util.regex.Pattern; 13 | 14 | public class HtmlUtil { 15 | public HtmlUtil() { 16 | } 17 | 18 | public static HashMap getImgWidthHeightByHtmlStr(String htmlStr) { 19 | HashMap hashMap = new HashMap(); 20 | Document document = Jsoup.parse(htmlStr); 21 | Elements imgElements = document.select("img"); 22 | 23 | Element element; 24 | String widthHeightStr; 25 | for(Iterator var4 = imgElements.iterator(); var4.hasNext(); hashMap.put(element.attr("src"), widthHeightStr)) { 26 | element = (Element)var4.next(); 27 | Attributes attributes = element.attributes(); 28 | widthHeightStr = ""; 29 | if (null != attributes) { 30 | String style = attributes.get("style"); 31 | style = style.replaceAll(" ", ""); 32 | String reWidth = "width:([0-9]+)"; 33 | Pattern p = Pattern.compile(reWidth, 34); 34 | Matcher m = p.matcher(style); 35 | String reHeight; 36 | if (m.find()) { 37 | reHeight = m.group(1); 38 | widthHeightStr = widthHeightStr + reHeight; 39 | } 40 | 41 | reHeight = "height:([0-9]+)"; 42 | p = Pattern.compile(reHeight, 34); 43 | m = p.matcher(style); 44 | if (m.find()) { 45 | String height = m.group(1); 46 | widthHeightStr = widthHeightStr + "," + height; 47 | } 48 | } 49 | } 50 | 51 | return hashMap; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/StringUtil.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.utils; 2 | 3 | import java.util.regex.Matcher; 4 | import java.util.regex.Pattern; 5 | 6 | /** 7 | * 字符串相关操作类 8 | */ 9 | public class StringUtil { 10 | 11 | /** 12 | * 查找指定字符串在某个字符串中出现的次数 13 | * @param srcText 源字符串 14 | * @param findText 要查找的字符串 15 | * @return 出现的次数 16 | */ 17 | public static int appearNumber(String srcText, String findText) { 18 | int count = 0; 19 | Pattern p = Pattern.compile(findText); 20 | Matcher m = p.matcher(srcText); 21 | while (m.find()) { 22 | count++; 23 | } 24 | return count; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/UUIDUtil.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.utils; 2 | 3 | import java.util.UUID; 4 | 5 | public class UUIDUtil { 6 | public UUIDUtil() { 7 | } 8 | 9 | public static String generator() { 10 | UUID uuid = UUID.randomUUID(); 11 | String str = uuid.toString(); 12 | String result = str.substring(0, 8) + str.substring(9, 13) + str.substring(14, 18) + str.substring(19, 23) + str.substring(24); 13 | return result; 14 | } 15 | } -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/widget/CustomTextView.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Typeface; 5 | import android.util.AttributeSet; 6 | import android.util.Log; 7 | import android.widget.TextView; 8 | 9 | public class CustomTextView extends TextView { 10 | private static final String TAG = CustomTextView.class.getSimpleName(); 11 | private Typeface iconfont; 12 | 13 | public CustomTextView(Context context) { 14 | super(context); 15 | this.init(context); 16 | } 17 | 18 | public CustomTextView(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | this.init(context); 21 | } 22 | 23 | public CustomTextView(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | this.init(context); 26 | } 27 | 28 | private void init(Context context) { 29 | try { 30 | this.iconfont = Typeface.createFromAsset(context.getAssets(), "iconfont/iconfont.ttf"); 31 | } catch (Exception var3) { 32 | Log.e(TAG, " 加载 iconfont 字体文件失败"); 33 | } 34 | 35 | this.setTypeface(this.iconfont); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/widget/EditView.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Color; 5 | import android.support.annotation.Nullable; 6 | import android.util.AttributeSet; 7 | import android.util.Log; 8 | 9 | /** 10 | * 编辑框UI 11 | */ 12 | 13 | public class EditView extends FormulaView { 14 | private static final String TAG = "EditView"; 15 | public EditView(Context context) { 16 | super(context, 1); 17 | initView(); 18 | } 19 | 20 | public EditView(Context context, @Nullable AttributeSet attrs) { 21 | super(context, attrs); 22 | initView(); 23 | } 24 | 25 | public EditView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 26 | super(context, attrs, defStyleAttr); 27 | initView(); 28 | } 29 | 30 | 31 | private void initView() { 32 | Log.d(TAG, "添加编辑框"); 33 | //重新设置latexview名称,用于操作 34 | latexView = getClass().getSimpleName(); 35 | 36 | this.setBackgroundColor(Color.parseColor("#dddddd")); 37 | //设置可点击控件,并且初始化选中控件 38 | setCanClickView(this, false, true); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/widget/LineView.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.widget; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.util.AttributeSet; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | 9 | import com.tianshaokai.mathkeyboard.R; 10 | 11 | /** 12 | * 竖线,在没有任何控件选中情况下显示 13 | */ 14 | 15 | public class LineView extends FormulaView { 16 | private static final String TAG = "LineView"; 17 | public LineView(Context context, int level) { 18 | super(context, 1); 19 | initView(level); 20 | } 21 | 22 | public LineView(Context context, @Nullable AttributeSet attrs) { 23 | super(context, attrs); 24 | } 25 | 26 | public LineView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 27 | super(context, attrs, defStyleAttr); 28 | } 29 | 30 | /** 31 | * desc: 初始化View 32 | * author: Xubin 33 | * date: 2017/5/11 16:49 34 | * update: 2017/5/11 35 | */ 36 | private void initView(int level) { 37 | Log.d(TAG, "添加编辑竖线"); 38 | //重新设置latexview名称,用于操作 39 | latexView = getClass().getSimpleName(); 40 | 41 | if (level == 1) { 42 | LayoutInflater.from(getContext()).inflate(R.layout.layout_latex_line_1, this); 43 | } else if (level == 2){ 44 | LayoutInflater.from(getContext()).inflate(R.layout.layout_latex_line_2, this); 45 | } else { 46 | LayoutInflater.from(getContext()).inflate(R.layout.layout_latex_line_3, this); 47 | } 48 | } 49 | 50 | @Override 51 | public boolean isRootSelected() { 52 | return true; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/widget/MyArcView.java: -------------------------------------------------------------------------------- 1 | package com.tianshaokai.mathkeyboard.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.RectF; 8 | import android.support.annotation.Nullable; 9 | import android.util.AttributeSet; 10 | import android.view.View; 11 | 12 | /** 13 | * Created by xiaopeng on 2018/5/11. 14 | */ 15 | 16 | public class MyArcView extends View { 17 | private Paint mPaint; 18 | 19 | public MyArcView(Context context) { 20 | super(context); 21 | init(); 22 | } 23 | 24 | public MyArcView(Context context, @Nullable AttributeSet attrs) { 25 | super(context, attrs); 26 | init(); 27 | } 28 | 29 | private void init() { 30 | mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 31 | mPaint.setStyle(Paint.Style.STROKE); 32 | mPaint.setColor(Color.BLACK); 33 | mPaint.setTextSize(12); 34 | mPaint.setStrokeWidth(2); 35 | } 36 | 37 | @Override 38 | protected void onDraw(Canvas canvas) { 39 | super.onDraw(canvas); 40 | RectF rectF = new RectF(0, getHeight() / 3, getWidth(), getHeight()); 41 | canvas.drawArc(rectF, -30, -120, false, mPaint); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/anim/bottom_view_anim_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/anim/bottom_view_anim_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/anim/update_app_window_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/anim/update_app_window_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/drawable-xxxhdpi/icon_sqrt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/MathKeyboard/src/main/res/drawable-xxxhdpi/icon_sqrt.png -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/drawable-xxxhdpi/icon_sum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/MathKeyboard/src/main/res/drawable-xxxhdpi/icon_sum.png -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/drawable/selected_tv.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/drawable/shape_dotted_stroke.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/drawable/textview_bg_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/drawable/textview_bg_press.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/drawable/textview_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/drawable/textview_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_absolute_value_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 23 | 24 | 29 | 30 | 31 | 32 | 39 | 40 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_absolute_value_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 23 | 24 | 29 | 30 | 31 | 32 | 39 | 40 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_absolute_value_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 23 | 24 | 29 | 30 | 31 | 32 | 39 | 40 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_angle_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 26 | 27 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_angle_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 26 | 27 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_angle_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 26 | 27 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_arc_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 24 | 25 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_arc_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 24 | 25 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_formula_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_fraction_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 24 | 25 | 26 | 27 | 33 | 34 | 43 | 44 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_fraction_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 24 | 25 | 26 | 27 | 33 | 34 | 43 | 44 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_fraction_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 24 | 25 | 26 | 27 | 33 | 34 | 43 | 44 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_line_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_line_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_line_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_power10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 23 | 24 | 25 | 26 | 34 | 35 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_power10_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 19 | 20 | 27 | 28 | 29 | 30 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_power10_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 19 | 20 | 27 | 28 | 29 | 30 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_power_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 34 | 35 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_power_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 34 | 35 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_power_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 34 | 35 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_power_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 21 | 22 | 27 | 28 | 29 | 30 | 37 | 38 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sct_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 26 | 27 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sct_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 26 | 27 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sct_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 26 | 27 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sqrt_square_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 18 | 19 | 28 | 29 | 34 | 35 | 36 | 37 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sqrt_square_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 18 | 19 | 27 | 28 | 33 | 34 | 35 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sqrt_square_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 18 | 19 | 20 | 21 | 28 | 29 | 34 | 35 | 36 | 37 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_subscript_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 20 | 21 | 26 | 27 | 28 | 29 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_subscript_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 20 | 21 | 26 | 27 | 28 | 29 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_subscript_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 20 | 21 | 26 | 27 | 28 | 29 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sum_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 31 | 32 | 39 | 40 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sum_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 31 | 32 | 39 | 40 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_sum_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 31 | 32 | 39 | 40 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_superior_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 35 | 36 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_superior_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 35 | 36 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/layout/layout_latex_superior_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 35 | 36 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | #dbdbdb 8 | 9 | #FFFFFF 10 | #000000 11 | 12 | #ffffff 13 | #e6e6e6 14 | 15 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 默认 4 | 代数 5 | 几何 6 | 字母 7 | 关闭 8 | 9 | -------------------------------------------------------------------------------- /MathKeyboard/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 数学公式键盘 2 | 3 | ## 键盘简介 4 | 1. 键盘中包括了代数,几何,字母等数学公式 5 | 2. 数学公式嵌套层级为3层,大于3层无法精准插入其他数据 6 | 3. 点击确认后一键导出对应的Latex数学公式 7 | 8 | ## 项目截图 9 | 10 | 11 | 12 | ## 开源协议 13 | 14 | Licensed under the Apache License, Version 2.0 (the "License"); 15 | you may not use this file except in compliance with the License. 16 | You may obtain a copy of the License at 17 | 18 | http://www.apache.org/licenses/LICENSE-2.0 19 | 20 | Unless required by applicable law or agreed to in writing, software 21 | distributed under the License is distributed on an "AS IS" BASIS, 22 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | See the License for the specific language governing permissions and 24 | limitations under the License. 25 | -------------------------------------------------------------------------------- /ScreenShot/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/ScreenShot/1.png -------------------------------------------------------------------------------- /ScreenShot/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/ScreenShot/2.png -------------------------------------------------------------------------------- /ScreenShot/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/ScreenShot/3.png -------------------------------------------------------------------------------- /ScreenShot/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/ScreenShot/4.png -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | 6 | long time = System.currentTimeMillis() / 1000; 7 | 8 | defaultConfig { 9 | applicationId "com.tianshaokai.mathkeyboard" 10 | minSdkVersion 19 11 | targetSdkVersion 28 12 | versionCode time.intValue() 13 | versionName "1.0" 14 | } 15 | 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(include: ['*.jar'], dir: 'libs') 27 | implementation 'com.android.support:appcompat-v7:28.0.0' 28 | implementation project(':MathKeyboard') 29 | } 30 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_keyboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 |