当前位置: 首页>>代码示例>>Java>>正文


Java Activity.requestWindowFeature方法代码示例

本文整理汇总了Java中android.app.Activity.requestWindowFeature方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.requestWindowFeature方法的具体用法?Java Activity.requestWindowFeature怎么用?Java Activity.requestWindowFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.Activity的用法示例。


在下文中一共展示了Activity.requestWindowFeature方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setActivity

import android.app.Activity; //导入方法依赖的package包/类
public void setActivity(Activity activity) {
	super.setActivity(activity);
	int resId = getBitmapRes(activity, "ssdk_oks_shake_to_share_back");
	if (resId > 0) {
		activity.setTheme(android.R.style.Theme_Dialog);
		activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
		Window win = activity.getWindow();
		win.setBackgroundDrawableResource(resId);
	}
}
 
开发者ID:liupengandroid,项目名称:ywApplication,代码行数:11,代码来源:Shake2Share.java

示例2: attachToActivity

import android.app.Activity; //导入方法依赖的package包/类
/**
 * 将SwipeFinishLayout关联到指定activity中
 * @param activity
 */
public void attachToActivity(Activity activity) {
    mActivity = activity;
    TypedArray ta = activity.getTheme().obtainStyledAttributes(
            new int[] {android.R.attr.windowBackground});
    int background = ta.getResourceId(0, 0);
    ta.recycle();

    // 设置window样式,FEATURE_NO_TITLE
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
    ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
    // 系统内置,/platforms/android-25/data/res/layout/screen_custom_title.xml
    ViewGroup decorChild = (ViewGroup) decorView.getChildAt(0);
    decorChild.setBackgroundResource(background);
    decorView.removeView(decorChild);
    addView(decorChild);
    // 设置content view
    mContentView = (View) decorChild.getParent();
    // 将SwipeFinishLayout添加到decorView中
    decorView.addView(this);
}
 
开发者ID:lorienzhang,项目名称:SwipeFinishLayout,代码行数:25,代码来源:SwipeFinishLayout.java

示例3: setActivity

import android.app.Activity; //导入方法依赖的package包/类
public void setActivity(Activity activity) {
    super.setActivity(activity);
    int resId = R.getBitmapRes(activity, "ssdk_oks_shake_to_share_back");
    if (resId > 0) {
        activity.setTheme(16973835);
        activity.requestWindowFeature(1);
        activity.getWindow().setBackgroundDrawableResource(resId);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:Shake2Share.java

示例4: open

import android.app.Activity; //导入方法依赖的package包/类
public static void open(final Activity activity, String imageUrl, final OnWelcomeDone onWelcomeDone) {
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
    final View welcome = LayoutInflater.from(activity).inflate(R.layout.welcome, null);
    final AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
    alphaAnimation.setDuration(1000);
    welcome.startAnimation(alphaAnimation);
    Glide.with(activity).load(imageUrl).into(((ImageView) welcome.findViewById(R.id.iv_welcome)));
    activity.setContentView(welcome);
    final TextView skipView = (TextView) welcome.findViewById(R.id.tv_skip);

    final CountDownTimer start = new CountDownTimer(5000, 1000) {
        @Override
        public void onTick(long millisUntilFinished) {
            skipView.setText("跳过" + ((millisUntilFinished / 1000) - 1));
        }

        @Override
        public void onFinish() {
            AlphaAnimation alphaAnimation1 = new AlphaAnimation(1.0f, 0.0f);
            alphaAnimation1.setDuration(1000);
            welcome.startAnimation(alphaAnimation1);
            if (onWelcomeDone != null) {
                onWelcomeDone.onDone();
            }
        }
    }.start();
    skipView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            start.onFinish();
        }
    });

}
 
开发者ID:TestSmirk,项目名称:WelcomeView,代码行数:36,代码来源:WelcomeUtil.java

示例5: setAllScreen

import android.app.Activity; //导入方法依赖的package包/类
/**
 * 设置全屏
 */
public static void setAllScreen(Activity activity) {
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);  //无title
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);  //全屏
}
 
开发者ID:StickyTolt,项目名称:ForeverLibrary,代码行数:9,代码来源:WindowUtils.java

