Browse Source

Upgraded to Gradle build system, with full and lite as flavours (rather than usign a library core project). Lib (Torrent Connect) is now integrated directly. Closes #148.

pull/177/head
Eric Kok 10 years ago
parent
commit
bda024f418
  1. 32
      .gitignore
  2. 61
      app/build.gradle
  3. 0
      app/src/full/res/values/bools.xml
  4. 0
      app/src/full/res/values/strings.xml
  5. 0
      app/src/lite/res/values/bools.xml
  6. 0
      app/src/lite/res/values/strings.xml
  7. 10
      app/src/main/AndroidManifest.xml
  8. 0
      app/src/main/java/com/android/internalcopy/http/multipart/BitCometFilePart.java
  9. 0
      app/src/main/java/com/android/internalcopy/http/multipart/ByteArrayPartSource.java
  10. 0
      app/src/main/java/com/android/internalcopy/http/multipart/FilePart.java
  11. 0
      app/src/main/java/com/android/internalcopy/http/multipart/FilePartSource.java
  12. 0
      app/src/main/java/com/android/internalcopy/http/multipart/MultipartEntity.java
  13. 0
      app/src/main/java/com/android/internalcopy/http/multipart/Part.java
  14. 0
      app/src/main/java/com/android/internalcopy/http/multipart/PartBase.java
  15. 0
      app/src/main/java/com/android/internalcopy/http/multipart/PartSource.java
  16. 0
      app/src/main/java/com/android/internalcopy/http/multipart/StringPart.java
  17. 0
      app/src/main/java/com/android/internalcopy/http/multipart/Utf8StringPart.java
  18. 0
      app/src/main/java/de/timroes/axmlrpc/Call.java
  19. 0
      app/src/main/java/de/timroes/axmlrpc/ResponseParser.java
  20. 0
      app/src/main/java/de/timroes/axmlrpc/XMLRPCCallback.java
  21. 0
      app/src/main/java/de/timroes/axmlrpc/XMLRPCClient.java
  22. 0
      app/src/main/java/de/timroes/axmlrpc/XMLRPCException.java
  23. 0
      app/src/main/java/de/timroes/axmlrpc/XMLRPCRuntimeException.java
  24. 0
      app/src/main/java/de/timroes/axmlrpc/XMLRPCServerException.java
  25. 0
      app/src/main/java/de/timroes/axmlrpc/XMLRPCTimeoutException.java
  26. 0
      app/src/main/java/de/timroes/axmlrpc/XMLUtil.java
  27. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/ArraySerializer.java
  28. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/Base64Serializer.java
  29. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/BooleanSerializer.java
  30. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/DateTimeSerializer.java
  31. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/DoubleSerializer.java
  32. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/IntSerializer.java
  33. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/LongSerializer.java
  34. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/NullSerializer.java
  35. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/Serializer.java
  36. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/SerializerHandler.java
  37. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/StringSerializer.java
  38. 0
      app/src/main/java/de/timroes/axmlrpc/serializer/StructSerializer.java
  39. 0
      app/src/main/java/de/timroes/axmlrpc/xmlcreator/SimpleXMLCreator.java
  40. 0
      app/src/main/java/de/timroes/axmlrpc/xmlcreator/XmlElement.java
  41. 0
      app/src/main/java/de/timroes/base64/Base64.java
  42. 0
      app/src/main/java/net/margaritov/preference/colorpicker/AlphaPatternDrawable.java
  43. 18
      app/src/main/java/net/margaritov/preference/colorpicker/ColorPickerDialog.java
  44. 9
      app/src/main/java/net/margaritov/preference/colorpicker/ColorPickerPanelView.java
  45. 31
      app/src/main/java/net/margaritov/preference/colorpicker/ColorPickerPreference.java
  46. 116
      app/src/main/java/net/margaritov/preference/colorpicker/ColorPickerView.java
  47. 0
      app/src/main/java/org/apache/openjpa/lib/util/Base16Encoder.java
  48. 0
      app/src/main/java/org/base64/android/Base64.java
  49. 0
      app/src/main/java/org/transdroid/core/app/search/GoogleWebSearchBarcodeResolver.java
  50. 0
      app/src/main/java/org/transdroid/core/app/search/SearchHelper.java
  51. 0
      app/src/main/java/org/transdroid/core/app/search/SearchResult.java
  52. 0
      app/src/main/java/org/transdroid/core/app/search/SearchSite.java
  53. 0
      app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java
  54. 2
      app/src/main/java/org/transdroid/core/app/settings/NotificationSettings.java
  55. 0
      app/src/main/java/org/transdroid/core/app/settings/RssfeedSetting.java
  56. 0
      app/src/main/java/org/transdroid/core/app/settings/ServerSetting.java
  57. 0
      app/src/main/java/org/transdroid/core/app/settings/SettingsPersistence.java
  58. 0
      app/src/main/java/org/transdroid/core/app/settings/SystemSettings.java
  59. 0
      app/src/main/java/org/transdroid/core/app/settings/WebsearchSetting.java
  60. 2
      app/src/main/java/org/transdroid/core/gui/DetailsActivity.java
  61. 2
      app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
  62. 0
      app/src/main/java/org/transdroid/core/gui/FilterEntryDialog.java
  63. 2
      app/src/main/java/org/transdroid/core/gui/ServerPickerDialog.java
  64. 2
      app/src/main/java/org/transdroid/core/gui/ServerStatusView.java
  65. 0
      app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java
  66. 2
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  67. 2
      app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
  68. 2
      app/src/main/java/org/transdroid/core/gui/lists/DetailsAdapter.java
  69. 2
      app/src/main/java/org/transdroid/core/gui/lists/LocalTorrent.java
  70. 0
      app/src/main/java/org/transdroid/core/gui/lists/MergeAdapter.java
  71. 2
      app/src/main/java/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java
  72. 0
      app/src/main/java/org/transdroid/core/gui/lists/SimpleListItem.java
  73. 0
      app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemAdapter.java
  74. 0
      app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemSpinnerAdapter.java
  75. 0
      app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemView.java
  76. 2
      app/src/main/java/org/transdroid/core/gui/lists/SortByListItem.java
  77. 2
      app/src/main/java/org/transdroid/core/gui/lists/TorrentDetailsView.java
  78. 2
      app/src/main/java/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java
  79. 0
      app/src/main/java/org/transdroid/core/gui/lists/TorrentFileView.java
  80. 2
      app/src/main/java/org/transdroid/core/gui/lists/TorrentProgressBar.java
  81. 2
      app/src/main/java/org/transdroid/core/gui/lists/TorrentStatusLayout.java
  82. 0
      app/src/main/java/org/transdroid/core/gui/lists/TorrentView.java
  83. 0
      app/src/main/java/org/transdroid/core/gui/lists/TorrentsAdapter.java
  84. 0
      app/src/main/java/org/transdroid/core/gui/lists/ViewHolderAdapter.java
  85. 0
      app/src/main/java/org/transdroid/core/gui/log/DatabaseHelper.java
  86. 0
      app/src/main/java/org/transdroid/core/gui/log/ErrorLogEntry.java
  87. 2
      app/src/main/java/org/transdroid/core/gui/log/ErrorLogSender.java
  88. 0
      app/src/main/java/org/transdroid/core/gui/log/Log.java
  89. 0
      app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java
  90. 2
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java
  91. 0
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListDropDownAdapter.java
  92. 0
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemAdapter.java
  93. 0
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemView.java
  94. 0
      app/src/main/java/org/transdroid/core/gui/navigation/FilterSeparatorView.java
  95. 0
      app/src/main/java/org/transdroid/core/gui/navigation/Label.java
  96. 0
      app/src/main/java/org/transdroid/core/gui/navigation/NavigationFilter.java
  97. 49
      app/src/main/java/org/transdroid/core/gui/navigation/NavigationHelper.java
  98. 0
      app/src/main/java/org/transdroid/core/gui/navigation/NavigationSelectionView.java
  99. 0
      app/src/main/java/org/transdroid/core/gui/navigation/RefreshableActivity.java
  100. 0
      app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java
  101. Some files were not shown because too many files have changed in this diff Show More

