Browse Source

Merged bugfixes into newui branch.

pull/11/head
Eric Kok 12 years ago
parent
commit
76f9e53a19
  1. 8
      external/ColorPickerPreference/.classpath
  2. 2
      external/ColorPickerPreference/.gitattributes
  3. 4
      external/ColorPickerPreference/.gitignore
  4. 33
      external/ColorPickerPreference/.project
  5. 18
      external/ColorPickerPreference/AndroidManifest.xml
  6. 26
      external/ColorPickerPreference/CHANGELOG.rst
  7. 15
      external/ColorPickerPreference/LICENSE
  8. 47
      external/ColorPickerPreference/README.rst
  9. 34
      external/ColorPickerPreference/proguard.cfg
  10. 12
      external/ColorPickerPreference/project.properties
  11. BIN
      external/ColorPickerPreference/res/drawable-hdpi/icon.png
  12. BIN
      external/ColorPickerPreference/res/drawable-ldpi/icon.png
  13. BIN
      external/ColorPickerPreference/res/drawable-mdpi/icon.png
  14. 77
      external/ColorPickerPreference/res/layout-land/dialog_color_picker.xml
  15. 78
      external/ColorPickerPreference/res/layout/dialog_color_picker.xml
  16. 5
      external/ColorPickerPreference/res/values/integer.xml
  17. 21
      external/ColorPickerPreference/res/values/strings.xml
  18. 32
      external/ColorPickerPreference/res/xml/settings.xml
  19. BIN
      external/ColorPickerPreference/screen_1.png
  20. BIN
      external/ColorPickerPreference/screen_2.png
  21. 128
      external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/AlphaPatternDrawable.java
  22. 142
      external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerDialog.java
  23. 171
      external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerPanelView.java
  24. 287
      external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerPreference.java
  25. 952
      external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerView.java
  26. 43
      external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/Test.java
  27. 6
      lib/src/org/transdroid/daemon/BitComet/BitCometAdapter.java
  28. 3
      lib/src/org/transdroid/daemon/Bitflu/BitfluAdapter.java
  29. 3
      lib/src/org/transdroid/daemon/BuffaloNas/BuffaloNasAdapter.java
  30. 3
      lib/src/org/transdroid/daemon/DLinkRouterBT/DLinkRouterBTAdapter.java
  31. 5
      lib/src/org/transdroid/daemon/Deluge/DelugeAdapter.java
  32. 4
      lib/src/org/transdroid/daemon/Ktorrent/StatsParser.java
  33. 3
      lib/src/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java
  34. 10
      lib/src/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java
  35. 4
      lib/src/org/transdroid/daemon/Tfb4rt/StatsParser.java
  36. 7
      lib/src/org/transdroid/daemon/Torrent.java
  37. 3
      lib/src/org/transdroid/daemon/Transmission/TransmissionAdapter.java
  38. 3
      lib/src/org/transdroid/daemon/Utorrent/UtorrentAdapter.java
  39. 16
      lib/src/org/transdroid/daemon/Vuze/VuzeAdapter.java
  40. 84
      lib/src/org/transdroid/daemon/util/FileSizeConverter.java
  41. 14
      lite/.classpath
  42. 3
      lite/.factorypath
  43. 33
      lite/.project
  44. 4
      lite/.settings/org.eclipse.jdt.apt.core.prefs
  45. 2
      lite/.settings/org.eclipse.jdt.core.prefs
  46. 102
      lite/AndroidManifest.xml
  47. BIN
      lite/compile-libs/androidannotations-3.0-SNAPSHOT.jar
  48. BIN
      lite/libs/androidannotations-api-3.0-SNAPSHOT.jar
  49. 20
      lite/proguard-project.txt
  50. 16
      lite/project.properties
  51. BIN
      lite/res/drawable-hdpi/ab_bottom_solid_transdroid.9.png
  52. BIN
      lite/res/drawable-hdpi/ab_solid_transdroid.9.png
  53. BIN
      lite/res/drawable-hdpi/ab_stacked_solid_transdroid.9.png
  54. BIN
      lite/res/drawable-hdpi/ab_transparent_transdroid.9.png
  55. BIN
      lite/res/drawable-hdpi/ic_action_discard.png
  56. BIN
      lite/res/drawable-hdpi/ic_action_labels.png
  57. BIN
      lite/res/drawable-hdpi/ic_action_new.png
  58. BIN
      lite/res/drawable-hdpi/ic_action_pause.png
  59. BIN
      lite/res/drawable-hdpi/ic_action_refresh.png
  60. BIN
      lite/res/drawable-hdpi/ic_action_remove.png
  61. BIN
      lite/res/drawable-hdpi/ic_action_resume.png
  62. BIN
      lite/res/drawable-hdpi/ic_action_rss.png
  63. BIN
      lite/res/drawable-hdpi/ic_action_search.png
  64. BIN
      lite/res/drawable-hdpi/ic_action_sort_by_size.png
  65. BIN
      lite/res/drawable-hdpi/ic_action_start.png
  66. BIN
      lite/res/drawable-hdpi/ic_action_stop.png
  67. BIN
      lite/res/drawable-hdpi/ic_activity_torrents.png
  68. BIN
      lite/res/drawable-hdpi/ic_empty_details.png
  69. BIN
      lite/res/drawable-hdpi/ic_launcher.png
  70. BIN
      lite/res/drawable-hdpi/ic_priority_high.png
  71. BIN
      lite/res/drawable-hdpi/ic_priority_low.png
  72. BIN
      lite/res/drawable-hdpi/ic_priority_normal.png
  73. BIN
      lite/res/drawable-hdpi/ic_priority_off.png
  74. BIN
      lite/res/drawable-hdpi/list_focused_transdroid.9.png
  75. BIN
      lite/res/drawable-hdpi/menu_dropdown_panel_transdroid.9.png
  76. BIN
      lite/res/drawable-hdpi/menu_hardkey_panel_transdroid.9.png
  77. BIN
      lite/res/drawable-hdpi/progress_bg_transdroid.9.png
  78. BIN
      lite/res/drawable-hdpi/progress_primary_transdroid.9.png
  79. BIN
      lite/res/drawable-hdpi/progress_secondary_transdroid.9.png
  80. BIN
      lite/res/drawable-hdpi/spinner_ab_default_transdroid.9.png
  81. BIN
      lite/res/drawable-hdpi/spinner_ab_disabled_transdroid.9.png
  82. BIN
      lite/res/drawable-hdpi/spinner_ab_focused_transdroid.9.png
  83. BIN
      lite/res/drawable-hdpi/spinner_ab_pressed_transdroid.9.png
  84. BIN
      lite/res/drawable-hdpi/tab_selected_focused_transdroid.9.png
  85. BIN
      lite/res/drawable-hdpi/tab_selected_pressed_transdroid.9.png
  86. BIN
      lite/res/drawable-hdpi/tab_selected_transdroid.9.png
  87. BIN
      lite/res/drawable-hdpi/tab_unselected_focused_transdroid.9.png
  88. BIN
      lite/res/drawable-hdpi/tab_unselected_pressed_transdroid.9.png
  89. BIN
      lite/res/drawable-mdpi/ab_bottom_solid_transdroid.9.png
  90. BIN
      lite/res/drawable-mdpi/ab_solid_transdroid.9.png
  91. BIN
      lite/res/drawable-mdpi/ab_stacked_solid_transdroid.9.png
  92. BIN
      lite/res/drawable-mdpi/ab_transparent_transdroid.9.png
  93. BIN
      lite/res/drawable-mdpi/ic_action_discard.png
  94. BIN
      lite/res/drawable-mdpi/ic_action_labels.png
  95. BIN
      lite/res/drawable-mdpi/ic_action_new.png
  96. BIN
      lite/res/drawable-mdpi/ic_action_pause.png
  97. BIN
      lite/res/drawable-mdpi/ic_action_refresh.png
  98. BIN
      lite/res/drawable-mdpi/ic_action_remove.png
  99. BIN
      lite/res/drawable-mdpi/ic_action_resume.png
  100. BIN
      lite/res/drawable-mdpi/ic_action_rss.png
  101. Some files were not shown because too many files have changed in this diff Show More

8
external/ColorPickerPreference/.classpath vendored

@ -0,0 +1,8 @@ @@ -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>

2
external/ColorPickerPreference/.gitattributes vendored

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

4
external/ColorPickerPreference/.gitignore vendored

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
/bin
/gen
.classpath
.project

33
external/ColorPickerPreference/.project vendored

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ColorPickerPreference</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>

18
external/ColorPickerPreference/AndroidManifest.xml vendored

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.margaritov.preference.colorpicker"
android:versionCode="0111"
android:versionName="1.11">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="net.margaritov.preference.colorpicker.Test"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>

26
external/ColorPickerPreference/CHANGELOG.rst vendored

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
================================
ColorPickerPreference Change Log
================================
2011-02-11 v1.11:
----------------
fix: color controls not visible in landscape orientation
fix: colorPickerDialog constructor was protected
2011-01-25 v1.1:
----------------
* new: Alpha Slider is disabled by default
* new: Alpha Slider can be enabled:
* with preference XML using attribute alphaSlider="true"
* with function setAlphaSliderEnabled(true)
* new: defaultValue in preference XML now accepts HEX color code:
* #FF00FF, rgb
* #FF00FF00, argb
2011-01-20 v1.01:
-----------------
fix: sometimes preview color disappear
2011-01-19 v1.0:
----------------
release

