Browse Source

Improved looks through differnt font family usage and margins.

pull/11/head
Eric Kok 12 years ago
parent
commit
cb85ff0229
  1. 6
      core/res/layout/actionbar_navigation.xml
  2. 13
      core/res/layout/actionbar_serverstatus.xml
  3. 98
      core/res/layout/fragment_details_header.xml
  4. 1
      core/res/layout/list_item_filter.xml
  5. 4
      core/res/layout/list_item_simple.xml
  6. 8
      core/res/layout/list_item_torrent.xml
  7. 19
      core/res/layout/list_item_torrentfile.xml
  8. 14
      core/res/values-land/dimens.xml
  9. 30
      core/res/values-v16/styles.xml
  10. 10
      core/res/values/dimens.xml
  11. 3
      core/res/values/strings.xml
  12. 2
      core/src/org/transdroid/core/gui/DetailsActivity.java
  13. 6
      core/src/org/transdroid/core/gui/lists/TorrentDetailsView.java
  14. 15
      core/src/org/transdroid/core/gui/navigation/NavigationHelper.java
  15. 2
      core/src/org/transdroid/core/gui/navigation/NavigationSelectionView.java

6
core/res/layout/list_item_navigation.xml → core/res/layout/actionbar_navigation.xml

@ -11,7 +11,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
android:textIsSelectable="false" android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_filter" /> android:textSize="@dimen/ui_navigation_filter"
android:fontFamily="sans-serif-condensed" />
<TextView <TextView
android:id="@+id/server_text" android:id="@+id/server_text"
@ -20,6 +21,7 @@
android:layout_marginTop="-4dip" android:layout_marginTop="-4dip"
android:textColor="?attr/text_actionbar" android:textColor="?attr/text_actionbar"
android:textIsSelectable="false" android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_server" /> android:textSize="@dimen/ui_navigation_server"
android:fontFamily="sans-serif-light" />
</LinearLayout> </LinearLayout>

13
core/res/layout/actionbar_serverstatus.xml

@ -3,18 +3,16 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:layout_marginRight="@dimen/margin_default" android:paddingRight="@dimen/margin_default"
android:layout_marginTop="@dimen/ui_serverstatus_margin" android:paddingTop="@dimen/ui_serverstatus_margin"
android:background="?attr/selectable_background_transdroid" android:background="?attr/selectable_background_transdroid"
android:clickable="true" android:clickable="true" >
android:focusable="true" >
<TextView <TextView
android:id="@+id/upcount_sign" android:id="@+id/upcount_sign"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:fontFamily="sans-serif-light"
android:paddingTop="@dimen/ui_serverstatus_signmargin" android:paddingTop="@dimen/ui_serverstatus_signmargin"
android:text="↑" android:text="↑"
android:textColor="?attr/text_bright" android:textColor="?attr/text_bright"
@ -27,7 +25,6 @@
android:layout_width="@dimen/ui_serverstatus_width" android:layout_width="@dimen/ui_serverstatus_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/upcount_sign" android:layout_toLeftOf="@id/upcount_sign"
android:fontFamily="sans-serif-light"
android:gravity="end" android:gravity="end"
android:textColor="?attr/text_bright" android:textColor="?attr/text_bright"
android:textSize="@dimen/ui_serverstatus_bignumber" /> android:textSize="@dimen/ui_serverstatus_bignumber" />
@ -37,7 +34,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/upcount_text" android:layout_toLeftOf="@id/upcount_text"
android:fontFamily="sans-serif-light"
android:paddingTop="@dimen/ui_serverstatus_signmargin" android:paddingTop="@dimen/ui_serverstatus_signmargin"
android:text="↓" android:text="↓"
android:textColor="?attr/text_bright" android:textColor="?attr/text_bright"
@ -50,7 +46,6 @@
android:layout_width="@dimen/ui_serverstatus_width" android:layout_width="@dimen/ui_serverstatus_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/downcount_sign" android:layout_toLeftOf="@id/downcount_sign"
android:fontFamily="sans-serif-light"
android:gravity="end" android:gravity="end"
android:textColor="?attr/text_bright" android:textColor="?attr/text_bright"
android:textSize="@dimen/ui_serverstatus_bignumber" /> android:textSize="@dimen/ui_serverstatus_bignumber" />
@ -63,7 +58,6 @@
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_below="@id/upcount_text" android:layout_below="@id/upcount_text"
android:layout_marginTop="-4dip" android:layout_marginTop="-4dip"
android:fontFamily="sans-serif-light"
android:gravity="end" android:gravity="end"
android:textColor="?attr/text_bright" android:textColor="?attr/text_bright"
android:textSize="@dimen/ui_serverstatus_smallnumber" /> android:textSize="@dimen/ui_serverstatus_smallnumber" />
@ -76,7 +70,6 @@
android:layout_alignRight="@id/downcount_sign" android:layout_alignRight="@id/downcount_sign"
android:layout_below="@id/downcount_text" android:layout_below="@id/downcount_text"
android:layout_marginTop="-4dip" android:layout_marginTop="-4dip"
android:fontFamily="sans-serif-light"
android:gravity="end" android:gravity="end"
android:textColor="?attr/text_bright" android:textColor="?attr/text_bright"
android:textSize="@dimen/ui_serverstatus_smallnumber" /> android:textSize="@dimen/ui_serverstatus_smallnumber" />

