Java Code Examples for android.widget.LinearLayout#getTag()

The following examples show how to use android.widget.LinearLayout#getTag() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: ClassSchedule   File: AddActivity.java    License: Apache License 2.0 5 votes vote down vote up
private void clickLocationItem(final LinearLayout locationItem) {
    PopupWindowDialog dialog = new PopupWindowDialog();

    CourseV2 courseV2 = null;
    Object obj = locationItem.getTag();
    // has tag data
    if (obj != null && obj instanceof CourseV2) {
        courseV2 = (CourseV2) obj;
    } else {
        throw new RuntimeException("Course data tag not be found");
    }

    dialog.showSelectTimeDialog(this, courseV2, new PopupWindowDialog.SelectTimeCallback() {
        @Override
        public void onSelected(CourseV2 course) {
            StringBuilder builder = new StringBuilder();
            builder.append("周").append(Constant.WEEK_SINGLE[course.getCouWeek() - 1])
                    .append(" 第").append(course.getCouStartNode()).append("-")
                    .append(course.getCouStartNode() + course.getCouNodeCount() - 1).append("节");
            if (!TextUtils.isEmpty(course.getCouLocation())) {
                builder.append("【").append(course.getCouLocation()).append("】");
            }

            ((TextView) locationItem.findViewById(R.id.tv_text))
                    .setText(builder.toString());
        }
    });
}
 
Example 2
Source Project: Shield   File: RowDividerAgent.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateHeaderView(ViewGroup parent, int headerViewType) {
    LinearLayout rootView = (LinearLayout) createShowView();
    if (rootView != null && (rootView.getTag() instanceof ItemViewHolder)) {
        TextView containView = ((ItemViewHolder) rootView.getTag()).textView;
        containView.setText("Header, divider");
        containView.setTextColor(getContext().getResources().getColor(android.R.color.holo_green_dark));
        containView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
    }
    return rootView;
}
 
Example 3
Source Project: Shield   File: RowDividerAgent.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateFooterView(ViewGroup parent, int footerViewType) {
    LinearLayout rootView = (LinearLayout) createShowView();
    if (rootView != null && (rootView.getTag() instanceof ItemViewHolder)) {
        TextView containView = ((ItemViewHolder) rootView.getTag()).textView;
        containView.setTextColor(getContext().getResources().getColor(android.R.color.holo_green_dark));
        containView.setText("Footer, divider");
        containView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
    }
    return rootView;
}
 
Example 4
Source Project: Shield   File: DefaultDividerAgent.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateHeaderView(ViewGroup parent, int headerViewType) {
    LinearLayout rootView = (LinearLayout) createShowView();
    if (rootView != null && (rootView.getTag() instanceof ItemViewHolder)) {
        TextView containView = ((ItemViewHolder) rootView.getTag()).textView;
        containView.setText("Header, divider");
        containView.setTextColor(getContext().getResources().getColor(android.R.color.holo_green_dark));
        containView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
    }
    return rootView;
}
 
Example 5
Source Project: Shield   File: DefaultDividerAgent.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateFooterView(ViewGroup parent, int footerViewType) {
    LinearLayout rootView = (LinearLayout) createShowView();
    if (rootView != null && (rootView.getTag() instanceof ItemViewHolder)) {
        TextView containView = ((ItemViewHolder) rootView.getTag()).textView;
        containView.setTextColor(getContext().getResources().getColor(android.R.color.holo_green_dark));
        containView.setText("Footer, divider");
        containView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
    }
    return rootView;
}
 
Example 6
Source Project: Shield   File: SectionDividerAgent.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateHeaderView(ViewGroup parent, int headerViewType) {
    LinearLayout rootView = (LinearLayout) createShowView();
    if (rootView != null && (rootView.getTag() instanceof ItemViewHolder)) {
        TextView containView = ((ItemViewHolder) rootView.getTag()).textView;
        containView.setText("Header, divider");
        containView.setTextColor(getContext().getResources().getColor(android.R.color.holo_green_dark));
        containView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
        return rootView;
    }
    return null;
}
 
Example 7
Source Project: Shield   File: SectionDividerAgent.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateFooterView(ViewGroup parent, int footerViewType) {
    LinearLayout rootView = (LinearLayout) createShowView();
    if (rootView != null && (rootView.getTag() instanceof ItemViewHolder)) {
        TextView containView = ((ItemViewHolder) rootView.getTag()).textView;
        containView.setTextColor(getContext().getResources().getColor(android.R.color.holo_green_dark));
        containView.setText("Footer, divider");
        containView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
        return rootView;
    }
    return null;
}