use of com.androidquery.simplefeed.enums.FeedMode in project simplefacebook by androidquery.
the class BaseActivity method modeChange.
protected void modeChange() {
FeedMode mode = AppUtility.getDefaultMode();
if (FeedMode.NEWS.equals(mode)) {
mode = FeedMode.WALL;
} else {
mode = FeedMode.NEWS;
}
//PrefUtility.put(MODE_KEY, mode);
PrefUtility.putEnum(mode);
modeChange(mode);
}
use of com.androidquery.simplefeed.enums.FeedMode in project simplefacebook by androidquery.
the class MenuActivity method initActionBar.
private void initActionBar() {
ActionBar bar = getActionBar();
if (bar == null)
return;
bar.setCustomView(R.layout.action_custom);
bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
PQuery aq = aq2.recycle(bar.getCustomView());
currentMode = getMode();
AQUtility.debug("mode", currentMode);
if (currentMode != null) {
List<FeedMode> modes = Arrays.asList(FeedMode.values());
ArrayAdapter<FeedMode> adapter = new ArrayAdapter<FeedMode>(this, R.layout.action_modes, modes);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
currentIndex = modes.indexOf(currentMode);
aq.id(R.id.spinner_action_bar).adapter(adapter).setSelection(currentIndex).visible().itemSelected(this, "modeSelected");
if (!isTablet()) {
aq.id(R.id.text_action_title).gone();
} else {
aq.id(R.id.text_action_title).visible();
}
} else {
aq.id(R.id.text_action_title).visible();
aq.id(R.id.spinner_action_bar).gone();
}
Entity entity = getSource();
if (entity != null) {
String tb = entity.getTb(handle);
if (tb != null) {
aq.id(R.id.image_action_bar).image(tb);
}
aq.id(R.id.text_action_title).text(entity.getName());
} else {
aq.id(R.id.text_action_title).gone();
}
}
use of com.androidquery.simplefeed.enums.FeedMode in project simplefacebook by androidquery.
the class AllDataActivity method itemClicked.
public void itemClicked(AdapterView<?> list, View view, int pos, long id) {
FeedMode item = items.getItem(pos);
AQUtility.debug(item.getDisplay(), item.getHandler());
if (FeedMode.NEWS.equals(item) || FeedMode.WALL.equals(item)) {
Entity source = AppUtility.getDefaultSource(item);
FeedActivity.start(this, source);
} else {
start(this, item.getHandler());
}
}
use of com.androidquery.simplefeed.enums.FeedMode in project simplefacebook by androidquery.
the class MenuActivity method modeSelected.
public void modeSelected(AdapterView<?> parent, View view, int position, long id) {
FeedMode[] modes = FeedMode.values();
FeedMode item = modes[position];
if (item.equals(currentMode)) {
return;
}
if (FeedMode.NEWS.equals(item) || FeedMode.WALL.equals(item)) {
Entity source = AppUtility.getDefaultSource(item);
FeedActivity.startLaunch(this, source, item);
} else {
startMode(this, item.getHandler());
}
}
Aggregations