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


Java FrameLayout.getChildAt方法代码示例

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


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

示例1: onBindViewHolder

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    if (position > 1) {
        position -= 2;
        position *= 4;
        FrameLayout frameLayout = (FrameLayout) holder.itemView;
        for (int a = 0; a < 4; a++) {
            AttachBotButton child = (AttachBotButton) frameLayout.getChildAt(a);
            if (position + a >= SearchQuery.inlineBots.size()) {
                child.setVisibility(View.INVISIBLE);
            } else {
                child.setVisibility(View.VISIBLE);
                child.setTag(position + a);
                child.setUser(MessagesController.getInstance().getUser(SearchQuery.inlineBots.get(position + a).peer.user_id));
            }
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:19,代码来源:ChatAttachAlert.java

示例2: AndroidBug5497Workaround

import android.widget.FrameLayout; //导入方法依赖的package包/类
private AndroidBug5497Workaround(Activity activity) {
    FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);
    mChildOfContent = content.getChildAt(0);
    mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        public void onGlobalLayout() {
            possiblyResizeChildOfContent();
        }
    });
    frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();
}
 
开发者ID:gsantner,项目名称:markor,代码行数:11,代码来源:AndroidBug5497Workaround.java

示例3: KeyBoardConflictCompat

import android.widget.FrameLayout; //导入方法依赖的package包/类
private KeyBoardConflictCompat(Activity activity) {
    FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);
    mChildOfContent = content.getChildAt(0);
    mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        public void onGlobalLayout() {
            if (isfirst) {
                contentHeight = mChildOfContent.getHeight();//兼容华为等机型
                isfirst = false;
            }
            possiblyResizeChildOfContent();
        }
    });
    frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();
    statusBarHeight =TitleCompatibilityUtil.getStatusBarHeight();
}
 
开发者ID:wzx54321,项目名称:XinFramework,代码行数:16,代码来源:KeyBoardConflictCompat.java

示例4: onRemoteUserLeft

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onRemoteUserLeft(String userId, RongCallCommon.CallDisconnectedReason reason) {
    //incoming状态,localViewUserId为空
    if (localViewUserId == null)
        return;
    if (localViewUserId.equals(userId)) {
        localViewContainer.removeAllViews();
        String currentUserId = RongIMClient.getInstance().getCurrentUserId();
        FrameLayout remoteVideoView = (FrameLayout) remoteViewContainer.findViewWithTag(currentUserId);
        localView = (SurfaceView) remoteVideoView.getChildAt(0);
        remoteVideoView.removeAllViews();
        localViewContainer.addView(localView);
        TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name);
        topUserNameView.setTag(currentUserId + "name");
        UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(currentUserId);
        if (userInfo != null) {
            topUserNameView.setText(userInfo.getName());
        } else {
            topUserNameView.setText(currentUserId);
        }
        localViewUserId = currentUserId;
    }

    View singleRemoteView = remoteViewContainer.findViewWithTag(userId + "view");

    if (singleRemoteView == null)
        return;

    LinearLayout container = (LinearLayout) singleRemoteView.getParent();
    container.removeView(singleRemoteView);
    if (container.equals(remoteViewContainer2)) {
        if (remoteViewContainer1.getChildCount() > 0) {
            View childView = remoteViewContainer1.getChildAt(0);
            remoteViewContainer1.removeView(childView);
            remoteViewContainer2.addView(childView);
        }
    }
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:39,代码来源:MultiVideoCallActivity.java

示例5: onPictureInPictureModeChanged

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode, Configuration newConfig) {
    super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig);

    FrameLayout container = findViewById(R.id.local_video_view_container);
    SurfaceView surfaceView = (SurfaceView) container.getChildAt(0);

    surfaceView.setZOrderMediaOverlay(!isInPictureInPictureMode);
    surfaceView.setVisibility(isInPictureInPictureMode ? View.GONE : View.VISIBLE);
    container.setVisibility(isInPictureInPictureMode ? View.GONE : View.VISIBLE);
}
 
