Browse Source

Further work on new layout.

pull/11/head
Eric Kok 12 years ago
parent
commit
7206333e92
  1. 7
      lite/res/layout-w600dp/activity_torrents.xml
  2. 10
      lite/res/layout-w720dp/activity_torrents.xml
  3. 2
      lite/res/layout/activity_torrents.xml
  4. 7
      lite/res/layout/fragment_details.xml
  5. 6
      lite/res/layout/fragment_filters.xml
  6. 18
      lite/res/layout/fragment_torrents.xml
  7. 2
      lite/src/org/transdroid/lite/gui/DetailsFagment.java
  8. 10
      lite/src/org/transdroid/lite/gui/TorrentsActivity.java

7
lite/res/layout-w600dp/activity_torrents.xml

@ -12,13 +12,16 @@ @@ -12,13 +12,16 @@
android:id="@+id/filters_list"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1" />
android:layout_weight="1"
android:choiceMode="singleChoice"
android:listSelector="@drawable/selectable_background_transdroid" />
<fragment
android:id="@+id/torrent_list"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="3"
class="org.transdroid.gui.TorrentsFragment" />
class="org.transdroid.gui.TorrentsFragment"
tools:layout="@layout/fragment_torrents" />
</LinearLayout>

10
lite/res/layout-w720dp/activity_torrents.xml

@ -12,20 +12,24 @@ @@ -12,20 +12,24 @@
android:id="@+id/filters_list"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1" />
android:layout_weight="1"
android:choiceMode="singleChoice"
android:listSelector="@drawable/selectable_background_transdroid" />
<fragment
android:id="@+id/torrent_list"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="2"
class="org.transdroid.gui.TorrentsFragment" />
class="org.transdroid.gui.TorrentsFragment"
tools:layout="@layout/fragment_torrents" />
<fragment
android:id="@+id/torrent_details"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="2"
class="org.transdroid.gui.DetailsFragment" />
class="org.transdroid.gui.DetailsFragment"
tools:layout="@layout/fragment_details" />
</LinearLayout>

2
lite/res/layout/activity_torrents.xml

@ -10,6 +10,6 @@ @@ -10,6 +10,6 @@
android:id="@+id/torrent_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="org.transdroid.gui.TorrentsFragment" />
class="org.transdroid.gui.TorrentsFragment" tools:layout="@layout/fragment_torrents"/>
</FrameLayout>

7
lite/res/layout/fragment_details.xml

@ -3,10 +3,13 @@ @@ -3,10 +3,13 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
<com.actionbarsherlock.view.SherlockListView
android:id="@+id/details_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:choiceMode="multipleChoiceModal"
android:listSelector="@drawable/selectable_background_transdroid"
android:visibility="gone" />
<TextView
android:id="@+id/empty_text"

6
lite/res/layout/fragment_filters.xml

@ -3,9 +3,11 @@ @@ -3,9 +3,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
<com.actionbarsherlock.view.ListView
android:id="@+id/filters_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:listSelector="@drawable/selectable_background_transdroid" />
</FrameLayout>

18
lite/res/layout/fragment_torrents.xml

@ -3,9 +3,23 @@ @@ -3,9 +3,23 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
<com.actionbarsherlock.view.SherlockListView
android:id="@+id/torrent_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:choiceMode="multipleChoiceModal"
android:listSelector="@drawable/selectable_background_transdroid"
android:visibility="gone" />
<TextView
android:id="@+id/empty_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="@drawable/ic_empty_details"
android:drawablePadding="8dip"
android:text="@string/navigation_emptytorrents"
android:textIsSelectable="false"
android:visibility="gone" />
</FrameLayout>

2
lite/src/org/transdroid/lite/gui/DetailsFagment.java

@ -40,6 +40,8 @@ public class DetailsFagment extends SherlockFragment { @@ -40,6 +40,8 @@ public class DetailsFagment extends SherlockFragment {
emptyText.setVisibility(View.VISIBLE);
}
// TODO: Show the torrent details and load the advanced statistics
}
}

10
lite/src/org/transdroid/lite/gui/TorrentsActivity.java

@ -14,11 +14,10 @@ import org.transdroid.lite.gui.navigation.FilterItem; @@ -14,11 +14,10 @@ import org.transdroid.lite.gui.navigation.FilterItem;
import org.transdroid.lite.gui.navigation.FilterSeparatorView;
import org.transdroid.lite.gui.navigation.NavigationHelper;
import android.widget.ListView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.SherlockListView;
@EActivity(R.layout.activity_torrents)
@OptionsMenu(R.menu.activity_torrents)
@ -28,7 +27,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi @@ -28,7 +27,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
@Bean
protected NavigationHelper navigationHelper;
@ViewById
protected ListView filtersList;
protected SherlockListView filtersList;
protected FilterAdapter navigationListAdapter = null;
protected FilterAdapter navigationSpinnerAdapter = null;
@ -57,6 +56,9 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi @@ -57,6 +56,9 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
}
/**
* Called when an item in the action bar navigation spinner was selected
*/
@Override
public boolean onNavigationItemSelected(int itemPosition, long itemId) {
Object item = navigationSpinnerAdapter.getItem(itemPosition);
@ -71,7 +73,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi @@ -71,7 +73,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
/**
* A new filter was selected; update the view over the current data
* @param selected
* @param selected True if
* @param item
*/
@ItemSelect(R.id.filters_list)

Loading…
Cancel
Save