Browse Source

No auto soft input

Code cleanup, new signature
Bump to 3.1.2
sense5
Mikanoshi 5 years ago
parent
commit
67a058b4db
12 changed files with 120 additions and 167 deletions
  1. +2
    -2
      OneToolbox/AndroidManifest.xml
  2. +9
    -3
      OneToolbox/TODO.txt
  3. +17
    -90
      OneToolbox/build.xml
  4. BIN
      OneToolbox/res/drawable-xxhdpi/stat_sys_data_bluetooth.png
  5. BIN
      OneToolbox/res/drawable-xxhdpi/stat_sys_data_bluetooth_connected.png
  6. +2
    -0
      OneToolbox/res/values/strings.xml
  7. +5
    -0
      OneToolbox/res/xml/preferences.xml
  8. +49
    -49
      OneToolbox/src/com/langerhans/one/ReorderActivity.java
  9. +21
    -0
      OneToolbox/src/com/langerhans/one/mods/OtherMods.java
  10. +1
    -1
      OneToolbox/src/com/langerhans/one/mods/PrismMods.java
  11. +6
    -4
      OneToolbox/src/com/langerhans/one/mods/XMain.java
  12. +8
    -18
      OneToolbox/src/com/langerhans/one/utils/Helpers.java

+ 2
- 2
OneToolbox/AndroidManifest.xml View File

@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.langerhans.one"
android:versionCode="45"
android:versionName="3.1.1" >
android:versionCode="46"
android:versionName="3.1.2" >
<uses-sdk
android:minSdkVersion="17"


+ 9
- 3
OneToolbox/TODO.txt View File

@@ -8,9 +8,11 @@ See Sense 6 Toolbox TODO
Current changelog
=================
3.1.1
[New] Open app drawer action for Sense gestures and navigation keys
[Fixed] Sent and delivered toasts can now be disabled using Messages settings
3.1.2
[New] Show soft keyboard only if you requested it
[New] APK signature, uninstall and install Toolbox again
Code cleanup
===========
Translators
@@ -35,6 +37,10 @@ http://forum.xda-developers.com/member.php?u=5379502
Old Changelogs
==============
3.1.1
[New] Open app drawer action for Sense gestures and navigation keys
[Fixed] Sent and delivered toasts can now be disabled using Messages settings
3.1
[Fixed] Large photo mod on low-density/low-resolution devices
[Fixed] App drawer titles text size on low-density/low-resolution devices


+ 17
- 90
OneToolbox/build.xml View File

@@ -1,106 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Sense 5 Toolbox" default="help">

<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />

<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:

source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.

For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml

Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.

This file is an integral part of the build system for your
application and should be checked into Version Control Systems.

-->
<property file="/home/git/android/sign.properties" />
<property file="ant.properties" />

<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property name="lib.dir" location="/home/git/android/libs-external-sense5/" />
<property name="sdk.dir" location="/home/git/android/android-sdk-linux/" />
<property environment="env" />
<condition property="sdk.dir" value="/opt/android-sdk-linux/">
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>

<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.

This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).

This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<fail message="sdk.dir path is not defined!" unless="sdk.dir" />
<fail message="lib.dir path is not defined!" unless="lib.dir" />

<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>

<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<target name="-pre-build">
<copy todir="libs/" verbose="true">
<fileset dir="/var/lib/jenkins/jobs/libs/s5/">
<include name="**/*.jar"/>
<target name="-pre-compile">
<path id="project.all.jars.path.tmp">
<pathelement path="${toString:project.all.jars.path}" />
</path>
<path id="project.all.jars.path">
<path refid="project.all.jars.path.tmp" />
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</copy>
<property environment="env" />
<replace file="src/com/langerhans/one/utils/Helpers.java" token="JENKINSBUILDNUMBERGOESHERE" value="${env.BUILD_NUMBER}"/>
</path>
</target>
<target name="-post-compile">
<target name="-post-compile">
<path id="project.all.jars.path">
<!-- un-comment below line if you want it-->
<pathelement path="libs/RootTools-2.6.jar"></pathelement>
<path refid="project.all.jars.path.tmp" />
</path>
</target>
<!-- Import the actual build file.

