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


Java TextView.addOnLayoutChangeListener方法代码示例

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


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

示例1: ViewHolder

import android.widget.TextView; //导入方法依赖的package包/类
public ViewHolder(final View view) {
    super(view);
    mTitle = (TextView) view.findViewById(android.support.v17.leanback.R.id.lb_details_description_title);
    mDate = (TextView) view.findViewById(R.id.date);
    mRating = (TextView) view.findViewById(R.id.rating);
    mBody = (TextView) view.findViewById(android.support.v17.leanback.R.id.lb_details_description_body);
    mTraktWatched = (ImageView) view.findViewById(R.id.trakt_watched);

    mTitle.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom,
                                   int oldLeft, int oldTop, int oldRight, int oldBottom) {
            addPreDrawListener();
        }
    });
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:17,代码来源:TvshowDetailsDescriptionPresenter.java

示例2: WebappUrlBar

import android.widget.TextView; //导入方法依赖的package包/类
/**
 * Creates a WebappUrlBar.
 * @param context Context to grab resources from.
 */
public WebappUrlBar(Context context, AttributeSet attrSet) {
    super(context, attrSet);
    mIconResourceWidths = new SparseIntArray();

    mUrlBar = new TextView(context);
    mUrlBar.setSingleLine(true);
    mUrlBar.setGravity(Gravity.CENTER_VERTICAL);
    mUrlBar.setMovementMethod(ScrollingMovementMethod.getInstance());
    mUrlBar.setHorizontalFadingEdgeEnabled(true);
    mSeparator = new View(context);

    addView(mUrlBar,
            new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
                    Gravity.CENTER));
    addView(mSeparator,
            new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT, 1, Gravity.BOTTOM));

    // Set the colors.
    mSeparator.setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
            R.color.webapp_url_bar_separator));
    setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
            R.color.webapp_url_bar_bg));

    // Listen for changes in the URL bar's size.
    mUrlBar.addOnLayoutChangeListener(this);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:33,代码来源:WebappUrlBar.java

示例3: ViewHolder

import android.widget.TextView; //导入方法依赖的package包/类
public ViewHolder(final View view) {
    super(view);
    mTitle = (TextView) view.findViewById(android.support.v17.leanback.R.id.lb_details_description_title);
    mEpisodeGroup = view.findViewById(R.id.episode_group);
    mEpisodeSXEX = (TextView) view.findViewById(R.id.episode_sxex);
    mEpisodeTitle = (TextView) view.findViewById(R.id.episode_title);
    mDate = (TextView) view.findViewById(R.id.date);
    mDuration = (TextView) view.findViewById(R.id.duration);
    mRating = (TextView) view.findViewById(R.id.rating);
    mBody = (TextView) view.findViewById(android.support.v17.leanback.R.id.lb_details_description_body);
    mTraktWatched = (ImageView) view.findViewById(R.id.trakt_watched);
    mResolutionBadge = (ImageView) view.findViewById(R.id.badge_resolution);
    mAudioBadge = (ImageView) view.findViewById(R.id.badge_audio);
    m3dBadge = (ImageView) view.findViewById(R.id.badge_3d);

    // Disallow Video Badges Animation for now, will be allowed at end of VideoDetails enter transition
    // to prevent a huge animation glitch when VideoDetails is opened
    mBadgesLayout = ((LinearLayout)view.findViewById(R.id.badges));
    mBadgesLayoutTransition = mBadgesLayout.getLayoutTransition();
    mBadgesLayout.setLayoutTransition(null);

    mTitle.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom,
                                   int oldLeft, int oldTop, int oldRight, int oldBottom) {
            addPreDrawListener();
        }
    });
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:30,代码来源:VideoDetailsDescriptionPresenter.java


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