15
external/ColorPickerPreference/LICENSE vendored

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
/*
* Copyright (C) 2011 Sergey Margaritov & Daniel Nilsson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

47
external/ColorPickerPreference/README.rst vendored

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
=====================
ColorPickerPreference
=====================
Generally used classes by Daniel Nilsson.
ColorPickerPreference class by Sergey Margaritov.
Packed by Sergey Margaritov.
Features
========
* Color Area
* Hue Slider
* Alpha Slider (disabled by default)
* Old & New Color
* Color Preview in Preferences List
Requirements
============
Tested with APIv7, but maybe will work with early versions
Usage
=====
You can see some tests inside
::
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="color1"
android:title="@string/color1_title"
android:summary="@string/color1_summary"
android:defaultValue="@color/pumpkin_orange" <!-- integer resources are also accepted -->
alphaSlider="true" <!-- enable alpha slider via XML -->
/>
To enable Alpha Slider in your code use function:
::
setAlphaSliderEnabled(boolean enable)
Screens
=======
* .. image:: https://github.com/attenzione/android-ColorPickerPreference/raw/master/screen_1.png
* .. image:: https://github.com/attenzione/android-ColorPickerPreference/raw/master/screen_2.png

34
external/ColorPickerPreference/proguard.cfg vendored

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

12
external/ColorPickerPreference/project.properties vendored

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
# 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 use,
# "ant.properties", and override values to adapt the script to your
# project structure.
android.library=true
# Project target.
target=android-16

BIN
external/ColorPickerPreference/res/drawable-hdpi/icon.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
external/ColorPickerPreference/res/drawable-ldpi/icon.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
external/ColorPickerPreference/res/drawable-mdpi/icon.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

77
external/ColorPickerPreference/res/layout-land/dialog_color_picker.xml vendored

@ -0,0 +1,77 @@ @@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Daniel Nilsson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:orientation="horizontal">
<net.margaritov.preference.colorpicker.ColorPickerView
android:id="@+id/color_picker_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tag="landscape"
android:layerType="software"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/press_color_to_apply"
android:gravity="center"
android:layout_marginTop="6dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginBottom="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
<net.margaritov.preference.colorpicker.ColorPickerPanelView
android:id="@+id/old_color_panel"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_weight="0.5"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="↓"
android:textSize="20sp"
android:gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
/>
<net.margaritov.preference.colorpicker.ColorPickerPanelView
android:id="@+id/new_color_panel"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_weight="0.5"
/>
</LinearLayout>
</LinearLayout>

78
external/ColorPickerPreference/res/layout/dialog_color_picker.xml vendored

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Daniel Nilsson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:orientation="vertical">
<net.margaritov.preference.colorpicker.ColorPickerView
android:id="@+id/color_picker_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:tag="portrait"
android:layerType="software"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/press_color_to_apply"
android:gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginBottom="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:orientation="horizontal"
android:layout_below="@id/color_picker_view"
android:layout_marginBottom="10dp">
<net.margaritov.preference.colorpicker.ColorPickerPanelView
android:id="@+id/old_color_panel"
android:layout_width="0px"
android:layout_height="fill_parent"
android:layout_weight="0.5"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="→"
android:textSize="20sp"
android:gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/>
<net.margaritov.preference.colorpicker.ColorPickerPanelView
android:id="@+id/new_color_panel"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="0.5"
/>
</LinearLayout>
</LinearLayout>

5
external/ColorPickerPreference/res/values/integer.xml vendored

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<integer name="COLOR_BLACK">0xff000000</integer>
<integer name="COLOR_GREEN">0xff00ff00</integer>
</resources>

21
external/ColorPickerPreference/res/values/strings.xml vendored

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- App -->
<string name="hello">Hello World, Main!</string>
<string name="app_name">ColorPickerPreference</string>
<!-- Color Picker -->
<string name="dialog_color_picker">Color Picker</string>
<string name="press_color_to_apply">Press on Color to apply</string>
<!-- Preferences -->
<string name="pref_category">Category</string>
<string name="color1_title">Color 1</string>
<string name="color1_summary">black color by default, set by reference</string>
<string name="color2_title">Color 2</string>
<string name="color2_summary">not persistent color\nalpha slider added via code</string>
<string name="color3_title">Color 3</string>
<string name="color3_summary">picker with alpha slider</string>
<string name="color4_title">Color 4</string>
<string name="color4_summary">color set with HEX code in xml</string>
</resources>

32
external/ColorPickerPreference/res/xml/settings.xml vendored

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/pref_category">
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="color1"
android:title="@string/color1_title"
android:summary="@string/color1_summary"
android:defaultValue="@integer/COLOR_BLACK"
/>
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="color2"
android:persistent="false"
android:title="@string/color2_title"
android:summary="@string/color2_summary"
android:defaultValue="@integer/COLOR_GREEN"
/>
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="color3"
android:title="@string/color3_title"
android:summary="@string/color3_summary"
android:defaultValue="@integer/COLOR_GREEN"
alphaSlider="true"
/>
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="color4"
android:persistent="false"
android:title="@string/color4_title"
android:summary="@string/color4_summary"
android:defaultValue="#0000FF"
/>
</PreferenceCategory>
</PreferenceScreen>

BIN
external/ColorPickerPreference/screen_1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
external/ColorPickerPreference/screen_2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

128
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/AlphaPatternDrawable.java vendored

@ -0,0 +1,128 @@ @@ -0,0 +1,128 @@
/*
* Copyright (C) 2010 Daniel Nilsson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.margaritov.preference.colorpicker;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
/**
* This drawable that draws a simple white and gray chessboard pattern.
* It's pattern you will often see as a background behind a
* partly transparent image in many applications.
* @author Daniel Nilsson
*/
public class AlphaPatternDrawable extends Drawable {
private int mRectangleSize = 10;
private Paint mPaint = new Paint();
private Paint mPaintWhite = new Paint();
private Paint mPaintGray = new Paint();
private int numRectanglesHorizontal;
private int numRectanglesVertical;
/**
* Bitmap in which the pattern will be cahched.
*/
private Bitmap mBitmap;
public AlphaPatternDrawable(int rectangleSize) {
mRectangleSize = rectangleSize;
mPaintWhite.setColor(0xffffffff);
mPaintGray.setColor(0xffcbcbcb);
}
@Override
public void draw(Canvas canvas) {
canvas.drawBitmap(mBitmap, null, getBounds(), mPaint);
}
@Override
public int getOpacity() {
return 0;
}
@Override
public void setAlpha(int alpha) {
throw new UnsupportedOperationException("Alpha is not supported by this drawwable.");
}
@Override
public void setColorFilter(ColorFilter cf) {
throw new UnsupportedOperationException("ColorFilter is not supported by this drawwable.");
}
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
int height = bounds.height();
int width = bounds.width();
numRectanglesHorizontal = (int) Math.ceil((width / mRectangleSize));
numRectanglesVertical = (int) Math.ceil(height / mRectangleSize);
generatePatternBitmap();
}
/**
* This will generate a bitmap with the pattern
* as big as the rectangle we were allow to draw on.
* We do this to chache the bitmap so we don't need to
* recreate it each time draw() is called since it
* takes a few milliseconds.
*/
private void generatePatternBitmap(){
if(getBounds().width() <= 0 || getBounds().height() <= 0){
return;
}
mBitmap = Bitmap.createBitmap(getBounds().width(), getBounds().height(), Config.ARGB_8888);
Canvas canvas = new Canvas(mBitmap);
Rect r = new Rect();
boolean verticalStartWhite = true;
for (int i = 0; i <= numRectanglesVertical; i++) {
boolean isWhite = verticalStartWhite;
for (int j = 0; j <= numRectanglesHorizontal; j++) {
r.top = i * mRectangleSize;
r.left = j * mRectangleSize;
r.bottom = r.top + mRectangleSize;
r.right = r.left + mRectangleSize;
canvas.drawRect(r, isWhite ? mPaintWhite : mPaintGray);
isWhite = !isWhite;
}
verticalStartWhite = !verticalStartWhite;
}
}
}

142
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerDialog.java vendored