98
core/res/layout/fragment_details_header.xml

@ -2,58 +2,61 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="@dimen/margin_default" > android:layout_marginBottom="@dimen/margin_default"
android:layout_marginTop="@dimen/margin_default" >
<TextView <TextView
android:id="@+id/label_text" android:id="@+id/label_text"
style="@style/LabelTextView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/margin_default"
android:textIsSelectable="true" android:textIsSelectable="true"
style="@style/LabelTextView"
android:visibility="invisible" /> android:visibility="invisible" />
<TextView <TextView
android:id="@+id/dateadded_text" android:id="@+id/dateadded_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/label_text" android:layout_marginLeft="@dimen/margin_default"
android:layout_marginRight="@dimen/margin_half" android:layout_marginRight="@dimen/margin_half"
android:layout_toLeftOf="@id/label_text"
android:textIsSelectable="false" /> android:textIsSelectable="false" />
<View <View
android:id="@+id/separator" android:id="@+id/separator"
android:layout_width="2dip" android:layout_width="2dip"
android:layout_height="@dimen/ui_details_seperator" android:layout_height="@dimen/ui_details_seperator"
android:textSize="@dimen/text_enlargednumbers"
android:layout_below="@id/dateadded_text" android:layout_below="@id/dateadded_text"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/margin_half"
android:layout_marginTop="@dimen/margin_default" android:layout_marginTop="@dimen/margin_default"
android:layout_marginBottom="@dimen/margin_default" android:background="@color/green"
android:background="@color/green" /> android:textSize="@dimen/text_enlargednumbers" />
<TextView <TextView
android:id="@+id/uploaded_text" android:id="@+id/uploaded_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/dateadded_text" android:layout_below="@id/dateadded_text"
android:layout_toRightOf="@id/separator"
android:layout_marginTop="@dimen/margin_half"
android:layout_marginLeft="@dimen/margin_half" android:layout_marginLeft="@dimen/margin_half"
android:textColor="?attr/text_bright" android:layout_marginTop="@dimen/margin_half"
android:textSize="@dimen/text_hugenumbers" android:layout_toRightOf="@id/separator"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:textIsSelectable="false" /> android:textColor="?attr/text_bright"
android:textIsSelectable="false"
android:textSize="@dimen/text_hugenumbers" />
<TextView <TextView
android:id="@+id/uploadedunit_text" android:id="@+id/uploadedunit_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBaseline="@id/uploaded_text" android:layout_alignBaseline="@id/uploaded_text"
android:layout_toRightOf="@id/uploaded_text"
android:layout_marginLeft="4dip" android:layout_marginLeft="4dip"
android:textColor="?attr/text_bright" android:layout_toRightOf="@id/uploaded_text"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:textColor="?attr/text_bright"
android:textIsSelectable="false" /> android:textIsSelectable="false" />
<TextView <TextView
@ -61,43 +64,43 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/uploaded_text" android:layout_below="@id/uploaded_text"
android:layout_toRightOf="@id/separator"
android:layout_marginLeft="@dimen/margin_half" android:layout_marginLeft="@dimen/margin_half"
android:textSize="@dimen/text_small" android:layout_toRightOf="@id/separator"
android:textIsSelectable="false" /> android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
<TextView <TextView
android:id="@+id/upspeed_text" android:id="@+id/upspeed_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/ratio_text" android:layout_below="@id/ratio_text"
android:layout_toRightOf="@id/separator"
android:layout_marginLeft="@dimen/margin_half"
android:layout_marginBottom="4dip" android:layout_marginBottom="4dip"
android:textSize="@dimen/text_enlargednumbers" android:layout_marginLeft="@dimen/margin_half"
android:textColor="?attr/text_bright" android:layout_toRightOf="@id/separator"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:textIsSelectable="false" /> android:textColor="?attr/text_bright"
android:textIsSelectable="false"
android:textSize="@dimen/text_enlargednumbers" />
<TextView <TextView
android:id="@+id/seeders_text" android:id="@+id/seeders_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/upspeed_text" android:layout_below="@id/upspeed_text"
android:layout_toRightOf="@id/separator"
android:layout_marginLeft="@dimen/margin_half" android:layout_marginLeft="@dimen/margin_half"
android:textSize="@dimen/text_small" android:layout_toRightOf="@id/separator"
android:textIsSelectable="false" /> android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
<TextView <TextView
android:id="@+id/downloadedunit_text" android:id="@+id/downloadedunit_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBaseline="@id/uploadedunit_text" android:layout_alignBaseline="@id/uploadedunit_text"
android:layout_toLeftOf="@id/separator"
android:layout_marginRight="@dimen/margin_half" android:layout_marginRight="@dimen/margin_half"
android:textColor="?attr/text_bright" android:layout_toLeftOf="@id/separator"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:textColor="?attr/text_bright"
android:textIsSelectable="false" /> android:textIsSelectable="false" />
<TextView <TextView
@ -105,51 +108,62 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBaseline="@id/uploadedunit_text" android:layout_alignBaseline="@id/uploadedunit_text"
android:layout_toLeftOf="@id/downloadedunit_text"
android:layout_marginRight="4dip" android:layout_marginRight="4dip"
android:textColor="?attr/text_bright" android:layout_toLeftOf="@id/downloadedunit_text"
android:textSize="@dimen/text_hugenumbers"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:textIsSelectable="false" /> android:textColor="?attr/text_bright"
android:textIsSelectable="false"
android:textSize="@dimen/text_hugenumbers" />
<TextView <TextView
android:id="@+id/totalsize_text" android:id="@+id/totalsize_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBaseline="@id/ratio_text" android:layout_alignBaseline="@id/ratio_text"
android:layout_toLeftOf="@id/separator"
android:layout_marginRight="@dimen/margin_half" android:layout_marginRight="@dimen/margin_half"
android:textSize="@dimen/text_small" android:layout_toLeftOf="@id/separator"
android:textIsSelectable="false" /> android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
<TextView <TextView
android:id="@+id/downspeed_text" android:id="@+id/downspeed_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBaseline="@id/upspeed_text" android:layout_alignBaseline="@id/upspeed_text"
android:layout_toLeftOf="@id/separator"
android:layout_marginRight="@dimen/margin_half" android:layout_marginRight="@dimen/margin_half"
android:textSize="@dimen/text_enlargednumbers" android:layout_toLeftOf="@id/separator"
android:textColor="?attr/text_bright"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:textIsSelectable="false" /> android:textColor="?attr/text_bright"
android:textIsSelectable="false"
android:textSize="@dimen/text_enlargednumbers" />
<TextView <TextView
android:id="@+id/leechers_text" android:id="@+id/leechers_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBaseline="@id/seeders_text" android:layout_alignBaseline="@id/seeders_text"
android:layout_toLeftOf="@id/separator"
android:layout_marginRight="@dimen/margin_half" android:layout_marginRight="@dimen/margin_half"
android:textSize="@dimen/text_small" android:layout_toLeftOf="@id/separator"
android:textIsSelectable="false" /> android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
<org.transdroid.core.gui.lists.TorrentStatusLayout
android:id="@+id/status_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/separator"
android:layout_marginBottom="@dimen/margin_half"
android:orientation="vertical"
android:paddingBottom="@dimen/margin_half"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_half" >
<TextView <TextView
android:id="@+id/status_text" android:id="@+id/status_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/separator"
android:layout_marginBottom="@dimen/margin_half"
android:textIsSelectable="false" /> android:textIsSelectable="false" />
</org.transdroid.core.gui.lists.TorrentStatusLayout>
</RelativeLayout> </RelativeLayout>