开发者ID:AgoraIO,项目名称:Agora-Picture-in-Picture-Android,代码行数:12,代码来源:VideoChatViewActivity.java

示例6: removeBarValues

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void removeBarValues() {

		if (oldFrameLayout != null)
			removeClickedBar();

		final int barsCount = ((LinearLayout) this.getChildAt(0)).getChildCount();

		for (int i = 0; i < barsCount; i++) {

			FrameLayout rootFrame = (FrameLayout) ((LinearLayout) this.getChildAt(0)).getChildAt(i);
			int rootChildCount = rootFrame.getChildCount();

			for (int j = 0; j < rootChildCount; j++) {

				View childView = rootFrame.getChildAt(j);

				if (childView instanceof LinearLayout) {
					//bar
					LinearLayout barContainerLinear = ((LinearLayout) childView);
					int barContainerCount = barContainerLinear.getChildCount();

					for (int k = 0; k < barContainerCount; k++) {

						View view = barContainerLinear.getChildAt(k);

						if (view instanceof Bar) {
							BarAnimation anim = new BarAnimation(((Bar) view), (int) (mDataList.get(i).getBarValue() * 100), 0);
							anim.setDuration(250);
							((Bar) view).startAnimation(anim);
						}
					}
				}
			}


		}
		isBarsEmpty = true;
	}
 
开发者ID:hadiidbouk,项目名称:ChartProgressBar-Android,代码行数:39,代码来源:ChartProgressBar.java

示例7: resetBarValues

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void resetBarValues() {

		if (oldFrameLayout != null)
			removeClickedBar();

		final int barsCount = ((LinearLayout) this.getChildAt(0)).getChildCount();

		for (int i = 0; i < barsCount; i++) {

			FrameLayout rootFrame = (FrameLayout) ((LinearLayout) this.getChildAt(0)).getChildAt(i);
			int rootChildCount = rootFrame.getChildCount();

			for (int j = 0; j < rootChildCount; j++) {

				View childView = rootFrame.getChildAt(j);

				if (childView instanceof LinearLayout) {
					//bar
					LinearLayout barContainerLinear = ((LinearLayout) childView);
					int barContainerCount = barContainerLinear.getChildCount();

					for (int k = 0; k < barContainerCount; k++) {

						View view = barContainerLinear.getChildAt(k);

						if (view instanceof Bar) {
							BarAnimation anim = new BarAnimation(((Bar) view), 0, (int) (mDataList.get(i).getBarValue() * 100));
							anim.setDuration(250);
							((Bar) view).startAnimation(anim);
						}
					}
				}


			}
		}
		isBarsEmpty = false;
	}
 
开发者ID:hadiidbouk,项目名称:ChartProgressBar-Android,代码行数:39,代码来源:ChartProgressBar.java

示例8: AndroidBug5497Workaround

import android.widget.FrameLayout; //导入方法依赖的package包/类
private AndroidBug5497Workaround(Activity activity, final boolean isFullScreen) {
    FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);
    mChildOfContent = content.getChildAt(0);
    mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        public void onGlobalLayout() {
            possiblyResizeChildOfContent(isFullScreen);
        }
    });
    frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();
}
 
开发者ID:nowandfurure,项目名称:richeditor,代码行数:11,代码来源:AndroidBug5497Workaround.java

示例9: destroyItem

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
  FrameLayout page = (FrameLayout) container.getChildAt(position);
  ZoomableDraweeView zoomableDraweeView = (ZoomableDraweeView) page.getChildAt(0);
  zoomableDraweeView.setController(null);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:MyPagerAdapter.java

示例10: updateTabStyles