32
.gitignore vendored

@ -1,26 +1,16 @@ @@ -1,26 +1,16 @@
# built application files
*.apk
*.ap_
# ignore Gradle files
.gradle/
build/
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
.apt_generated/
# Local configuration file (sdk path, etc)
# local configuration file (sdk path, etc)
local.properties
signing.gradle
# Eclipse project files
.classpath
.project
.settings/
.local.properties
# IntelliJ
*.iml
*.ipr
*.iws
.idea
# OS temp files
# Mac
.DS_Store

61
app/build.gradle

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply from: '../signing.gradle'
android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
defaultConfig {
minSdkVersion 15
targetSdkVersion 19
versionCode 216
versionName '2.3.0'
resValue "string", "search_history_authority", applicationId + ".search.SearchHistoryProvider"
}
signingConfigs {
release {
storeFile STORE_FILE
storePassword STORE_PASSWORD
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
}
}
buildTypes {
release {
runProguard false
signingConfig signingConfigs.release
}
}
productFlavors {
full {
applicationId 'org.transdroid.full'
}
lite {
applicationId 'org.transdroid.lite'
}
}
lintOptions {
disable 'MissingTranslation', 'ExtraTranslation'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.androidannotations:androidannotations-api:3.1'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:0.8'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.+'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.+'
apt "org.androidannotations:androidannotations:3.1"
}
apt {
arguments {
androidManifestFile variant.processResources.manifestFile
resourcePackageName 'org.transdroid'
//logLevel 'INFO'
//logFile '/Users/erickok/Dev/transdroid/transdroid/app/build/aa-log.txt'
}
}

0
full/res/values/bools.xml → app/src/full/res/values/bools.xml

0
full/res/values/strings.xml → app/src/full/res/values/strings.xml

0
lite/res/values/bools.xml → app/src/lite/res/values/bools.xml

0
lite/res/values/strings.xml → app/src/lite/res/values/strings.xml

10
full/AndroidManifest.xml → app/src/main/AndroidManifest.xml

@ -17,13 +17,9 @@ @@ -17,13 +17,9 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.transdroid.full"
android:versionCode="216"
android:versionName="2.3.0" >
package="org.transdroid" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="19" />
<uses-sdk />
<supports-screens
android:anyDensity="true"
@ -229,7 +225,7 @@ @@ -229,7 +225,7 @@
<provider
android:name="org.transdroid.core.gui.search.SearchHistoryProvider"
android:authorities="org.transdroid.core.gui.search.SearchHistoryProvider"
android:authorities="@string/search_history_authority"
android:exported="false" />
<!-- RSS -->

0
lib/src/com/android/internalcopy/http/multipart/BitCometFilePart.java → app/src/main/java/com/android/internalcopy/http/multipart/BitCometFilePart.java