1
core/res/layout/list_item_filter.xml

@ -11,7 +11,6 @@
android:id="@+id/item_text" android:id="@+id/item_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="17sp"
android:textIsSelectable="false" /> android:textIsSelectable="false" />
</FrameLayout> </FrameLayout>

4
core/res/layout/list_item_simple.xml

@ -2,10 +2,10 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingBottom="@dimen/margin_half" android:paddingBottom="4dip"
android:paddingLeft="@dimen/margin_default" android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default" android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_half" > android:paddingTop="4dip" >
<TextView <TextView
android:id="@+id/item_text" android:id="@+id/item_text"

8
core/res/layout/list_item_torrent.xml

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<org.transdroid.core.gui.lists.TorrentStatusLayout <org.transdroid.core.gui.lists.TorrentStatusLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/selectable_background_transdroid"
android:orientation="vertical" android:orientation="vertical"
android:paddingRight="@dimen/margin_default" android:paddingRight="@dimen/margin_default" >
android:background="?attr/selectable_background_transdroid" >
<TextView <TextView
android:id="@+id/name_text" android:id="@+id/name_text"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_torrentlistleft" android:layout_marginLeft="@dimen/margin_torrentlistleft"
android:fontFamily="sans-serif-condensed"
android:paddingTop="@dimen/margin_half" android:paddingTop="@dimen/margin_half"
android:textColor="?attr/text_bright" android:textColor="?attr/text_bright"
android:textIsSelectable="false" android:textIsSelectable="false"

