• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Header类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: registerSettingsAppHook

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public static void registerSettingsAppHook(LoadPackageParam lpparam,
		final LXSettingsCallback iface) {
	if (!lpparam.packageName.equals("com.android.settings"))
		return;

	if (settingsAppHooked)
		return;

	Class<?> SettingsClazz = XposedHelpers.findClass(
			"com.android.settings.Settings", lpparam.classLoader);
	XposedBridge.hookAllMethods(SettingsClazz, "updateHeaderList",
			new XC_MethodHook() {
				@SuppressWarnings("unchecked")
				@Override
				protected void beforeHookedMethod(MethodHookParam param)
						throws Throwable {
					List<Header> headers = (List<Header>) param.args[0];
					iface.updateHeaderList(headers);
				}
			});

	settingsAppHooked = true;
}
 
开发者ID:M1cha,项目名称:android_library_libxposed,代码行数:24,代码来源:LXAppSettings.java


示例2: hookLoadHeadersFromResource

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
protected void hookLoadHeadersFromResource(LoadPackageParam lpparam, String className, final int[] hookResIds, final int addAfterHeaderId) throws Throwable
{
	hookLoadHeadersFromResource(lpparam, className, new XC_MethodHook() {

			@SuppressWarnings("unchecked")
			@Override
			protected void afterHookedMethod(MethodHookParam param) throws Throwable
			{
				final int xmlResId = (Integer) param.args[0];
				debug("loadHeadersFromResource: xmlResId=" + xmlResId);

				for(int hookResId : hookResIds)
				{
					if(xmlResId == hookResId)
					{
						addAppOpsHeader((List<Header>) param.args[1], addAfterHeaderId, (Context) param.thisObject);
						break;
					}
				}
			}
	});
}
 
开发者ID:jclehner,项目名称:AppOpsXposed,代码行数:23,代码来源:ApkVariant.java


示例3: getView

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public View getView(int position, View convertView, ViewGroup parent) {
	Header header = getItem(position);
	int headerType = header.extras.getInt(UniversalHeader.HEADER_TYPE_KEY);
	View view = null;

	switch (headerType) {
	case UniversalHeader.TYPE_CATEGORY:
		view = mInflater.inflate(android.R.layout.preference_category, parent, false);
		((TextView) view.findViewById(android.R.id.title)).setText(header.getTitle(getContext()
				.getResources()));
		break;

	case UniversalHeader.TYPE_NORMAL:
	case UniversalHeader.TYPE_ABOUT_DIALOG:
	case UniversalHeader.TYPE_ONE_TIME_INTENT:
		int customLayoutResource = header.extras==null? 0 : header.extras.getInt(UniversalHeader.HEADER_CUSTOM_LAYOUT_RESOURCE_KEY);
		
		view = mInflater.inflate(customLayoutResource==0?mHeaderLayoutResource:customLayoutResource, parent, false);
		((ImageView) view.findViewById(android.R.id.icon)).setImageResource(header.iconRes);
		TextView titleView = ((TextView) view.findViewById(android.R.id.title));
		titleView.setText(header.getTitle(getContext().getResources()));
		TextView summaryView = ((TextView) view.findViewById(android.R.id.summary));
		if (header.summaryRes!=0){
			summaryView.setText(header.getSummary(getContext().getResources()));
		} else {
			summaryView.setVisibility(View.GONE);
		}

		break;
	}

	return view;
}
 
开发者ID:CypherCove,项目名称:LWPTools,代码行数:34,代码来源:UniversalHeaderAdapter.java


示例4: onCreateAppOpsHeader

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
protected Object onCreateAppOpsHeader(Context context, int addAfterHeaderId)
{
	final Header appOpsHeader = new Header();
	appOpsHeader.title = getAppOpsTitle();
	appOpsHeader.id = R.id.app_ops_settings;
	appOpsHeader.iconRes = getAppOpsHeaderIcon();
	appOpsHeader.intent = Util.createAppOpsIntent(null);

	return appOpsHeader;
}
 
