本文整理汇总了Java中android.widget.FrameLayout.setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:Java FrameLayout.setBackgroundColor方法的具体用法?Java FrameLayout.setBackgroundColor怎么用?Java FrameLayout.setBackgroundColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.FrameLayout
的用法示例。
在下文中一共展示了FrameLayout.setBackgroundColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeWebappData
import android.widget.FrameLayout; //导入方法依赖的package包/类
private void initializeWebappData() {
final int backgroundColor = ColorUtils.getOpaqueColor(mWebappInfo.backgroundColor(
ApiCompatibilityUtils.getColor(getResources(), R.color.webapp_default_bg)));
mSplashScreen = new FrameLayout(this);
mSplashScreen.setBackgroundColor(backgroundColor);
ViewGroup contentView = (ViewGroup) findViewById(android.R.id.content);
contentView.addView(mSplashScreen);
mWebappUma.splashscreenVisible();
mWebappUma.recordSplashscreenBackgroundColor(mWebappInfo.hasValidBackgroundColor()
? WebappUma.SPLASHSCREEN_COLOR_STATUS_CUSTOM
: WebappUma.SPLASHSCREEN_COLOR_STATUS_DEFAULT);
mWebappUma.recordSplashscreenThemeColor(mWebappInfo.hasValidThemeColor()
? WebappUma.SPLASHSCREEN_COLOR_STATUS_CUSTOM
: WebappUma.SPLASHSCREEN_COLOR_STATUS_DEFAULT);
initializeSplashScreenWidgets(backgroundColor);
}
示例2: RPopupWindow
import android.widget.FrameLayout; //导入方法依赖的package包/类
public RPopupWindow(Context context) {
super(context);
mContext = context;
setWidth(-2);
setHeight(-2);
mRootLayout = new FrameLayout(context);
mViewHolder = new RBaseViewHolder(mRootLayout);
mRootLayout.setBackgroundColor(Color.WHITE);
// setBackgroundDrawable(new ColorDrawable(Color.WHITE));
setTouchable(true);
setOutsideTouchable(true);//点击窗口外, 消失
}
示例3: doCreateDisplay
import android.widget.FrameLayout; //导入方法依赖的package包/类
private void doCreateDisplay(ViewGroup container) {
log("doCreateDisplay");
isolateDisplayBox();
FrameLayout displayBox = new FrameLayout(container.getContext());
displayBox.setId(R.id.player_display_box);
displayBox.setBackgroundColor(videoInfo.getBgColor());
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
Gravity.CENTER
);
ScalableTextureView textureView = new ScalableTextureView(container.getContext());
textureView.setAspectRatio(videoInfo.getAspectRatio());
textureView.setId(R.id.player_display);
displayBox.addView(textureView, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
Gravity.CENTER
));
container.addView(displayBox, 0, lp);
bindDisplay(textureView);
displayBoxRef = new WeakReference<>(displayBox);
}
示例4: initLevelContainers
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
protected void initLevelContainers(Context context) {
//add low cover container
mLevelLowCoverContainer = new FrameLayout(context);
mLevelLowCoverContainer.setBackgroundColor(Color.TRANSPARENT);
addLevelContainerView(mLevelLowCoverContainer,null);
//add medium cover container
mLevelMediumCoverContainer = new FrameLayout(context);
mLevelMediumCoverContainer.setBackgroundColor(Color.TRANSPARENT);
addLevelContainerView(mLevelMediumCoverContainer,null);
//add high cover container
mLevelHighCoverContainer = new FrameLayout(context);
mLevelHighCoverContainer.setBackgroundColor(Color.TRANSPARENT);
addLevelContainerView(mLevelHighCoverContainer,null);
}
示例5: initViews
import android.widget.FrameLayout; //导入方法依赖的package包/类
private void initViews() {
flNavigationButtonsBar = (FrameLayout) findViewById(R.id.fl_navigation_buttons_bar);
ivCancel = (ImageView) findViewById(R.id.iv_cancel);
ivDone = (ImageView) findViewById(R.id.iv_done);
calendarView = (CalendarView) findViewById(R.id.calendar_view);
Drawable background = calendarView.getBackground();
if (background instanceof ColorDrawable) {
flNavigationButtonsBar.setBackgroundColor(((ColorDrawable) background).getColor());
}
ivCancel.setOnClickListener(this);
ivDone.setOnClickListener(this);
}
示例6: createBodyOnDomThread
import android.widget.FrameLayout; //导入方法依赖的package包/类
WXComponent createBodyOnDomThread(WXDomObject dom) {
if (mWXSDKInstance == null) {
return null;
}
WXDomObject domObject = new WXDomObject();
WXDomObject.prepareGod(domObject);
mGodComponent = (WXVContainer) WXComponentFactory.newInstance(mWXSDKInstance, domObject, null);
mGodComponent.createView(null, -1);
if (mGodComponent == null) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.e("rootView failed!");
}
//TODO error callback
return null;
}
FrameLayout frameLayout = (FrameLayout) mGodComponent.getHostView();
ViewGroup.LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
frameLayout.setLayoutParams(layoutParams);
frameLayout.setBackgroundColor(Color.TRANSPARENT);
WXComponent component = generateComponentTree(dom, mGodComponent);
mGodComponent.addChild(component);
mRegistry.put(component.getRef(), component);
return component;
}
示例7: getView
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public View getView() {
FrameLayout root = new FrameLayout(mContext);
root.setBackgroundColor(Color.WHITE);
mWebView = new WebView(mContext);//mContext.getApplicationContext();
FrameLayout.LayoutParams wvLayoutParams =
new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT);
wvLayoutParams.gravity = Gravity.CENTER;
mWebView.setLayoutParams(wvLayoutParams);
root.addView(mWebView);
initWebView(mWebView);
mProgressBar = new ProgressBar(mContext);
showProgressBar(false);
FrameLayout.LayoutParams pLayoutParams =
new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT);
mProgressBar.setLayoutParams(pLayoutParams);
pLayoutParams.gravity = Gravity.CENTER;
root.addView(mProgressBar);
return root;
}
示例8: onCreateView
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_loading, container, false);
FrameLayout loadingContainer = (FrameLayout) view.findViewById(R.id.fragment_loading_container);
loadingContainer.setBackgroundColor(backgroundColor);
progressBar = new ProgressBar(container.getContext());
if (container instanceof FrameLayout) {
FrameLayout.LayoutParams layoutParams =
new FrameLayout.LayoutParams(progressWidth, progressHeight, Gravity.CENTER);
progressBar.setLayoutParams(layoutParams);
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
if (progressBar.getIndeterminateDrawable() != null) {
progressBar.getIndeterminateDrawable().setColorFilter(getResources().getColor(progressColor),
PorterDuff.Mode.SRC_IN);
}
} else {
ColorStateList stateList = ColorStateList.valueOf(progressColor);
progressBar.setIndeterminateTintMode(PorterDuff.Mode.SRC_IN);
progressBar.setIndeterminateTintList(stateList);
progressBar.setProgressBackgroundTintMode(PorterDuff.Mode.SRC_IN);
progressBar.setProgressBackgroundTintList(stateList);
progressBar.setIndeterminate(true);
}
loadingContainer.addView(progressBar);
return view;
}
示例9: ViewHolder
import android.widget.FrameLayout; //导入方法依赖的package包/类
public ViewHolder(View itemView) {
super(itemView);
text = (TextView) itemView.findViewById(R.id.end_text);
background = (FrameLayout) itemView.findViewById(R.id.end_layout);
if (mFlag == FLAG_TEXT_COLOR_BLACK) {
text.setTextColor(ContextCompat.getColor(text.getContext(), R.color.colorBlack));
background.setBackgroundColor(ContextCompat.getColor(background.getContext(), R.color.colorWhite));
}
}
示例10: onCreateView
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
FrameLayout frameLayout = new FrameLayout(getActivity());
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
lp.gravity = Gravity.CENTER;
frameLayout.setLayoutParams(lp);
frameLayout.setBackgroundColor(0xff000000);
initView(frameLayout);
return frameLayout;
}
示例11: initView
import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
* 初始化播放器视图
*/
protected void initView() {
Constants.SCREEN_HEIGHT = WindowUtil.getScreenHeight(getContext(), false);
Constants.SCREEN_WIDTH = WindowUtil.getScreenWidth(getContext());
playerContainer = new FrameLayout(getContext());
playerContainer.setBackgroundColor(Color.BLACK);
LayoutParams params = new LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
this.addView(playerContainer, params);
}
示例12: createVHForRefreshComponent
import android.widget.FrameLayout; //导入方法依赖的package包/类
private ListBaseViewHolder createVHForRefreshComponent(int viewType) {
FrameLayout view = new FrameLayout(getContext());
view.setBackgroundColor(Color.WHITE);
view.setLayoutParams(new FrameLayout.LayoutParams(1, 1));
view.setVisibility(View.GONE);
return new ListBaseViewHolder(view, viewType);
}
示例13: init
import android.widget.FrameLayout; //导入方法依赖的package包/类
private void init(Context context) {
iMediaControl = ConfigManage.getInstance(getContext()).getIMediaControl(this);
videoView = new FrameLayout(context);
renderViewContainer = new FrameLayout(context);
renderViewContainer.setBackgroundColor(Color.BLACK);
videoView.addView(renderViewContainer, new LayoutParams(-1, -1));
addView(videoView, new LayoutParams(-1, -1));
}
示例14: createVHForFakeComponent
import android.widget.FrameLayout; //导入方法依赖的package包/类
@NonNull
private ListBaseViewHolder createVHForFakeComponent(int viewType) {
FrameLayout view = new FrameLayout(getContext());
view.setBackgroundColor(Color.WHITE);
view.setLayoutParams(new FrameLayout.LayoutParams(0, 0));
return new ListBaseViewHolder(view, viewType);
}
示例15: createVHForFakeComponent
import android.widget.FrameLayout; //导入方法依赖的package包/类
@NonNull
private ListBaseViewHolder createVHForFakeComponent(int viewType) {
FrameLayout view = new FrameLayout(getContext());
view.setBackgroundColor(Color.WHITE);
view.setLayoutParams(new FrameLayout.LayoutParams(0, 0));
return new ListBaseViewHolder(view, viewType);
}