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


Java ActivityGroup类代码示例

本文整理汇总了Java中android.app.ActivityGroup的典型用法代码示例。如果您正苦于以下问题:Java ActivityGroup类的具体用法?Java ActivityGroup怎么用?Java ActivityGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: close

import android.app.ActivityGroup; //导入依赖的package包/类
public void close(String[] args)
{
	LocalActivityManager mgr = ((ActivityGroup) mContext)
			.getLocalActivityManager();
	ViewerActivity viewerActivity = (ViewerActivity) mgr.getActivity(TAG);
	if(viewerActivity != null){
		View view = viewerActivity.getWindow().getDecorView();
		removeViewFromCurrentWindow(view);
		viewerActivity.finish();
		viewerActivity = null;
		view = null;
	}

	
	if(isOpen){
		isOpen=!isOpen;
	}
	
}
 
开发者ID:Git-tl,项目名称:appcan-plugin-pdfreader-android,代码行数:20,代码来源:EUExPdf.java

示例2: getActionBarHeight

import android.app.ActivityGroup; //导入依赖的package包/类
/**
 * 获取actionbar的像素高度,默认使用android官方兼容包做actionbar兼容
 *
 * @return
 */
public static int getActionBarHeight(Context context) {
    int actionBarHeight = 0;
    if (context instanceof AppCompatActivity && ((AppCompatActivity) context).getSupportActionBar() != null) {
        Log.d("isAppCompatActivity", "==AppCompatActivity");
        actionBarHeight = ((AppCompatActivity) context).getSupportActionBar().getHeight();
    } else if (context instanceof Activity && ((Activity) context).getActionBar() != null) {
        Log.d("isActivity", "==Activity");
        actionBarHeight = ((Activity) context).getActionBar().getHeight();
    } else if (context instanceof ActivityGroup) {
        Log.d("ActivityGroup", "==ActivityGroup");
        if (((ActivityGroup) context).getCurrentActivity() instanceof AppCompatActivity && ((AppCompatActivity) ((ActivityGroup) context).getCurrentActivity()).getSupportActionBar() != null) {
            actionBarHeight = ((AppCompatActivity) ((ActivityGroup) context).getCurrentActivity()).getSupportActionBar().getHeight();
        } else if (((ActivityGroup) context).getCurrentActivity() instanceof Activity && ((Activity) ((ActivityGroup) context).getCurrentActivity()).getActionBar() != null) {
            actionBarHeight = ((Activity) ((ActivityGroup) context).getCurrentActivity()).getActionBar().getHeight();
        }
    }
    if (actionBarHeight != 0)
        return actionBarHeight;
    final TypedValue tv = new TypedValue();
    if (context.getTheme().resolveAttribute(android.support.v7.appcompat.R.attr.actionBarSize, tv, true)) {
        if (context.getTheme().resolveAttribute(android.support.v7.appcompat.R.attr.actionBarSize, tv, true))
            actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, context.getResources().getDisplayMetrics());
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
            actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, context.getResources().getDisplayMetrics());
    } else {
        if (context.getTheme().resolveAttribute(android.support.v7.appcompat.R.attr.actionBarSize, tv, true))
            actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, context.getResources().getDisplayMetrics());
    }
    Log.d("actionBarHeight", "====" + actionBarHeight);
    return actionBarHeight;
}
 
开发者ID:lanyuanxiaoyao,项目名称:PicKing,代码行数:38,代码来源:ScreenUtil.java

示例3: getCurrentActivity_shouldReturnTheProvidedCurrentActivity

import android.app.ActivityGroup; //导入依赖的package包/类
@Test
public void getCurrentActivity_shouldReturnTheProvidedCurrentActivity() throws Exception {
ActivityGroup activityGroup = new ActivityGroup();
Activity activity = new Activity();
shadowOf(activityGroup).setCurrentActivity(activity);

  assertThat(activityGroup.getCurrentActivity()).isSameAs(activity);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:9,代码来源:ActivityGroupTest.java

示例4: getActionBarHeight

import android.app.ActivityGroup; //导入依赖的package包/类
/**
 * 获取actionbar的像素高度,默认使用android官方兼容包做actionbar兼容
 *
 * @return
 */
public static int getActionBarHeight(Context context) {
    int actionBarHeight = 0;
    if (context instanceof AppCompatActivity && ((AppCompatActivity) context)
            .getSupportActionBar() != null) {
        Log.d("isAppCompatActivity", "==AppCompatActivity");
        actionBarHeight = ((AppCompatActivity) context).getSupportActionBar().getHeight();
    } else if (context instanceof Activity && ((Activity) context).getActionBar() != null) {
        Log.d("isActivity", "==Activity");
        actionBarHeight = ((Activity) context).getActionBar().getHeight();
    } else if (context instanceof ActivityGroup) {
        Log.d("ActivityGroup", "==ActivityGroup");
        if (((ActivityGroup) context).getCurrentActivity() instanceof AppCompatActivity && (
                (AppCompatActivity) ((ActivityGroup) context).getCurrentActivity())
                .getSupportActionBar() != null) {
            actionBarHeight = ((AppCompatActivity) ((ActivityGroup) context)
                    .getCurrentActivity()).getSupportActionBar().getHeight();
        } else if (((ActivityGroup) context).getCurrentActivity() instanceof Activity && (
                (Activity) ((ActivityGroup) context).getCurrentActivity()).getActionBar() !=
                null) {
            actionBarHeight = ((Activity) ((ActivityGroup) context).getCurrentActivity())
                    .getActionBar().getHeight();
        }
    }
    if (actionBarHeight != 0)
        return actionBarHeight;
    final TypedValue tv = new TypedValue();
    if (context.getTheme().resolveAttribute(android.support.v7.appcompat.R.attr
            .actionBarSize, tv, true)) {
        if (context.getTheme().resolveAttribute(android.support.v7.appcompat.R.attr
                .actionBarSize, tv, true))
            actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, context
                    .getResources().getDisplayMetrics());
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
            actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, context
                    .getResources().getDisplayMetrics());
    } else {
        if (context.getTheme().resolveAttribute(android.support.v7.appcompat.R.attr
                .actionBarSize, tv, true))
            actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, context
                    .getResources().getDisplayMetrics());
    }
    Log.d("actionBarHeight", "====" + actionBarHeight);
    return actionBarHeight;
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:51,代码来源:ScreenUtils.java

示例5: shadowOf

import android.app.ActivityGroup; //导入依赖的package包/类
public static ShadowActivityGroup shadowOf(ActivityGroup instance) {
  return (ShadowActivityGroup) shadowOf_(instance);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:4,代码来源:Robolectric.java


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