当前位置: 首页>>代码示例>>Java>>正文


Java FormEntryCaption.getMultiplicity方法代码示例

本文整理汇总了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;
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:20,代码来源:FormSummaryView.java

示例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);
    }
}
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:31,代码来源:ODKView.java

示例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;
}
 
开发者ID:dimagi,项目名称:commcare-android,代码行数:37,代码来源:QuestionsView.java

示例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);
    }
}
 
开发者ID:dimagi,项目名称:commcare-android,代码行数:13,代码来源:FormHierarchyBuilder.java

示例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);
    }
}
 
开发者ID:sages-health,项目名称:sagesmobile-mCollect,代码行数:31,代码来源:ODKView.java


注:本文中的org.javarosa.form.api.FormEntryCaption.getMultiplicity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。