0
lib/src/com/android/internalcopy/http/multipart/ByteArrayPartSource.java → app/src/main/java/com/android/internalcopy/http/multipart/ByteArrayPartSource.java

0
lib/src/com/android/internalcopy/http/multipart/FilePart.java → app/src/main/java/com/android/internalcopy/http/multipart/FilePart.java

0
lib/src/com/android/internalcopy/http/multipart/FilePartSource.java → app/src/main/java/com/android/internalcopy/http/multipart/FilePartSource.java

0
lib/src/com/android/internalcopy/http/multipart/MultipartEntity.java → app/src/main/java/com/android/internalcopy/http/multipart/MultipartEntity.java

0
lib/src/com/android/internalcopy/http/multipart/Part.java → app/src/main/java/com/android/internalcopy/http/multipart/Part.java

0
lib/src/com/android/internalcopy/http/multipart/PartBase.java → app/src/main/java/com/android/internalcopy/http/multipart/PartBase.java

0
lib/src/com/android/internalcopy/http/multipart/PartSource.java → app/src/main/java/com/android/internalcopy/http/multipart/PartSource.java

0
lib/src/com/android/internalcopy/http/multipart/StringPart.java → app/src/main/java/com/android/internalcopy/http/multipart/StringPart.java

0
lib/src/com/android/internalcopy/http/multipart/Utf8StringPart.java → app/src/main/java/com/android/internalcopy/http/multipart/Utf8StringPart.java

0
lib/src/de/timroes/axmlrpc/Call.java → app/src/main/java/de/timroes/axmlrpc/Call.java

0
lib/src/de/timroes/axmlrpc/ResponseParser.java → app/src/main/java/de/timroes/axmlrpc/ResponseParser.java

0
lib/src/de/timroes/axmlrpc/XMLRPCCallback.java → app/src/main/java/de/timroes/axmlrpc/XMLRPCCallback.java

0
lib/src/de/timroes/axmlrpc/XMLRPCClient.java → app/src/main/java/de/timroes/axmlrpc/XMLRPCClient.java

0
lib/src/de/timroes/axmlrpc/XMLRPCException.java → app/src/main/java/de/timroes/axmlrpc/XMLRPCException.java

0
lib/src/de/timroes/axmlrpc/XMLRPCRuntimeException.java → app/src/main/java/de/timroes/axmlrpc/XMLRPCRuntimeException.java

0
lib/src/de/timroes/axmlrpc/XMLRPCServerException.java → app/src/main/java/de/timroes/axmlrpc/XMLRPCServerException.java

0
lib/src/de/timroes/axmlrpc/XMLRPCTimeoutException.java → app/src/main/java/de/timroes/axmlrpc/XMLRPCTimeoutException.java

0
lib/src/de/timroes/axmlrpc/XMLUtil.java → app/src/main/java/de/timroes/axmlrpc/XMLUtil.java

0
lib/src/de/timroes/axmlrpc/serializer/ArraySerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/ArraySerializer.java

0
lib/src/de/timroes/axmlrpc/serializer/Base64Serializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/Base64Serializer.java

0
lib/src/de/timroes/axmlrpc/serializer/BooleanSerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/BooleanSerializer.java

0
lib/src/de/timroes/axmlrpc/serializer/DateTimeSerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/DateTimeSerializer.java

0
lib/src/de/timroes/axmlrpc/serializer/DoubleSerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/DoubleSerializer.java

0
lib/src/de/timroes/axmlrpc/serializer/IntSerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/IntSerializer.java

0
lib/src/de/timroes/axmlrpc/serializer/LongSerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/LongSerializer.java

0
lib/src/de/timroes/axmlrpc/serializer/NullSerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/NullSerializer.java

0
lib/src/de/timroes/axmlrpc/serializer/Serializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/Serializer.java

0
lib/src/de/timroes/axmlrpc/serializer/SerializerHandler.java → app/src/main/java/de/timroes/axmlrpc/serializer/SerializerHandler.java

0
lib/src/de/timroes/axmlrpc/serializer/StringSerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/StringSerializer.java

0
lib/src/de/timroes/axmlrpc/serializer/StructSerializer.java → app/src/main/java/de/timroes/axmlrpc/serializer/StructSerializer.java

0
lib/src/de/timroes/axmlrpc/xmlcreator/SimpleXMLCreator.java → app/src/main/java/de/timroes/axmlrpc/xmlcreator/SimpleXMLCreator.java

0
lib/src/de/timroes/axmlrpc/xmlcreator/XmlElement.java → app/src/main/java/de/timroes/axmlrpc/xmlcreator/XmlElement.java

0
lib/src/de/timroes/base64/Base64.java → app/src/main/java/de/timroes/base64/Base64.java

0
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/AlphaPatternDrawable.java → app/src/main/java/net/margaritov/preference/colorpicker/AlphaPatternDrawable.java

18
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerDialog.java → app/src/main/java/net/margaritov/preference/colorpicker/ColorPickerDialog.java

