本文整理了Java中android.view.Window.setBackgroundDrawable()
方法的一些代码示例,展示了Window.setBackgroundDrawable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.setBackgroundDrawable()
方法的具体详情如下:
包路径:android.view.Window
类名称:Window
方法名:setBackgroundDrawable
暂无
代码示例来源:origin: GitLqr/LQRWeChat
public void onCreate() {
activity.getWindow().setBackgroundDrawable(new ColorDrawable(0xfff3f3f3));
}
代码示例来源:origin: jaydenxiao2016/AndroidFire
public void onCreate() {
activity.getWindow().setBackgroundDrawable(new ColorDrawable(0xfff3f3f3));
}
代码示例来源:origin: Cleveroad/AdaptiveTableLayout
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//noinspection ConstantConditions
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
return inflater.inflate(R.layout.dialog_delete, container, false);
}
代码示例来源:origin: Cleveroad/AdaptiveTableLayout
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//noinspection ConstantConditions
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
return inflater.inflate(R.layout.dialog_add_column, container, false);
}
代码示例来源:origin: Cleveroad/AdaptiveTableLayout
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//noinspection ConstantConditions
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
return inflater.inflate(R.layout.dialog_add_row, container, false);
}
代码示例来源:origin: Cleveroad/AdaptiveTableLayout
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
//noinspection ConstantConditions
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
View view = inflater.inflate(R.layout.dialog_settings, container, false);
swSolidRow = view.findViewById(R.id.swSolidRow);
swFixedHeaders = view.findViewById(R.id.swFixedHeaders);
swRtlDirection = view.findViewById(R.id.swRtlDirection);
swDragAndDropEnabled = view.findViewById(R.id.swDragAndDropEnabled);
return view;
}
代码示例来源:origin: chentao0707/SimplifyReader
@SuppressWarnings("deprecation")
public void onActivityCreate() {
mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(
R.layout.swipeback_layout, null);
mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {
@Override
public void onScrollStateChange(int state, float scrollPercent) {
}
@Override
public void onEdgeTouch(int edgeFlag) {
Utils.convertActivityToTranslucent(mActivity);
}
@Override
public void onScrollOverThreshold() {
}
});
}
代码示例来源:origin: Cleveroad/AdaptiveTableLayout
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
//noinspection ConstantConditions
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
View view = inflater.inflate(R.layout.dialog_edit_item, container, false);
mTilValue = view.findViewById(R.id.tilValue);
mEtValue = view.findViewById(R.id.etValue);
mTvDelete = view.findViewById(R.id.tvDelete);
mTvAdd = view.findViewById(R.id.tvAdd);
mTvDelete.setOnClickListener(this);
mTvAdd.setOnClickListener(this);
view.findViewById(R.id.bPositive).setOnClickListener(this);
view.findViewById(R.id.bNegative).setOnClickListener(this);
return view;
}
代码示例来源:origin: ZieIony/Carbon
private void initLayout() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
Window window = getWindow();
if (window != null) {
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
}
dialogLayout = getLayoutInflater().inflate(R.layout.carbon_dialog, null);
container = dialogLayout.findViewById(R.id.carbon_windowContent);
super.setContentView(dialogLayout);
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
@Override
public void initToolBar() {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setBackgroundDrawable(null);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
代码示例来源:origin: H07000223/FlycoDialog_Master
/** set dialog theme(设置对话框主题) */
private void setDialogTheme() {
requestWindowFeature(Window.FEATURE_NO_TITLE);// android:windowNoTitle
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));// android:windowBackground
getWindow().addFlags(LayoutParams.FLAG_DIM_BEHIND);// android:backgroundDimEnabled默认是true的
}
代码示例来源:origin: GitLqr/LQRWeChat
public void onCreate() {
activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
sivViewer = new ScaledImageView(activity);
sivViewer.setScaleType(ScaleType.MATRIX);
activity.setContentView(sivViewer);
if (pic != null) {
sivViewer.getViewTreeObserver().addOnGlobalLayoutListener(this);
}
}
代码示例来源:origin: MindorksOpenSource/android-mvp-architecture
public static ProgressDialog showLoadingDialog(Context context) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.show();
if (progressDialog.getWindow() != null) {
progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
progressDialog.setContentView(R.layout.progress_dialog);
progressDialog.setIndeterminate(true);
progressDialog.setCancelable(false);
progressDialog.setCanceledOnTouchOutside(false);
return progressDialog;
}
代码示例来源:origin: jaydenxiao2016/AndroidFire
public void onCreate() {
activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
sivViewer = new ScaledImageView(activity);
sivViewer.setScaleType(ScaleType.MATRIX);
activity.setContentView(sivViewer);
if (pic != null) {
sivViewer.getViewTreeObserver().addOnGlobalLayoutListener(this);
}
}
代码示例来源:origin: Rukey7/MvpApp
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
mSwipeBackLayout = new SwipeBackLayout(this);
}
代码示例来源:origin: rey5137/material
public Dialog(Context context, int style) {
super(context, style);
//Override style to ensure not show window's title or background.
//TODO: find a way to ensure windowIsFloating attribute is false.
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setBackgroundDrawable(BlankDrawable.getInstance());
WindowManager.LayoutParams layout = getWindow().getAttributes();
layout.width = ViewGroup.LayoutParams.MATCH_PARENT;
layout.height = ViewGroup.LayoutParams.MATCH_PARENT;
layout.windowAnimations = R.style.DialogNoAnimation;
getWindow().setAttributes(layout);
init(context, style);
}
代码示例来源:origin: rey5137/material
public BottomSheetDialog(Context context, int style) {
super(context, style);
//Override style to ensure not show window's title or background.
//TODO: find a way to ensure windowIsFloating attribute is false.
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setBackgroundDrawable(BlankDrawable.getInstance());
WindowManager.LayoutParams layout = getWindow().getAttributes();
layout.width = ViewGroup.LayoutParams.MATCH_PARENT;
layout.height = ViewGroup.LayoutParams.MATCH_PARENT;
layout.windowAnimations = R.style.DialogNoAnimation;
getWindow().setAttributes(layout);
init(context, style);
}
代码示例来源:origin: lipangit/JiaoZiVideoPlayer
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(false);
getSupportActionBar().setTitle("WebView");
getWindow().setBackgroundDrawable(null);
setContentView(R.layout.activity_webview);
mWebView = findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.addJavascriptInterface(new JZCallBack(), "jzvd");
mWebView.loadUrl("file:///android_asset/jzvd.html");
}
代码示例来源:origin: gzu-liyujiang/AndroidPicker
private void initDialog() {
contentLayout = new FrameLayout(activity);
contentLayout.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
contentLayout.setFocusable(true);
contentLayout.setFocusableInTouchMode(true);
dialog = new Dialog(activity);
dialog.setCanceledOnTouchOutside(true);//触摸屏幕取消窗体
dialog.setCancelable(true);//按返回键取消窗体
dialog.setOnKeyListener(this);
dialog.setOnDismissListener(this);
Window window = dialog.getWindow();
if (window != null) {
window.setGravity(Gravity.BOTTOM);
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
//AndroidRuntimeException: requestFeature() must be called before adding content
window.requestFeature(Window.FEATURE_NO_TITLE);
window.setContentView(contentLayout);
}
setSize(screenWidthPixels, WRAP_CONTENT);
}
代码示例来源:origin: robolectric/robolectric
@Test
public void getBackgroundDrawable() throws Exception {
Drawable drawable = activity.getResources().getDrawable(android.R.drawable.bottom_bar);
window.setBackgroundDrawable(drawable);
assertThat(shadowOf(window).getBackgroundDrawable()).isSameAs(drawable);
}
}
内容来源于网络,如有侵权,请联系作者删除!