コード例 #1
0
  protected TextView message() {
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    params.addRule(ALIGN_PARENT_TOP);
    params.addRule(ALIGN_PARENT_LEFT);
    params.bottomMargin = topBottomPaddingOne;

    TextView v = new TextView(getContext());
    v.setId(RandomId.get());
    v.setLayoutParams(params);
    messageTextStyle.style(v);

    return v;
  }
コード例 #2
0
  protected TextView fieldValue(View rightView) {
    LayoutParams params =
        new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.addRule(LEFT_OF, rightView.getId());

    TextView v = new TextView(getContext());
    v.setId(RandomId.get());
    v.setLayoutParams(params);
    v.setGravity(Gravity.CENTER_VERTICAL | Gravity.RIGHT);
    styleBodyTwo.style(v);
    v.setText("NUM");

    return v;
  }
コード例 #3
0
  protected TextView unitHeightFillView() {
    LayoutParams params =
        new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.addRule(ALIGN_PARENT_RIGHT);

    TextView v = new TextView(getContext());
    v.setId(RandomId.get());
    v.setLayoutParams(params);
    styleNote.style(v);
    v.setText("UNIT");
    v.setVisibility(INVISIBLE);

    return v;
  }
コード例 #4
0
  protected TextView triggerTime(View leftView) {
    LayoutParams params =
        new LayoutParams(LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.addRule(RIGHT_OF, leftView.getId());
    params.addRule(CENTER_VERTICAL);
    params.addRule(ALIGN_PARENT_RIGHT);

    TextView v = new TextView(getContext());
    v.setId(RandomId.get());
    v.setLayoutParams(params);
    triggeredTextStyle.style(v);

    return v;
  }
コード例 #5
0
  protected TextView status(View leftView) {
    LayoutParams params =
        new LayoutParams(LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.addRule(RIGHT_OF, leftView.getId());
    params.addRule(CENTER_VERTICAL);
    params.leftMargin = leftRightPaddingOne;

    TextView v = new TextView(getContext());
    v.setId(RandomId.get());
    v.setLayoutParams(params);
    statusTextStyle.style(v);

    return v;
  }
コード例 #6
0
  protected TextView fieldUnit(View leftView, View backgroundView) {
    LayoutParams params =
        new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.addRule(ALIGN_LEFT, backgroundView.getId());
    params.addRule(ALIGN_RIGHT, backgroundView.getId());
    params.addRule(ALIGN_BOTTOM, leftView.getId());

    TextView v = new TextView(getContext());
    v.setId(RandomId.get());
    v.setLayoutParams(params);
    styleNote.style(v);
    v.setText("UNIT");

    return v;
  }
コード例 #7
0
  private TextView getNumberButton(int resourceText, int number) {
    LayoutParams params = new LayoutParams(ruler.getW(31), ruler.getW(23));

    StateListDrawable states = new StateListDrawable();
    states.addState(
        new int[] {android.R.attr.state_pressed}, new ColorDrawable(ColorTable._D5D5D5));
    states.addState(
        new int[] {android.R.attr.state_focused}, new ColorDrawable(ColorTable._D5D5D5));
    states.addState(
        new int[] {}, new ColorDrawable(designSpec.getPrimaryColors().getBackgroundOne()));

    TextView v = new TextView(getContext());
    v.setId(RandomId.get());
    v.setLayoutParams(params);
    v.setBackground(states);
    v.setGravity(Gravity.CENTER);
    v.setText(resourceText);
    v.setTag(number);
    v.setTextColor(ColorTable._666666);
    styleLargeButton.style(v);

    return v;
  }