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


Java SherlockActivity类代码示例

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


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

示例1: showStorageMessage

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
public void showStorageMessage(SherlockActivity activity, int remaining) {
	int noStorageText = -1;

	if (remaining == NO_STORAGE_ERROR) {
		String state = Environment.getExternalStorageState();
		if (state == Environment.MEDIA_CHECKING) {
			noStorageText = R.string.preparing_card;
		} else {
			noStorageText = R.string.no_storage_card;
		}
	} else if (remaining < 1) {
		noStorageText = R.string.not_enough_space;
	}

	if (noStorageText != -1) {
		Layouts.showDialogBoxSingle(context, R.string.dialog_title_whoops,
				noStorageText);
	}
}
 
开发者ID:LeonardoCardoso,项目名称:Silence-Please,代码行数:20,代码来源:CropImage.java

示例2: getContextForInflater

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
/**
 * @return Context which should be used for inflating the header layout
 */
public Context getContextForInflater(Activity activity) {
    if (activity instanceof SherlockActivity) {
        return ((SherlockActivity) activity).getSupportActionBar().getThemedContext();
    } else if (activity instanceof SherlockListActivity) {
        return ((SherlockListActivity) activity).getSupportActionBar().getThemedContext();
    } else if (activity instanceof SherlockFragmentActivity) {
        return ((SherlockFragmentActivity) activity).getSupportActionBar()
                .getThemedContext();
    } else if (activity instanceof SherlockExpandableListActivity) {
        return ((SherlockExpandableListActivity) activity).getSupportActionBar()
                .getThemedContext();
    } else if (activity instanceof SherlockPreferenceActivity) {
        return ((SherlockPreferenceActivity) activity).getSupportActionBar()
                .getThemedContext();
    }
    return super.getContextForInflater(activity);
}
 
开发者ID:GoogleCloudPlatform,项目名称:endpoints-codelab-android,代码行数:21,代码来源:PullToRefreshAttacher.java

示例3: getContextForInflater

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
/**
 * @return Context which should be used for inflating the header layout
 */