19
core/res/layout/list_item_torrentfile.xml

@ -1,35 +1,33 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<org.transdroid.core.gui.lists.TorrentFilePriorityLayout <org.transdroid.core.gui.lists.TorrentFilePriorityLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/selectable_background_transdroid"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="@dimen/margin_half"
android:paddingBottom="@dimen/margin_half" android:paddingBottom="@dimen/margin_half"
android:paddingLeft="@dimen/margin_default" android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default" android:paddingRight="@dimen/margin_default"
android:background="?attr/selectable_background_transdroid"> android:paddingTop="@dimen/margin_half" >
<TextView <TextView
android:id="@+id/name_text" android:id="@+id/name_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed"
android:textColor="?attr/text_bright" android:textColor="?attr/text_bright"
android:textSize="@dimen/text_enlarged"
android:textIsSelectable="false" android:textIsSelectable="false"
android:focusable="false" /> android:textSize="@dimen/text_enlarged" />
<TextView <TextView
android:id="@+id/progress_text" android:id="@+id/progress_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/name_text"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_below="@id/name_text"
android:layout_marginLeft="@dimen/margin_half" android:layout_marginLeft="@dimen/margin_half"
android:layout_marginTop="4dip" android:layout_marginTop="4dip"
android:textSize="@dimen/text_small"
android:textIsSelectable="false" android:textIsSelectable="false"
android:focusable="false" /> android:textSize="@dimen/text_small" />
<TextView <TextView
android:id="@+id/sizes_text" android:id="@+id/sizes_text"
@ -37,7 +35,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/progress_text" android:layout_alignBaseline="@+id/progress_text"
android:textIsSelectable="false" android:textIsSelectable="false"
android:textSize="@dimen/text_small" android:textSize="@dimen/text_small" />
android:focusable="false" />
</org.transdroid.core.gui.lists.TorrentFilePriorityLayout> </org.transdroid.core.gui.lists.TorrentFilePriorityLayout>

14
core/res/values-land/dimens.xml

@ -1,22 +1,8 @@
<resources> <resources>
<!-- Margins -->
<dimen name="margin_default">16dp</dimen>
<dimen name="margin_half">8dp</dimen>
<dimen name="margin_torrentlistleft">16dp</dimen>
<!-- Text sizes -->
<dimen name="text_small">12sp</dimen>
<dimen name="text_default">15sp</dimen>
<dimen name="text_enlarged">15sp</dimen>
<dimen name="text_enlargednumbers">22sp</dimen>
<dimen name="text_hugenumbers">33sp</dimen>
<dimen name="text_label">12sp</dimen>
<!-- UI elements --> <!-- UI elements -->
<dimen name="ui_navigation_filter">15sp</dimen> <dimen name="ui_navigation_filter">15sp</dimen>
<dimen name="ui_navigation_server">12sp</dimen> <dimen name="ui_navigation_server">12sp</dimen>
<dimen name="ui_details_seperator">110dp</dimen>
<dimen name="ui_serverstatus_margin">1dp</dimen> <dimen name="ui_serverstatus_margin">1dp</dimen>
<dimen name="ui_serverstatus_signmargin">2dp</dimen> <dimen name="ui_serverstatus_signmargin">2dp</dimen>
<dimen name="ui_serverstatus_bignumber">19sp</dimen> <dimen name="ui_serverstatus_bignumber">19sp</dimen>