To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.

***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />

</project>

BIN
OneToolbox/res/drawable-xxhdpi/stat_sys_data_bluetooth.png View File

Before After
Width: 64  |  Height: 64  |  Size: 3.4 KiB Width: 64  |  Height: 64  |  Size: 3.4 KiB

BIN
OneToolbox/res/drawable-xxhdpi/stat_sys_data_bluetooth_connected.png View File

Before After
Width: 64  |  Height: 64  |  Size: 3.4 KiB Width: 64  |  Height: 64  |  Size: 1.2 KiB

+ 2
- 0
OneToolbox/res/values/strings.xml View File

@@ -398,6 +398,8 @@
<string name="various_keyslight_summ">Change backlight brightness for buttons.</string>
<string name="various_keyslight_auto_title">Dynamic backlight</string>
<string name="various_keyslight_auto_summ">Turn off buttons backlight in fullscreen apps.</string>
<string name="various_noautoime_title">No auto soft input</string>
<string name="various_noautoime_summ">Show keyboard only if you requested it.</string>
<string name="various_allrotations_title">All rotations</string>
<string name="various_allrotations_summ">Allow 180 degree orientation additionally to stock 90 and 270.</string>
<string name="various_nolowbattwarn_title">Disable low battery warning</string>


+ 5
- 0
OneToolbox/res/xml/preferences.xml View File

@@ -813,6 +813,11 @@
android:summary="@string/various_keyslight_auto_summ"
android:title="@string/various_keyslight_auto_title"
android:defaultValue="false" />
<com.htc.preference.HtcCheckBoxPreference
android:key="pref_key_other_noautoime"
android:summary="@string/various_noautoime_summ"
android:title="@string/various_noautoime_title"
android:defaultValue="false" />
<com.htc.preference.HtcPreferenceCategory
android:title="@string/various_mods_notifications" >


+ 49
- 49
OneToolbox/src/com/langerhans/one/ReorderActivity.java View File