开发者ID:jclehner,项目名称:AppOpsXposed,代码行数:11,代码来源:ApkVariant.java


示例5: addAppOpsHeader

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
private void addAppOpsHeader(LoadPackageParam lpparam)
{
	final int settingsHeadersId = Res.getSettingsIdentifier("xml/settings_headers");
	final int personalSectionId = Res.getSettingsIdentifier("id/personal_section");

	if(settingsHeadersId != 0)
	{
		try
		{
			hookLoadHeadersFromResource(lpparam, settingsHeadersId, personalSectionId);
			return;
		}
		catch(Throwable t)
		{
			debug(t);
		}
	}

	// This is a last resort only, since we might end up with multiple occurences of
	// "App ops" within settings, which is ugly.

	log("Hooking onBuildHeaders :-(");

	XposedHelpers.findAndHookMethod("com.android.settings.Settings", lpparam.classLoader,
			"onBuildHeaders", List.class, new XC_MethodHook() {
				@SuppressWarnings("unchecked")
				@Override
				protected void afterHookedMethod(MethodHookParam param) throws Throwable
				{
					addAppOpsHeader((List<Header>) param.args[0], personalSectionId, (Context) param.thisObject);
				}
	});
}
 
开发者ID:jclehner,项目名称:AppOpsXposed,代码行数:34,代码来源:AOSP.java


示例6: onCreateAppOpsHeader

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
@Override
protected Object onCreateAppOpsHeader(Context context, int addAfterHeaderId)
{
	final Header header = (Header) super.onCreateAppOpsHeader(context, addAfterHeaderId);
	if(mForceCompatibilityMode)
	{
		header.fragment = null;
		header.intent = Util.createAppOpsIntent(null);
	}
	return header;
}
 
开发者ID:jclehner,项目名称:AppOpsXposed,代码行数:12,代码来源:Oppo.java


示例7: onBuildHeaders

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
/**
 * We override this method to provide PreferenceActivity with the top-level preference headers.
 */
