Browse Source

Fixed the vertical divider line to display correctly on light and dark themes and only on tablets.

pull/11/head
Eric Kok 12 years ago
parent
commit
d92dc5df4d
  1. 4
      core/res/drawable/details_list_background_dark.xml
  2. 5
      core/res/drawable/details_list_background_light.xml
  3. 3
      core/res/drawable/details_list_line_dark.xml
  4. 3
      core/res/drawable/details_list_line_light.xml
  5. 3
      core/res/layout/fragment_details.xml
  6. 1
      core/res/values/attrs.xml
  7. 3
      core/res/values/colors_transdroid_dark.xml
  8. 2
      core/res/values/colors_transdroid_light.xml
  9. 2
      core/res/values/styles.xml
  10. 12
      core/src/org/transdroid/core/gui/DetailsFragment.java
  11. 19
      core/src/org/transdroid/core/gui/TorrentsActivity.java

4
core/res/drawable/details_list_background.xml → core/res/drawable/details_list_background_dark.xml

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@color/divider_grey" />
<item android:left="6dp" android:drawable="@attr/details_list_line" />
<item android:drawable="@color/divider_dark" />
<item android:left="6dp" android:drawable="@color/background_dark" />
</layer-list>

5
core/res/drawable/details_list_background_light.xml

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:left="2dp" android:drawable="@color/divider_light" />
<item android:left="4dp" android:drawable="@color/background_light" />
</layer-list>

3
core/res/drawable/details_list_line_dark.xml

@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<color xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/background_dark" />

3
core/res/drawable/details_list_line_light.xml

@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<color xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/background_light" />

3
core/res/layout/fragment_details.xml

@ -11,8 +11,7 @@ @@ -11,8 +11,7 @@
android:divider="@null"
android:dividerHeight="0dip"
android:listSelector="?attr/selectable_background_transdroid"
android:background="@drawable/details_list_background"
android:visibility="visible" />
android:visibility="gone" />
<ProgressBar
android:id="@+id/loading_progress"

1
core/res/values/attrs.xml

@ -28,5 +28,4 @@ @@ -28,5 +28,4 @@
<attr name="selectable_background_transdroid" format="reference"/>
<attr name="text_bright" format="reference" />
<attr name="text_actionbar" format="reference" />
<attr name="details_list_line" format="reference" />
</resources>

3
core/res/values/colors_transdroid_dark.xml

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
@ -18,7 +19,7 @@ @@ -18,7 +19,7 @@
<resources>
<color name="pressed_transdroid_dark">#CCaada62</color>
<color name="divider_grey">#d4d4d4</color>
<color name="divider_dark">#d4d4d4</color>
<color name="background_dark">#000</color>
<color name="text_bright_dark">#fff</color>
<color name="text_actionbar_dark">#fff</color>

2
core/res/values/colors_transdroid_light.xml

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
<resources>
<color name="pressed_transdroid_light">#CC8ACC12</color>
<color name="divider_grey">#d4d4d4</color>
<color name="divider_light">#bdbdbd</color>
<color name="background_light">#fff</color>
<color name="text_bright_light">#000</color>
<color name="text_actionbar_light">#000</color>

2
core/res/values/styles.xml

@ -27,7 +27,6 @@ @@ -27,7 +27,6 @@
<item name="selectable_background_transdroid">@drawable/selectable_background_transdroid2</item>
<item name="text_bright">@color/text_bright_light</item>
<item name="text_actionbar">@color/text_actionbar_light</item>
<item name="details_list_line">@drawable/details_list_line_light</item>
</style>
<style name="TransdroidTheme.Dark" parent="Theme.Transdroid.Dark">
@ -57,7 +56,6 @@ @@ -57,7 +56,6 @@
<item name="selectable_background_transdroid">@drawable/selectable_background_transdroid</item>
<item name="text_bright">@color/text_bright_dark</item>
<item name="text_actionbar">@color/text_actionbar_dark</item>
<item name="details_list_line">@drawable/details_list_line_dark</item>
</style>
<!-- Taken from http://stackoverflow.com/questions/10020466/android-4-0-sub-title-section-label-styling -->

12
core/src/org/transdroid/core/gui/DetailsFragment.java

@ -12,9 +12,11 @@ import org.androidannotations.annotations.OptionsItem; @@ -12,9 +12,11 @@ import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.OptionsMenu;
import org.androidannotations.annotations.ViewById;
import org.transdroid.core.R;
import org.transdroid.core.app.settings.SystemSettings_;
import org.transdroid.core.gui.lists.DetailsAdapter;
import org.transdroid.core.gui.lists.SimpleListItemAdapter;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.NavigationHelper_;
import org.transdroid.core.gui.navigation.SelectionManagerMode;
import org.transdroid.daemon.Daemon;
import org.transdroid.daemon.Priority;
@ -67,6 +69,16 @@ public class DetailsFragment extends SherlockFragment { @@ -67,6 +69,16 @@ public class DetailsFragment extends SherlockFragment {
@AfterViews
protected void init() {
// On large screens where this fragment is shown next to the torrents list, we show a continues grey vertical
// line to separate the lists visually
if (!NavigationHelper_.getInstance_(getActivity()).isSmallScreen()) {
if (SystemSettings_.getInstance_(getActivity()).useDarkTheme()) {
detailsList.setBackgroundResource(R.drawable.details_list_background_dark);
} else {
detailsList.setBackgroundResource(R.drawable.details_list_background_light);
}
}
// Set up details adapter (itself containing the actual lists to show), which allows multi-select and fast
// scrolling
detailsList.setAdapter(new DetailsAdapter(getActivity()));

19
core/src/org/transdroid/core/gui/TorrentsActivity.java

@ -29,26 +29,17 @@ import org.apache.http.impl.client.DefaultHttpClient; @@ -29,26 +29,17 @@ import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.cookie.BasicClientCookie;
import org.transdroid.core.R;
import org.transdroid.core.app.settings.ApplicationSettings;
import org.transdroid.core.app.settings.ServerSetting;
import org.transdroid.core.app.settings.SystemSettings_;
import org.transdroid.core.app.settings.*;
import org.transdroid.core.app.settings.WebsearchSetting;
import org.transdroid.core.gui.lists.LocalTorrent;
import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.core.gui.log.Log;
import org.transdroid.core.gui.log.Log_;
import org.transdroid.core.gui.navigation.FilterListAdapter;
import org.transdroid.core.gui.navigation.FilterListAdapter_;
import org.transdroid.core.gui.navigation.FilterListDropDownAdapter;
import org.transdroid.core.gui.navigation.FilterListDropDownAdapter_;
import org.transdroid.core.gui.navigation.Label;
import org.transdroid.core.gui.navigation.NavigationFilter;
import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.gui.navigation.StatusType;
import org.transdroid.core.gui.rss.RssfeedsActivity_;
import org.transdroid.core.gui.log.*;
import org.transdroid.core.gui.navigation.*;
import org.transdroid.core.gui.rss.*;
import org.transdroid.core.gui.search.BarcodeHelper;
import org.transdroid.core.gui.search.FilePickerHelper;
import org.transdroid.core.gui.search.UrlEntryDialog;
import org.transdroid.core.gui.settings.MainSettingsActivity_;
import org.transdroid.core.gui.settings.*;
import org.transdroid.daemon.Daemon;
import org.transdroid.daemon.IDaemonAdapter;
import org.transdroid.daemon.Priority;

Loading…
Cancel
Save