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


Java RatingBar.setOnRatingBarChangeListener方法代码示例

本文整理汇总了Java中android.widget.RatingBar.setOnRatingBarChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java RatingBar.setOnRatingBarChangeListener方法的具体用法?Java RatingBar.setOnRatingBarChangeListener怎么用?Java RatingBar.setOnRatingBarChangeListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.RatingBar的用法示例。


在下文中一共展示了RatingBar.setOnRatingBarChangeListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EvaluationViewHolder

import android.widget.RatingBar; //导入方法依赖的package包/类
public EvaluationViewHolder(View view) {
    super(view);
    className = (TextView) view.findViewById(R.id.student_class);
    examName = (TextView) view.findViewById(R.id.student_exam);
    userAccountName = (TextView) view.findViewById(R.id.student_name);
    ratingBar = (RatingBar) view.findViewById(R.id.ratingBar);
    ratingBar.setOnRatingBarChangeListener(this);
}
 
开发者ID:fga-gpp-mds,项目名称:2017.1-Trezentos,代码行数:9,代码来源:EvaluationViewHolder.java

示例2: onCreateView

import android.widget.RatingBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.session_feedback_frag, container, false);

    mTitle = (TextView) rootView.findViewById(R.id.feedback_header_session_title);
    mSpeakers = (TextView) rootView.findViewById(R.id.feedback_header_session_speakers);
    mOverallFeedbackBar = (RatingBar) rootView.findViewById(R.id.rating_bar_0);
    mSessionRelevantFeedbackBar = (NumberRatingBar) rootView.findViewById(
            R.id.session_relevant_feedback_bar);
    mContentFeedbackBar = (NumberRatingBar) rootView.findViewById(R.id.content_feedback_bar);
    mSpeakerFeedbackBar = (NumberRatingBar) rootView.findViewById(R.id.speaker_feedback_bar);

    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        // Helps accessibility services determine the importance of this view.
        mOverallFeedbackBar.setImportantForAccessibility(RatingBar.IMPORTANT_FOR_ACCESSIBILITY_YES);

        // Automatically notifies the user about changes to the view's content description.
        mOverallFeedbackBar.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_ASSERTIVE);
    }

    // When the rating changes, update the content description. In TalkBack mode, this
    // informs the user about the selected rating.
    mOverallFeedbackBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
        @Override
        public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
            ratingBar.setContentDescription(
                    getString(R.string.updated_session_feedback_rating_bar_content_description, (int) rating));
        }
    });

    rootView.findViewById(R.id.submit_feedback_button).setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    submitFeedback();
                }
            }
    );
    return rootView;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:43,代码来源:SessionFeedbackFragment.java


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