@ -0,0 +1,142 @@ @@ -0,0 +1,142 @@
/*
* Copyright (C) 2010 Daniel Nilsson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.margaritov.preference.colorpicker;
import android.app.Dialog;
import android.content.Context;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
public class ColorPickerDialog
extends
Dialog
implements
ColorPickerView.OnColorChangedListener,
View.OnClickListener {
private ColorPickerView mColorPicker;
private ColorPickerPanelView mOldColor;
private ColorPickerPanelView mNewColor;
private OnColorChangedListener mListener;
public interface OnColorChangedListener {
public void onColorChanged(int color);
}
public ColorPickerDialog(Context context, int initialColor) {
super(context);
init(initialColor);
}
private void init(int color) {
// To fight color banding.
getWindow().setFormat(PixelFormat.RGBA_8888);
setUp(color);
}
private void setUp(int color) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.dialog_color_picker, null);
setContentView(layout);
setTitle(R.string.dialog_color_picker);
mColorPicker = (ColorPickerView) layout.findViewById(R.id.color_picker_view);
mOldColor = (ColorPickerPanelView) layout.findViewById(R.id.old_color_panel);
mNewColor = (ColorPickerPanelView) layout.findViewById(R.id.new_color_panel);
((LinearLayout) mOldColor.getParent()).setPadding(
Math.round(mColorPicker.getDrawingOffset()),
0,
Math.round(mColorPicker.getDrawingOffset()),
0
);
mOldColor.setOnClickListener(this);
mNewColor.setOnClickListener(this);
mColorPicker.setOnColorChangedListener(this);
mOldColor.setColor(color);
mColorPicker.setColor(color, true);
}
@Override
public void onColorChanged(int color) {
mNewColor.setColor(color);
/*
if (mListener != null) {
mListener.onColorChanged(color);
}
*/
}
public void setAlphaSliderVisible(boolean visible) {
mColorPicker.setAlphaSliderVisible(visible);
}
/**
* Set a OnColorChangedListener to get notified when the color
* selected by the user has changed.
* @param listener
*/
public void setOnColorChangedListener(OnColorChangedListener listener){
mListener = listener;
}
public int getColor() {
return mColorPicker.getColor();
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.new_color_panel) {
if (mListener != null) {
mListener.onColorChanged(mNewColor.getColor());
}
}
dismiss();
}
@Override
public Bundle onSaveInstanceState() {
Bundle state = super.onSaveInstanceState();
state.putInt("old_color", mOldColor.getColor());
state.putInt("new_color", mNewColor.getColor());
return state;
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
mOldColor.setColor(savedInstanceState.getInt("old_color"));
mColorPicker.setColor(savedInstanceState.getInt("new_color"), true);
}
}

171
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerPanelView.java vendored

@ -0,0 +1,171 @@ @@ -0,0 +1,171 @@
/*
* Copyright (C) 2010 Daniel Nilsson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.margaritov.preference.colorpicker;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
/**
* This class draws a panel which which will be filled with a color which can be set.
* It can be used to show the currently selected color which you will get from
* the {@link ColorPickerView}.
* @author Daniel Nilsson
*
*/
public class ColorPickerPanelView extends View {
/**
* The width in pixels of the border
* surrounding the color panel.
*/
private final static float BORDER_WIDTH_PX = 1;
private float mDensity = 1f;
private int mBorderColor = 0xff6E6E6E;
private int mColor = 0xff000000;
private Paint mBorderPaint;
private Paint mColorPaint;
private RectF mDrawingRect;
private RectF mColorRect;
private AlphaPatternDrawable mAlphaPattern;
public ColorPickerPanelView(Context context){
this(context, null);
}
public ColorPickerPanelView(Context context, AttributeSet attrs){
this(context, attrs, 0);
}
public ColorPickerPanelView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
private void init(){
mBorderPaint = new Paint();
mColorPaint = new Paint();
mDensity = getContext().getResources().getDisplayMetrics().density;
}
@Override
protected void onDraw(Canvas canvas) {
final RectF rect = mColorRect;
if(BORDER_WIDTH_PX > 0){
mBorderPaint.setColor(mBorderColor);
canvas.drawRect(mDrawingRect, mBorderPaint);
}
if(mAlphaPattern != null){
mAlphaPattern.draw(canvas);
}
mColorPaint.setColor(mColor);
canvas.drawRect(rect, mColorPaint);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(width, height);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mDrawingRect = new RectF();
mDrawingRect.left = getPaddingLeft();
mDrawingRect.right = w - getPaddingRight();
mDrawingRect.top = getPaddingTop();
mDrawingRect.bottom = h - getPaddingBottom();
setUpColorRect();
}
private void setUpColorRect(){
final RectF dRect = mDrawingRect;
float left = dRect.left + BORDER_WIDTH_PX;
float top = dRect.top + BORDER_WIDTH_PX;
float bottom = dRect.bottom - BORDER_WIDTH_PX;
float right = dRect.right - BORDER_WIDTH_PX;
mColorRect = new RectF(left,top, right, bottom);
mAlphaPattern = new AlphaPatternDrawable((int)(5 * mDensity));
mAlphaPattern.setBounds(
Math.round(mColorRect.left),
Math.round(mColorRect.top),
Math.round(mColorRect.right),
Math.round(mColorRect.bottom)
);
}
/**
* Set the color that should be shown by this view.
* @param color
*/
public void setColor(int color){
mColor = color;
invalidate();
}
/**
* Get the color currently show by this view.
* @return
*/
public int getColor(){
return mColor;
}
/**
* Set the color of the border surrounding the panel.
* @param color
*/
public void setBorderColor(int color){
mBorderColor = color;
invalidate();
}
/**
* Get the color of the border surrounding the panel.
*/
public int getBorderColor(){
return mBorderColor;
}
}

287
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerPreference.java vendored

@ -0,0 +1,287 @@ @@ -0,0 +1,287 @@
/*
* Copyright (C) 2011 Sergey Margaritov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.margaritov.preference.colorpicker;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
/**
* A preference type that allows a user to choose a time
* @author Sergey Margaritov
*/
public class ColorPickerPreference
extends
Preference
implements
Preference.OnPreferenceClickListener,
ColorPickerDialog.OnColorChangedListener {
View mView;
ColorPickerDialog mDialog;
private int mValue = Color.BLACK;
private float mDensity = 0;
private boolean mAlphaSliderEnabled = false;
public ColorPickerPreference(Context context) {
super(context);
init(context, null);
}
public ColorPickerPreference(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
public ColorPickerPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context, attrs);
}
@Override
protected Object onGetDefaultValue(TypedArray a, int index) {
return a.getColor(index, Color.BLACK);
}
@Override
protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
onColorChanged(restoreValue ? getPersistedInt(mValue) : (Integer) defaultValue);
}
private void init(Context context, AttributeSet attrs) {
mDensity = getContext().getResources().getDisplayMetrics().density;
setOnPreferenceClickListener(this);
if (attrs != null) {
mAlphaSliderEnabled = attrs.getAttributeBooleanValue(null, "alphaSlider", false);
}
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
mView = view;
setPreviewColor();
}
private void setPreviewColor() {
if (mView == null) return;
ImageView iView = new ImageView(getContext());
LinearLayout widgetFrameView = ((LinearLayout)mView.findViewById(android.R.id.widget_frame));
if (widgetFrameView == null) return;
widgetFrameView.setVisibility(View.VISIBLE);
widgetFrameView.setPadding(
widgetFrameView.getPaddingLeft(),
widgetFrameView.getPaddingTop(),
(int)(mDensity * 8),
widgetFrameView.getPaddingBottom()
);
// remove already create preview image
int count = widgetFrameView.getChildCount();
if (count > 0) {
widgetFrameView.removeViews(0, count);
}
widgetFrameView.addView(iView);
widgetFrameView.setMinimumWidth(0);
iView.setBackgroundDrawable(new AlphaPatternDrawable((int)(5 * mDensity)));
iView.setImageBitmap(getPreviewBitmap());
}
private Bitmap getPreviewBitmap() {
int d = (int) (mDensity * 31); //30dip
int color = mValue;
Bitmap bm = Bitmap.createBitmap(d, d, Config.ARGB_8888);
int w = bm.getWidth();
int h = bm.getHeight();
int c = color;
for (int i = 0; i < w; i++) {
for (int j = i; j < h; j++) {
c = (i <= 1 || j <= 1 || i >= w-2 || j >= h-2) ? Color.GRAY : color;
bm.setPixel(i, j, c);
if (i != j) {
bm.setPixel(j, i, c);
}
}
}
return bm;
}
@Override
public void onColorChanged(int color) {
if (isPersistent()) {
persistInt(color);
}
mValue = color;
setPreviewColor();
try {
getOnPreferenceChangeListener().onPreferenceChange(this, color);
} catch (NullPointerException e) {
}
}
public boolean onPreferenceClick(Preference preference) {
showDialog(null);
return false;
}
protected void showDialog(Bundle state) {
mDialog = new ColorPickerDialog(getContext(), mValue);
mDialog.setOnColorChangedListener(this);
if (mAlphaSliderEnabled) {
mDialog.setAlphaSliderVisible(true);
}
if (state != null) {
mDialog.onRestoreInstanceState(state);
}
mDialog.show();
}
/**
* Toggle Alpha Slider visibility (by default it's disabled)
* @param enable
*/
public void setAlphaSliderEnabled(boolean enable) {
mAlphaSliderEnabled = enable;
}
/**
* For custom purposes. Not used by ColorPickerPreferrence
* @param color
* @author Unknown
*/
public static String convertToARGB(int color) {
String alpha = Integer.toHexString(Color.alpha(color));
String red = Integer.toHexString(Color.red(color));
String green = Integer.toHexString(Color.green(color));
String blue = Integer.toHexString(Color.blue(color));
if (alpha.length() == 1) {
alpha = "0" + alpha;
}
if (red.length() == 1) {
red = "0" + red;
}
if (green.length() == 1) {
green = "0" + green;
}
if (blue.length() == 1) {
blue = "0" + blue;
}
return "#" + alpha + red + green + blue;
}
/**
* For custom purposes. Not used by ColorPickerPreferrence
* @param argb
* @throws NumberFormatException
* @author Unknown
*/
public static int convertToColorInt(String argb) throws NumberFormatException {
if (argb.startsWith("#")) {
argb = argb.replace("#", "");
}
int alpha = -1, red = -1, green = -1, blue = -1;
if (argb.length() == 8) {
alpha = Integer.parseInt(argb.substring(0, 2), 16);
red = Integer.parseInt(argb.substring(2, 4), 16);
green = Integer.parseInt(argb.substring(4, 6), 16);
blue = Integer.parseInt(argb.substring(6, 8), 16);
}
else if (argb.length() == 6) {
alpha = 255;
red = Integer.parseInt(argb.substring(0, 2), 16);
green = Integer.parseInt(argb.substring(2, 4), 16);
blue = Integer.parseInt(argb.substring(4, 6), 16);
}
return Color.argb(alpha, red, green, blue);
}
@Override
protected Parcelable onSaveInstanceState() {
final Parcelable superState = super.onSaveInstanceState();
if (mDialog == null || !mDialog.isShowing()) {
return superState;
}
final SavedState myState = new SavedState(superState);
myState.dialogBundle = mDialog.onSaveInstanceState();
return myState;
}
@Override
protected void onRestoreInstanceState(Parcelable state) {
if (state == null || !(state instanceof SavedState)) {
// Didn't save state for us in onSaveInstanceState
super.onRestoreInstanceState(state);
return;
}
SavedState myState = (SavedState) state;
super.onRestoreInstanceState(myState.getSuperState());
showDialog(myState.dialogBundle);
}
private static class SavedState extends BaseSavedState {
Bundle dialogBundle;
public SavedState(Parcel source) {
super(source);
dialogBundle = source.readBundle();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeBundle(dialogBundle);
}
public SavedState(Parcelable superState) {
super(superState);
}
@SuppressWarnings("unused")
public static final Parcelable.Creator<SavedState> CREATOR =
new Parcelable.Creator<SavedState>() {
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}
public SavedState[] newArray(int size) {
return new SavedState[size];
}
};
}
}