30
core/res/values-v16/styles.xml

@ -0,0 +1,30 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Taken from http://stackoverflow.com/questions/10020466/android-4-0-sub-title-section-label-styling -->
<style name="SectionHeader" parent="android:Widget.Holo.Light.TextView">
<item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">4dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textColor">@color/green</item>
<item name="android:textSize">14sp</item>
<item name="android:fontFamily">sans-serif</item>
</style>
<style name="DefaultTextView" parent="android:Widget.Holo.Light.TextView">
<item name="android:textSize">@dimen/text_default</item>
<item name="android:fontFamily">sans-serif-light</item>
</style>
<style name="LabelTextView" parent="android:Widget.Holo.Light.TextView">
<item name="android:textSize">@dimen/text_label</item>
<item name="android:background">#333</item>
<item name="android:textColor">#fff</item>
<item name="android:paddingLeft">4dip</item>
<item name="android:paddingRight">4dip</item>
<item name="android:paddingTop">2dip</item>
<item name="android:paddingBottom">2dip</item>
<item name="android:fontFamily">sans-serif-condensed</item>
</style>
</resources>

10
core/res/values/dimens.xml

@ -8,15 +8,15 @@
<!-- Text sizes --> <!-- Text sizes -->
<dimen name="text_small">12sp</dimen> <dimen name="text_small">12sp</dimen>
<dimen name="text_default">15sp</dimen> <dimen name="text_default">15sp</dimen>
<dimen name="text_enlarged">15sp</dimen> <dimen name="text_enlarged">17sp</dimen>
<dimen name="text_enlargednumbers">22sp</dimen> <dimen name="text_enlargednumbers">24sp</dimen>
<dimen name="text_hugenumbers">33sp</dimen> <dimen name="text_hugenumbers">35sp</dimen>
<dimen name="text_label">12sp</dimen> <dimen name="text_label">14sp</dimen>
<!-- UI elements --> <!-- UI elements -->
<dimen name="ui_navigation_filter">17sp</dimen> <dimen name="ui_navigation_filter">17sp</dimen>
<dimen name="ui_navigation_server">14sp</dimen> <dimen name="ui_navigation_server">14sp</dimen>
<dimen name="ui_details_seperator">110dp</dimen> <dimen name="ui_details_seperator">105dp</dimen>
<dimen name="ui_serverstatus_margin">2dp</dimen> <dimen name="ui_serverstatus_margin">2dp</dimen>
<dimen name="ui_serverstatus_signmargin">3dp</dimen> <dimen name="ui_serverstatus_signmargin">3dp</dimen>
<dimen name="ui_serverstatus_bignumber">21sp</dimen> <dimen name="ui_serverstatus_bignumber">21sp</dimen>

3
core/res/values/strings.xml

@ -70,11 +70,12 @@
<string name="status_sincedate">SINCE %1$s</string> <string name="status_sincedate">SINCE %1$s</string>
<string name="status_eta">~ %1$s</string> <string name="status_eta">~ %1$s</string>
<string name="status_etalong">ETA %1$s</string> <string name="status_etalong">ETA %1$s</string>
<string name="status_ofsize">OF %1$s</string>
<string name="status_unknowneta">UNKNOWN ETA</string> <string name="status_unknowneta">UNKNOWN ETA</string>
<string name="status_ratio">RATIO %1$s</string> <string name="status_ratio">RATIO %1$s</string>
<string name="status_peers">%1$s OF %2$s PEERS</string> <string name="status_peers">%1$s OF %2$s PEERS</string>
<string name="status_speed_up" translatable="false">↑ %1$s</string> <string name="status_speed_up" translatable="false">↑ %1$s</string>
<string name="status_speed_down" translatable="false">%1$s</string> <string name="status_speed_down" translatable="false">%1$s</string>
<string name="status_downloading">Downloading</string> <string name="status_downloading">Downloading</string>
<string name="status_seeding">Seeding</string> <string name="status_seeding">Seeding</string>
<string name="status_paused">Paused</string> <string name="status_paused">Paused</string>

2
core/src/org/transdroid/core/gui/DetailsActivity.java

