Browse Source

Updated RSS feeds views to include Toolbar. More work later.

material
Eric Kok 10 years ago
parent
commit
cb47a0ea96
  1. 1
      app/build.gradle
  2. 2
      app/src/main/AndroidManifest.xml
  3. 8
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java
  4. 9
      app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java
  5. 17
      app/src/main/res/layout-w600dp/activity_torrents.xml
  6. 56
      app/src/main/res/layout-w900dp/activity_rssfeeds.xml
  7. 17
      app/src/main/res/layout-w900dp/activity_torrents.xml
  8. 18
      app/src/main/res/layout/activity_rssfeeds.xml
  9. 22
      app/src/main/res/layout/activity_rssitems.xml
  10. 18
      app/src/main/res/layout/activity_torrents.xml
  11. 8
      app/src/main/res/layout/fragment_rssfeeds.xml
  12. 20
      app/src/main/res/layout/list_item_rssfeed.xml
  13. 11
      app/src/main/res/layout/list_item_rssitem.xml

1
app/build.gradle

@ -50,6 +50,7 @@ dependencies { @@ -50,6 +50,7 @@ dependencies {
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.+'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-annotations:20.0.0'
//compile 'com.getbase:floatingactionbutton:1.2.1'
apt "org.androidannotations:androidannotations:3.1"
}

2
app/src/main/AndroidManifest.xml

@ -194,7 +194,7 @@ @@ -194,7 +194,7 @@
<activity android:name="org.transdroid.core.seedbox.XirvikSharedSettingsActivity_" />
<activity android:name="org.transdroid.core.seedbox.XirvikSemiSettingsActivity_" />
<activity android:name="org.transdroid.core.seedbox.XirvikDediSettingsActivity_" />
<!-- Search -->
<activity
android:name="org.transdroid.core.gui.search.SearchActivity_"

8
app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java

@ -27,6 +27,7 @@ import org.androidannotations.annotations.EActivity; @@ -27,6 +27,7 @@ import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.FragmentById;
import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
import org.transdroid.core.app.settings.*;
import org.transdroid.core.gui.*;
@ -41,6 +42,7 @@ import android.net.Uri; @@ -41,6 +42,7 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import de.keyboardsurfer.android.widget.crouton.Crouton;
@ -59,6 +61,8 @@ public class RssfeedsActivity extends ActionBarActivity { @@ -59,6 +61,8 @@ public class RssfeedsActivity extends ActionBarActivity {
protected RssfeedsFragment fragmentFeeds;
@FragmentById(resName = "rssitems_fragment")
protected RssitemsFragment fragmentItems;
@ViewById
protected Toolbar rssfeedsToolbar;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -71,9 +75,9 @@ public class RssfeedsActivity extends ActionBarActivity { @@ -71,9 +75,9 @@ public class RssfeedsActivity extends ActionBarActivity {
@AfterViews
protected void init() {
// Simple action bar with up button and correct title font
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setSupportActionBar(rssfeedsToolbar);
getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds)));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)

9
app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java

@ -21,6 +21,7 @@ import org.androidannotations.annotations.EActivity; @@ -21,6 +21,7 @@ import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.Extra;
import org.androidannotations.annotations.FragmentById;
import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.ViewById;
import org.transdroid.R;
import org.transdroid.core.app.settings.*;
import org.transdroid.core.gui.*;
@ -28,10 +29,12 @@ import org.transdroid.core.gui.navigation.NavigationHelper; @@ -28,10 +29,12 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.rssparser.Channel;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
@EActivity(resName = "activity_rssitems")
public class RssitemsActivity extends ActionBarActivity {
@ -43,6 +46,8 @@ public class RssitemsActivity extends ActionBarActivity { @@ -43,6 +46,8 @@ public class RssitemsActivity extends ActionBarActivity {
@FragmentById(resName = "rssitems_fragment")
protected RssitemsFragment fragmentItems;
@ViewById
protected Toolbar rssfeedsToolbar;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -62,9 +67,9 @@ public class RssitemsActivity extends ActionBarActivity { @@ -62,9 +67,9 @@ public class RssitemsActivity extends ActionBarActivity {
return;
}
// Simple action bar with up button and torrent name as title
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setSupportActionBar(rssfeedsToolbar);
getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(rssfeedName));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Get the intent extras and show them to the already loaded fragment
fragmentItems.update(rssfeed, false);

17
app/src/main/res/layout-w600dp/activity_torrents.xml

@ -1,10 +1,25 @@ @@ -1,10 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010-2013 Eric Kok et al.
Transdroid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Transdroid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<!-- This layout is for 7" and 10" tablets in portrait and shows torrents and filters. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".core.gui.TorrentsActivity_">
<android.support.v7.widget.Toolbar

56
app/src/main/res/layout-w900dp/activity_rssfeeds.xml

@ -15,28 +15,44 @@ @@ -15,28 +15,44 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="false"
tools:context=".RssfeedsActivity" >
tools:context=".core.gui.rss.RssfeedsActivity_">
<fragment
android:id="@+id/rssfeeds_fragment"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="2"
class="org.transdroid.core.gui.rss.RssfeedsFragment_"
tools:layout="@layout/fragment_rssfeeds" />
<fragment
android:id="@+id/rssitems_fragment"
android:layout_width="0dip"
<android.support.v7.widget.Toolbar
android:id="@+id/rssfeeds_toolbar"
style="@style/DefaultToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"/>
<View
style="@style/DefaultToolbarShadow"
android:layout_below="@id/rssfeeds_toolbar"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3"
class="org.transdroid.core.gui.rss.RssitemsFragment_"
tools:layout="@layout/fragment_rssitems" />
</LinearLayout>
android:layout_below="@id/rssfeeds_toolbar"
android:baselineAligned="false"
android:orientation="horizontal">
<fragment
android:id="@+id/rssfeeds_fragment"
class="org.transdroid.core.gui.rss.RssfeedsFragment_"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="2"
tools:layout="@layout/fragment_rssfeeds"/>
<fragment
android:id="@+id/rssitems_fragment"
class="org.transdroid.core.gui.rss.RssitemsFragment_"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="3"
tools:layout="@layout/fragment_rssitems"/>
</LinearLayout>
</RelativeLayout>

17
app/src/main/res/layout-w900dp/activity_torrents.xml

@ -1,10 +1,25 @@ @@ -1,10 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010-2013 Eric Kok et al.
Transdroid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Transdroid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<!-- This layout is for 7" and 10" tablets in landscape shows torrents, filters and details. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".core.gui.TorrentsActivity_">
<android.support.v7.widget.Toolbar

18
app/src/main/res/layout/activity_rssfeeds.xml

@ -15,17 +15,29 @@ @@ -15,17 +15,29 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".RssfeedsActivity" >
tools:context=".core.gui.rss.RssfeedsActivity_" >
<android.support.v7.widget.Toolbar
android:id="@+id/rssfeeds_toolbar"
style="@style/DefaultToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"/>
<View
style="@style/DefaultToolbarShadow"
android:layout_below="@id/rssfeeds_toolbar"/>
<fragment
android:id="@+id/rssfeeds_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/rssfeeds_toolbar"
class="org.transdroid.core.gui.rss.RssfeedsFragment_"
tools:layout="@layout/fragment_rssfeeds" />
</FrameLayout>
</RelativeLayout>

22
app/src/main/res/layout/activity_rssitems.xml

@ -15,17 +15,29 @@ @@ -15,17 +15,29 @@
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".RssItemsActivity" >
tools:context=".core.gui.rss.RssitemsActivity_">
<android.support.v7.widget.Toolbar
android:id="@+id/rssfeeds_toolbar"
style="@style/DefaultToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"/>
<View
style="@style/DefaultToolbarShadow"
android:layout_below="@id/rssfeeds_toolbar"/>
<fragment
android:id="@+id/rssitems_fragment"
class="org.transdroid.core.gui.rss.RssitemsFragment_"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="org.transdroid.core.gui.rss.RssitemsFragment_"
tools:layout="@layout/fragment_rssitems" />
android:layout_below="@id/rssfeeds_toolbar"
tools:layout="@layout/fragment_rssitems"/>
</FrameLayout>
</RelativeLayout>

18
app/src/main/res/layout/activity_torrents.xml

@ -1,5 +1,21 @@ @@ -1,5 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This layout is for phones in portrait and shows only the torrents list. -->
<!--
Copyright 2010-2013 Eric Kok et al.
Transdroid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Transdroid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<!-- This layout is for phones in portrait and shows the torrents list with the filters as navigation drawer. -->
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"

8
app/src/main/res/layout/fragment_rssfeeds.xml

@ -16,15 +16,16 @@ @@ -16,15 +16,16 @@
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:layout_height="match_parent">
<ListView
android:id="@+id/rssfeeds_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:visibility="gone" />
android:visibility="gone"/>
<TextView
android:id="@+id/nosettings_text"
@ -38,6 +39,7 @@ @@ -38,6 +39,7 @@
android:padding="@dimen/margin_default"
android:text="@string/rss_nosettings"
android:textIsSelectable="false"
android:visibility="gone" />
android:visibility="gone"
tools:visibility="visible"/>
</FrameLayout>

20
app/src/main/res/layout/list_item_rssfeed.xml

@ -21,36 +21,38 @@ @@ -21,36 +21,38 @@
android:layout_height="wrap_content"
android:background="?attr/activatable_background"
android:orientation="horizontal"
android:paddingBottom="@dimen/margin_half"
android:paddingBottom="@dimen/margin_default"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_half" >
android:paddingTop="@dimen/margin_default" >
<ImageView
android:id="@+id/favicon_image"
android:layout_width="24dip"
android:layout_height="24dip"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginRight="@dimen/margin_default"
android:scaleType="centerCrop"
tools:src="@drawable/ic_launcher"
tools:ignore="contentDescription" />
<TextView
android:id="@+id/name_text"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_marginTop="1dip"
android:layout_height="24dp"
android:layout_weight="1"
android:textIsSelectable="false" />
android:gravity="center_vertical"
android:textIsSelectable="false"
tools:text="Custom RSS Feed"/>
<TextView
android:id="@+id/newcount_text"
style="@style/LabelTextView"
android:layout_width="wrap_content"
android:layout_height="24dip"
android:gravity="center_horizontal"
android:gravity="center"
android:minWidth="24dip"
android:paddingLeft="4dip"
android:textIsSelectable="false" />
android:textIsSelectable="false"
tools:text="28"/>
<ProgressBar
android:id="@+id/loading_progress"

11
app/src/main/res/layout/list_item_rssitem.xml

@ -16,13 +16,14 @@ @@ -16,13 +16,14 @@
along with Transdroid. If not, see <http://www.gnu.org/licenses/>.
-->
<org.transdroid.core.gui.rss.RssitemStatusLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/activatable_background"
android:paddingBottom="@dimen/margin_half"
android:paddingBottom="@dimen/margin_default"
android:paddingLeft="@dimen/margin_default"
android:paddingRight="@dimen/margin_default"
android:paddingTop="@dimen/margin_half" >
android:paddingTop="@dimen/margin_default">
<TextView
android:id="@+id/name_text"
@ -31,7 +32,8 @@ @@ -31,7 +32,8 @@
android:fontFamily="sans-serif-condensed"
android:textColor="?attr/text_bright"
android:textIsSelectable="false"
android:textSize="@dimen/text_enlarged" />
android:textSize="@dimen/text_enlarged"
tools:text="Test RSS Item Text Here"/>
<TextView
android:id="@+id/date_text"
@ -40,6 +42,7 @@ @@ -40,6 +42,7 @@
android:layout_below="@id/name_text"
android:layout_marginTop="4dip"
android:textIsSelectable="false"
android:textSize="@dimen/text_small" />
android:textSize="@dimen/text_small"
tools:text="25-12-2015"/>
</org.transdroid.core.gui.rss.RssitemStatusLayout>

Loading…
Cancel
Save