Search in sources :

Example 1 with FeedMode

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);
}
Also used : FeedMode(com.androidquery.simplefeed.enums.FeedMode)

Example 2 with FeedMode

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();
    }
}
Also used : Entity(com.androidquery.simplefeed.data.Entity) PQuery(com.androidquery.simplefeed.PQuery) FeedMode(com.androidquery.simplefeed.enums.FeedMode) ActionBar(android.app.ActionBar) ArrayAdapter(android.widget.ArrayAdapter)

Example 3 with FeedMode

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());
    }
}
Also used : Entity(com.androidquery.simplefeed.data.Entity) FeedMode(com.androidquery.simplefeed.enums.FeedMode)

Example 4 with FeedMode

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());
    }
}
Also used : Entity(com.androidquery.simplefeed.data.Entity) FeedMode(com.androidquery.simplefeed.enums.FeedMode)

Aggregations

FeedMode (com.androidquery.simplefeed.enums.FeedMode)4 Entity (com.androidquery.simplefeed.data.Entity)3 ActionBar (android.app.ActionBar)1 ArrayAdapter (android.widget.ArrayAdapter)1 PQuery (com.androidquery.simplefeed.PQuery)1