本文整理汇总了Java中org.javarosa.form.api.FormEntryCaption.getMultiplicity方法的典型用法代码示例。如果您正苦于以下问题:Java FormEntryCaption.getMultiplicity方法的具体用法?Java FormEntryCaption.getMultiplicity怎么用?Java FormEntryCaption.getMultiplicity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.javarosa.form.api.FormEntryCaption
的用法示例。
在下文中一共展示了FormEntryCaption.getMultiplicity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHeaderText
import org.javarosa.form.api.FormEntryCaption; //导入方法依赖的package包/类
private String getHeaderText(FormEntryCaption[] hierachy) {
String headertext = "";
for (FormEntryCaption caption : hierachy) {
String c = caption.getLongText();
if(c != null) {
headertext += c;
if (caption.getIndex().getInstanceIndex() > -1) {
headertext += " " + (caption.getMultiplicity() + 1);
}
headertext += ": ";
}
}
if (headertext.endsWith(": "))
headertext = headertext.substring(0, headertext.length() - 2);
return headertext;
}
示例2: addGroupText
import org.javarosa.form.api.FormEntryCaption; //导入方法依赖的package包/类
/**
* // * Add a TextView containing the hierarchy of groups to which the question belongs. //
*/
private void addGroupText(FormEntryCaption[] groups) {
StringBuilder s = new StringBuilder("");
String t = "";
int i;
// list all groups in one string
for (FormEntryCaption g : groups) {
i = g.getMultiplicity() + 1;
t = g.getLongText();
if (t != null) {
s.append(t);
if (g.repeats() && i > 0) {
s.append(" (" + i + ")");
}
s.append(" > ");
}
}
// build view
if (s.length() > 0) {
TextView tv = new TextView(getContext());
tv.setText(s.substring(0, s.length() - 3));
int questionFontsize = Collect.getQuestionFontsize();
tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, questionFontsize - 4);
tv.setPadding(0, 0, 0, 5);
mView.addView(tv, mLayout);
}
}
示例3: deriveGroupText
import org.javarosa.form.api.FormEntryCaption; //导入方法依赖的package包/类
/**
* Returns the hierarchy of groups to which the question belongs.
*/
private SpannableStringBuilder deriveGroupText(FormEntryCaption[] groups) {
SpannableStringBuilder s = new SpannableStringBuilder("");
String t;
String m;
int i;
// list all groups in one string
for (FormEntryCaption g : groups) {
i = g.getMultiplicity() + 1;
t = g.getLongText();
m = g.getMarkdownText();
if (m != null) {
Spannable markdownSpannable = MarkupUtil.returnMarkdown(getContext(), m);
s.append(markdownSpannable);
} else if (t != null && !t.trim().equals("")) {
s.append(t);
} else {
continue;
}
if (g.repeats() && i > 0) {
s.append(" (").append(String.valueOf(i)).append(")");
}
s.append(" > ");
}
//remove the trailing " > "
if (s.length() > 0) {
s.delete(s.length() - 2, s.length());
}
return s;
}
示例4: addRepeatHeading
import org.javarosa.form.api.FormEntryCaption; //导入方法依赖的package包/类
private void addRepeatHeading() {
FormEntryCaption fc = FormEntryActivity.mFormController.getCaptionPrompt();
if (fc.getMultiplicity() == 0) {
// Only add the heading if it is the repeat group entry, not an element in the group.
HierarchyElement group =
new HierarchyElement(context, fc.getLongText(), null,
context.getResources().getDrawable(R.drawable.expander_ic_minimized),
false,
HierarchyEntryType.collapsed, fc.getIndex());
formList.add(group);
}
}
示例5: addGroupText
import org.javarosa.form.api.FormEntryCaption; //导入方法依赖的package包/类
/**
* // * Add a TextView containing the hierarchy of groups to which the question belongs. //
*/
private void addGroupText(FormEntryCaption[] groups) {
StringBuffer s = new StringBuffer("");
String t = "";
int i;
// list all groups in one string
for (FormEntryCaption g : groups) {
i = g.getMultiplicity() + 1;
t = g.getLongText();
if (t != null) {
s.append(t);
if (g.repeats() && i > 0) {
s.append(" (" + i + ")");
}
s.append(" > ");
}
}
// build view
if (s.length() > 0) {
TextView tv = new TextView(getContext());
tv.setText(s.substring(0, s.length() - 3));
int questionFontsize = Collect.getQuestionFontsize();
tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, questionFontsize - 4);
tv.setPadding(0, 0, 0, 5);
mView.addView(tv, mLayout);
}
}