Browse Source

Layout bugs fixed.

pull/11/head
Eric Kok 13 years ago
parent
commit
f9736fe1c7
  1. 5
      android/AndroidManifest.xml
  2. 4
      android/res/layout-xlarge-v11/part_actionbar_progressitem.xml
  3. 1
      android/res/layout/list_item_rssitem.xml
  4. 2
      android/src/org/transdroid/gui/Details.java
  5. 49
      android/src/org/transdroid/gui/DetailsFragment.java
  6. 21
      android/src/org/transdroid/gui/TorrentsFragment.java
  7. 3
      android/src/org/transdroid/gui/Transdroid.java
  8. 2
      lib/.classpath

5
android/AndroidManifest.xml

@ -18,7 +18,8 @@ @@ -18,7 +18,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid"
android:versionName="1.1.0" android:versionCode="140"
android:versionName="1.1.1"
android:versionCode="141"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="13" />
@ -34,7 +35,7 @@ @@ -34,7 +35,7 @@
android:label="Transdroid Torrent Manager"
android:description="@string/description"
android:theme="@style/Theme.Transdroid"
android:hardwareAccelerated="true">
android:hardwareAccelerated="false">
<activity
android:name="org.transdroid.gui.Torrents"

4
android/res/layout-xlarge-v11/part_actionbar_progressitem.xml

@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="12dip"
android:layout_marginRight="16dip"
android:layout_marginRight="17dip"
android:layout_marginTop="1dip"
android:layout_marginBottom="1dip"
android:text="@string/refresh"
style="@android:style/TextAppearance.Medium" />
<!--android:textColor="@color/TitleTextColor" />-->

1
android/res/layout/list_item_rssitem.xml

@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
android:layout_toRightOf="@id/rssitem_check"
android:paddingRight="29dip"
android:paddingTop="5dip"
android:textSize="16dip"
style="@style/SearchNameText" />
<TextView

2
android/src/org/transdroid/gui/Details.java

