Browse Source

Current filter list text size through separate view.

pull/11/head
Eric Kok 12 years ago
parent
commit
9ae53ba848
  1. 2
      core/src/org/transdroid/core/gui/TorrentsActivity.java
  2. 6
      core/src/org/transdroid/core/gui/navigation/FilterListAdapter.java
  3. 5
      core/src/org/transdroid/core/gui/navigation/FilterListDropDownAdapter.java
  4. 7
      core/src/org/transdroid/core/gui/navigation/FilterListItemAdapter.java
  5. 2
      core/src/org/transdroid/core/gui/navigation/FilterListItemView.java

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

@ -132,6 +132,8 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
// Check if there was room for a dedicated filter list (i.e. on tablets) // Check if there was room for a dedicated filter list (i.e. on tablets)
if (filtersList != null) { if (filtersList != null) {
// The action bar spinner doesn't have to show the 'servers' label, as it will only contain servers
navigationSpinnerAdapter.hideServersLabel();
// Create dedicated side list adapter and add the status types // Create dedicated side list adapter and add the status types
navigationListAdapter = FilterListAdapter_.getInstance_(this); navigationListAdapter = FilterListAdapter_.getInstance_(this);
navigationListAdapter.updateStatusTypes(StatusType.getAllStatusTypes(this)); navigationListAdapter.updateStatusTypes(StatusType.getAllStatusTypes(this));

6
core/src/org/transdroid/core/gui/navigation/FilterListAdapter.java

@ -26,9 +26,9 @@ public class FilterListAdapter extends MergeAdapter {
private FilterListItemAdapter serverItems = null; private FilterListItemAdapter serverItems = null;
private FilterListItemAdapter statusTypeItems = null; private FilterListItemAdapter statusTypeItems = null;
private FilterListItemAdapter labelItems = null; private FilterListItemAdapter labelItems = null;
private FilterSeparatorView statusTypeSeparator; protected FilterSeparatorView statusTypeSeparator;
private FilterSeparatorView labelSeperator; protected FilterSeparatorView labelSeperator;
private FilterSeparatorView serverSeparator; protected FilterSeparatorView serverSeparator;
/** /**
* Update the list of available servers * Update the list of available servers

5
core/src/org/transdroid/core/gui/navigation/FilterListDropDownAdapter.java

@ -46,4 +46,9 @@ public class FilterListDropDownAdapter extends FilterListAdapter {
navigationSelectionView.bind(this.currentServer, this.currentFilter); navigationSelectionView.bind(this.currentServer, this.currentFilter);
} }
public void hideServersLabel() {
serverSeparator.setVisibility(View.INVISIBLE);
notifyDataSetInvalidated();
}
} }

7
core/src/org/transdroid/core/gui/navigation/FilterListItemAdapter.java

@ -4,7 +4,6 @@ import java.util.List;
import org.transdroid.core.gui.lists.SimpleListItem; import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.core.gui.lists.SimpleListItemView; import org.transdroid.core.gui.lists.SimpleListItemView;
import org.transdroid.core.gui.lists.SimpleListItemView_;
import android.content.Context; import android.content.Context;
import android.view.View; import android.view.View;
@ -47,11 +46,11 @@ public class FilterListItemAdapter extends BaseAdapter {
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
SimpleListItemView filterItemView; FilterListItemView filterItemView;
if (convertView == null || !(convertView instanceof SimpleListItemView)) { if (convertView == null || !(convertView instanceof SimpleListItemView)) {
filterItemView = SimpleListItemView_.build(context); filterItemView = FilterListItemView_.build(context);
} else { } else {
filterItemView = (SimpleListItemView) convertView; filterItemView = (FilterListItemView) convertView;
} }
filterItemView.bind(getItem(position)); filterItemView.bind(getItem(position));
return filterItemView; return filterItemView;

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

@ -9,7 +9,7 @@ import android.widget.FrameLayout;
import android.widget.TextView; import android.widget.TextView;
/** /**
* View that represents some {@link SimpleListItem} object used to represent a navigation filter item * View that represents some {@link SimpleListItem} object specifically used to represent a navigation filter item.
* @author Eric Kok * @author Eric Kok
*/ */
@EViewGroup(resName="list_item_filter") @EViewGroup(resName="list_item_filter")

Loading…
Cancel
Save