952
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerView.java vendored

@ -0,0 +1,952 @@ @@ -0,0 +1,952 @@
/*
* Copyright (C) 2010 Daniel Nilsson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.margaritov.preference.colorpicker;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ComposeShader;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
import android.graphics.Shader.TileMode;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
/**
* Displays a color picker to the user and allow them
* to select a color. A slider for the alpha channel is
* also available. Enable it by setting
* setAlphaSliderVisible(boolean) to true.
* @author Daniel Nilsson
*/
public class ColorPickerView extends View {
private final static int PANEL_SAT_VAL = 0;
private final static int PANEL_HUE = 1;
private final static int PANEL_ALPHA = 2;
/**
* The width in pixels of the border
* surrounding all color panels.
*/
private final static float BORDER_WIDTH_PX = 1;
/**
* The width in dp of the hue panel.
*/
private float HUE_PANEL_WIDTH = 30f;
/**
* The height in dp of the alpha panel
*/
private float ALPHA_PANEL_HEIGHT = 20f;
/**
* The distance in dp between the different
* color panels.
*/
private float PANEL_SPACING = 10f;
/**
* The radius in dp of the color palette tracker circle.
*/
private float PALETTE_CIRCLE_TRACKER_RADIUS = 5f;
/**
* The dp which the tracker of the hue or alpha panel
* will extend outside of its bounds.
*/
private float RECTANGLE_TRACKER_OFFSET = 2f;
private float mDensity = 1f;
private OnColorChangedListener mListener;
private Paint mSatValPaint;
private Paint mSatValTrackerPaint;
private Paint mHuePaint;
private Paint mHueTrackerPaint;
private Paint mAlphaPaint;
private Paint mAlphaTextPaint;
private Paint mBorderPaint;
private Shader mValShader;
private Shader mSatShader;
private Shader mHueShader;
private Shader mAlphaShader;
private int mAlpha = 0xff;
private float mHue = 360f;
private float mSat = 0f;
private float mVal = 0f;
private String mAlphaSliderText = "";
private int mSliderTrackerColor = 0xff1c1c1c;
private int mBorderColor = 0xff6E6E6E;
private boolean mShowAlphaPanel = false;
/*
* To remember which panel that has the "focus" when
* processing hardware button data.
*/
private int mLastTouchedPanel = PANEL_SAT_VAL;
/**
* Offset from the edge we must have or else
* the finger tracker will get clipped when
* it is drawn outside of the view.
*/
private float mDrawingOffset;
/*
* Distance form the edges of the view
* of where we are allowed to draw.
*/
private RectF mDrawingRect;
private RectF mSatValRect;
private RectF mHueRect;
private RectF mAlphaRect;
private AlphaPatternDrawable mAlphaPattern;
private Point mStartTouchPoint = null;
public interface OnColorChangedListener {
public void onColorChanged(int color);
}
public ColorPickerView(Context context){
this(context, null);
}
public ColorPickerView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public ColorPickerView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
private void init(){
mDensity = getContext().getResources().getDisplayMetrics().density;
PALETTE_CIRCLE_TRACKER_RADIUS *= mDensity;
RECTANGLE_TRACKER_OFFSET *= mDensity;
HUE_PANEL_WIDTH *= mDensity;
ALPHA_PANEL_HEIGHT *= mDensity;
PANEL_SPACING = PANEL_SPACING * mDensity;
mDrawingOffset = calculateRequiredOffset();
initPaintTools();
//Needed for receiving trackball motion events.
setFocusable(true);
setFocusableInTouchMode(true);
}
private void initPaintTools(){
mSatValPaint = new Paint();
mSatValTrackerPaint = new Paint();
mHuePaint = new Paint();
mHueTrackerPaint = new Paint();
mAlphaPaint = new Paint();
mAlphaTextPaint = new Paint();
mBorderPaint = new Paint();
mSatValTrackerPaint.setStyle(Style.STROKE);
mSatValTrackerPaint.setStrokeWidth(2f * mDensity);
mSatValTrackerPaint.setAntiAlias(true);
mHueTrackerPaint.setColor(mSliderTrackerColor);
mHueTrackerPaint.setStyle(Style.STROKE);
mHueTrackerPaint.setStrokeWidth(2f * mDensity);
mHueTrackerPaint.setAntiAlias(true);
mAlphaTextPaint.setColor(0xff1c1c1c);
mAlphaTextPaint.setTextSize(14f * mDensity);
mAlphaTextPaint.setAntiAlias(true);
mAlphaTextPaint.setTextAlign(Align.CENTER);
mAlphaTextPaint.setFakeBoldText(true);
}
private float calculateRequiredOffset(){
float offset = Math.max(PALETTE_CIRCLE_TRACKER_RADIUS, RECTANGLE_TRACKER_OFFSET);
offset = Math.max(offset, BORDER_WIDTH_PX * mDensity);
return offset * 1.5f;
}
private int[] buildHueColorArray(){
int[] hue = new int[361];
int count = 0;
for(int i = hue.length -1; i >= 0; i--, count++){
hue[count] = Color.HSVToColor(new float[]{i, 1f, 1f});
}
return hue;
}
@Override
protected void onDraw(Canvas canvas) {
if(mDrawingRect.width() <= 0 || mDrawingRect.height() <= 0) return;
drawSatValPanel(canvas);
drawHuePanel(canvas);
drawAlphaPanel(canvas);
}
private void drawSatValPanel(Canvas canvas){
final RectF rect = mSatValRect;
if(BORDER_WIDTH_PX > 0){
mBorderPaint.setColor(mBorderColor);
canvas.drawRect(mDrawingRect.left, mDrawingRect.top, rect.right + BORDER_WIDTH_PX, rect.bottom + BORDER_WIDTH_PX, mBorderPaint);
}
if (mValShader == null) {
mValShader = new LinearGradient(rect.left, rect.top, rect.left, rect.bottom,
0xffffffff, 0xff000000, TileMode.CLAMP);
}
int rgb = Color.HSVToColor(new float[]{mHue,1f,1f});
mSatShader = new LinearGradient(rect.left, rect.top, rect.right, rect.top,
0xffffffff, rgb, TileMode.CLAMP);
ComposeShader mShader = new ComposeShader(mValShader, mSatShader, PorterDuff.Mode.MULTIPLY);
mSatValPaint.setShader(mShader);
canvas.drawRect(rect, mSatValPaint);
Point p = satValToPoint(mSat, mVal);
mSatValTrackerPaint.setColor(0xff000000);
canvas.drawCircle(p.x, p.y, PALETTE_CIRCLE_TRACKER_RADIUS - 1f * mDensity, mSatValTrackerPaint);
mSatValTrackerPaint.setColor(0xffdddddd);
canvas.drawCircle(p.x, p.y, PALETTE_CIRCLE_TRACKER_RADIUS, mSatValTrackerPaint);
}
private void drawHuePanel(Canvas canvas){
final RectF rect = mHueRect;
if(BORDER_WIDTH_PX > 0){
mBorderPaint.setColor(mBorderColor);
canvas.drawRect(rect.left - BORDER_WIDTH_PX,
rect.top - BORDER_WIDTH_PX,
rect.right + BORDER_WIDTH_PX,
rect.bottom + BORDER_WIDTH_PX,
mBorderPaint);
}
if (mHueShader == null) {
mHueShader = new LinearGradient(rect.left, rect.top, rect.left, rect.bottom, buildHueColorArray(), null, TileMode.CLAMP);
mHuePaint.setShader(mHueShader);
}
canvas.drawRect(rect, mHuePaint);
float rectHeight = 4 * mDensity / 2;
Point p = hueToPoint(mHue);
RectF r = new RectF();
r.left = rect.left - RECTANGLE_TRACKER_OFFSET;
r.right = rect.right + RECTANGLE_TRACKER_OFFSET;
r.top = p.y - rectHeight;
r.bottom = p.y + rectHeight;
canvas.drawRoundRect(r, 2, 2, mHueTrackerPaint);
}
private void drawAlphaPanel(Canvas canvas){
if(!mShowAlphaPanel || mAlphaRect == null || mAlphaPattern == null) return;
final RectF rect = mAlphaRect;
if(BORDER_WIDTH_PX > 0){
mBorderPaint.setColor(mBorderColor);
canvas.drawRect(rect.left - BORDER_WIDTH_PX,
rect.top - BORDER_WIDTH_PX,
rect.right + BORDER_WIDTH_PX,
rect.bottom + BORDER_WIDTH_PX,
mBorderPaint);
}
mAlphaPattern.draw(canvas);
float[] hsv = new float[]{mHue,mSat,mVal};
int color = Color.HSVToColor(hsv);
int acolor = Color.HSVToColor(0, hsv);
mAlphaShader = new LinearGradient(rect.left, rect.top, rect.right, rect.top,
color, acolor, TileMode.CLAMP);
mAlphaPaint.setShader(mAlphaShader);
canvas.drawRect(rect, mAlphaPaint);
if(mAlphaSliderText != null && mAlphaSliderText!= ""){
canvas.drawText(mAlphaSliderText, rect.centerX(), rect.centerY() + 4 * mDensity, mAlphaTextPaint);
}
float rectWidth = 4 * mDensity / 2;
Point p = alphaToPoint(mAlpha);
RectF r = new RectF();
r.left = p.x - rectWidth;
r.right = p.x + rectWidth;
r.top = rect.top - RECTANGLE_TRACKER_OFFSET;
r.bottom = rect.bottom + RECTANGLE_TRACKER_OFFSET;
canvas.drawRoundRect(r, 2, 2, mHueTrackerPaint);
}
private Point hueToPoint(float hue){
final RectF rect = mHueRect;
final float height = rect.height();
Point p = new Point();
p.y = (int) (height - (hue * height / 360f) + rect.top);
p.x = (int) rect.left;
return p;
}
private Point satValToPoint(float sat, float val){
final RectF rect = mSatValRect;
final float height = rect.height();
final float width = rect.width();
Point p = new Point();
p.x = (int) (sat * width + rect.left);
p.y = (int) ((1f - val) * height + rect.top);
return p;
}
private Point alphaToPoint(int alpha){
final RectF rect = mAlphaRect;
final float width = rect.width();
Point p = new Point();
p.x = (int) (width - (alpha * width / 0xff) + rect.left);
p.y = (int) rect.top;
return p;
}
private float[] pointToSatVal(float x, float y){
final RectF rect = mSatValRect;
float[] result = new float[2];
float width = rect.width();
float height = rect.height();
if (x < rect.left){
x = 0f;
}
else if(x > rect.right){
x = width;
}
else{
x = x - rect.left;
}
if (y < rect.top){
y = 0f;
}
else if(y > rect.bottom){
y = height;
}
else{
y = y - rect.top;
}
result[0] = 1.f / width * x;
result[1] = 1.f - (1.f / height * y);
return result;
}
private float pointToHue(float y){
final RectF rect = mHueRect;
float height = rect.height();
if (y < rect.top){
y = 0f;
}
else if(y > rect.bottom){
y = height;
}
else{
y = y - rect.top;
}
return 360f - (y * 360f / height);
}
private int pointToAlpha(int x){
final RectF rect = mAlphaRect;
final int width = (int) rect.width();
if(x < rect.left){
x = 0;
}
else if(x > rect.right){
x = width;
}
else{
x = x - (int)rect.left;
}
return 0xff - (x * 0xff / width);
}
@Override
public boolean onTrackballEvent(MotionEvent event) {
float x = event.getX();
float y = event.getY();
boolean update = false;
if(event.getAction() == MotionEvent.ACTION_MOVE){
switch(mLastTouchedPanel){
case PANEL_SAT_VAL:
float sat, val;
sat = mSat + x/50f;
val = mVal - y/50f;
if(sat < 0f){
sat = 0f;
}
else if(sat > 1f){
sat = 1f;
}
if(val < 0f){
val = 0f;
}
else if(val > 1f){
val = 1f;
}
mSat = sat;
mVal = val;
update = true;
break;
case PANEL_HUE:
float hue = mHue - y * 10f;
if(hue < 0f){
hue = 0f;
}
else if(hue > 360f){
hue = 360f;
}
mHue = hue;
update = true;
break;
case PANEL_ALPHA:
if(!mShowAlphaPanel || mAlphaRect == null){
update = false;
}
else{
int alpha = (int) (mAlpha - x*10);
if(alpha < 0){
alpha = 0;
}
else if(alpha > 0xff){
alpha = 0xff;
}
mAlpha = alpha;
update = true;
}
break;
}
}
if(update){
if(mListener != null){
mListener.onColorChanged(Color.HSVToColor(mAlpha, new float[]{mHue, mSat, mVal}));
}
invalidate();
return true;
}
return super.onTrackballEvent(event);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean update = false;
switch(event.getAction()){
case MotionEvent.ACTION_DOWN:
mStartTouchPoint = new Point((int)event.getX(), (int)event.getY());
update = moveTrackersIfNeeded(event);
break;
case MotionEvent.ACTION_MOVE:
update = moveTrackersIfNeeded(event);
break;
case MotionEvent.ACTION_UP:
mStartTouchPoint = null;
update = moveTrackersIfNeeded(event);
break;
}
if(update){
if(mListener != null){
mListener.onColorChanged(Color.HSVToColor(mAlpha, new float[]{mHue, mSat, mVal}));
}
invalidate();
return true;
}
return super.onTouchEvent(event);
}
private boolean moveTrackersIfNeeded(MotionEvent event){
if(mStartTouchPoint == null) return false;
boolean update = false;
int startX = mStartTouchPoint.x;
int startY = mStartTouchPoint.y;
if(mHueRect.contains(startX, startY)){
mLastTouchedPanel = PANEL_HUE;
mHue = pointToHue(event.getY());
update = true;
}
else if(mSatValRect.contains(startX, startY)){
mLastTouchedPanel = PANEL_SAT_VAL;
float[] result = pointToSatVal(event.getX(), event.getY());
mSat = result[0];
mVal = result[1];
update = true;
}
else if(mAlphaRect != null && mAlphaRect.contains(startX, startY)){
mLastTouchedPanel = PANEL_ALPHA;
mAlpha = pointToAlpha((int)event.getX());
update = true;
}
return update;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = 0;
int height = 0;
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
int widthAllowed = MeasureSpec.getSize(widthMeasureSpec);
int heightAllowed = MeasureSpec.getSize(heightMeasureSpec);
widthAllowed = chooseWidth(widthMode, widthAllowed);
heightAllowed = chooseHeight(heightMode, heightAllowed);
if(!mShowAlphaPanel){
height = (int) (widthAllowed - PANEL_SPACING - HUE_PANEL_WIDTH);
//If calculated height (based on the width) is more than the allowed height.
if(height > heightAllowed || getTag().equals("landscape")) {
height = heightAllowed;
width = (int) (height + PANEL_SPACING + HUE_PANEL_WIDTH);
}
else{
width = widthAllowed;
}
}
else{
width = (int) (heightAllowed - ALPHA_PANEL_HEIGHT + HUE_PANEL_WIDTH);
if(width > widthAllowed){
width = widthAllowed;
height = (int) (widthAllowed - HUE_PANEL_WIDTH + ALPHA_PANEL_HEIGHT);
}
else{
height = heightAllowed;
}
}
setMeasuredDimension(width, height);
}
private int chooseWidth(int mode, int size){
if (mode == MeasureSpec.AT_MOST || mode == MeasureSpec.EXACTLY) {
return size;
} else { // (mode == MeasureSpec.UNSPECIFIED)
return getPrefferedWidth();
}
}
private int chooseHeight(int mode, int size){
if (mode == MeasureSpec.AT_MOST || mode == MeasureSpec.EXACTLY) {
return size;
} else { // (mode == MeasureSpec.UNSPECIFIED)
return getPrefferedHeight();
}
}
private int getPrefferedWidth(){
int width = getPrefferedHeight();
if(mShowAlphaPanel){
width -= (PANEL_SPACING + ALPHA_PANEL_HEIGHT);
}
return (int) (width + HUE_PANEL_WIDTH + PANEL_SPACING);
}
private int getPrefferedHeight(){
int height = (int)(200 * mDensity);
if(mShowAlphaPanel){
height += PANEL_SPACING + ALPHA_PANEL_HEIGHT;
}
return height;
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mDrawingRect = new RectF();
mDrawingRect.left = mDrawingOffset + getPaddingLeft();
mDrawingRect.right = w - mDrawingOffset - getPaddingRight();
mDrawingRect.top = mDrawingOffset + getPaddingTop();
mDrawingRect.bottom = h - mDrawingOffset - getPaddingBottom();
setUpSatValRect();
setUpHueRect();
setUpAlphaRect();
}
private void setUpSatValRect(){
final RectF dRect = mDrawingRect;
float panelSide = dRect.height() - BORDER_WIDTH_PX * 2;
if(mShowAlphaPanel){
panelSide -= PANEL_SPACING + ALPHA_PANEL_HEIGHT;
}
float left = dRect.left + BORDER_WIDTH_PX;
float top = dRect.top + BORDER_WIDTH_PX;
float bottom = top + panelSide;
float right = left + panelSide;
mSatValRect = new RectF(left,top, right, bottom);
}
private void setUpHueRect(){
final RectF dRect = mDrawingRect;
float left = dRect.right - HUE_PANEL_WIDTH + BORDER_WIDTH_PX;
float top = dRect.top + BORDER_WIDTH_PX;
float bottom = dRect.bottom - BORDER_WIDTH_PX - (mShowAlphaPanel ? (PANEL_SPACING + ALPHA_PANEL_HEIGHT) : 0);
float right = dRect.right - BORDER_WIDTH_PX;
mHueRect = new RectF(left, top, right, bottom);
}
private void setUpAlphaRect() {
if(!mShowAlphaPanel) return;
final RectF dRect = mDrawingRect;
float left = dRect.left + BORDER_WIDTH_PX;
float top = dRect.bottom - ALPHA_PANEL_HEIGHT + BORDER_WIDTH_PX;
float bottom = dRect.bottom - BORDER_WIDTH_PX;
float right = dRect.right - BORDER_WIDTH_PX;
mAlphaRect = new RectF(left, top, right, bottom);
mAlphaPattern = new AlphaPatternDrawable((int) (5 * mDensity));
mAlphaPattern.setBounds(
Math.round(mAlphaRect.left),
Math.round(mAlphaRect.top),
Math.round(mAlphaRect.right),
Math.round(mAlphaRect.bottom)
);
}
/**
* Set a OnColorChangedListener to get notified when the color
* selected by the user has changed.
* @param listener
*/
public void setOnColorChangedListener(OnColorChangedListener listener){
mListener = listener;
}
/**
* Set the color of the border surrounding all panels.
* @param color
*/
public void setBorderColor(int color){
mBorderColor = color;
invalidate();
}
/**
* Get the color of the border surrounding all panels.
*/
public int getBorderColor(){
return mBorderColor;
}
/**
* Get the current color this view is showing.
* @return the current color.
*/
public int getColor(){
return Color.HSVToColor(mAlpha, new float[]{mHue,mSat,mVal});
}
/**
* Set the color the view should show.
* @param color The color that should be selected.
*/
public void setColor(int color){
setColor(color, false);
}
/**
* Set the color this view should show.
* @param color The color that should be selected.
* @param callback If you want to get a callback to
* your OnColorChangedListener.
*/
public void setColor(int color, boolean callback){
int alpha = Color.alpha(color);
int red = Color.red(color);
int blue = Color.blue(color);
int green = Color.green(color);
float[] hsv = new float[3];
Color.RGBToHSV(red, green, blue, hsv);
mAlpha = alpha;
mHue = hsv[0];
mSat = hsv[1];
mVal = hsv[2];
if(callback && mListener != null){
mListener.onColorChanged(Color.HSVToColor(mAlpha, new float[]{mHue, mSat, mVal}));
}
invalidate();
}
/**
* Get the drawing offset of the color picker view.
* The drawing offset is the distance from the side of
* a panel to the side of the view minus the padding.
* Useful if you want to have your own panel below showing
* the currently selected color and want to align it perfectly.
* @return The offset in pixels.
*/
public float getDrawingOffset(){
return mDrawingOffset;
}
/**
* Set if the user is allowed to adjust the alpha panel. Default is false.
* If it is set to false no alpha will be set.
* @param visible
*/
public void setAlphaSliderVisible(boolean visible){
if(mShowAlphaPanel != visible){
mShowAlphaPanel = visible;
/*
* Reset all shader to force a recreation.
* Otherwise they will not look right after
* the size of the view has changed.
*/
mValShader = null;
mSatShader = null;
mHueShader = null;
mAlphaShader = null;;
requestLayout();
}
}
public void setSliderTrackerColor(int color){
mSliderTrackerColor = color;
mHueTrackerPaint.setColor(mSliderTrackerColor);
invalidate();
}
public int getSliderTrackerColor(){
return mSliderTrackerColor;
}
/**
* Set the text that should be shown in the
* alpha slider. Set to null to disable text.
* @param res string resource id.
*/
public void setAlphaSliderText(int res){
String text = getContext().getString(res);
setAlphaSliderText(text);
}
/**
* Set the text that should be shown in the
* alpha slider. Set to null to disable text.
* @param text Text that should be shown.
*/
public void setAlphaSliderText(String text){
mAlphaSliderText = text;
invalidate();
}
/**
* Get the current value of the text
* that will be shown in the alpha
* slider.
* @return
*/
public String getAlphaSliderText(){
return mAlphaSliderText;
}
}