@ -98,7 +98,7 @@ public class DetailsActivity extends SherlockFragmentActivity implements Torrent
// Simple action bar with up, torrent name as title and refresh button // Simple action bar with up, torrent name as title and refresh button
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(torrent.getName()); getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(torrent.getName()));
// Connect to the last used server // Connect to the last used server
ServerSetting lastUsed = applicationSettings.getLastUsedServer(); ServerSetting lastUsed = applicationSettings.getLastUsedServer();

6
core/src/org/transdroid/core/gui/lists/TorrentDetailsView.java

@ -24,6 +24,8 @@ public class TorrentDetailsView extends RelativeLayout {
@ViewById @ViewById
protected TextView labelText, dateaddedText, uploadedText, uploadedunitText, ratioText, upspeedText, seedersText, protected TextView labelText, dateaddedText, uploadedText, uploadedunitText, ratioText, upspeedText, seedersText,
downloadedunitText, downloadedText, totalsizeText, downspeedText, leechersText, statusText; downloadedunitText, downloadedText, totalsizeText, downspeedText, leechersText, statusText;
@ViewById
protected TorrentStatusLayout statusLayout;
public TorrentDetailsView(Context context) { public TorrentDetailsView(Context context) {
super(context); super(context);
@ -64,6 +66,7 @@ public class TorrentDetailsView extends RelativeLayout {
dateaddedText.setVisibility(View.INVISIBLE); dateaddedText.setVisibility(View.INVISIBLE);
} }
statusLayout.setStatus(torrent.getStatusCode());
statusText.setText(getResources().getString(R.string.status_status, local.getProgressStatusEta(getResources()))); statusText.setText(getResources().getString(R.string.status_status, local.getProgressStatusEta(getResources())));
ratioText.setText(getResources().getString(R.string.status_ratio, local.getRatioString())); ratioText.setText(getResources().getString(R.string.status_ratio, local.getRatioString()));
// TODO: Implement separate numbers of seeders and leechers // TODO: Implement separate numbers of seeders and leechers
@ -75,7 +78,8 @@ public class TorrentDetailsView extends RelativeLayout {
// TODO: Add field that displays availability // TODO: Add field that displays availability
// Sizes and speeds texts // Sizes and speeds texts
totalsizeText.setText(FileSizeConverter.getSize(torrent.getTotalSize())); totalsizeText.setText(getResources().getString(R.string.status_ofsize,
FileSizeConverter.getSize(torrent.getTotalSize())));
downloadedText.setText(FileSizeConverter.getSize(torrent.getDownloadedEver(), false)); downloadedText.setText(FileSizeConverter.getSize(torrent.getDownloadedEver(), false));
downloadedunitText.setText(FileSizeConverter.getSizeUnit(torrent.getDownloadedEver()).toString()); downloadedunitText.setText(FileSizeConverter.getSizeUnit(torrent.getDownloadedEver()).toString());
uploadedText.setText(FileSizeConverter.getSize(torrent.getUploadedEver(), false)); uploadedText.setText(FileSizeConverter.getSize(torrent.getUploadedEver(), false));

15
core/src/org/transdroid/core/gui/navigation/NavigationHelper.java

@ -8,6 +8,9 @@ import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.TypefaceSpan;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
import de.keyboardsurfer.android.widget.crouton.Style; import de.keyboardsurfer.android.widget.crouton.Style;
@ -78,4 +81,16 @@ public class NavigationHelper {
return !context.getPackageName().equals("org.transdroid.lite"); return !context.getPackageName().equals("org.transdroid.lite");
} }
/**
* Converts a string into a {@link Spannable} that displays the string in the Roboto Condensed font
* @param string A plain text {@link String}
* @return A {@link Spannable} that can be applied to supporting views (such as the action bar title) so that the
* input string will be displayed using the Roboto Condensed font (if the OS has this)
*/
public static SpannableString buildCondensedFontString(String string) {
SpannableString s = new SpannableString(string);
s.setSpan(new TypefaceSpan("sans-serif-condensed"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return s;
}
} }

2
core/src/org/transdroid/core/gui/navigation/NavigationSelectionView.java

@ -11,7 +11,7 @@ import android.widget.TextView;
* View that displays the user-selected server and display filter inside the action bar list navigation spinner * View that displays the user-selected server and display filter inside the action bar list navigation spinner
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(resName="list_item_navigation") @EViewGroup(resName="actionbar_navigation")
public class NavigationSelectionView extends LinearLayout { public class NavigationSelectionView extends LinearLayout {
@ViewById @ViewById

Loading…
Cancel
Save