Skip to content

Commit

Permalink
实现安卓8.0以上系统避让输入法
Browse files Browse the repository at this point in the history
  • Loading branch information
fg607 committed Sep 2, 2018
1 parent 65c2161 commit 77cf81b
Show file tree
Hide file tree
Showing 25 changed files with 181 additions and 201 deletions.
Binary file added .idea/caches/build_file_checksums.ser
Binary file not shown.
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 19 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
compileSdkVersion 28
buildToolsVersion '27.0.3'

defaultConfig {
applicationId "com.hardwork.fg607.relaxfinger"
minSdkVersion 18
targetSdkVersion 27
versionCode 25
versionName "3.0.2.1"
targetSdkVersion 28

versionCode 30
versionName "3.0.2.5"
}

signingConfigs {
Expand Down Expand Up @@ -38,19 +39,18 @@ android {


dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.afollestad.material-dialogs:core:0.9.6.0'
compile 'com.ogaclejapan.arclayout:library:1.0.1@aar'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.jakewharton:butterknife:8.8.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.ogaclejapan.arclayout:library:1.0.1@aar'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.android.support:cardview-v7:27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'net.grandcentrix.tray:tray:0.12.0'
compile 'com.jenzz:materialpreference:1.3'
compile 'com.facebook.rebound:rebound:0.3.8'
compile 'com.github.satyan:sugar:1.5'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.yinglan.shadowimageview:shadowimageview:1.0.4'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'net.grandcentrix.tray:tray:0.12.0'
implementation 'com.jenzz:materialpreference:1.3'
implementation 'com.facebook.rebound:rebound:0.3.8'
implementation 'com.github.satyan:sugar:1.5'
implementation 'cn.pedant.sweetalert:library:1.3'
}
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":25},"path":"app-release.apk","properties":{"packageId":"com.hardwork.fg607.relaxfinger","split":"","minSdkVersion":"18"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":30,"versionName":"3.0.2.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
18 changes: 9 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:excludeFromRecents="true"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down Expand Up @@ -89,7 +88,7 @@
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
<!-- <receiver
android:name=".receiver.ScreenOffAdminReceiver"
android:description="@string/admin"
android:label="@string/admin"
Expand All @@ -101,7 +100,7 @@
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>
</receiver>-->

<service
android:name=".service.NotificationService"
Expand All @@ -119,16 +118,17 @@
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:theme="@style/Theme.Transparent" />
<activity android:name=".view.ClipImageActivity"
android:excludeFromRecents="true"/>
<activity android:name=".view.AppChooseActivity"
android:excludeFromRecents="true"/>
<activity
android:name=".view.ClipImageActivity"
android:excludeFromRecents="true" />
<activity
android:name=".view.AppChooseActivity"
android:excludeFromRecents="true" />

<service
android:name=".service.FloatJobService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":remote">
</service>
android:process=":remote"></service>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -49,7 +50,6 @@ public class SettingActivity extends AppCompatActivity {
public static Messenger sMessenger = null;
private boolean mBound = false;
private FloatingActionButton mFab;
private boolean mIsAlertShowing = false;

private ServiceConnection mServiceConnection = new ServiceConnection() {
@Override
Expand Down Expand Up @@ -94,23 +94,13 @@ protected void onCreate(Bundle savedInstanceState) {
protected void onResume() {
super.onResume();

hideAlertDialog();
checkUpgrade();

if(checkAccessibility()){

mIsAlertShowing = false;
checkUpgrade();

}else {

mIsAlertShowing = true;
openAlertDialog();
}

if(isServiceRunning()){
/* if(isServiceRunning()){
bindFloatService();
}
}*/

if(mAppSettingFragment != null){

Expand Down Expand Up @@ -344,14 +334,6 @@ protected void onDestroy() {
}


private void hideAlertDialog() {

if (mAlertDialog != null && mAlertDialog.isShowing()) {

mAlertDialog.dismiss();
}
}

private void checkUpgrade() {
if (mPreferences.getInt("versionCode", 0) < AppUtils.getVersionCode(this)) {

Expand Down Expand Up @@ -448,7 +430,7 @@ public void developerInfo() {
dialog.setTitle("关于悬浮助手");
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
dialog.setMessage("版本:3.0.2.1\r\n作者:fg607\r\n邮箱:[email protected]");
dialog.setMessage("版本:3.0.2.5\r\n作者:fg607\r\n邮箱:[email protected]");
dialog.show();
}

Expand All @@ -461,7 +443,7 @@ public void questionsAnswer() {
dialog.setMessage("1.不能卸载软件:在设置界面关闭“开启锁屏”选项后,即可正常卸载。\r\n" +
"2.屏幕截图没反应:部分手机在第一次屏幕截图时需要稍等片刻,弹出授权框后,点击允许即可。\r\n" +
"3.截图保存在哪里:截图保存在系统存储卡根目录RelaxFinger文件夹里面。\r\n" +
"4.避让软键盘无效:避让软键盘功能需要安装两个及以上输入法时生效(包含系统自带输入法)。" +
"4.避让软键盘无效:安卓7.0以下系统避让软键盘功能最好安装两个及以上输入法(单个输入法也可以用,但需要手动点击悬浮球恢复初始位置)(包含系统自带输入法)。" +
"如果仍然无效,打开输入法,把通知栏打开看一下选择输入法通知的标题,反馈给我,我加到软件里面就可以了。\r\n" +
"5.不能开机自启动:首先确保设置界面“开机启动”选项已开启,如果仍然不能启动,到系统设置->" +
"安全->应用程序许可中找到RelaxFinger,点击进去后打开自动运行开关即可。\r\n" +
Expand All @@ -482,13 +464,14 @@ public void questionsAnswer() {
public void showUpdateInfo() {

AlertDialog dialog = new AlertDialog.Builder(this).create();
dialog.setTitle("悬浮助手-3.0.2.1版本更新内容");
dialog.setTitle("悬浮助手-3.0.2.5版本更新内容");
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
dialog.setMessage("" +
"1.进入临时移动模式悬浮球会变成飞碟主题。\r\n" +
"2.修复避让软键盘位置过高的问题。\r\n"+
"3.修复其他细节问题。"+
"1.增加安卓8.0以上系统避让输入法功能(安装一个输入法即可,建议手动点击悬浮球关闭输入法)。\r\n"+
"2.低于安卓8.0的系统安装一个输入法也可实现输入法避让,但是建议手动点击悬浮球关闭输入法("+
"要实现关闭输入法悬浮球自动恢复位置需要安装两个输入法)\r\n"+
"3.修复已知bug。\r\n"+
"");
dialog.show();

Expand All @@ -508,11 +491,6 @@ private void saveExit(){
finish();
}

public boolean isAlertShowing() {

return mIsAlertShowing;
}

public void showFab(){

mFab.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Date;
import java.util.List;

import static com.hardwork.fg607.relaxfinger.utils.AccessibilityUtil.checkAccessibility;
import static com.hardwork.fg607.relaxfinger.view.MenuViewProxy.MENU_A;
import static com.hardwork.fg607.relaxfinger.view.MenuViewProxy.MENU_B;
import static com.hardwork.fg607.relaxfinger.view.MenuViewProxy.MENU_C;
Expand Down Expand Up @@ -349,11 +350,6 @@ private void checkLongPressVibrate(){
}


private boolean checkAccessibility(){

return AccessibilityUtil.checkAccessibility();
}

private void executeAction(String action){

switch (action) {
Expand All @@ -375,13 +371,17 @@ private void executeAction(String action){

break;
case "返回键":
if (!checkAccessibility()) {
if (checkAccessibility()) {

mManager.closeMenu();

FloatingBallUtils.keyBack(NavAccessibilityService.instance);

}else {

AccessibilityUtil.openSettingActivity();
return;
}
mManager.closeMenu();
FloatingBallUtils.keyBack(NavAccessibilityService.instance);

break;
case "Home键":
mManager.closeMenu();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ public class Config {
public static final int HALF_HIDE = 38;

public static final int TEMP_MOVE = 40;
public static final int AS_DEAD = 41;
}
Loading

0 comments on commit 77cf81b

Please sign in to comment.