Search in sources :

Example 1 with LinearAdapterPlus

use of rocks.tbog.tblauncher.ui.LinearAdapterPlus in project TBLauncher by TBog.

the class WidgetManager method getWidgetListPopup.

/**
 * A popup with all active widgets to choose one
 *
 * @return the menu
 */
public ListPopup getWidgetListPopup(@StringRes int title) {
    Context ctx = mLayout.getContext();
    LinearAdapter adapter = new LinearAdapterPlus();
    adapter.add(new LinearAdapter.ItemTitle(ctx, title));
    for (WidgetRecord rec : mWidgets.values()) {
        adapter.add(WidgetPopupItem.create(ctx, mAppWidgetManager, rec.appWidgetId));
    }
    for (PlaceholderWidgetRecord placeholder : mPlaceholders) {
        adapter.add(PlaceholderPopupItem.create(ctx, placeholder));
    }
    return ListPopup.create(ctx, adapter);
}
Also used : Context(android.content.Context) LinearAdapter(rocks.tbog.tblauncher.ui.LinearAdapter) LinearAdapterPlus(rocks.tbog.tblauncher.ui.LinearAdapterPlus) PlaceholderWidgetRecord(rocks.tbog.tblauncher.db.PlaceholderWidgetRecord) PlaceholderWidgetRecord(rocks.tbog.tblauncher.db.PlaceholderWidgetRecord) WidgetRecord(rocks.tbog.tblauncher.db.WidgetRecord)

Aggregations

Context (android.content.Context)1 PlaceholderWidgetRecord (rocks.tbog.tblauncher.db.PlaceholderWidgetRecord)1 WidgetRecord (rocks.tbog.tblauncher.db.WidgetRecord)1 LinearAdapter (rocks.tbog.tblauncher.ui.LinearAdapter)1 LinearAdapterPlus (rocks.tbog.tblauncher.ui.LinearAdapterPlus)1