本文整理汇总了Java中android.widget.FrameLayout.requestLayout方法的典型用法代码示例。如果您正苦于以下问题:Java FrameLayout.requestLayout方法的具体用法?Java FrameLayout.requestLayout怎么用?Java FrameLayout.requestLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.FrameLayout
的用法示例。
在下文中一共展示了FrameLayout.requestLayout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: instantiateItem
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public Object instantiateItem(ViewGroup container, int position) {
FrameLayout page = (FrameLayout) container.getChildAt(position);
if (page == null) {
return null;
}
ZoomableDraweeView zoomableDraweeView =
(ZoomableDraweeView) page.findViewById(R.id.zoomableView);
zoomableDraweeView.setAllowTouchInterceptionWhileZoomed(mAllowSwipingWhileZoomed);
// needed for double tap to zoom
zoomableDraweeView.setIsLongpressEnabled(false);
zoomableDraweeView.setTapListener(new DoubleTapGestureListener(zoomableDraweeView));
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setUri(SAMPLE_URIS[position % SAMPLE_URIS.length])
.setCallerContext("ZoomableApp-MyPagerAdapter")
.build();
zoomableDraweeView.setController(controller);
page.requestLayout();
return page;
}
示例2: onCreate
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
viewLayout = new LinearLayout(this);
viewLayout.setOrientation(LinearLayout.HORIZONTAL);
frameLayout = new FrameLayout(this);
frameLayout.addView(viewLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
frameLayout.setBackgroundColor(0xFFFFFFFF); // COLOR_WHITE XXX
setContentView(frameLayout);
frameLayout.requestLayout();
hasSurface = false;
}
示例3: setForceShowHint
import android.widget.FrameLayout; //导入方法依赖的package包/类
public void setForceShowHint(boolean enabled, CharSequence hint) {
CharSequence oldHint = mForceHint;
mForceHint = hint;
if (enabled == mForceShowHint)
return;
mWasHintEnabled = isHintEnabled();
if (enabled)
setHintEnabled(false);
mForceShowHint = enabled;
FrameLayout inputFrame = (FrameLayout) getChildAt(0);
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) inputFrame.getLayoutParams();
int newTopMargin = 0;
if (enabled) {
newTopMargin = (int) -mTextPaint.ascent();
}
if(newTopMargin != lp.topMargin) {
lp.topMargin = newTopMargin;
inputFrame.requestLayout();
}
if (!enabled) {
setHintEnabled(mWasHintEnabled);
setHint(oldHint);
}
}