use of com.amazon.android.tv.tenfoot.presenter.SettingsCardPresenter in project zype-firebuilder by zype.
the class BrowseHelper method addSettingsActionsToRowAdapter.
/**
* Adds the settings actions to an adapter and adds the adapter to the row adapter.
*
* @param activity The activity.
* @param rowAdapter The row adapter.
*/
public static ArrayObjectAdapter addSettingsActionsToRowAdapter(Activity activity, ArrayObjectAdapter rowAdapter) {
List<Action> settings = ContentBrowser.getInstance(activity).getSettingsHomeActions();
if (settings == null || settings.isEmpty()) {
Log.d(TAG, "No settings were found");
return null;
}
SettingsCardPresenter cardPresenter = new SettingsCardPresenter();
ArrayObjectAdapter settingsAdapter = new ArrayObjectAdapter(cardPresenter);
for (Action item : settings) {
settingsAdapter.add(item);
}
// Create settings header and row.
HeaderItem header = new HeaderItem(0, activity.getResources().getString(R.string.settings_title));
rowAdapter.add(new ListRow(header, settingsAdapter));
return settingsAdapter;
}
use of com.amazon.android.tv.tenfoot.presenter.SettingsCardPresenter in project zype-firebuilder by zype.
the class ZypePlaylistContentBrowseFragment method addSettingsActionsToRowAdapter.
private void addSettingsActionsToRowAdapter(ArrayObjectAdapter arrayObjectAdapter) {
List<Action> settings = ContentBrowser.getInstance(getActivity()).getSettingsActions();
if (settings != null && !settings.isEmpty()) {
SettingsCardPresenter cardPresenter = new SettingsCardPresenter();
settingsAdapter = new ArrayObjectAdapter(cardPresenter);
// for (Action item : settings) {
// settingsAdapter.add(item);
// }
} else {
Log.d(TAG, "No settings were found");
}
if (settingsAdapter != null) {
// Create settings header and row
// HeaderItem header = new HeaderItem(0, getString(R.string.settings_title));
HeaderItem header = new HeaderItem(" ");
arrayObjectAdapter.add(new ListRow(header, settingsAdapter));
}
}
Aggregations