@ -24,12 +24,9 @@ import android.view.LayoutInflater; @@ -24,12 +24,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
public class ColorPickerDialog
extends
Dialog
implements
ColorPickerView.OnColorChangedListener,
View.OnClickListener {
import org.transdroid.R;
public class ColorPickerDialog extends Dialog implements ColorPickerView.OnColorChangedListener, View.OnClickListener {
private ColorPickerView mColorPicker;
@ -70,12 +67,9 @@ public class ColorPickerDialog @@ -70,12 +67,9 @@ public class ColorPickerDialog
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
);
((LinearLayout) mOldColor.getParent())
.setPadding(Math.round(mColorPicker.getDrawingOffset()), 0, Math.round(mColorPicker.getDrawingOffset()),
0);
mOldColor.setOnClickListener(this);
mNewColor.setOnClickListener(this);

9
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerPanelView.java → app/src/main/java/net/margaritov/preference/colorpicker/ColorPickerPanelView.java

@ -28,7 +28,6 @@ import android.view.View; @@ -28,7 +28,6 @@ import android.view.View;
* 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 {
@ -126,12 +125,8 @@ public class ColorPickerPanelView extends View { @@ -126,12 +125,8 @@ public class ColorPickerPanelView extends View {
mAlphaPattern = new AlphaPatternDrawable((int) (5 * mDensity));
mAlphaPattern.setBounds(
Math.round(mColorRect.left),
Math.round(mColorRect.top),
Math.round(mColorRect.right),
Math.round(mColorRect.bottom)
);
mAlphaPattern.setBounds(Math.round(mColorRect.left), Math.round(mColorRect.top), Math.round(mColorRect.right),
Math.round(mColorRect.bottom));
}

31
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerPreference.java → app/src/main/java/net/margaritov/preference/colorpicker/ColorPickerPreference.java

@ -34,12 +34,8 @@ import android.widget.LinearLayout; @@ -34,12 +34,8 @@ 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 {
public class ColorPickerPreference extends Preference
implements Preference.OnPreferenceClickListener, ColorPickerDialog.OnColorChangedListener {
View mView;
ColorPickerDialog mDialog;
@ -88,17 +84,18 @@ public class ColorPickerPreference @@ -88,17 +84,18 @@ public class ColorPickerPreference
}
private void setPreviewColor() {
if (mView == null) return;
if (mView == null) {
return;
}
ImageView iView = new ImageView(getContext());
LinearLayout widgetFrameView = ((LinearLayout) mView.findViewById(android.R.id.widget_frame));
if (widgetFrameView == null) return;
if (widgetFrameView == null) {
return;
}
widgetFrameView.setVisibility(View.VISIBLE);
widgetFrameView.setPadding(
widgetFrameView.getPaddingLeft(),
widgetFrameView.getPaddingTop(),
(int)(mDensity * 8),
widgetFrameView.getPaddingBottom()
);
widgetFrameView
.setPadding(widgetFrameView.getPaddingLeft(), widgetFrameView.getPaddingTop(), (int) (mDensity * 8),
widgetFrameView.getPaddingBottom());
// remove already create preview image
int count = widgetFrameView.getChildCount();
if (count > 0) {
@ -218,8 +215,7 @@ public class ColorPickerPreference @@ -218,8 +215,7 @@ public class ColorPickerPreference
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) {
} else if (argb.length() == 6) {
alpha = 255;
red = Integer.parseInt(argb.substring(0, 2), 16);
green = Integer.parseInt(argb.substring(2, 4), 16);
@ -273,8 +269,7 @@ public class ColorPickerPreference @@ -273,8 +269,7 @@ public class ColorPickerPreference
}
@SuppressWarnings("unused")
public static final Parcelable.Creator<SavedState> CREATOR =
new Parcelable.Creator<SavedState>() {
public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() {
public SavedState createFromParcel(Parcel in) {
return new SavedState(in);
}

116
external/ColorPickerPreference/src/net/margaritov/preference/colorpicker/ColorPickerView.java → app/src/main/java/net/margaritov/preference/colorpicker/ColorPickerView.java

@ -22,12 +22,12 @@ import android.graphics.Color; @@ -22,12 +22,12 @@ import android.graphics.Color;
import android.graphics.ComposeShader;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
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;
@ -220,7 +220,9 @@ public class ColorPickerView extends View { @@ -220,7 +220,9 @@ public class ColorPickerView extends View {
@Override
protected void onDraw(Canvas canvas) {
if(mDrawingRect.width() <= 0 || mDrawingRect.height() <= 0) return;
if (mDrawingRect.width() <= 0 || mDrawingRect.height() <= 0) {
return;
}
drawSatValPanel(canvas);
drawHuePanel(canvas);
@ -234,18 +236,18 @@ public class ColorPickerView extends View { @@ -234,18 +236,18 @@ public class ColorPickerView extends View {
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);
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);
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);
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);
@ -267,15 +269,13 @@ public class ColorPickerView extends View { @@ -267,15 +269,13 @@ public class ColorPickerView extends View {
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);
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);
mHueShader = new LinearGradient(rect.left, rect.top, rect.left, rect.bottom, buildHueColorArray(), null,
TileMode.CLAMP);
mHuePaint.setShader(mHueShader);
}
@ -298,17 +298,16 @@ public class ColorPickerView extends View { @@ -298,17 +298,16 @@ public class ColorPickerView extends View {
private void drawAlphaPanel(Canvas canvas) {
if(!mShowAlphaPanel || mAlphaRect == null || mAlphaPattern == null) return;
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);
canvas.drawRect(rect.left - BORDER_WIDTH_PX, rect.top - BORDER_WIDTH_PX, rect.right + BORDER_WIDTH_PX,
rect.bottom + BORDER_WIDTH_PX, mBorderPaint);
}
@ -318,8 +317,7 @@ public class ColorPickerView extends View { @@ -318,8 +317,7 @@ public class ColorPickerView extends View {
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);
mAlphaShader = new LinearGradient(rect.left, rect.top, rect.right, rect.top, color, acolor, TileMode.CLAMP);
mAlphaPaint.setShader(mAlphaShader);
@ -396,21 +394,17 @@ public class ColorPickerView extends View { @@ -396,21 +394,17 @@ public class ColorPickerView extends View {
if (x < rect.left) {
x = 0f;
}
else if(x > rect.right){
} else if (x > rect.right) {
x = width;
}
else{
} else {
x = x - rect.left;
}
if (y < rect.top) {
y = 0f;
}
else if(y > rect.bottom){
} else if (y > rect.bottom) {
y = height;
}
else{
} else {
y = y - rect.top;
}
@ -429,11 +423,9 @@ public class ColorPickerView extends View { @@ -429,11 +423,9 @@ public class ColorPickerView extends View {
if (y < rect.top) {
y = 0f;
}
else if(y > rect.bottom){
} else if (y > rect.bottom) {
y = height;
}
else{
} else {
y = y - rect.top;
}
@ -447,11 +439,9 @@ public class ColorPickerView extends View { @@ -447,11 +439,9 @@ public class ColorPickerView extends View {
if (x < rect.left) {
x = 0;
}
else if(x > rect.right){
} else if (x > rect.right) {
x = width;
}
else{
} else {
x = x - (int) rect.left;
}
@ -482,15 +472,13 @@ public class ColorPickerView extends View { @@ -482,15 +472,13 @@ public class ColorPickerView extends View {
if (sat < 0f) {
sat = 0f;
}
else if(sat > 1f){
} else if (sat > 1f) {
sat = 1f;
}
if (val < 0f) {
val = 0f;
}
else if(val > 1f){
} else if (val > 1f) {
val = 1f;
}
@ -507,8 +495,7 @@ public class ColorPickerView extends View { @@ -507,8 +495,7 @@ public class ColorPickerView extends View {
if (hue < 0f) {
hue = 0f;
}
else if(hue > 360f){
} else if (hue > 360f) {
hue = 360f;
}
@ -522,15 +509,13 @@ public class ColorPickerView extends View { @@ -522,15 +509,13 @@ public class ColorPickerView extends View {
if (!mShowAlphaPanel || mAlphaRect == null) {
update = false;
}
else{
} else {
int alpha = (int) (mAlpha - x * 10);
if (alpha < 0) {
alpha = 0;
}
else if(alpha > 0xff){
} else if (alpha > 0xff) {
alpha = 0xff;
}
@ -608,7 +593,9 @@ public class ColorPickerView extends View { @@ -608,7 +593,9 @@ public class ColorPickerView extends View {
private boolean moveTrackersIfNeeded(MotionEvent event) {
if(mStartTouchPoint == null) return false;
if (mStartTouchPoint == null) {
return false;
}
boolean update = false;
@ -622,8 +609,7 @@ public class ColorPickerView extends View { @@ -622,8 +609,7 @@ public class ColorPickerView extends View {
mHue = pointToHue(event.getY());
update = true;
}
else if(mSatValRect.contains(startX, startY)){
} else if (mSatValRect.contains(startX, startY)) {
mLastTouchedPanel = PANEL_SAT_VAL;
@ -633,8 +619,7 @@ public class ColorPickerView extends View { @@ -633,8 +619,7 @@ public class ColorPickerView extends View {
mVal = result[1];
update = true;
}
else if(mAlphaRect != null && mAlphaRect.contains(startX, startY)){
} else if (mAlphaRect != null && mAlphaRect.contains(startX, startY)) {
mLastTouchedPanel = PANEL_ALPHA;
@ -670,20 +655,17 @@ public class ColorPickerView extends View { @@ -670,20 +655,17 @@ public class ColorPickerView extends View {
if (height > heightAllowed || getTag().equals("landscape")) {
height = heightAllowed;
width = (int) (height + PANEL_SPACING + HUE_PANEL_WIDTH);
}
else{
} else {
width = widthAllowed;
}
}
else{
} 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{
} else {
height = heightAllowed;
}
@ -733,7 +715,6 @@ public class ColorPickerView extends View { @@ -733,7 +715,6 @@ public class ColorPickerView extends View {
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
@ -779,7 +760,9 @@ public class ColorPickerView extends View { @@ -779,7 +760,9 @@ public class ColorPickerView extends View {
private void setUpAlphaRect() {
if(!mShowAlphaPanel) return;
if (!mShowAlphaPanel) {
return;
}
final RectF dRect = mDrawingRect;
@ -791,12 +774,8 @@ public class ColorPickerView extends View { @@ -791,12 +774,8 @@ public class ColorPickerView extends View {
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)
);
mAlphaPattern.setBounds(Math.round(mAlphaRect.left), Math.round(mAlphaRect.top), Math.round(mAlphaRect.right),
Math.round(mAlphaRect.bottom));
}
@ -901,7 +880,8 @@ public class ColorPickerView extends View { @@ -901,7 +880,8 @@ public class ColorPickerView extends View {
mValShader = null;
mSatShader = null;
mHueShader = null;
mAlphaShader = null;;
mAlphaShader = null;
;
requestLayout();
}

0
lib/src/org/apache/openjpa/lib/util/Base16Encoder.java → app/src/main/java/org/apache/openjpa/lib/util/Base16Encoder.java

0
lib/src/org/base64/android/Base64.java → app/src/main/java/org/base64/android/Base64.java

0
core/src/org/transdroid/core/app/search/GoogleWebSearchBarcodeResolver.java → app/src/main/java/org/transdroid/core/app/search/GoogleWebSearchBarcodeResolver.java

0
core/src/org/transdroid/core/app/search/SearchHelper.java → app/src/main/java/org/transdroid/core/app/search/SearchHelper.java

0
core/src/org/transdroid/core/app/search/SearchResult.java → app/src/main/java/org/transdroid/core/app/search/SearchResult.java

0
core/src/org/transdroid/core/app/search/SearchSite.java → app/src/main/java/org/transdroid/core/app/search/SearchSite.java

0
core/src/org/transdroid/core/app/settings/ApplicationSettings.java → app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java

2
core/src/org/transdroid/core/app/settings/NotificationSettings.java → app/src/main/java/org/transdroid/core/app/settings/NotificationSettings.java

@ -19,7 +19,7 @@ package org.transdroid.core.app.settings; @@ -19,7 +19,7 @@ package org.transdroid.core.app.settings;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.EBean.Scope;
import org.androidannotations.annotations.RootContext;
import org.transdroid.core.R;
import org.transdroid.R;
import android.content.Context;
import android.content.SharedPreferences;

0
core/src/org/transdroid/core/app/settings/RssfeedSetting.java → app/src/main/java/org/transdroid/core/app/settings/RssfeedSetting.java

0
core/src/org/transdroid/core/app/settings/ServerSetting.java → app/src/main/java/org/transdroid/core/app/settings/ServerSetting.java

0
core/src/org/transdroid/core/app/settings/SettingsPersistence.java → app/src/main/java/org/transdroid/core/app/settings/SettingsPersistence.java

0
core/src/org/transdroid/core/app/settings/SystemSettings.java → app/src/main/java/org/transdroid/core/app/settings/SystemSettings.java

0
core/src/org/transdroid/core/app/settings/WebsearchSetting.java → app/src/main/java/org/transdroid/core/app/settings/WebsearchSetting.java

2
core/src/org/transdroid/core/gui/DetailsActivity.java → app/src/main/java/org/transdroid/core/gui/DetailsActivity.java

@ -29,7 +29,7 @@ import org.androidannotations.annotations.InstanceState; @@ -29,7 +29,7 @@ import org.androidannotations.annotations.InstanceState;
import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.OptionsMenu;
import org.androidannotations.annotations.UiThread;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.app.settings.*;
import org.transdroid.core.gui.lists.LocalTorrent;
import org.transdroid.core.gui.lists.NoProgressHeaderTransformer;

2
core/src/org/transdroid/core/gui/DetailsFragment.java → app/src/main/java/org/transdroid/core/gui/DetailsFragment.java

@ -28,7 +28,7 @@ import org.androidannotations.annotations.ItemClick; @@ -28,7 +28,7 @@ import org.androidannotations.annotations.ItemClick;
import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.OptionsMenu;
import org.androidannotations.annotations.ViewById;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.app.settings.ServerSetting;
import org.transdroid.core.app.settings.SystemSettings_;
import org.transdroid.core.gui.lists.DetailsAdapter;

0
core/src/org/transdroid/core/gui/FilterEntryDialog.java → app/src/main/java/org/transdroid/core/gui/FilterEntryDialog.java

2
core/src/org/transdroid/core/gui/ServerPickerDialog.java → app/src/main/java/org/transdroid/core/gui/ServerPickerDialog.java

@ -2,7 +2,7 @@ package org.transdroid.core.gui; @@ -2,7 +2,7 @@ package org.transdroid.core.gui;
import java.util.List;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.app.settings.ServerSetting;
import android.app.AlertDialog;

2
core/src/org/transdroid/core/gui/ServerStatusView.java → app/src/main/java/org/transdroid/core/gui/ServerStatusView.java

@ -20,7 +20,7 @@ import java.util.List; @@ -20,7 +20,7 @@ import java.util.List;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.SetTransferRatesDialog;
import org.transdroid.core.gui.navigation.SetTransferRatesDialog.OnRatesPickedListener;

0
core/src/org/transdroid/core/gui/TorrentTasksExecutor.java → app/src/main/java/org/transdroid/core/gui/TorrentTasksExecutor.java

2
core/src/org/transdroid/core/gui/TorrentsActivity.java → app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java

@ -43,7 +43,7 @@ import org.apache.http.HttpStatus; @@ -43,7 +43,7 @@ import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.cookie.BasicClientCookie;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.app.search.*;
import org.transdroid.core.app.settings.*;
import org.transdroid.core.gui.lists.LocalTorrent;

2
core/src/org/transdroid/core/gui/TorrentsFragment.java → app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java

@ -28,7 +28,7 @@ import org.androidannotations.annotations.EFragment; @@ -28,7 +28,7 @@ import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.InstanceState;
import org.androidannotations.annotations.ItemClick;
import org.androidannotations.annotations.ViewById;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.app.settings.ApplicationSettings;
import org.transdroid.core.app.settings.SystemSettings;
import org.transdroid.core.gui.lists.TorrentsAdapter;

2
core/src/org/transdroid/core/gui/lists/DetailsAdapter.java → app/src/main/java/org/transdroid/core/gui/lists/DetailsAdapter.java

@ -19,7 +19,7 @@ package org.transdroid.core.gui.lists; @@ -19,7 +19,7 @@ package org.transdroid.core.gui.lists;
import java.util.ArrayList;
import java.util.List;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.gui.navigation.FilterSeparatorView_;
import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentFile;

2
core/src/org/transdroid/core/gui/lists/LocalTorrent.java → app/src/main/java/org/transdroid/core/gui/lists/LocalTorrent.java

@ -18,7 +18,7 @@ package org.transdroid.core.gui.lists; @@ -18,7 +18,7 @@ package org.transdroid.core.gui.lists;
import java.util.Locale;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.daemon.DaemonException;
import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.TorrentStatus;

0
core/src/org/transdroid/core/gui/lists/MergeAdapter.java → app/src/main/java/org/transdroid/core/gui/lists/MergeAdapter.java

2
core/src/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java → app/src/main/java/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
package org.transdroid.core.gui.lists;
import org.transdroid.core.R;
import org.transdroid.R;
import uk.co.senab.actionbarpulltorefresh.library.DefaultHeaderTransformer;
import android.app.Activity;

0
core/src/org/transdroid/core/gui/lists/SimpleListItem.java → app/src/main/java/org/transdroid/core/gui/lists/SimpleListItem.java

0
core/src/org/transdroid/core/gui/lists/SimpleListItemAdapter.java → app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemAdapter.java

0
core/src/org/transdroid/core/gui/lists/SimpleListItemSpinnerAdapter.java → app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemSpinnerAdapter.java

0
core/src/org/transdroid/core/gui/lists/SimpleListItemView.java → app/src/main/java/org/transdroid/core/gui/lists/SimpleListItemView.java

2
core/src/org/transdroid/core/gui/lists/SortByListItem.java → app/src/main/java/org/transdroid/core/gui/lists/SortByListItem.java

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
*/
package org.transdroid.core.gui.lists;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.daemon.TorrentsSortBy;
import android.content.Context;

2
core/src/org/transdroid/core/gui/lists/TorrentDetailsView.java → app/src/main/java/org/transdroid/core/gui/lists/TorrentDetailsView.java

@ -18,7 +18,7 @@ package org.transdroid.core.gui.lists; @@ -18,7 +18,7 @@ package org.transdroid.core.gui.lists;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.daemon.Daemon;
import org.transdroid.daemon.Torrent;
import org.transdroid.daemon.util.FileSizeConverter;

2
core/src/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java → app/src/main/java/org/transdroid/core/gui/lists/TorrentFilePriorityLayout.java

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
*/
package org.transdroid.core.gui.lists;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.daemon.Priority;
import android.content.Context;

0
core/src/org/transdroid/core/gui/lists/TorrentFileView.java → app/src/main/java/org/transdroid/core/gui/lists/TorrentFileView.java

2
core/src/org/transdroid/core/gui/lists/TorrentProgressBar.java → app/src/main/java/org/transdroid/core/gui/lists/TorrentProgressBar.java

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
*/
package org.transdroid.core.gui.lists;
import org.transdroid.core.R;
import org.transdroid.R;
import android.content.Context;
import android.content.res.TypedArray;

2
core/src/org/transdroid/core/gui/lists/TorrentStatusLayout.java → app/src/main/java/org/transdroid/core/gui/lists/TorrentStatusLayout.java

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
*/
package org.transdroid.core.gui.lists;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.daemon.TorrentStatus;
import android.content.Context;

0
core/src/org/transdroid/core/gui/lists/TorrentView.java → app/src/main/java/org/transdroid/core/gui/lists/TorrentView.java

0
core/src/org/transdroid/core/gui/lists/TorrentsAdapter.java → app/src/main/java/org/transdroid/core/gui/lists/TorrentsAdapter.java

0
core/src/org/transdroid/core/gui/lists/ViewHolderAdapter.java → app/src/main/java/org/transdroid/core/gui/lists/ViewHolderAdapter.java

0
core/src/org/transdroid/core/gui/log/DatabaseHelper.java → app/src/main/java/org/transdroid/core/gui/log/DatabaseHelper.java

0
core/src/org/transdroid/core/gui/log/ErrorLogEntry.java → app/src/main/java/org/transdroid/core/gui/log/ErrorLogEntry.java

2
core/src/org/transdroid/core/gui/log/ErrorLogSender.java → app/src/main/java/org/transdroid/core/gui/log/ErrorLogSender.java

@ -22,7 +22,7 @@ import java.util.List; @@ -22,7 +22,7 @@ import java.util.List;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.OrmLiteDao;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.app.settings.ServerSetting;
import org.transdroid.core.gui.navigation.NavigationHelper;

0
core/src/org/transdroid/core/gui/log/Log.java → app/src/main/java/org/transdroid/core/gui/log/Log.java

0
core/src/org/transdroid/core/gui/navigation/DialogHelper.java → app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java

2
core/src/org/transdroid/core/gui/navigation/FilterListAdapter.java → app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java

@ -20,7 +20,7 @@ import java.util.List; @@ -20,7 +20,7 @@ import java.util.List;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.transdroid.core.R;
import org.transdroid.R;
import org.transdroid.core.app.settings.ServerSetting;
import org.transdroid.core.gui.lists.MergeAdapter;
import org.transdroid.core.gui.lists.ViewHolderAdapter;

0
core/src/org/transdroid/core/gui/navigation/FilterListDropDownAdapter.java → app/src/main/java/org/transdroid/core/gui/navigation/FilterListDropDownAdapter.java

0
core/src/org/transdroid/core/gui/navigation/FilterListItemAdapter.java → app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemAdapter.java

0
core/src/org/transdroid/core/gui/navigation/FilterListItemView.java → app/src/main/java/org/transdroid/core/gui/navigation/FilterListItemView.java

0
core/src/org/transdroid/core/gui/navigation/FilterSeparatorView.java → app/src/main/java/org/transdroid/core/gui/navigation/FilterSeparatorView.java

0
core/src/org/transdroid/core/gui/navigation/Label.java → app/src/main/java/org/transdroid/core/gui/navigation/Label.java

0
core/src/org/transdroid/core/gui/navigation/NavigationFilter.java → app/src/main/java/org/transdroid/core/gui/navigation/NavigationFilter.java

49
core/src/org/transdroid/core/gui/navigation/NavigationHelper.java → app/src/main/java/org/transdroid/core/gui/navigation/NavigationHelper.java

@ -16,10 +16,6 @@ @@ -16,10 +16,6 @@
*/
package org.transdroid.core.gui.navigation;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.transdroid.core.R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@ -30,7 +26,7 @@ import android.text.Spannable; @@ -30,7 +26,7 @@ import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.TypefaceSpan;
import com.nostra13.universalimageloader.cache.disc.impl.FileCountLimitedDiscCache;
import com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiscCache;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.cache.memory.impl.UsingFreqLimitedMemoryCache;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
@ -38,6 +34,12 @@ import com.nostra13.universalimageloader.core.ImageLoader; @@ -38,6 +34,12 @@ import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration.Builder;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.transdroid.R;
import java.io.IOException;
import de.keyboardsurfer.android.widget.crouton.Crouton;
import de.keyboardsurfer.android.widget.crouton.Style;
@ -58,14 +60,14 @@ public class NavigationHelper { @@ -58,14 +60,14 @@ public class NavigationHelper {
/**
* Use with {@link Crouton#showText(android.app.Activity, int, Style)} (and variants) to display error messages.
*/
public static Style CROUTON_ERROR_STYLE = new Style.Builder().setBackgroundColor(R.color.crouton_error)
.setTextSize(13).build();
public static Style CROUTON_ERROR_STYLE =
new Style.Builder().setBackgroundColor(R.color.crouton_error).setTextSize(13).build();
/**
* Use with {@link Crouton#showText(android.app.Activity, int, Style)} (and variants) to display info messages.
*/
public static Style CROUTON_INFO_STYLE = new Style.Builder().setBackgroundColor(R.color.crouton_info)
.setTextSize(13).build();
public static Style CROUTON_INFO_STYLE =
new Style.Builder().setBackgroundColor(R.color.crouton_info).setTextSize(13).build();
/**
* Returns (and initialises, if needed) an image cache that uses memory and (1MB) local storage.
@ -73,22 +75,25 @@ public class NavigationHelper { @@ -73,22 +75,25 @@ public class NavigationHelper {
*/
public ImageLoader getImageCache() {
if (imageCache == null) {
// @formatter:off
imageCache = ImageLoader.getInstance();
try {
LruDiscCache diskCache =
new LruDiscCache(context.getCacheDir(), null, new Md5FileNameGenerator(), 640000, 25);
// @formatter:off
Builder imageCacheBuilder = new Builder(context)
.defaultDisplayImageOptions(
new DisplayImageOptions.Builder()
.cacheInMemory()
.cacheOnDisc()
.imageScaleType(ImageScaleType.IN_SAMPLE_INT)
.showImageForEmptyUri(R.drawable.ic_launcher)
.build())
.memoryCache(
new UsingFreqLimitedMemoryCache(1024 * 1024))
.discCache(
new FileCountLimitedDiscCache(context.getCacheDir(), new Md5FileNameGenerator(), 25));
.showImageForEmptyUri(R.drawable.ic_launcher).build())
.memoryCache(new UsingFreqLimitedMemoryCache(1024 * 1024))
.discCache(diskCache);
imageCache.init(imageCacheBuilder.build());
// @formatter:on
} catch (IOException e) {
// The cache directory is always available on Android; ignore this exception
}
}
return imageCache;
}
@ -178,8 +183,9 @@ public class NavigationHelper { @@ -178,8 +183,9 @@ public class NavigationHelper {
* input string will be displayed using the Roboto Condensed font (if the OS has this)
*/
public static SpannableString buildCondensedFontString(String string) {
if (string == null)
if (string == null) {
return null;
}
SpannableString s = new SpannableString(string);
s.setSpan(new TypefaceSpan("sans-serif-condensed"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return s;
@ -200,19 +206,22 @@ public class NavigationHelper { @@ -200,19 +206,22 @@ public class NavigationHelper {
if (rawTorrentUri.getScheme().equals("magnet")) {
// Magnet links might have a dn (display name) parameter
String dn = getQueryParameter(rawTorrentUri, "dn");
if (dn != null && !dn.equals(""))
if (dn != null && !dn.equals("")) {
return dn;
}
// If not, try to return the hash that is specified as xt (exact topci)
String xt = getQueryParameter(rawTorrentUri, "xt");
if (xt != null && !xt.equals(""))
if (xt != null && !xt.equals("")) {
return xt;
}
}
if (rawTorrentUri.isHierarchical()) {
String path = rawTorrentUri.getPath();
if (path != null) {
if (path.contains("/"))
if (path.contains("/")) {
path = path.substring(path.lastIndexOf("/"));
}
return path;
}
}

0
core/src/org/transdroid/core/gui/navigation/NavigationSelectionView.java → app/src/main/java/org/transdroid/core/gui/navigation/NavigationSelectionView.java

0
core/src/org/transdroid/core/gui/navigation/RefreshableActivity.java → app/src/main/java/org/transdroid/core/gui/navigation/RefreshableActivity.java

0
core/src/org/transdroid/core/gui/navigation/SelectionManagerMode.java → app/src/main/java/org/transdroid/core/gui/navigation/SelectionManagerMode.java

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

Loading…
Cancel
Save