@Override
public void onBuildHeaders(List<Header> target) {
    loadHeadersFromResource(R.xml.device_admin_headers, target);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:8,代码来源:DeviceAdminSample.java


示例8: onBuildHeaders

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
/**
 * Populate the activity with the top-level headers.
 */
@Override
public void onBuildHeaders(List<Header> target) {
    loadHeadersFromResource(R.xml.preference_headers, target);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:8,代码来源:PreferenceWithHeaders.java


示例9: onGetInitialHeader

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public Header onGetInitialHeader() {
//		return super.onGetInitialHeader();
		return null;
	}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:5,代码来源:Target_PreferenceActivity.java


示例10: onGetNewHeader

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public Header onGetNewHeader() {
//do NOT edit this file, auto-generated by host_target.groovy from Target_Activity.java.template
//		return super.onGetNewHeader();
		return null;
	}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:6,代码来源:Target_PreferenceActivity.java


示例11: loadHeadersFromResource

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public void loadHeadersFromResource(int resid, List<Header> target) {
	mHostActivity.loadHeadersFromResource(resid, target);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:4,代码来源:Target_PreferenceActivity.java


示例12: onHeaderClick

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public void onHeaderClick(Header header, int position) {
//		super.onHeaderClick(header, position);
	}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:4,代码来源:Target_PreferenceActivity.java


示例13: switchToHeader

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public void switchToHeader(Header header) {
	mHostActivity.switchToHeader(header);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:4,代码来源:Target_PreferenceActivity.java


示例14: createHeader

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public Header createHeader(Context context){
	if (headerType==TYPE_ONE_TIME_INTENT){
		final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
		if (sharedPrefs.getBoolean(oneTimeIntentPrefNamePressed, false))
			return null; //it's been pressed before. don't create the header.
	}
	
	header = new Header();
	header.title = context.getString(titleRes);
	if (headerType==TYPE_ONE_TIME_INTENT){
		header.intent = new Intent(Intent.ACTION_VIEW);
		header.intent.setData(Uri.parse(oneTimeIntentUrl));
	} else if (intent!=null){
		header.intent = intent;
	} else if (fragment!=null){
		header.fragment = fragment;
	}
	header.iconRes = iconRes;
	header.summaryRes = summaryRes;
	
	Bundle extras = new Bundle();
	extras.putInt(HEADER_TYPE_KEY, headerType);
	
	if (customLayoutRes != 0){
		extras.putInt(HEADER_CUSTOM_LAYOUT_RESOURCE_KEY,customLayoutRes);
	}
	
	if (headerType==TYPE_ABOUT_DIALOG){
		extras.putInt(ABOUT_DIALOG_VERSION_RESOURCE, aboutDialogVersionRes);
		extras.putInt(ABOUT_DIALOG_HTML_MESSAGE_RESOURCE, aboutDialogHtmlMessageRes);
		extras.putInt(ABOUT_DIALOG_ICON_RESOURCE, aboutDialogIconRes);
	}
	
	if (headerType==TYPE_ONE_TIME_INTENT){
		extras.putString(ONE_TIME_INTENT_PREF_NAME_PRESSED, oneTimeIntentPrefNamePressed);
	}
	
	header.extras = extras;
	return header;
}
 
开发者ID:CypherCove,项目名称:LWPTools,代码行数:42,代码来源:UniversalHeader.java


示例15: UniversalHeaderAdapter

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public UniversalHeaderAdapter(Context context, List<Header> objects, int headerLayoutResource) {
	super(context, 0, objects);
	mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	mHeaderLayoutResource = headerLayoutResource;
}
 
开发者ID:CypherCove,项目名称:LWPTools,代码行数:6,代码来源:UniversalHeaderAdapter.java


示例16: HeaderListAdapter

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public HeaderListAdapter(Context context, List<Header> objects) {
    super(context, 0, objects);
    inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
 
开发者ID:oakesville,项目名称:mythling,代码行数:5,代码来源:HeaderListAdapter.java


示例17: getIdFromHeader

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
protected long getIdFromHeader(Object header) {
	return ((Header) header).id;
}
 
开发者ID:jclehner,项目名称:AppOpsXposed,代码行数:4,代码来源:ApkVariant.java


示例18: onBuildHeaders

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
/**
 * Called when the activity needs its list of headers built. By implementing
 * this and adding at least one item to the list, you will cause the
 * activity to run in its modern fragment mode. Note that this function may
 * not always be called; for example, if the activity has been asked to
 * display a particular fragment without the header list, there is no need
 * to build the headers.
 * 
 * <p>
 * Typical implementations will use {@link #loadHeadersFromResource} to fill
 * in the list from a resource. For convenience this is done if a header
 * resource has been set with {@link #setHeaderRes(int)}.
 * 
 * @param target The list in which to place the headers.
 */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void onBuildHeaders(List<Header> target) {
	// Do not build headers unless in single pane mode.
	if (!isSinglePane() && mHeaderRes > 0) {
		loadHeadersFromResource(mHeaderRes, target);
	}
}
 
开发者ID:shakalaca,项目名称:learning_gradle_android,代码行数:23,代码来源:UnifiedPreferenceHelper.java


示例19: onBuildHeaders

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public void onBuildHeaders(List<Header> target) {
	
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:4,代码来源:Target_PreferenceActivity.java


示例20: updateHeaderList

import android.preference.PreferenceActivity.Header; //导入依赖的package包/类
public void updateHeaderList(List<Header> target); 
开发者ID:M1cha,项目名称:android_library_libxposed,代码行数:2,代码来源:LXSettingsCallback.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UiAutomatorScreenshotStrategy类代码示例发布时间:2022-05-22
下一篇:
Java ObjectTagging类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap