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


Java FrameLayout.getChildCount方法代码示例

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


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

示例1: setupRemoteVideo

import android.widget.FrameLayout; //导入方法依赖的package包/类
private void setupRemoteVideo(int uid) {
    FrameLayout container = (FrameLayout) findViewById(R.id.remote_video_view_container);

    if (container.getChildCount() >= 1) {
        return;
    }

    SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext());
    container.addView(surfaceView);
    mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_ADAPTIVE, uid));
    surfaceView.setTag(uid); // for mark purpose
    View tipMsg = findViewById(R.id.quick_tips_when_use_agora_sdk); // optional UI
    tipMsg.setVisibility(View.GONE);
}
 
开发者ID:AgoraIO,项目名称:Agora-Video-Source-Android,代码行数:15,代码来源:VideoChatViewActivity.java

示例2: onBindViewHolder

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    VideoUserStatusHolder myHolder = ((VideoUserStatusHolder) holder);

    final UserStatusData user = mUsers.get(position);

    log.debug("onBindViewHolder " + position + " " + user + " " + myHolder + " " + myHolder.itemView + " " + mDefaultChildItem);

    FrameLayout holderView = (FrameLayout) myHolder.itemView;

    holderView.setOnTouchListener(new OnDoubleTapListener(mContext) {
        @Override
        public void onDoubleTap(View view, MotionEvent e) {
            if (mListener != null) {
                mListener.onItemDoubleClick(view, user);
            }
        }

        @Override
        public void onSingleTapUp() {
        }
    });

    if (holderView.getChildCount() == mDefaultChildItem) {
        SurfaceView target = user.mView;
        VideoViewAdapterUtil.stripView(target);
        holderView.addView(target, 0, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    }

    VideoViewAdapterUtil.renderExtraData(mContext, user, myHolder);
}
 
开发者ID:AgoraIO,项目名称:OpenVideoCall-Android,代码行数:32,代码来源:VideoViewAdapter.java

示例3: onBindViewHolder

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    VideoUserStatusHolder myHolder = ((VideoUserStatusHolder) holder);

    final VideoStatusData user = mUsers.get(position);

    Log.d("VideoViewAdapter", "onBindViewHolder " + position + " " + user + " " + myHolder + " " + myHolder.itemView);

    log.debug("onBindViewHolder " + position + " " + user + " " + myHolder + " " + myHolder.itemView);

    FrameLayout holderView = (FrameLayout) myHolder.itemView;

    if (holderView.getChildCount() == 0) {
        SurfaceView target = user.mView;
        stripSurfaceView(target);
        holderView.addView(target, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    }

    holderView.setOnTouchListener(new OnDoubleTapListener(mContext) {
        @Override
        public void onDoubleTap(View view, MotionEvent e) {
            if (mListener != null) {
                mListener.onItemDoubleClick(view, user);
            }
        }

        @Override
        public void onSingleTapUp() {
        }
    });

}
 
开发者ID:AgoraIO,项目名称:OpenLive-Android,代码行数:33,代码来源:VideoViewAdapter.java

示例4: onBindViewHolder

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    VideoUserStatusHolder myHolder = ((VideoUserStatusHolder) holder);

    final VideoStatusData user = mUsers.get(position);

    log.debug("onBindViewHolder " + position + " " + user + " " + myHolder + " " + myHolder.itemView);

    FrameLayout holderView = (FrameLayout) myHolder.itemView;

    holderView.setOnTouchListener(new OnDoubleTapListener(mContext) {
        @Override
        public void onDoubleTap(View view, MotionEvent e) {
            if (mListener != null) {
                mListener.onItemDoubleClick(view, user);
            }
        }

        @Override
        public void onSingleTapUp() {
        }
    });

    if (holderView.getChildCount() == 0) {
        SurfaceView target = user.mView;
        stripSurfaceView(target);
        holderView.addView(target, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    }
}
 
开发者ID:AgoraIO,项目名称:OpenLive-Android,代码行数:30,代码来源:GridVideoViewContainerAdapter.java

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

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

示例7: onBindViewHolder

import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    VideoUserStatusHolder myHolder = ((VideoUserStatusHolder) holder);

    final VideoStatusData user = mUsers.get(position);

    log.debug("onBindViewHolder " + position + " " + user + " " + myHolder + " " + myHolder.itemView);

    FrameLayout holderView = (FrameLayout) myHolder.itemView;

    holderView.setOnTouchListener(new OnLiveDoubleTapListener(mContext) {
        @Override
        public void onDoubleTap(View view, MotionEvent e) {
            if (mListener != null) {
                mListener.onItemDoubleClick(view, user);
            }
        }

        @Override
        public void onSingleTapUp() {
        }
    });

    if (holderView.getChildCount() == 0) {
        SurfaceView target = user.mView;
        stripSurfaceView(target);
        holderView.addView(target, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    }
}
 
开发者ID:huangjingqiang,项目名称:SWDemo,代码行数:30,代码来源:GridVideoViewContainerLiveAdapter.java

示例8: setupRemoteVideo

import android.widget.FrameLayout; //导入方法依赖的package包/类
private void setupRemoteVideo(int uid) {
    FrameLayout container = findViewById(R.id.remote_video_view_container);

    if (container.getChildCount() >= 1) {
        return;
    }

    SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext());
    container.addView(surfaceView);
    mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_ADAPTIVE, uid));

    surfaceView.setTag(uid); // for mark purpose
    View tipMsg = findViewById(R.id.quick_tips_when_use_agora_sdk); // optional UI
    tipMsg.setVisibility(View.GONE);
}
 
开发者ID:AgoraIO,项目名称:Agora-Picture-in-Picture-Android,代码行数:16,代码来源:VideoChatViewActivity.java

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

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

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

示例12: enableBar

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void enableBar(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(true);
				rootFrame.setClickable(true);

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

示例13: selectBar

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void selectBar(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;

				if (oldFrameLayout != null)
					clickBarOff(oldFrameLayout);

				clickBarOn(rootFrame);
				oldFrameLayout = rootFrame;
			}
		}
	}
 
开发者ID:hadiidbouk,项目名称:ChartProgressBar-Android,代码行数:24,代码来源:ChartProgressBar.java

示例14: deselectBar

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void deselectBar(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;

			clickBarOff(rootFrame);
		}
	}
}
 
开发者ID:hadiidbouk,项目名称:ChartProgressBar-Android,代码行数:19,代码来源:ChartProgressBar.java

示例15: clickBarOff

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

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


		isOldBarClicked = false;

		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 (progressLayer != null) {
					progressLayer.setColor(ContextCompat.getColor(mContext, mProgressColor));
				}
				titleTxtView.setTextColor(ContextCompat.getColor(mContext, mBarTitleColor));
			}
		}
	}
 
开发者ID:hadiidbouk,项目名称:ChartProgressBar-Android,代码行数:32,代码来源:ChartProgressBar.java


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