From 6d3e59de6260e33e3dc434c7aaa366e5650b252d Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Thu, 19 Jan 2012 16:58:22 +0100 Subject: [PATCH] More bug fixes. New 1.1.2 release. --- android/AndroidManifest.xml | 4 +- .../part_actionbar_progressitem.xml | 4 +- android/res/layout/dialog_about.xml | 5 +- android/res/layout/list_item_rssfeed.xml | 1 - android/res/layout/part_controlbar.xml | 2 +- android/res/values-sk/strings.xml | 59 ------------------- android/res/values/attrs.xml | 8 --- .../org/transdroid/gui/DetailsFragment.java | 10 +++- .../org/transdroid/gui/TorrentsFragment.java | 12 ++-- .../preferences/PreferencesRssFeed.java | 3 +- 10 files changed, 26 insertions(+), 82 deletions(-) delete mode 100644 android/res/values-sk/strings.xml diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 8497ecee..945d2415 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -18,8 +18,8 @@ --> diff --git a/android/res/layout-xlarge-v11/part_actionbar_progressitem.xml b/android/res/layout-xlarge-v11/part_actionbar_progressitem.xml index 7d3a9ced..71aa7038 100644 --- a/android/res/layout-xlarge-v11/part_actionbar_progressitem.xml +++ b/android/res/layout-xlarge-v11/part_actionbar_progressitem.xml @@ -8,6 +8,7 @@ android:id="@+id/progress" android:layout_width="20dip" android:layout_height="20dip" + android:paddingTop="2dip" android:layout_marginLeft="22dip" android:layout_marginRight="2dip" android:layout_gravity="center_vertical" @@ -22,8 +23,7 @@ android:layout_gravity="center_vertical" android:layout_marginLeft="12dip" android:layout_marginRight="17dip" - android:layout_marginTop="1dip" - android:layout_marginBottom="1dip" + android:paddingTop="2dip" android:text="@string/refresh" style="@android:style/TextAppearance.Medium" /> diff --git a/android/res/layout/dialog_about.xml b/android/res/layout/dialog_about.xml index 80b98338..516632b7 100644 --- a/android/res/layout/dialog_about.xml +++ b/android/res/layout/dialog_about.xml @@ -2,11 +2,12 @@ + android:layout_height="fill_parent" + android:fillViewport="true"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/res/values/attrs.xml b/android/res/values/attrs.xml index c8139ba8..a19eb9b9 100644 --- a/android/res/values/attrs.xml +++ b/android/res/values/attrs.xml @@ -4,12 +4,4 @@ - - - - - - - - \ No newline at end of file diff --git a/android/src/org/transdroid/gui/DetailsFragment.java b/android/src/org/transdroid/gui/DetailsFragment.java index 6c85255e..498f1661 100644 --- a/android/src/org/transdroid/gui/DetailsFragment.java +++ b/android/src/org/transdroid/gui/DetailsFragment.java @@ -98,7 +98,7 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele TorrentFilesSortBy sortSetting = TorrentFilesSortBy.Alphanumeric; boolean sortReversed = false; - private TorrentsFragment torrentsFragment; + private final TorrentsFragment torrentsFragment; private final int daemonNumber; private Torrent torrent; private TorrentDetails fineDetails = null; @@ -109,6 +109,14 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele private LinearLayout prioBar; private Button prioOff, prioLow, prioNormal, prioHigh; + /** + * Public empty constructor for use with fragment retainment (setRetainInstance(true);) + */ + public DetailsFragment() { + this.torrentsFragment = null; + this.daemonNumber = -1; + } + public DetailsFragment(TorrentsFragment torrentsFragment, int daemonNumber, Torrent torrent, String[] existingLabels) { this.torrentsFragment = torrentsFragment; this.daemonNumber = daemonNumber; diff --git a/android/src/org/transdroid/gui/TorrentsFragment.java b/android/src/org/transdroid/gui/TorrentsFragment.java index caa6cb54..ee414bac 100644 --- a/android/src/org/transdroid/gui/TorrentsFragment.java +++ b/android/src/org/transdroid/gui/TorrentsFragment.java @@ -966,7 +966,7 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou break; } - return true; + return super.onOptionsItemSelected(item); } private OnItemClickListener onTorrentClicked = new OnItemClickListener() { @@ -1420,14 +1420,18 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou if (daemon == null) { // No connection possible yet: give message - Toast.makeText(getActivity(), R.string.no_settings_short, Toast.LENGTH_SHORT).show(); + if (getActivity() != null) { + Toast.makeText(getActivity(), R.string.no_settings_short, Toast.LENGTH_SHORT).show(); + } return; } if (!Daemon.supportsAddByFile(daemon.getType())) { // The daemon type does not support .torrent file uploads/metadata sending or this is not yet implemented - Toast.makeText(getActivity(), R.string.no_file_uploads, Toast.LENGTH_LONG).show(); - return; + if (getActivity() != null) { + Toast.makeText(getActivity(), R.string.no_file_uploads, Toast.LENGTH_LONG).show(); + } + return; } queue.enqueue(AddByFileTask.create(daemon, fileUri)); diff --git a/android/src/org/transdroid/preferences/PreferencesRssFeed.java b/android/src/org/transdroid/preferences/PreferencesRssFeed.java index 1a93f62a..20457f85 100644 --- a/android/src/org/transdroid/preferences/PreferencesRssFeed.java +++ b/android/src/org/transdroid/preferences/PreferencesRssFeed.java @@ -22,13 +22,12 @@ import org.transdroid.R; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.Preference; +import android.preference.Preference.OnPreferenceChangeListener; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; -import android.preference.Preference.OnPreferenceChangeListener; import android.text.InputType; import android.view.View; import android.widget.ListView; -import android.widget.Toast; public class PreferencesRssFeed extends PreferenceActivity {