本文整理汇总了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);
}
示例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;
}
}
示例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);
}
示例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);
}
}
示例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;
}