43
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/Test.java vendored

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
/*
* Copyright (C) 2011 Sergey Margaritov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.margaritov.preference.colorpicker;
import net.margaritov.preference.colorpicker.R;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceActivity;
public class Test extends PreferenceActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
((ColorPickerPreference)findPreference("color2")).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
preference.setSummary(ColorPickerPreference.convertToARGB(Integer.valueOf(String.valueOf(newValue))));
return true;
}
});
((ColorPickerPreference)findPreference("color2")).setAlphaSliderEnabled(true);
}
}

6
lib/src/org/transdroid/daemon/BitComet/BitCometAdapter.java

@ -480,7 +480,8 @@ public class BitCometAdapter implements IDaemonAdapter { @@ -480,7 +480,8 @@ public class BitCometAdapter implements IDaemonAdapter {
comment,
dateAdded,
null,
null));
null,
settings.getType()));
}
}
}
@ -557,7 +558,8 @@ public class BitCometAdapter implements IDaemonAdapter { @@ -557,7 +558,8 @@ public class BitCometAdapter implements IDaemonAdapter {
label,
dateAdded,
null,
null)); // Not supported in the web interface
null, // Not supported in the web interface
settings.getType()));
id++; // Stop/start/etc. requests are made by ID, which is the order number in the returned XML list :-S

3
lib/src/org/transdroid/daemon/Bitflu/BitfluAdapter.java

@ -214,7 +214,8 @@ public class BitfluAdapter implements IDaemonAdapter { @@ -214,7 +214,8 @@ public class BitfluAdapter implements IDaemonAdapter {
null, // label
null, // Not available
null, // Not available
null)); // Not available
null, // Not available
settings.getType()));
}
}
// Return the list

3
lib/src/org/transdroid/daemon/BuffaloNas/BuffaloNasAdapter.java

@ -281,7 +281,8 @@ public class BuffaloNasAdapter implements IDaemonAdapter { @@ -281,7 +281,8 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
null,
null,
null,
null));
null,
settings.getType()));
}
// Return the list

3
lib/src/org/transdroid/daemon/DLinkRouterBT/DLinkRouterBTAdapter.java

@ -376,7 +376,8 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter { @@ -376,7 +376,8 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
null,
null,
null,
null);
null,
settings.getType());
torrents.add(new_t);
}

5
lib/src/org/transdroid/daemon/Deluge/DelugeAdapter.java

@ -593,8 +593,9 @@ public class DelugeAdapter implements IDaemonAdapter { @@ -593,8 +593,9 @@ public class DelugeAdapter implements IDaemonAdapter {
0f, // Not available
tor.has(RPC_LABEL)? tor.getString(RPC_LABEL): null,
tor.has(RPC_TIMEADDED)? new Date(tor.getInt(RPC_TIMEADDED) * 1000L): null,
null,
tor.getString(RPC_MESSAGE))); // Not available
null, // Not available
tor.getString(RPC_MESSAGE),
settings.getType()));
}
}

4
lib/src/org/transdroid/daemon/Ktorrent/StatsParser.java

@ -5,6 +5,7 @@ import java.io.Reader; @@ -5,6 +5,7 @@ import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import org.transdroid.daemon.Daemon;
import org.transdroid.daemon.DaemonException;
import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentStatus;
@ -85,7 +86,8 @@ public class StatsParser { @@ -85,7 +86,8 @@ public class StatsParser {
null, // Not supported in the web interface
null, // Not supported in the web interface
null, // Not supported in the web interface
null)); // Not supported in the web interface
null, // Not supported in the web interface
Daemon.KTorrent));
id++; // Stop/start/etc. requests are made by ID, which is the order number in the returned XML list :-S
} else if (next == XmlPullParser.START_TAG && name.equals("torrent")){

3
lib/src/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java

@ -409,7 +409,8 @@ public class QbittorrentAdapter implements IDaemonAdapter { @@ -409,7 +409,8 @@ public class QbittorrentAdapter implements IDaemonAdapter {
null,
null, // Only available in /json/propertiesGeneral on a per-torrent basis, unfortunately
null,
null));
null,
settings.getType()));
}
// Return the list

10
lib/src/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java

@ -350,10 +350,11 @@ public class RtorrentAdapter implements IDaemonAdapter { @@ -350,10 +350,11 @@ public class RtorrentAdapter implements IDaemonAdapter {
(Long)info[10], // totalSize
((Long)info[8]).floatValue() / ((Long)info[10]).floatValue(), // partDone
0f, // TODO: Add availability data
label, // See remark on rTorrent/groups above
label,
added,
finished,
error));
error,
settings.getType()));
} else {
@ -379,10 +380,11 @@ public class RtorrentAdapter implements IDaemonAdapter { @@ -379,10 +380,11 @@ public class RtorrentAdapter implements IDaemonAdapter {
(Integer)info[10], // totalSize
((Integer)info[8]).floatValue() / ((Integer)info[10]).floatValue(), // partDone
0f, // TODO: Add availability data
label, // See remark on rTorrent/groups above
label,
added,
finished,
error));
error,
settings.getType()));
}
}

4
lib/src/org/transdroid/daemon/Tfb4rt/StatsParser.java

@ -5,6 +5,7 @@ import java.io.Reader; @@ -5,6 +5,7 @@ import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import org.transdroid.daemon.Daemon;
import org.transdroid.daemon.DaemonException;
import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentStatus;
@ -80,7 +81,8 @@ public class StatsParser { @@ -80,7 +81,8 @@ public class StatsParser {
null, // Not supported in the XML stats
null,
null,
null));
null,
Daemon.Tfb4rt));
} else if (next == XmlPullParser.START_TAG && name.equals("transfer")){

7
lib/src/org/transdroid/daemon/Torrent.java

@ -55,6 +55,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent> { @@ -55,6 +55,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent> {
final private Date dateAdded;
final private Date dateDone;
final private String error;
final private Daemon daemon;
//public long getID() { return id; }
//public String getHash() { return hash; }
@ -80,6 +81,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent> { @@ -80,6 +81,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent> {
public Date getDateAdded() { return dateAdded; }
public Date getDateDone() { return dateDone; }
public String getError() { return error; }
public Daemon getDaemon() { return daemon; }
private Torrent(Parcel in) {
this.id = in.readLong();
@ -108,12 +110,13 @@ public final class Torrent implements Parcelable, Comparable<Torrent> { @@ -108,12 +110,13 @@ public final class Torrent implements Parcelable, Comparable<Torrent> {
long lDateDone = in.readLong();
this.dateDone = (lDateDone == -1)? null: new Date(lDateDone);
this.error = in.readString();
this.daemon = Daemon.valueOf(in.readString());
}
public Torrent(long id, String hash, String name, TorrentStatus statusCode, String locationDir, int rateDownload, int rateUpload,
int peersGettingFromUs, int peersSendingToUs, int peersConnected, int peersKnown, int eta,
long downloadedEver, long uploadedEver, long totalSize, float partDone, float available, String label,
Date dateAdded, Date realDateDone, String error) {
Date dateAdded, Date realDateDone, String error, Daemon daemon) {
this.id = id;
this.hash = hash;
this.name = name;
@ -148,6 +151,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent> { @@ -148,6 +151,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent> {
}
}
this.error = error;
this.daemon = daemon;
}
/**
@ -295,6 +299,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent> { @@ -295,6 +299,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent> {
dest.writeLong((dateAdded == null)? -1: dateAdded.getTime());
dest.writeLong((dateDone == null)? -1: dateDone.getTime());
dest.writeString(error);
dest.writeString(daemon.name());
}
}

3
lib/src/org/transdroid/daemon/Transmission/TransmissionAdapter.java

@ -500,7 +500,8 @@ public class TransmissionAdapter implements IDaemonAdapter { @@ -500,7 +500,8 @@ public class TransmissionAdapter implements IDaemonAdapter {
null, // No label/category/group support in the RPC API for now
new Date(tor.getLong(RPC_DATEADDED) * 1000L),
new Date(tor.getLong(RPC_DATEDONE) * 1000L),
errorString));
errorString,
settings.getType()));
}
// Return the list

3
lib/src/org/transdroid/daemon/Utorrent/UtorrentAdapter.java

@ -515,7 +515,8 @@ public class UtorrentAdapter implements IDaemonAdapter { @@ -515,7 +515,8 @@ public class UtorrentAdapter implements IDaemonAdapter {
addedOnDate,
completedOnDate,
// uTorrent doesn't give the error message, so just remind that there is some error
status == TorrentStatus.Error? "See GUI for error message": null));
status == TorrentStatus.Error? "See GUI for error message": null,
settings.getType()));
}
return torrents;

16
lib/src/org/transdroid/daemon/Vuze/VuzeAdapter.java

@ -31,6 +31,7 @@ import java.util.Map; @@ -31,6 +31,7 @@ import java.util.Map;
import org.apache.openjpa.lib.util.Base16Encoder;
import org.transdroid.daemon.Daemon;
import org.transdroid.daemon.DaemonException;
import org.transdroid.daemon.DaemonException.ExceptionType;
import org.transdroid.daemon.DaemonMethod;
import org.transdroid.daemon.DaemonSettings;
import org.transdroid.daemon.IDaemonAdapter;
@ -38,7 +39,6 @@ import org.transdroid.daemon.Priority; @@ -38,7 +39,6 @@ import org.transdroid.daemon.Priority;
import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentFile;
import org.transdroid.daemon.TorrentStatus;
import org.transdroid.daemon.DaemonException.ExceptionType;
import org.transdroid.daemon.task.AddByFileTask;
import org.transdroid.daemon.task.AddByUrlTask;
import org.transdroid.daemon.task.DaemonTask;
@ -99,18 +99,27 @@ public class VuzeAdapter implements IDaemonAdapter { @@ -99,18 +99,27 @@ public class VuzeAdapter implements IDaemonAdapter {
case AddByFile:
byte[] bytes;
FileInputStream in = null;
try {
// Request to add a torrent by local .torrent file
String file = ((AddByFileTask)task).getFile();
FileInputStream in = new FileInputStream(new File(URI.create(file)));
in = new FileInputStream(new File(URI.create(file)));
bytes = new byte[in.available()];
in.read(bytes, 0, in.available());
in.close();
} catch (FileNotFoundException e) {
return new DaemonTaskFailureResult(task, new DaemonException(ExceptionType.FileAccessError, e.toString()));
} catch (IllegalArgumentException e) {
return new DaemonTaskFailureResult(task, new DaemonException(ExceptionType.FileAccessError, "Invalid local URI"));
} catch (Exception e) {
return new DaemonTaskFailureResult(task, new DaemonException(ExceptionType.FileAccessError, e.toString()));
} finally {
try {
if (in != null)
in.close();
} catch (IOException e) {
// Ignore; it was already closed or never opened
}
}
makeVuzeCall(DaemonMethod.AddByFile, "createFromBEncodedData[byte[]]", new String[] { Base16Encoder.encode(bytes) });
return new DaemonTaskSuccessResult(task);
@ -406,7 +415,8 @@ public class VuzeAdapter implements IDaemonAdapter { @@ -406,7 +415,8 @@ public class VuzeAdapter implements IDaemonAdapter {
null, // TODO: Implement Vuze label support
new Date((Long) statsinfo.get("time_started")), // dateAdded
null, // Unsupported?
error));
error,
settings.getType()));
}

84
lib/src/org/transdroid/daemon/util/FileSizeConverter.java

@ -15,71 +15,99 @@ @@ -15,71 +15,99 @@
* along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.transdroid.daemon.util;
package org.transdroid.daemon.util;
/**
* Quick and dirty file size formatter.
*
* @author erickok
*
*/
public class FileSizeConverter {
private static final String DECIMAL_FORMATTER = "%.1f";
/**
* A quantity in which to express a file size.
*
* @author erickok
*
*/
public enum SizeUnit {
B,
KB,
MB,
GB
B, KB, MB, GB
}
private static int INC_SIZE = 1024;
// Returns a file size given in bytes to a different unit, as a formatted string
public static String getSize(long from, SizeUnit to)
{
/**
* Returns a file size (in bytes) in a different unit, as a formatted string
* @param from The file size in bytes
* @param to The unit to convert to
* @return A formatted string with number (rounded to one decimal) and unit, e.g. 1177.4MB
*/
public static String getSize(long from, SizeUnit to) {
String out;
switch (to) {
case B:
out = String.valueOf(from);
break;
case KB:
out = String.format(DECIMAL_FORMATTER, ((double)from) / 1024);
out = String.format(DECIMAL_FORMATTER, ((double) from) / INC_SIZE);
break;
case MB:
out = String.format(DECIMAL_FORMATTER, ((double)from) / 1024 / 1024);
out = String.format(DECIMAL_FORMATTER, ((double) from) / INC_SIZE / INC_SIZE);
break;
default:
out = String.format(DECIMAL_FORMATTER, ((double)from) / 1024 / 1024 / 1024);
out = String.format(DECIMAL_FORMATTER, ((double) from) / INC_SIZE / INC_SIZE / INC_SIZE);
break;
}
return (out + " " + to.toString());
return (out + " " + to.toString());
}
// Returns a file size in bytes in a nice readable formatted string
/**
* Returns a file size as nice readable string, with unit, e.g. 1234567890 (bytes) returns 1,15GB
* @param from The file size in bytes
* @return A formatted string with number (rounded to one decimal), with unit text
*/
public static String getSize(long from) {
return getSize(from, true);
}
// Returns a file size in bytes in a nice readable formatted string
/**
* Returns a file size as nice readable string, e.g. 1234567890 (bytes) returns 1,15 or 1,15GB
* @param from The file size in bytes
* @param withUnit Whether to also append the appropriate unit (B, KB, MB, GB) as text
* @return A formatted string with number (rounded to one decimal) and optionally unit
*/
public static String getSize(long from, boolean withUnit) {
if (from < INC_SIZE) {
return String.valueOf(from) + (withUnit? SizeUnit.B.toString(): "");
} else if (from < (INC_SIZE * INC_SIZE)) {
return String.format(DECIMAL_FORMATTER, ((double)from) / INC_SIZE) + (withUnit? SizeUnit.KB.toString(): "");
return String.valueOf(from) + (withUnit ? SizeUnit.B.toString() : "");
} else if (from < (INC_SIZE * INC_SIZE)) {
return String.format(DECIMAL_FORMATTER, ((double) from) / INC_SIZE)
+ (withUnit ? SizeUnit.KB.toString() : "");
} else if (from < (INC_SIZE * INC_SIZE * INC_SIZE)) {
return String.format(DECIMAL_FORMATTER, ((double)from) / INC_SIZE / INC_SIZE) + (withUnit? SizeUnit.MB.toString(): "");
} else {
return String.format(DECIMAL_FORMATTER, ((double)from) / INC_SIZE / INC_SIZE / INC_SIZE) + (withUnit? SizeUnit.GB.toString(): "");
return String.format(DECIMAL_FORMATTER, ((double) from) / INC_SIZE / INC_SIZE)
+ (withUnit ? SizeUnit.MB.toString() : "");
} else {
return String.format(DECIMAL_FORMATTER, ((double) from) / INC_SIZE / INC_SIZE / INC_SIZE)
+ (withUnit ? SizeUnit.GB.toString() : "");
}
}
/**
* Returns the unit to display some file size (as returned by getSize(long)) in, e.g. 1234567890 (bytes) returns GB
* as it is 1.2GB big
* @param from The file size in bytes
* @return The unit, i.e. B, KB, MB or GB
*/
public static SizeUnit getSizeUnit(long from) {
if (from < INC_SIZE) {
return SizeUnit.B;
} else if (from < (INC_SIZE * INC_SIZE)) {
return SizeUnit.KB;
} else if (from < (INC_SIZE * INC_SIZE * INC_SIZE)) {
return SizeUnit.MB;
} else {
return SizeUnit.GB;
}
}
}

14
lite/.classpath

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
<?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="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/Transdroid Torrent Connect"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

3
lite/.factorypath

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
<factorypath>
<factorypathentry kind="WKSPJAR" id="/Transdroid Core/compile-libs/androidannotations-3.0-SNAPSHOT.jar" enabled="true" runInBatchMode="false"/>
</factorypath>

33
lite/.project

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Transdroid Core</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
lite/.settings/org.eclipse.jdt.apt.core.prefs

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=.apt_generated
org.eclipse.jdt.apt.reconcileEnabled=true

2
lite/.settings/org.eclipse.jdt.core.prefs

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.processAnnotations=enabled

102
lite/AndroidManifest.xml

@ -0,0 +1,102 @@ @@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.core"
android:versionCode="1"
android:versionName="2.0-alpha1" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock" >
<!-- Main activities -->
<activity
android:name="org.transdroid.core.gui.TorrentsActivity_"
android:label="@string/app_name"
android:icon="@drawable/ic_activity_torrents"
android:uiOptions="splitActionBarWhenNarrow"
android:theme="@style/TransdroidTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.default_searchable"
android:value="org.transdroid.gui.search.Search" />
</activity>
<activity
android:name="org.transdroid.core.gui.DetailsActivity_"
android:icon="@drawable/ic_activity_torrents"
android:uiOptions="splitActionBarWhenNarrow"
android:theme="@style/TransdroidTheme" >
</activity>
<!-- Settings screens -->
<activity android:name="org.transdroid.core.gui.settings.MainSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.ServerSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.WebsearchSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.RssfeedSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.NotificationSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.SystemSettingsActivity_" />
<!-- Search -->
<activity
android:name="org.transdroid.core.gui.SearchActivity"
android:label="@string/search_torrentsearch"
android:icon="@drawable/ic_activity_torrents"
android:theme="@style/TransdroidTheme" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<meta-data
android:name="android.app.default_searchable"
android:value="org.transdroid.gui.search.Search" />
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<provider
android:name="org.transdroid.core.gui.SearchHistoryProvider"
android:authorities="org.transdroid.core.gui.SearchHistoryProvider"
android:exported="false" />
<meta-data
android:name="android.app.default_searchable"
android:value="org.transdroid.core.gui.SearchActivity_" />
</application>
</manifest>

BIN
lite/compile-libs/androidannotations-3.0-SNAPSHOT.jar

Binary file not shown.

BIN
lite/libs/androidannotations-api-3.0-SNAPSHOT.jar

Binary file not shown.

20
lite/proguard-project.txt

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

16
lite/project.properties

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
# 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-16
android.library.reference.1=../external/JakeWharton-ActionBarSherlock/library
android.library.reference.2=../external/ColorPickerPreference

BIN
lite/res/drawable-hdpi/ab_bottom_solid_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

BIN
lite/res/drawable-hdpi/ab_solid_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

BIN
lite/res/drawable-hdpi/ab_stacked_solid_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

BIN
lite/res/drawable-hdpi/ab_transparent_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

BIN
lite/res/drawable-hdpi/ic_action_discard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
lite/res/drawable-hdpi/ic_action_labels.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
lite/res/drawable-hdpi/ic_action_new.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
lite/res/drawable-hdpi/ic_action_pause.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
lite/res/drawable-hdpi/ic_action_refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
lite/res/drawable-hdpi/ic_action_remove.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
lite/res/drawable-hdpi/ic_action_resume.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
lite/res/drawable-hdpi/ic_action_rss.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

BIN
lite/res/drawable-hdpi/ic_action_search.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
lite/res/drawable-hdpi/ic_action_sort_by_size.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
lite/res/drawable-hdpi/ic_action_start.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
lite/res/drawable-hdpi/ic_action_stop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
lite/res/drawable-hdpi/ic_activity_torrents.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
lite/res/drawable-hdpi/ic_empty_details.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
lite/res/drawable-hdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
lite/res/drawable-hdpi/ic_priority_high.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
lite/res/drawable-hdpi/ic_priority_low.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

BIN
lite/res/drawable-hdpi/ic_priority_normal.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
lite/res/drawable-hdpi/ic_priority_off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
lite/res/drawable-hdpi/list_focused_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

BIN
lite/res/drawable-hdpi/menu_dropdown_panel_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
lite/res/drawable-hdpi/menu_hardkey_panel_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

BIN
lite/res/drawable-hdpi/progress_bg_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

BIN
lite/res/drawable-hdpi/progress_primary_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

BIN
lite/res/drawable-hdpi/progress_secondary_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

BIN
lite/res/drawable-hdpi/spinner_ab_default_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

BIN
lite/res/drawable-hdpi/spinner_ab_disabled_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

BIN
lite/res/drawable-hdpi/spinner_ab_focused_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

BIN
lite/res/drawable-hdpi/spinner_ab_pressed_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

BIN
lite/res/drawable-hdpi/tab_selected_focused_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
lite/res/drawable-hdpi/tab_selected_pressed_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
lite/res/drawable-hdpi/tab_selected_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

BIN
lite/res/drawable-hdpi/tab_unselected_focused_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

BIN
lite/res/drawable-hdpi/tab_unselected_pressed_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

BIN
lite/res/drawable-mdpi/ab_bottom_solid_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

BIN
lite/res/drawable-mdpi/ab_solid_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

BIN
lite/res/drawable-mdpi/ab_stacked_solid_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

BIN
lite/res/drawable-mdpi/ab_transparent_transdroid.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

BIN
lite/res/drawable-mdpi/ic_action_discard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
lite/res/drawable-mdpi/ic_action_labels.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
lite/res/drawable-mdpi/ic_action_new.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
lite/res/drawable-mdpi/ic_action_pause.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
lite/res/drawable-mdpi/ic_action_refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
lite/res/drawable-mdpi/ic_action_remove.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
lite/res/drawable-mdpi/ic_action_resume.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
lite/res/drawable-mdpi/ic_action_rss.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save