import android.widget.FrameLayout; //导入方法依赖的package包/类
private void updateTabStyles() {
    for (int i = 0; i < tabCount; i++) {
        FrameLayout frameLayout = (FrameLayout) tabsContainer.getChildAt(i);
        frameLayout.setBackgroundResource(tabBackgroundResId);

        for (int j = 0; j < frameLayout.getChildCount(); j++) {
            View v = frameLayout.getChildAt(j);
            if (v instanceof TextView) {
                TextView tab = (TextView) v;
                tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize);
                tab.setTypeface(tabTypeface, tabTypefaceStyle);
                tab.setPadding(tabPadding, 0, tabPadding, 0);
                if (j == 0) {
                    tab.setTextColor(tabTextColor);
                } else {
                    tab.setTextColor(selectedTabTextColor);
                }
                ViewHelper.setAlpha(tabViews.get(i).get("normal"), 1);
                ViewHelper.setAlpha(tabViews.get(i).get("selected"), 0);

                //set normal  Scale
                ViewHelper.setPivotX(frameLayout, frameLayout.getMeasuredWidth() * 0.5f);
                ViewHelper.setPivotY(frameLayout, frameLayout.getMeasuredHeight() * 0.5f);
                ViewHelper.setScaleX(frameLayout, 1f);
                ViewHelper.setScaleY(frameLayout, 1f);

                // setAllCaps() is only available from API 14, so the upper case is made manually if we are on a
                // pre-ICS-build
                if (textAllCaps) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                        tab.setAllCaps(true);
                    } else {
                        tab.setText(tab.getText().toString().toUpperCase(locale));
                    }
                }
                if (i == selectedPosition) {
                    ViewHelper.setAlpha(tabViews.get(i).get("normal"), 0);
                    ViewHelper.setAlpha(tabViews.get(i).get("selected"), 1);

                    //set select  Scale
                    ViewHelper.setPivotX(frameLayout, frameLayout.getMeasuredWidth() * 0.5f);
                    ViewHelper.setPivotY(frameLayout, frameLayout.getMeasuredHeight() * 0.5f);
                    ViewHelper.setScaleX(frameLayout, 1 + zoomMax);
                    ViewHelper.setScaleY(frameLayout, 1 + zoomMax);
                }
            }
        }
    }
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:50,代码来源:PagerSlidingTabStrip.java

示例11: 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

示例12: getView

import android.widget.FrameLayout; //导入方法依赖的package包/类
public View getView() {
    ViewGroup viewGroup = (ViewGroup) getWindow().getDecorView();
    FrameLayout content = (FrameLayout) viewGroup.findViewById(android.R.id.content);
    return content.getChildAt(0);
}
 
开发者ID:ymqq,项目名称:CommonFramework,代码行数:6,代码来源:BaseAppCompatActivity.java

示例13: clickBarOn

import android.widget.FrameLayout; //导入方法依赖的package包/类
private void clickBarOn(FrameLayout frameLayout) {

		pins.get((int) frameLayout.getTag()).setVisibility(View.VISIBLE);

		isOldBarClicked = true;

		int childCount = frameLayout.getChildCount();

		for (int i = 0; i < childCount; i++) {

			View childView = frameLayout.getChildAt(i);
			if (childView instanceof LinearLayout) {

				LinearLayout linearLayout = (LinearLayout) childView;
				Bar bar = (Bar) linearLayout.getChildAt(0);
				TextView titleTxtView = (TextView) linearLayout.getChildAt(1);

				LayerDrawable layerDrawable = (LayerDrawable) bar.getProgressDrawable();
				layerDrawable.mutate();

				ScaleDrawable scaleDrawable = (ScaleDrawable) layerDrawable.getDrawable(1);

				GradientDrawable progressLayer = (GradientDrawable) scaleDrawable.getDrawable();
				if (mPinBackgroundColor != 0) {
					if (progressLayer != null) {
						progressLayer.setColor(ContextCompat.getColor(mContext, mProgressClickColor));
					}

				} else {
					if (progressLayer != null) {
						progressLayer.setColor(ContextCompat.getColor(mContext, android.R.color.holo_green_dark));
					}
				}

				if (mBarTitleSelectedColor > 0) {
					titleTxtView.setTextColor(ContextCompat.getColor(mContext, mBarTitleSelectedColor));
				} else {
					titleTxtView.setTextColor(ContextCompat.getColor(mContext, android.R.color.holo_green_dark));
				}

			}
		}
	}
 
开发者ID:hadiidbouk,项目名称:ChartProgressBar-Android,代码行数:44,代码来源:ChartProgressBar.java