示例6: hideStatusBar

import android.app.Activity; //导入方法依赖的package包/类
/**
 * 隐藏状态栏
 * <p>也就是设置全屏,一定要在setContentView之前调用,否则报错</p>
 * <p>此方法Activity可以继承AppCompatActivity</p>
 * <p>启动的时候状态栏会显示一下再隐藏,比如QQ的欢迎界面</p>
 * <p>在配置文件中Activity加属性android:theme="@android:style/Theme.NoTitleBar.Fullscreen"</p>
 * <p>如加了以上配置Activity不能继承AppCompatActivity,会报错</p>
 *
 * @param activity activity
 */
public static void hideStatusBar(Activity activity)
{
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
 
开发者ID:Ayvytr,项目名称:EasyAndroid,代码行数:17,代码来源:BarTool.java

示例7: setFullScreen

import android.app.Activity; //导入方法依赖的package包/类
/**
 * 设置屏幕为全屏
 * <p>需在 {@code setContentView} 之前调用</p>
 *
 * @param activity activity
 */
public static void setFullScreen(@NonNull final Activity activity) {
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:ScreenUtils.java

示例8: hideStatusBar

import android.app.Activity; //导入方法依赖的package包/类
/**
 * 隐藏状态栏
 * <p>也就是设置全屏,一定要在setContentView之前调用,否则报错</p>
 * <p>此方法Activity可以继承AppCompatActivity</p>
 * <p>启动的时候状态栏会显示一下再隐藏,比如QQ的欢迎界面</p>
 * <p>在配置文件中Activity加属性android:theme="@android:style/Theme.NoTitleBar.Fullscreen"</p>
 * <p>如加了以上配置Activity不能继承AppCompatActivity,会报错</p>
 *
 * @param activity activity
 */
public static void hideStatusBar(Activity activity) {
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
 
开发者ID:hoangkien0705,项目名称:Android-UtilCode,代码行数:16,代码来源:BarUtils.java

示例9: hideTitleBar

import android.app.Activity; //导入方法依赖的package包/类
/**
 * </br><b>title : </b>		隐藏系统标题栏
 * </br><b>description :</b>隐藏Activity的系统默认标题栏
 *
 * @param activity Activity对象
 */
public static void hideTitleBar(Activity activity) {
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
}
 
开发者ID:zhou-you,项目名称:RxEasyHttp,代码行数:10,代码来源:AppTools.java

示例10: hideStatusBar

import android.app.Activity; //导入方法依赖的package包/类
/**
 * 隐藏状态栏
 * <p>也就是设置全屏,一定要在setContentView之前调用,否则报错</p>
 * <p>此方法Activity可以继承AppCompatActivity</p>
 * <p>启动的时候状态栏会显示一下再隐藏,比如QQ的欢迎界面</p>
 * <p>在配置文件中Activity加属性android:theme="@android:style/Theme.NoTitleBar.Fullscreen"</p>
 * <p>如加了以上配置Activity不能继承AppCompatActivity,会报错</p>
 *
 * @param activity activity
 */
public static void hideStatusBar(Activity activity) {
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
    activity.getWindow()
            .setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
 
开发者ID:imliujun,项目名称:LJFramework,代码行数:16,代码来源:BarUtils.java

示例11: hideStatusBar

import android.app.Activity; //导入方法依赖的package包/类
/**
 * 隐藏状态栏
 * <p>也就是设置全屏,一定要在setContentView之前调用,否则报错
 * <p>此方法Activity可以继承AppCompatActivity
 * <p>启动的时候状态栏会显示一下再隐藏,比如QQ的欢迎界面
 * <p>在配置文件中Activity加属性android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 * <p>如加了以上配置Activity不能继承AppCompatActivity,会报错
 */
public static void hideStatusBar(Activity activity) {
    activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
    activity.getWindow().setFlags(LayoutParams.FLAG_FULLSCREEN,
            LayoutParams.FLAG_FULLSCREEN);
}
 
开发者ID:zhuangzaiku,项目名称:AndroidCollection,代码行数:14,代码来源:ScreenUtils.java


注:本文中的android.app.Activity.requestWindowFeature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。