public Context getContextForInflater(Activity activity) {
    ActionBar ab = null;
    if (activity instanceof SherlockActivity) {
        ab = ((SherlockActivity) activity).getSupportActionBar();
    } else if (activity instanceof SherlockListActivity) {
        ab = ((SherlockListActivity) activity).getSupportActionBar();
    } else if (activity instanceof SherlockFragmentActivity) {
        ab = ((SherlockFragmentActivity) activity).getSupportActionBar();
    } else if (activity instanceof SherlockExpandableListActivity) {
        ab = ((SherlockExpandableListActivity) activity).getSupportActionBar();
    } else if (activity instanceof SherlockPreferenceActivity) {
        ab = ((SherlockPreferenceActivity) activity).getSupportActionBar();
    }

    Context context = null;
    if (ab != null) {
        context = ab.getThemedContext();
    }
    if (context == null) {
        context = activity;
    }
    return context;
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:27,代码来源:AbsPullToRefreshAttacher.java

示例4: getActionBar

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
private ActionBar getActionBar(Activity activity) {
    if (activity instanceof SherlockActivity) {
        return ((SherlockActivity) activity).getSupportActionBar();
    }
    if (activity instanceof SherlockFragmentActivity) {
        return ((SherlockFragmentActivity) activity).getSupportActionBar();
    }
    if (activity instanceof SherlockListActivity) {
        return ((SherlockListActivity) activity).getSupportActionBar();
    }
    ActionBar actionBar = getActionBarWithReflection(activity, "getSupportActionBar");
    if (actionBar == null) {
        throw new RuntimeException("Activity should derive from one of the ActionBarSherlock activities "
            + "or implement a method called getSupportActionBar");
    }
    return actionBar;
}
 
开发者ID:tarksgit,项目名称:Favorite-Android-Client-Example,代码行数:18,代码来源:FadingActionBarHelper.java

示例5: checkActivity

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
void checkActivity() {
    Context context = adapterView.getContext();
    if (context instanceof ListActivity) {
        throw new RuntimeException("ListView cannot belong to an activity which subclasses ListActivity");
    }
    if (context instanceof SherlockActivity || context instanceof SherlockFragmentActivity
            || context instanceof SherlockPreferenceActivity) {
        return;
    }
    throw new RuntimeException("ListView must belong to an activity which subclasses SherlockActivity");
}
 
开发者ID:Aptoide,项目名称:aptoide-backup-apps,代码行数:12,代码来源:MultiChoiceAdapterHelper.java

示例6: setIcon

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
public static void setIcon(final SherlockActivity activity, final int iconResc) {
	if (activity == null) return;
	
	activity.getSupportActionBar().setIcon(iconResc);
	activity.getSupportActionBar().setDisplayShowHomeEnabled(true);
	activity.getSupportActionBar().setDisplayUseLogoEnabled(true);
	activity.getSupportActionBar().setHomeButtonEnabled(true);
}
 
开发者ID:buddycloud,项目名称:buddycloud-android,代码行数:9,代码来源:ActionbarUtil.java

示例7: setLogo

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
public static void setLogo(final SherlockActivity activity, final int logoResc) {
	if (activity == null) return;
	
	activity.getSupportActionBar().setLogo(logoResc);
	activity.getSupportActionBar().setDisplayShowHomeEnabled(true);
	activity.getSupportActionBar().setDisplayUseLogoEnabled(true);
	activity.getSupportActionBar().setHomeButtonEnabled(true);
}
 
开发者ID:buddycloud,项目名称:buddycloud-android,代码行数:9,代码来源:ActionbarUtil.java

示例8: showActionBar

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
/**
 * Show the actionbar with given attributes
 * 
 * @param activity
 * @param title
 * @param isShowDrawerMenu
 */
public static void showActionBar(final SherlockActivity activity, 
		final String title, final boolean isShowDrawerMenu) {
	if (activity == null) return;
	
	setTitle(activity, title);
	if (isShowDrawerMenu) {
		setActionBar(activity.getActionBar(), activity.getSupportActionBar(), R.drawable.ic_drawer);
	}
	makeOverflowMenuShow(activity.getApplicationContext());
}
 
开发者ID:buddycloud,项目名称:buddycloud-android,代码行数:18,代码来源:ActionbarUtil.java

示例9: showActionBarwithBack

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
/**
 * Show the actionbar with backstack icon
 * 
 * @param activity
 * @param title
 */
public static void showActionBarwithBack(final SherlockActivity activity, 
		final String title) {
	if (activity == null) return;
	
	setTitle(activity, title);
	makeOverflowMenuShow(activity.getApplicationContext());
	setActionBar(activity.getActionBar(), activity.getSupportActionBar(), R.drawable.ic_ab_up_compat);
}
 
开发者ID:buddycloud,项目名称:buddycloud-android,代码行数:15,代码来源:ActionbarUtil.java

示例10: MainActivityUI

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
public MainActivityUI(Context context)
{
    super(context);
    
    activity = (SherlockActivity) context;
}
 
开发者ID:jackpf,项目名称:ApkDownloader,代码行数:7,代码来源:MainActivityUI.java

示例11: actionBarSet

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
public static synchronized void actionBarSet(SherlockActivity activity) {
	actionBarSet(activity, activity.getSupportActionBar());
}
 
开发者ID:nfsclient-speedops,项目名称:NfsClient,代码行数:4,代码来源:AppState.java

示例12: TransactionActivityUI

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
public TransactionActivityUI(Context context)
{
    super(context);
    
    activity = (SherlockActivity) context;
}
 
开发者ID:jackpf,项目名称:BlockchainSearch,代码行数:7,代码来源:TransactionActivityUI.java

示例13: LoadingTask

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
public LoadingTask(SherlockActivity activity) {
	super(activity, R.string.loading_);
}
 
开发者ID:ais-albania,项目名称:ZalartAndroid,代码行数:4,代码来源:BaseListActivity.java

示例14: setTitle

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
public static void setTitle(final SherlockActivity activity, final String title) {
	if (activity == null || title == null) return;
	
	activity.getSupportActionBar().setTitle(title);
	activity.getSupportActionBar().setDisplayShowTitleEnabled(true);
}
 
开发者ID:buddycloud,项目名称:buddycloud-android,代码行数:7,代码来源:ActionbarUtil.java

示例15: showUpButton

import com.actionbarsherlock.app.SherlockActivity; //导入依赖的package包/类
@Override
public void showUpButton() {

	if (getActivity() instanceof SherlockActivity) {

		((SherlockActivity) getActivity()).getSupportActionBar()
				.setDisplayHomeAsUpEnabled(true);

	} else if (getActivity() instanceof SherlockFragmentActivity) {

		((SherlockFragmentActivity) getActivity()).getSupportActionBar()
				.setDisplayHomeAsUpEnabled(true);

	} else if (getActivity() instanceof SherlockExpandableListActivity) {

		((SherlockExpandableListActivity) getActivity())
				.getSupportActionBar().setDisplayHomeAsUpEnabled(true);

	} else if (getActivity() instanceof SherlockListActivity) {

		((SherlockListActivity) getActivity()).getSupportActionBar()
				.setDisplayHomeAsUpEnabled(true);

	} else if (getActivity() instanceof SherlockPreferenceActivity) {
		((SherlockPreferenceActivity) getActivity()).getSupportActionBar()
				.setDisplayHomeAsUpEnabled(true);

	} else {
		super.showUpButton();
	}

}
 
开发者ID:SimoneLocatelli,项目名称:androidbase,代码行数:33,代码来源:SupportActivityHelper.java


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