@@ -54,7 +54,7 @@ public class ReorderActivity extends Activity {
Element eQS;
String cidXML;
ArrayList<String> qsAvail;
String packagename;
String packagename;
Resources res;
@Override
@@ -64,12 +64,12 @@ public class ReorderActivity extends Activity {
ActionBarExt actionBarExt = new ActionBarExt(this, getActionBar());
ActionBarContainer actionBarContainer = actionBarExt.getCustomContainer();
ActionBarText actionBarText = new ActionBarText(this);
actionBarText.setPrimaryText(Helpers.l10n(this, R.string.eqs_reorder));
ActionBarText actionBarText = new ActionBarText(this);
actionBarText.setPrimaryText(Helpers.l10n(this, R.string.eqs_reorder));
actionBarContainer.addCenterView(actionBarText);
actionBarContainer.setBackUpEnabled(true);
View homeBtn = actionBarContainer.getChildAt(0);
View homeBtn = actionBarContainer.getChildAt(0);
if (homeBtn != null) {
View.OnClickListener goBackFromEQS = new View.OnClickListener() {
@Override
@@ -81,16 +81,16 @@ public class ReorderActivity extends Activity {
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.remove("android:support:fragments");
super.onSaveInstanceState(outState);
outState.remove("android:support:fragments");
}
@Override
@@ -110,56 +110,56 @@ public class ReorderActivity extends Activity {
//First run handling. May be removed later.
if (prefs.getBoolean("firstrun_reorder", true)) {
showHelp();
prefs.edit().putBoolean("firstrun_reorder", false).commit();
prefs.edit().putBoolean("firstrun_reorder", false).commit();
}
//Getting the CID for the right ACC file
cidXML = Helpers.getCID();
//Get the available tiles from the Resources
String[] qsAvailH = getResources().getStringArray(R.array.availTiles);
qsAvail = new ArrayList<String>();
Collections.addAll(qsAvail, qsAvailH);
//Parse the ACC file and add the currently used tiles into a new list, then create an ArrayAdapter from it
ArrayList<String> used = new ArrayList<String>(Arrays.asList(Helpers.parseACC(cidXML, this)));
qsAvail.removeAll(used);
adapter = new ArrayAdapter<String>(this, R.layout.dummy_layout, R.id.invisible_text, used);
//Some setup for later
dgv = ((DraggableGridView)findViewById(R.id.dgv));
packagename = getPackageName();
String[] qsAvailH = getResources().getStringArray(R.array.availTiles);
qsAvail = new ArrayList<String>();
Collections.addAll(qsAvail, qsAvailH);
//Parse the ACC file and add the currently used tiles into a new list, then create an ArrayAdapter from it
ArrayList<String> used = new ArrayList<String>(Arrays.asList(Helpers.parseACC(cidXML, this)));
qsAvail.removeAll(used);
adapter = new ArrayAdapter<String>(this, R.layout.dummy_layout, R.id.invisible_text, used);
//Some setup for later
dgv = ((DraggableGridView)findViewById(R.id.dgv));
packagename = getPackageName();
res = getResources();
//Build the initial grid
renewGrid();
dgv.setOnRearrangeListener(new OnRearrangeListener(){
dgv.setOnRearrangeListener(new OnRearrangeListener(){
@Override
public void onRearrange(int from, int to) {
if (from != to)
{
String item = adapter.getItem(from);
adapter.remove(item);
adapter.insert(item, to);
}
{
String item = adapter.getItem(from);
adapter.remove(item);
adapter.insert(item, to);
}
}
});
dgv.setOnItemClickListener(new OnItemClickListener(){
});
dgv.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if(adapter.getCount()<2)
{
{
Toast.makeText(getBaseContext(), Helpers.l10n(getBaseContext(), R.string.remove_last), Toast.LENGTH_SHORT).show();
return;
}else
{
return;
}else
{
askForDelete(adapter.getItem(position), view);
}
}
}
});
}
});
}
/**
* Ask the user if he wants to delete the clicked EQS tile.
@@ -207,8 +207,8 @@ public class ReorderActivity extends Activity {
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.menu_save) {
Helpers.writeACC(cidXML, adapter, this);
savePrev();
askForReboot();
savePrev();
askForReboot();
return true;
}
if (item.getItemId() == R.id.menu_add) {
@@ -300,12 +300,12 @@ public class ReorderActivity extends Activity {
if (file != null) {
String qss;
try {
qss = new Scanner(file).useDelimiter("\n").nextLine();
Scanner scan = new Scanner(file);
qss = scan.useDelimiter("\n").nextLine();
scan.close();
if (!qss.isEmpty()) {
adapter.clear();
for (String item : qss.split(";;")) {
adapter.add(item);
}
for (String item : qss.split(";;")) adapter.add(item);
renewGrid();
alertbox(R.string.success, R.string.backup_restored);
}
@@ -332,7 +332,7 @@ public class ReorderActivity extends Activity {
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
/**


+ 21
- 0
OneToolbox/src/com/langerhans/one/mods/OtherMods.java View File

@@ -51,6 +51,7 @@ import android.view.ViewParent;
import android.view.Window;
import android.view.WindowManager;
import android.view.ViewGroup.LayoutParams;
import android.view.inputmethod.InputMethodManager;
import android.widget.AutoCompleteTextView;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -1164,4 +1165,24 @@ public class OtherMods{
XposedBridge.log(t);
}
}
public static void execHook_NoAutoIME() {
findAndHookMethod(Activity.class, "onResume", new XC_MethodHook() {
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
try {
Activity act = (Activity)param.thisObject;
if (act != null) act.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED);
} catch (Throwable t) {
XposedBridge.log(t);
}
}
});
findAndHookMethod("com.android.server.InputMethodManagerService", null, "showSoftInput", "com.android.internal.view.IInputMethodClient", int.class, "android.os.ResultReceiver", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if ((Integer)param.args[1] == InputMethodManager.SHOW_IMPLICIT) param.setResult(false);
}
});
}
}

+ 1
- 1
OneToolbox/src/com/langerhans/one/mods/PrismMods.java View File

@@ -925,7 +925,7 @@ public class PrismMods {
if (position == 0) {
launcher.startActivity(new Intent(Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS));
} else if (position == 1) {
launcher.startActivity((new Intent("android.intent.action.MAIN")).setAction("com.htc.personalize.ACTION_HOMEPERSONALIZE"));
launcher.startActivity((new Intent("com.htc.personalize.ACTION_HOMEPERSONALIZE")).addCategory(Intent.CATEGORY_DEFAULT));
} else if (position == 2) {
launcher.startActivity(new Intent(Settings.ACTION_SETTINGS));
} else if (position == 3) {


+ 6
- 4
OneToolbox/src/com/langerhans/one/mods/XMain.java View File

@@ -36,13 +36,12 @@ public class XMain implements IXposedHookInitPackageResources, IXposedHookZygote
MODULE_PATH = startupParam.modulePath;

pref = new XSharedPreferences("com.langerhans.one", "one_toolbox_prefs");
senseVersion = new Version(pref.getString("pref_sense_version", "5.0"));
if(pref.getBoolean("pref_key_cb_beats", false))
if (pref.getBoolean("pref_key_cb_beats", false))
StatusbarMods.execHook_BeatsIcon();
if(pref.getBoolean("pref_key_other_movevol", false))
if (pref.getBoolean("pref_key_other_movevol", false))
OtherMods.execHook_MoveVolume(startupParam);
pref_swipedown = Integer.parseInt(pref.getString("pref_key_prism_swipedownaction", "1"));
@@ -96,7 +95,7 @@ public class XMain implements IXposedHookInitPackageResources, IXposedHookZygote
if (pref.getBoolean("pref_key_other_ledoncharge", false))
OtherMods.execHook_LEDOnCharge();
if(pref.getBoolean("pref_key_sysui_tnsb", false))
if (pref.getBoolean("pref_key_sysui_tnsb", false))
SysUIMods.execHook_TranslucentNotificationsDividers();
if (pref.getBoolean("pref_key_other_contactsnocorner", false))
@@ -116,6 +115,9 @@ public class XMain implements IXposedHookInitPackageResources, IXposedHookZygote
pref.getBoolean("pref_key_controls_keyboardhaptic_enable", false))
ControlsMods.execHook_KeysHapticFeedback();
if (pref.getBoolean("pref_key_other_noautoime", false))
OtherMods.execHook_NoAutoIME();
GlobalActions.easterEgg();
}



+ 8
- 18
OneToolbox/src/com/langerhans/one/utils/Helpers.java View File

@@ -4,7 +4,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringWriter;
@@ -13,7 +12,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Scanner;
import javax.xml.parsers.DocumentBuilder;
@@ -254,24 +252,16 @@ public class Helpers {
InputStream inputstream = null;
try {
inputstream = Runtime.getRuntime().exec("/system/bin/getprop ro.cid").getInputStream();
} catch (IOException e) {
e.printStackTrace();
}
String propval = "";
try {
propval = new Scanner(inputstream).useDelimiter("\\A").nextLine();
} catch (NoSuchElementException e) {
e.printStackTrace();
}
try {
Scanner scan = new Scanner(inputstream);
String propval = scan.useDelimiter("\\A").nextLine();
scan.close();
List<String> availACC = new ArrayList<String>();
availACC = RootTools.sendShell("ls /system/customize/ACC/", -1);
for (int i = 0; i < availACC.size(); i++) {
String tc = propval + ".xml";
if (availACC.get(i).equals(tc)) {
cidXML = propval;
return cidXML;
}
for (int i = 0; i < availACC.size(); i++)
if (availACC.get(i).equals(propval + ".xml")) {
cidXML = propval;
return cidXML;
}
cidXML = "default";
return cidXML;


Loading…
Cancel
Save