/** * Create and add a list rows for setting the list mode. * @param section List section where to add the list items/rows. */ void SettingsScreen::createModeOptionRows(SegmentedListViewSection& section) { // Create and add the display list item. mDisplayMode = new SegmentedListViewItem(); RelativeLayout* layout = new RelativeLayout(); mDisplayMode->addChild(layout); section.addItem(mDisplayMode); Label* label = new Label(); label->setText(DISPLAY_MODE_LABEL_TEXT); label->setTopPosition(LABEL_PADDING_TOP); label->setLeftPosition(LABEL_PADDING_LEFT); layout->addChild(label); // Create and add the display list item. mEditMode = new SegmentedListViewItem(); layout = new RelativeLayout(); mEditMode->addChild(layout); section.addItem(mEditMode); label = new Label(); label->setText(EDIT_MODE_LABEL_TEXT); label->setTopPosition(LABEL_PADDING_TOP); label->setLeftPosition(LABEL_PADDING_LEFT); layout->addChild(label); }
/** * Add a given section to list. * @param section Section to add. */ void IndexedListScreen::addSectionDataToList(const ListSection& section) { SegmentedListViewSection* segmentedListViewSection = new SegmentedListViewSection(); segmentedListViewSection->setTitle(section.getTitle()); segmentedListViewSection->setHeaderText(section.getTitle()); int countCells = section.getCellCount(); for (int i = 0; i < countCells; i++) { const String* cellText = section.getCellText(i); // Create cell and add it to section. CountrySegmentedListItem* cell = new CountrySegmentedListItem(*cellText); segmentedListViewSection->addItem(cell); } mSegmentedListView->addSection(segmentedListViewSection); }
/** * Create and add a list row containing a check box for enabling/disabling * list move option. * @param section List section where to add the list item/row. */ void SettingsScreen::createMoveOptionRow(SegmentedListViewSection& section) { SegmentedListViewItem* item = new SegmentedListViewItem(); section.addItem(item); RelativeLayout* layout = new RelativeLayout(); item->addChild(layout); Label* label = new Label(); label->setTopPosition(LABEL_PADDING_TOP); label->setLeftPosition(LABEL_PADDING_LEFT); label->setText(MOVE_LABEL_TEXT); layout->addChild(label); mAllowMoving = new CheckBox(); int leftCoord = item->getWidth() - 3* LABEL_PADDING_LEFT - mAllowMoving->getWidth(); mAllowMoving->setLeftPosition(leftCoord); mAllowMoving->setTopPosition(LABEL_PADDING_TOP); layout->addChild(mAllowMoving); }