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


Java FrameLayout.setTag方法代码示例

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


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

示例1: addRemoteVideo

import android.widget.FrameLayout; //导入方法依赖的package包/类
void addRemoteVideo(View singleRemoteView, SurfaceView video, String userId) {
        if (singleRemoteView == null)
            return;
        FrameLayout remoteVideoView = (FrameLayout) singleRemoteView.findViewById(R.id.viewlet_remote_video_user);
        remoteVideoView.removeAllViews();
        if (video.getParent() != null) {
            ((ViewGroup) video.getParent()).removeView(video);
        }
        remoteVideoView.addView(video, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
//        TextView remoteNameTextView = new TextView(this);
//        TextView tv = (TextView) singleRemoteView.findViewById(R.id.user_name);
//        ViewGroup.LayoutParams params = tv.getLayoutParams();
//        remoteNameTextView.setLayoutParams(params);
//        remoteNameTextView.setTextAppearance(this, R.style.rc_voip_text_style_style);
//        UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(userId);
//        if (userInfo != null) {
//            remoteNameTextView.setText(userInfo.getName());
//        } else {
//            remoteNameTextView.setText(userId);
//        }
//        remoteVideoView.addView(remoteNameTextView);
        remoteVideoView.setVisibility(View.VISIBLE);
        remoteVideoView.setTag(userId);
    }
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:25,代码来源:MultiVideoCallActivity.java

示例2: onCreateView

import android.widget.FrameLayout; //导入方法依赖的package包/类
private void onCreateView(Bundle savedInstanceState) {
    this.saveInstanceState = savedInstanceState;
    boolean isVisible;
    if (isVisibleToUserState == STATE_NO_SET) {
        isVisible = getUserVisibleHint();
    } else {
        isVisible = isVisibleToUserState == STATE_VISIBLE;
    }
    if (isLazyEnable) {
        if (isVisible && !isInitReady) {
            onCreateViewLazy(savedInstanceState);
            isInitReady = true;
        } else {
            LayoutInflater mInflater = layoutInflater;
            if (mInflater == null && context != null) {
                mInflater = LayoutInflater.from(context);
            }
            layout = new FrameLayout(context);
            layout.setTag(TAG_ROOT_FRAMELAYOUT);

            View view = getPreviewLayout(mInflater, layout);
            if (view != null) {
                layout.addView(view);
            }
            layout.setLayoutParams(
                    new FrameLayout.LayoutParams(
                            ViewGroup.LayoutParams.MATCH_PARENT,
                            ViewGroup.LayoutParams.MATCH_PARENT));
            setContentView(layout);
        }
    } else {
        onCreateViewLazy(savedInstanceState);
        isInitReady = true;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:36,代码来源:LazyFragment.java

示例3: init

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void init() {
    fl = new FrameLayout(getContext());
    fl.setTag("aah_fl");
    fab = new FloatingActionButton(getContext());
    fab.setTag("aah_fab");
    fab.setCompatElevation(0);
    fl.addView(fab);
    this.addView(fl);

}
 
开发者ID:Krupen,项目名称:FabulousFilter,代码行数:11,代码来源:AAH_FilterView.java

示例4: populateWallpapersFromAdapter

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Thunk void populateWallpapersFromAdapter(ViewGroup parent, BaseAdapter adapter,
        boolean addLongPressHandler) {
    for (int i = 0; i < adapter.getCount(); i++) {
        FrameLayout thumbnail = (FrameLayout) adapter.getView(i, null, parent);
        parent.addView(thumbnail, i);
        WallpaperTileInfo info = (WallpaperTileInfo) adapter.getItem(i);
        thumbnail.setTag(info);
        info.setView(thumbnail);
        if (addLongPressHandler) {
            addLongPressHandler(thumbnail);
        }
        thumbnail.setOnClickListener(mThumbnailOnClickListener);
    }
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:15,代码来源:WallpaperPickerActivity.java

示例5: onSwitchRemoteUsers

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void onSwitchRemoteUsers(View view) {
    String from = (String) view.getTag();
    if (from == null)
        return;
    String to = (String) localView.getTag();
    FrameLayout layout = (FrameLayout) view;
    SurfaceView fromView = (SurfaceView) layout.getChildAt(0);
    SurfaceView toView = localView;

    localViewContainer.removeAllViews();
    layout.removeAllViews();

    View singleRemoteView = remoteViewContainer.findViewWithTag(from + "view");
    UserInfo toUserInfo = RongContext.getInstance().getUserInfoFromCache(to);
    UserInfo fromUserInfo = RongContext.getInstance().getUserInfoFromCache(from);

    AsyncImageView userPortraitView = (AsyncImageView) singleRemoteView.findViewById(R.id.user_portrait);
    TextView backUserNameView = (TextView) singleRemoteView.findViewById(R.id.user_name);

    if (toUserInfo != null) {
        if (toUserInfo.getPortraitUri() != null) {
            userPortraitView.setAvatar(toUserInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
        }
        backUserNameView.setText(toUserInfo.getName());
    } else {
        backUserNameView.setText(to);
    }
    singleRemoteView.setTag(to + "view");
    fromView.setZOrderOnTop(false);
    fromView.setZOrderMediaOverlay(false);
    localViewContainer.addView(fromView);
    toView.setZOrderOnTop(true);
    toView.setZOrderMediaOverlay(true);
    layout.addView(toView);

    TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name);
    topUserNameView.setTag(from + "name");
    if (fromUserInfo != null) {
        topUserNameView.setText(fromUserInfo.getName());
    } else {
        topUserNameView.setText(from);
    }
    layout.setTag(to);
    localView = fromView;
    localView.setTag(from);
    localViewUserId = from;
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:48,代码来源:MultiVideoCallActivity.java


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