This repository was archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of XposedLibrary and XposedTweakbox
- Loading branch information
Showing
27 changed files
with
964 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
21
XposedLibrary/res/layout/preference_valueseekbar_extension.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
63 changes: 63 additions & 0 deletions
63
XposedLibrary/src/de/robv/android/xposed/library/ui/IntegerListPreference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
XposedLibrary/src/de/robv/android/xposed/library/ui/ListPreferenceFixedSummary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
Oops, something went wrong.