@ -49,7 +49,7 @@ public class Details extends FragmentActivity { @@ -49,7 +49,7 @@ public class Details extends FragmentActivity {
// Start the fragment for this torrent
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.details, new DetailsFragment(daemonNumber, torrent, existingLabels));
ft.replace(R.id.details, new DetailsFragment(null, daemonNumber, torrent, existingLabels));
if (getSupportFragmentManager().findFragmentById(R.id.details) != null) {
ft.addToBackStack(null);
}

49
android/src/org/transdroid/gui/DetailsFragment.java

@ -82,11 +82,11 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele @@ -82,11 +82,11 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele
private static final int FILEMENU_REMOTESTART_ID = 5;
private static final int FILEMENU_FTPDOWNLOAD_ID = 6;
private static final int MENU_FORCESTART_ID = 0;
private static final int MENU_SETLOCATION_ID = 1;
private static final int MENU_EDITTRACKERS_ID = 2;
private static final int MENU_INVERTSELECTION_ID = 3;
private static final int MENU_REFRESH_ID = 4;
private static final int MENU_FORCESTART_ID = 50;
private static final int MENU_SETLOCATION_ID = 51;
private static final int MENU_EDITTRACKERS_ID = 52;
private static final int MENU_INVERTSELECTION_ID = 53;
private static final int MENU_REFRESH_ID = 54;
static final int DIALOG_ASKREMOVE = 11;
private static final int DIALOG_INSTALLVLC = 12;
@ -98,6 +98,7 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele @@ -98,6 +98,7 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele
TorrentFilesSortBy sortSetting = TorrentFilesSortBy.Alphanumeric;
boolean sortReversed = false;
private TorrentsFragment torrentsFragment;
private final int daemonNumber;
private Torrent torrent;
private TorrentDetails fineDetails = null;
@ -108,7 +109,8 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele @@ -108,7 +109,8 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele
private LinearLayout prioBar;
private Button prioOff, prioLow, prioNormal, prioHigh;
public DetailsFragment(int daemonNumber, Torrent torrent, String[] existingLabels) {
public DetailsFragment(TorrentsFragment torrentsFragment, int daemonNumber, Torrent torrent, String[] existingLabels) {
this.torrentsFragment = torrentsFragment;
this.daemonNumber = daemonNumber;
this.torrent = torrent;
this.existingLabels = existingLabels;
@ -537,6 +539,10 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele @@ -537,6 +539,10 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele
@Override
public void onTaskFailure(DaemonTaskFailureResult result) {
if (getActivity() == null) {
// No longer visible
return;
}
// Show error message
Toast.makeText(getActivity(), LocalTorrent.getResourceForDaemonException(result.getException()),
Toast.LENGTH_SHORT * 2).show();
@ -596,6 +602,10 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele @@ -596,6 +602,10 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele
case Pause:
torrent.mimicPause();
getDetailsListAdapter().updateViewsAndButtonStates();
// Also call back to the main torrents list to update its view
if (torrentsFragment != null) {
torrentsFragment.updateTorrentList();
}
break;
case Resume:
@ -603,11 +613,19 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele @@ -603,11 +613,19 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele
getDetailsListAdapter().updateViewsAndButtonStates();
queue.enqueue(RetrieveTask.create(daemon));
queue.enqueue(GetFileListTask.create(daemon, torrent));
// Also call back to the main torrents list to update its view
if (torrentsFragment != null) {
torrentsFragment.updateTorrentList();
}
break;
case Stop:
torrent.mimicStop();
getDetailsListAdapter().updateViewsAndButtonStates();
// Also call back to the main torrents list to update its view
if (torrentsFragment != null) {
torrentsFragment.updateTorrentList();
}
break;
case Start:
@ -615,6 +633,10 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele @@ -615,6 +633,10 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele
getDetailsListAdapter().updateViewsAndButtonStates();
queue.enqueue(RetrieveTask.create(daemon));
queue.enqueue(GetFileListTask.create(daemon, torrent));
// Also call back to the main torrents list to update its view
if (torrentsFragment != null) {
torrentsFragment.updateTorrentList();
}
break;
case Remove:
@ -624,11 +646,18 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele @@ -624,11 +646,18 @@ public class DetailsFragment extends Fragment implements IDaemonCallback, OnSele
"'" + result.getTargetTorrent().getName() + "' "
+ getText(includingData ? R.string.torrent_removed_with_data : R.string.torrent_removed),
Toast.LENGTH_SHORT).show();
// Also call back to the main torrents list to update its view
if (torrentsFragment != null) {
torrentsFragment.updateTorrentList();
}
// Close this details fragment
FragmentTransaction ft = getSupportActivity().getSupportFragmentManager().beginTransaction();
ft.remove(this);
ft.addToBackStack(null);
ft.commit();
if (torrentsFragment != null) {
FragmentTransaction ft = getSupportActivity().getSupportFragmentManager().beginTransaction();
ft.remove(this);
ft.commit();
} else {
getSupportActivity().getSupportFragmentManager().popBackStack();
}
break;
case SetDownloadLocation:

21
android/src/org/transdroid/gui/TorrentsFragment.java

@ -979,7 +979,8 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou @@ -979,7 +979,8 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou
// Show the details in the right of the screen (tablet interface) or separately
if (useTabletInterface) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.details, new DetailsFragment(lastUsedDaemonSettings, tor, buildLabelTexts(false)));
ft.replace(R.id.details, new DetailsFragment(TorrentsFragment.this, lastUsedDaemonSettings, tor,
buildLabelTexts(false)));
ft.commit();
} else {
Intent i = new Intent(getActivity(), Details.class);
@ -1377,7 +1378,7 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou @@ -1377,7 +1378,7 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou
}
}
private void updateTorrentList() {
public void updateTorrentList() {
if (daemon != null) {
queue.enqueue(RetrieveTask.create(daemon));
}
@ -1750,13 +1751,9 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou @@ -1750,13 +1751,9 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou
taskmessage.setText(taskmessageText);
taskmessage.setVisibility(View.VISIBLE);
statusBox.setVisibility(View.GONE);
emptyText.setVisibility(View.VISIBLE);
getListView().setVisibility(View.GONE);
/*if (getSupportFragmentManager().findFragmentById(R.id.details) != null) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.remove(getSupportFragmentManager().findFragmentById(R.id.details));
ft.commit();
}*/
if (allTorrents == null) {
emptyText.setVisibility(View.VISIBLE);
}
return;
}
@ -1767,7 +1764,7 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou @@ -1767,7 +1764,7 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou
int eta = -1;
int seeding = 0;
int seedingU = 0;
int other = 0;
//int other = 0;
for (Torrent tor : allTorrents) {
if (tor.getStatusCode() == TorrentStatus.Downloading && (!onlyShowTransferring || tor.getRateDownload() > 0)) {
downloading++;
@ -1777,8 +1774,8 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou @@ -1777,8 +1774,8 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou
} else if (tor.getStatusCode() == TorrentStatus.Seeding && (!onlyShowTransferring || tor.getRateUpload() > 0)) {
seeding++;
seedingU += tor.getRateUpload();
} else {
other++;
//} else {
// other++;
}
}

3
android/src/org/transdroid/gui/Transdroid.java

@ -60,7 +60,8 @@ public class Transdroid { @@ -60,7 +60,8 @@ public class Transdroid {
public static boolean isTablet(Resources r) {
//boolean hasLargeScreen = ((r.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
boolean hasXLargeScreen = ((r.getConfiguration().screenLayout &
Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE);
Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE) &&
android.os.Build.VERSION.SDK_INT >= 11;
return hasXLargeScreen;
}

2
lib/.classpath

@ -2,6 +2,6 @@ @@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="/var/data/Dev/android-sdk/platforms/android-13/android.jar"/>
<classpathentry kind="lib" path="/home/eric/Dev/android-sdk/platforms/android-13/android.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Loading…
Cancel
Save