Пример #1
0
/**
 * 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);

}
Пример #2
0
/**
 * Create and add a list section to segmented list.
 * The new section will allow the user to set the list mode.
 * @param list A  segmented list where to add the section.
 */
void SettingsScreen::createListSectionForListMode(SegmentedListView& list)
{
	SegmentedListViewSection* section = new SegmentedListViewSection();
	section->setHeaderText(MODE_SECTION_HEADING_TEXT);
	list.addSection(section);

	this->createModeOptionRows(*section);
}
Пример #3
0
/**
 * Create and add a list section to segmented list.
 * @param list A  segmented list where to add the section.
 */
void SettingsScreen::createListSection(SegmentedListView& list)
{
	SegmentedListViewSection* section = new SegmentedListViewSection();
	section->setHeaderText(FIRST_SECTION_HEADING_TEXT);
	list.addSection(section);

	this->createEditOptionRow(*section);
	this->createMoveOptionRow(*section);
}
Пример #4
0
/**
 * 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);
}
Пример #5
0
/**
 * 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);
}