Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Initial commit of XposedLibrary and XposedTweakbox
Browse files Browse the repository at this point in the history
  • Loading branch information
rovo89 committed May 3, 2012
1 parent efd0831 commit 5af6843
Show file tree
Hide file tree
Showing 27 changed files with 964 additions and 0 deletions.
8 changes: 8 additions & 0 deletions XposedLibrary/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
33 changes: 33 additions & 0 deletions XposedLibrary/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>XposedLibrary</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
4 changes: 4 additions & 0 deletions XposedLibrary/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.robv.android.xposed.library" >
</manifest>
Expand Down
Binary file added XposedLibrary/XposedBridgeApi.jar
Binary file not shown.
15 changes: 15 additions & 0 deletions XposedLibrary/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt

# Project target.
target=android-15
android.library=true
21 changes: 21 additions & 0 deletions XposedLibrary/res/layout/preference_valueseekbar_extension.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical"
android:paddingRight="?android:attr/scrollbarSize" >

<SeekBar
android:id="@+id/valueseekbar_preference_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<TextView
android:id="@+id/valueseekbar_preference_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />

</LinearLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package de.robv.android.xposed.library.ui;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.ListPreference;
import android.util.AttributeSet;

public class IntegerListPreference extends ListPreference {
public IntegerListPreference(Context context) {
super(context);
}

public IntegerListPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
public void setValue(String value) {
super.setValue(value);
notifyChanged();
}

@Override
protected boolean persistString(String value) {
if (value == null)
return false;

return persistInt(getIntValue(value));
}

@Override
protected String getPersistedString(String defaultReturnValue) {
SharedPreferences pref = getPreferenceManager().getSharedPreferences();
String key = getKey();
if (!shouldPersist() || !pref.contains(key))
return defaultReturnValue;

return String.valueOf(pref.getInt(key, 0));
}

@Override
public int findIndexOfValue(String value) {
CharSequence[] entryValues = getEntryValues();
int intValue = getIntValue(value);
if (value != null && entryValues != null) {
for (int i = entryValues.length - 1; i >= 0; i--) {
if (getIntValue(entryValues[i].toString()) == intValue) {
return i;
}
}
}
return -1;
}

public static int getIntValue(String value) {
if (value == null)
return 0;

return (int)((value.startsWith("0x"))
? Long.parseLong(value.substring(2), 16)
: Long.parseLong(value));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package de.robv.android.xposed.library.ui;

import android.content.Context;
import android.preference.ListPreference;
import android.util.AttributeSet;

public class ListPreferenceFixedSummary extends ListPreference {
public ListPreferenceFixedSummary(Context context) {
super(context);
}

public ListPreferenceFixedSummary(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
public void setValue(String value) {
super.setValue(value);
notifyChanged();
}
}
Loading

0 comments on commit 5af6843

Please sign in to comment.