示例14: disableBar

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void disableBar(int index) {

		final int barsCount = ((LinearLayout) this.getChildAt(0)).getChildCount();

		for (int i = 0; i < barsCount; i++) {

			FrameLayout rootFrame = (FrameLayout) ((LinearLayout) this.getChildAt(0)).getChildAt(i);

			int rootChildCount = rootFrame.getChildCount();

			for (int j = 0; j < rootChildCount; j++) {

				if ((int) rootFrame.getTag() != index)
					continue;

				rootFrame.setEnabled(false);
				rootFrame.setClickable(false);

				View childView = rootFrame.getChildAt(j);
				if (childView instanceof LinearLayout) {
					//bar
					LinearLayout barContainerLinear = ((LinearLayout) childView);
					int barContainerCount = barContainerLinear.getChildCount();

					for (int k = 0; k < barContainerCount; k++) {

						View view = barContainerLinear.getChildAt(k);

						if (view instanceof Bar) {

							Bar bar = (Bar) view;

							LayerDrawable layerDrawable = (LayerDrawable) bar.getProgressDrawable();
							layerDrawable.mutate();

							ScaleDrawable scaleDrawable = (ScaleDrawable) layerDrawable.getDrawable(1);

							GradientDrawable progressLayer = (GradientDrawable) scaleDrawable.getDrawable();

							if (progressLayer != null) {

								if (mProgressDisableColor > 0)
									progressLayer.setColor(ContextCompat.getColor(mContext, mProgressDisableColor));
								else
									progressLayer.setColor(ContextCompat.getColor(mContext, android.R.color.darker_gray));
							}
						} else {
							TextView titleTxtView = (TextView) view;
							if (mProgressDisableColor > 0)
								titleTxtView.setTextColor(ContextCompat.getColor(mContext, mProgressDisableColor));
							else
								titleTxtView.setTextColor(ContextCompat.getColor(mContext, android.R.color.darker_gray));
						}
					}
				}
			}
		}
	}
 
开发者ID:hadiidbouk,项目名称:ChartProgressBar-Android,代码行数:59,代码来源:ChartProgressBar.java

示例15: setAlertDialog

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void setAlertDialog(Context context, Dialog dialog)
{
	try
	{
		SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
		int themeSet = Integer.parseInt(sharedPreferences.getString("preferences_theme_set", "0"));
		int colorThemeSet = Integer.parseInt(sharedPreferences.getString("preferences_color_theme_set", "7"));
		
		ViewGroup decorView = (ViewGroup) dialog.getWindow().getDecorView();
		if (decorView == null)
		{
			return;
		}
		
		FrameLayout windowContentView = (FrameLayout) decorView.getChildAt(0);
		if (windowContentView == null)
		{
			return;
		}
		
		FrameLayout contentView = (FrameLayout) windowContentView.getChildAt(0);
		if (contentView == null)
		{
			return;
		}
		
		LinearLayout parentPanel = (LinearLayout) contentView.getChildAt(0);
		if (parentPanel == null)
		{
			return;
		}
		
		LinearLayout topPanel = (LinearLayout) parentPanel.getChildAt(0);
		if (topPanel == null)
		{
			return;
		}
		
		View titleDivider = topPanel.getChildAt(2);
		if (titleDivider == null)
		{
			return;
		}
		else
		{
			titleDivider.setBackgroundColor(context.getResources().getColor(color[themeSet][colorThemeSet]));
		}	
		
		LinearLayout titleTemplate = (LinearLayout) topPanel.getChildAt(1);
		if (titleTemplate == null)
		{
			return;
		}
		
		TextView alertTitle = (TextView) titleTemplate.getChildAt(1);
		if (alertTitle == null)
		{
			return;
		}
		else
		{
			alertTitle.setTextColor(context.getResources().getColor(color[themeSet][colorThemeSet]));
		}
	}
	catch (Exception e)
	{

	}
}
 
开发者ID:vassela,项目名称:AC2RD,代码行数:70,代码来源:ThemeManager.java


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