Tasks.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:ATimeTracker 作者:
public TaskView(Context context, Task t) {
    super(context);
    setOrientation(LinearLayout.HORIZONTAL);
    setPadding(5, 10, 5, 10);

    taskName = new TextView(context);
    taskName.setTextSize(fontSize);
    taskName.setText(t.getTaskName());
    addView(taskName, new LinearLayout.LayoutParams(
            LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT, 1f));

    checkMark = new ImageView(context);
    checkMark.setImageResource(R.drawable.ic_check_mark_dark);
    checkMark.setVisibility(View.INVISIBLE);
    addView(checkMark, new LinearLayout.LayoutParams(
            LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT, 0f));

    total = new TextView(context);
    total.setTextSize(fontSize);
    total.setGravity(Gravity.RIGHT);
    total.setTransformationMethod(SingleLineTransformationMethod.getInstance());
    total.setText(formatTotal(decimalFormat, t.getTotal(), 0));
    addView(total, new LinearLayout.LayoutParams(
            LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT, 0f));

    setGravity(Gravity.TOP);
    markupSelectedTask(t);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号