From 6d7d0efd02b5e0ebb9adb72a3a93faf60c70f286 Mon Sep 17 00:00:00 2001 From: huangjie <289223562@qq.com> Date: Thu, 28 Nov 2019 15:10:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=91=BD=E5=90=8D,=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 71 +++++++++- app/src/main/AndroidManifest.xml | 9 +- .../keybord/keyborddemo/MainActivity.java | 2 +- .../keyborddemo/SystemKeyboardActivity.java | 14 +- ...va => SystemKeyboardEditTextActivity.java} | 9 +- .../res/layout/activity_systemkeyboard.xml | 4 +- .../activity_systemkeyboardedittext.xml | 32 +++-- build.gradle | 2 +- .../easykeyboard/SystemKeyBoardEditText.java | 131 ++++++++++-------- .../com/jay/easykeyboard/SystemKeyboard.java | 63 ++++----- ...KeyBoardUI.java => IKeyBoardUIChange.java} | 2 +- ...tence.java => KeyBoardActionListener.java} | 2 +- ...ce.java => OnEditFocusChangeListener.java} | 2 +- .../com/jay/easykeyboard/bean/KeyModel.java | 10 +- .../easykeyboard/impl/FormatTextWatcher.java | 2 +- .../impl/SystemOnKeyboardActionListener.java | 19 ++- .../easykeyboard/keyboard/MyKeyboardView.java | 36 ++--- .../java/com/jay/easykeyboard/util/Util.java | 11 +- .../easykeyboard/widget/KeyBoardEditText.java | 15 +- easykeyboard/src/main/res/values/attrs.xml | 6 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 21 files changed, 257 insertions(+), 187 deletions(-) rename app/src/main/java/com/example/keybord/keyborddemo/{SystemKeyboardEidtTextActivity.java => SystemKeyboardEditTextActivity.java} (74%) rename easykeyboard/src/main/java/com/jay/easykeyboard/action/{IKeyBoardUI.java => IKeyBoardUIChange.java} (82%) rename easykeyboard/src/main/java/com/jay/easykeyboard/action/{KeyBoardActionListence.java => KeyBoardActionListener.java} (88%) rename easykeyboard/src/main/java/com/jay/easykeyboard/action/{OnEditFocusChangeListence.java => OnEditFocusChangeListener.java} (86%) diff --git a/.gitignore b/.gitignore index c6cbe56..3c117df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,65 @@ +# Built application files +*.apk +*.ap_ + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# IntelliJ *.iml -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures +.idea/workspace.xml +.idea/tasks.xml +.idea/gradle.xml +.idea/assetWizardSettings.xml +.idea/dictionaries +.idea/libraries +.idea/caches + +# Keystore files +# Uncomment the following line if you do not want to check your keystore files in. +#*.jks + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild + +# Google Services (e.g. APIs or Firebase) +google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7940f80..dd59338 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ + android:theme="@style/AppTheme" + tools:ignore="GoogleAppIndexingWarning"> @@ -15,9 +17,8 @@ - - - + + \ No newline at end of file diff --git a/app/src/main/java/com/example/keybord/keyborddemo/MainActivity.java b/app/src/main/java/com/example/keybord/keyborddemo/MainActivity.java index a2abf9d..5c75d55 100644 --- a/app/src/main/java/com/example/keybord/keyborddemo/MainActivity.java +++ b/app/src/main/java/com/example/keybord/keyborddemo/MainActivity.java @@ -24,7 +24,7 @@ protected void onListItemClick(ListView l, View v, int position, long id) { startActivity(SystemKeyboardActivity.class); break; case 1: - startActivity(SystemKeyboardEidtTextActivity.class); + startActivity(SystemKeyboardEditTextActivity.class); break; } } diff --git a/app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardActivity.java b/app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardActivity.java index 3938778..ac555e2 100644 --- a/app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardActivity.java +++ b/app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardActivity.java @@ -13,8 +13,8 @@ import android.widget.Toast; import com.jay.easykeyboard.SystemKeyboard; -import com.jay.easykeyboard.action.IKeyBoardUI; -import com.jay.easykeyboard.action.KeyBoardActionListence; +import com.jay.easykeyboard.action.IKeyBoardUIChange; +import com.jay.easykeyboard.action.KeyBoardActionListener; import com.jay.easykeyboard.util.Util; /** @@ -34,11 +34,11 @@ public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_systemkeyboard); mKeyboard = findViewById(R.id.systemkeyboard); - Button btn_setkeyui = findViewById(R.id.btn_setkeyui); + Button btnChangeUi = findViewById(R.id.btn_change_ui); EditText edit1 = findViewById(R.id.edit); EditText edit2 = findViewById(R.id.edit2); mKeyboard.setEditText(edit1); //用于绑定EditText,如果切换了EditText,请务必设置此方法 - mKeyboard.setOnKeyboardActionListener(new KeyBoardActionListence() { + mKeyboard.setOnKeyboardActionListener(new KeyBoardActionListener() { @Override public void onComplete() { showShortToast("完成"); @@ -63,11 +63,11 @@ public void onClearAll() { edit1.setOnFocusChangeListener(this); edit2.setOnFocusChangeListener(this); - btn_setkeyui.setOnClickListener(new View.OnClickListener() { + btnChangeUi.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //改变ui - mKeyboard.setKeyboardUI(new IKeyBoardUI() { + mKeyboard.setKeyboardUI(new IKeyBoardUIChange() { @Override public Paint setPaint(Paint paint) { paint.setColor(Color.BLUE); @@ -82,7 +82,7 @@ public Paint setPaint(Paint paint) { @Override public void onClick(View v) { isRandom = !isRandom; - mKeyboard.setRandomkeys(isRandom); + mKeyboard.setRandomKeys(isRandom); } }); } diff --git a/app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardEidtTextActivity.java b/app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardEditTextActivity.java similarity index 74% rename from app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardEidtTextActivity.java rename to app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardEditTextActivity.java index 1aac851..a04e44b 100644 --- a/app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardEidtTextActivity.java +++ b/app/src/main/java/com/example/keybord/keyborddemo/SystemKeyboardEditTextActivity.java @@ -1,17 +1,12 @@ package com.example.keybord.keyborddemo; -import android.inputmethodservice.Keyboard; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.text.Editable; -import android.view.View; -import android.widget.EditText; -import android.widget.Toast; import com.jay.easykeyboard.SystemKeyBoardEditText; -import com.jay.easykeyboard.action.KeyBoardActionListence; -import com.jay.easykeyboard.impl.SystemOnKeyboardActionListener; +import com.jay.easykeyboard.action.KeyBoardActionListener; /** * Created by huangjie on 2018/2/6. @@ -19,7 +14,7 @@ * 说明:附带EditText的popwindow形式弹出的键盘 */ -public class SystemKeyboardEidtTextActivity extends AppCompatActivity implements KeyBoardActionListence { +public class SystemKeyboardEditTextActivity extends AppCompatActivity implements KeyBoardActionListener { @Override public void onCreate(@Nullable Bundle savedInstanceState) { diff --git a/app/src/main/res/layout/activity_systemkeyboard.xml b/app/src/main/res/layout/activity_systemkeyboard.xml index ea2b63c..06a8909 100644 --- a/app/src/main/res/layout/activity_systemkeyboard.xml +++ b/app/src/main/res/layout/activity_systemkeyboard.xml @@ -25,7 +25,7 @@