本文整理汇总了Java中android.widget.FrameLayout.setClipChildren方法的典型用法代码示例。如果您正苦于以下问题:Java FrameLayout.setClipChildren方法的具体用法?Java FrameLayout.setClipChildren怎么用?Java FrameLayout.setClipChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.FrameLayout
的用法示例。
在下文中一共展示了FrameLayout.setClipChildren方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleStyledAttributes
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void handleStyledAttributes(TypedArray a) {
mRootContainer = new LinearLayout(getContext());
mRootContainer.setOrientation(VERTICAL);
mHeaderContainer = new FrameLayout(getContext());
if (mZoomView != null) {
mHeaderContainer.addView(mZoomView);
}
if (mHeaderView != null) {
mHeaderContainer.addView(mHeaderView);
}
int contentViewResId = a.getResourceId(R.styleable.PullToZoomView_contentView, 0);
if (contentViewResId > 0) {
LayoutInflater mLayoutInflater = LayoutInflater.from(getContext());
mContentView = mLayoutInflater.inflate(contentViewResId, null, false);
}
mRootContainer.addView(mHeaderContainer);
if (mContentView != null) {
mRootContainer.addView(mContentView);
}
mRootContainer.setClipChildren(false);
mHeaderContainer.setClipChildren(false);
mRootView.addView(mRootContainer);
}
示例2: initComponentHostView
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
protected FrameLayout initComponentHostView(Context context) {
FrameLayout view = new FrameLayout(context);
// init view pager
FrameLayout.LayoutParams pagerParams = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
pagerParams.gravity = Gravity.CENTER;
mViewPager = new WXCircleViewPager(mContext);
mViewPager.setLayoutParams(pagerParams);
// init adapter
mAdapter = new WXCirclePageAdapter();
mViewPager.setAdapter(mAdapter);
// add to parent
view.addView(mViewPager);
mViewPager.addOnPageChangeListener(mPageChangeListener);
// set animation
mViewPager.setPageTransformer(true, new ZoomTransformer());
mViewPager.setOverScrollMode(View.OVER_SCROLL_NEVER);
view.setClipChildren(false);
registerActivityStateListener();
return view;
}
示例3: wrapKeyboardView
import android.widget.FrameLayout; //导入方法依赖的package包/类
@NonNull
private static FrameLayout wrapKeyboardView(Activity activity, KeyboardView keyboardView) {
FrameLayout keyboardWrapper = new FrameLayout(activity);
keyboardWrapper.setId(R.id.keyboard_wrapper_id);
keyboardWrapper.setClipChildren(false);
FrameLayout.LayoutParams keyboardParams = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
keyboardWrapper.addView(keyboardView, keyboardParams);
return keyboardWrapper;
}
示例4: animate
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void animate() {
final ViewGroup parentView = (ViewGroup) view.getParent();
final FrameLayout slideOutFrame = new FrameLayout(view.getContext());
final int positionView = parentView.indexOfChild(view);
slideOutFrame.setLayoutParams(view.getLayoutParams());
slideOutFrame.setClipChildren(true);
parentView.removeView(view);
slideOutFrame.addView(view);
parentView.addView(slideOutFrame, positionView);
switch (direction) {
case DIRECTION_LEFT:
slideAnim = ObjectAnimator.ofFloat(view, View.TRANSLATION_X,
view.getTranslationX() - view.getWidth());
break;
case DIRECTION_RIGHT:
slideAnim = ObjectAnimator.ofFloat(view, View.TRANSLATION_X,
view.getTranslationX() + view.getWidth());
break;
case DIRECTION_UP:
slideAnim = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y,
view.getTranslationY() - view.getHeight());
break;
case DIRECTION_DOWN:
slideAnim = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y,
view.getTranslationY() + view.getHeight());
break;
default:
break;
}
AnimatorSet slideSet = new AnimatorSet();
slideSet.play(slideAnim);
slideSet.setInterpolator(interpolator);
slideSet.setDuration(duration);
slideSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.INVISIBLE);
slideAnim.reverse();
slideOutFrame.removeAllViews();
parentView.removeView(slideOutFrame);
parentView.addView(view, positionView);
if (getListener() != null) {
getListener().onAnimationEnd(
SlideOutUnderneathAnimation.this);
}
}
});
slideSet.start();
}
示例5: TrashView
import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
* コンストラクタ
*
* @param context Context
*/
TrashView(Context context) {
super(context);
mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
mMetrics = new DisplayMetrics();
mWindowManager.getDefaultDisplay().getMetrics(mMetrics);
mAnimationHandler = new AnimationHandler(this);
mIsEnabled = true;
mParams = new WindowManager.LayoutParams();
mParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
mParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
mParams.type = WindowManager.LayoutParams.TYPE_PRIORITY_PHONE;
mParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE |
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
mParams.format = PixelFormat.TRANSLUCENT;
// INFO:Windowの原点のみ左下に設定
mParams.gravity = Gravity.LEFT | Gravity.BOTTOM;
// 各種Viewの設定
// TrashViewに直接貼り付けられるView(このViewを介さないと、削除Viewと背景Viewのレイアウトがなぜか崩れる)
mRootView = new FrameLayout(context);
mRootView.setClipChildren(false);
// 削除アイコンのルートView
mTrashIconRootView = new FrameLayout(context);
mTrashIconRootView.setClipChildren(false);
mFixedTrashIconView = new ImageView(context);
mActionTrashIconView = new ImageView(context);
// 背景View
mBackgroundView = new FrameLayout(context);
mBackgroundView.setAlpha(0.0f);
final GradientDrawable gradientDrawable = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{0x00000000, 0x50000000});
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
//noinspection deprecation
mBackgroundView.setBackgroundDrawable(gradientDrawable);
} else {
mBackgroundView.setBackground(gradientDrawable);
}
// 背景Viewの貼り付け
final FrameLayout.LayoutParams backgroundParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (int) (BACKGROUND_HEIGHT * mMetrics.density));
backgroundParams.gravity = Gravity.BOTTOM;
mRootView.addView(mBackgroundView, backgroundParams);
// アクションアイコンの貼り付け
final FrameLayout.LayoutParams actionTrashIconParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
actionTrashIconParams.gravity = Gravity.CENTER;
mTrashIconRootView.addView(mActionTrashIconView, actionTrashIconParams);
// 固定アイコンの貼付け
final FrameLayout.LayoutParams fixedTrashIconParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
fixedTrashIconParams.gravity = Gravity.CENTER;
mTrashIconRootView.addView(mFixedTrashIconView, fixedTrashIconParams);
// 削除アイコンの貼り付け
final FrameLayout.LayoutParams trashIconParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
trashIconParams.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
mRootView.addView(mTrashIconRootView, trashIconParams);
// TrashViewに貼り付け
addView(mRootView);
// 初回描画処理用
getViewTreeObserver().addOnPreDrawListener(this);
}