當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。