本文整理汇总了Java中android.view.Window.setFormat方法的典型用法代码示例。如果您正苦于以下问题:Java Window.setFormat方法的具体用法?Java Window.setFormat怎么用?Java Window.setFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.Window
的用法示例。
在下文中一共展示了Window.setFormat方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAttachedToWindow
import android.view.Window; //导入方法依赖的package包/类
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
// https://crazygui.wordpress.com/2010/09/05/high-quality-radial-gradient-in-android/
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
// int screenWidth = displayMetrics.widthPixels;
int screenHeight = displayMetrics.heightPixels;
Window window = getWindow();
GradientDrawable gradientBackgroundDrawable = GradientUtils.create(
ContextCompat.getColor(this, R.color.mp_theme_dark_blue_gradientColor),
ContextCompat.getColor(this, R.color.mp_theme_dark_blue_background),
screenHeight / 2, // (int) Math.hypot(screenWidth / 2, screenHeight / 2),
0.5f,
0.5f
);
window.setBackgroundDrawable(gradientBackgroundDrawable);
window.setFormat(PixelFormat.RGBA_8888);
}
示例2: onCreate
import android.view.Window; //导入方法依赖的package包/类
@Override
public void onCreate(final Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
boolean showTermsAndConditions = true;
if (getIntent().getExtras() != null) {
final String checkTypeName = getIntent().getExtras().getString(EXTRA_KEY_CHECK_TYPE, null);
if (checkTypeName != null) {
checkType = CheckType.valueOf(checkTypeName);
}
showTermsAndConditions = getIntent().getExtras().getBoolean(EXTRA_KEY_CHECK_TERMS_AND_COND, true);
}
final Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
window.addFlags(WindowManager.LayoutParams.FLAG_DITHER);
if (savedInstanceState == null)
{
if (showTermsAndConditions) {
showTermsCheck();
}
else {
continueWorkflow();
}
}
}
示例3: onAttachedToWindow
import android.view.Window; //导入方法依赖的package包/类
@Override
public void onAttachedToWindow() { //ensures smooth gradient
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}
示例4: onAttachedToWindow
import android.view.Window; //导入方法依赖的package包/类
@Override
public void onAttachedToWindow() { ///ensures smooth gradient
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}
示例5: onAttachedToWindow
import android.view.Window; //导入方法依赖的package包/类
public void onAttachedToWindow() {
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}
示例6: onAttachedToWindow
import android.view.Window; //导入方法依赖的package包/类
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}