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

Java LiveFolders类代码示例

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

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



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

示例1: onCreate

import android.provider.LiveFolders; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final Intent intent = getIntent();
    final String action = intent.getAction();

    if (LiveFolders.ACTION_CREATE_LIVE_FOLDER.equals(action)) {
        // Build the live folder intent.
        final Intent liveFolderIntent = new Intent();

        liveFolderIntent.setData(CONTENT_URI);
        liveFolderIntent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME,
                getString(R.string.live_folder_name));
        liveFolderIntent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,
                Intent.ShortcutIconResource.fromContext(this,
                        R.drawable.live_folder_notes));
        liveFolderIntent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE,
                LiveFolders.DISPLAY_MODE_LIST);
        liveFolderIntent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT,
                new Intent(Intent.ACTION_EDIT, NOTE_URI));

        // The result of this activity should be a live folder intent.
        setResult(RESULT_OK, liveFolderIntent);
    } else {
        setResult(RESULT_CANCELED);
    }

    finish();
}
 
开发者ID:firebase,项目名称:firebase-testlab-instr-lib,代码行数:31,代码来源:NotesLiveFolder.java


示例2: LiveFolderAdapter

import android.provider.LiveFolders; //导入依赖的package包/类
LiveFolderAdapter(Launcher launcher, LiveFolderInfo info, Cursor cursor) {
	super(launcher, cursor, true);
	mIsList = info.displayMode == LiveFolders.DISPLAY_MODE_LIST;
	mInflater = LayoutInflater.from(launcher);
	mLauncher = launcher;

	mLauncher.startManagingCursor(getCursor());
}
 
开发者ID:yftx,项目名称:fruit.launcher,代码行数:9,代码来源:LiveFolderAdapter.java


示例3: newView

import android.provider.LiveFolders; //导入依赖的package包/类
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
	View view;
	final ViewHolder holder = new ViewHolder();

	if (!mIsList) {
		view = mInflater.inflate(R.layout.application_boxed, parent, false);
	} else {
		view = mInflater.inflate(R.layout.application_list, parent, false);
		holder.description = (TextView) view.findViewById(R.id.description);
		holder.icon = (ImageView) view.findViewById(R.id.icon);
	}

	holder.name = (TextView) view.findViewById(R.id.name);

	holder.idIndex = cursor.getColumnIndexOrThrow(BaseColumns._ID);
	holder.nameIndex = cursor.getColumnIndexOrThrow(LiveFolders.NAME);
	holder.descriptionIndex = cursor
			.getColumnIndex(LiveFolders.DESCRIPTION);
	holder.intentIndex = cursor.getColumnIndex(LiveFolders.INTENT);
	holder.iconBitmapIndex = cursor.getColumnIndex(LiveFolders.ICON_BITMAP);
	holder.iconResourceIndex = cursor
			.getColumnIndex(LiveFolders.ICON_RESOURCE);
	holder.iconPackageIndex = cursor
			.getColumnIndex(LiveFolders.ICON_PACKAGE);

	view.setTag(holder);

	return view;
}
 
开发者ID:yftx,项目名称:fruit.launcher,代码行数:31,代码来源:LiveFolderAdapter.java


示例4: isDisplayModeList

import android.provider.LiveFolders; //导入依赖的package包/类
private static boolean isDisplayModeList(FolderInfo folderInfo) {
	return ((LiveFolderInfo) folderInfo).displayMode == LiveFolders.DISPLAY_MODE_LIST;
}
 
开发者ID:yftx,项目名称:fruit.launcher,代码行数:4,代码来源:LiveFolder.java


示例5: addLiveFolder

import android.provider.LiveFolders; //导入依赖的package包/类
static LiveFolderInfo addLiveFolder(Context context, Intent data,
		CellLayout.CellInfo cellInfo, boolean notify) {

	Intent baseIntent = data
			.getParcelableExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT);
	String name = data.getStringExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME);

	Drawable icon = null;
	Intent.ShortcutIconResource iconResource = null;

	Parcelable extra = data
			.getParcelableExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON);
	if (extra != null && extra instanceof Intent.ShortcutIconResource) {
		try {
			iconResource = (Intent.ShortcutIconResource) extra;
			final PackageManager packageManager = context
					.getPackageManager();
			Resources resources = packageManager
					.getResourcesForApplication(iconResource.packageName);
			final int id = resources.getIdentifier(
					iconResource.resourceName, null, null);
			icon = resources.getDrawable(id);
		} catch (Exception e) {
			Log.w(TAG, "Could not load live folder icon: " + extra);
		}
	}

	final LiveFolderInfo info = new LiveFolderInfo();
	if (icon == null) {
		IconCache iconCache = ((LauncherApplication) context
				.getApplicationContext()).getIconCache();
		info.icon = iconCache.getFolderLocalIcon(true);
	} else {
		info.icon = Utilities.createIconBitmap(icon, context);
	}
	info.title = name;
	info.iconResource = iconResource;
	info.uri = data.getData();
	info.baseIntent = baseIntent;
	info.displayMode = data.getIntExtra(
			LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE,
			LiveFolders.DISPLAY_MODE_GRID);

	LauncherModel.addItemToDatabase(context, info,
			Favorites.CONTAINER_DESKTOP, cellInfo.screen, cellInfo.cellX,
			cellInfo.cellY, notify);
	mFolders.put(info.id, info);

	return info;
}
 
开发者ID:yftx,项目名称:fruit.launcher,代码行数:51,代码来源:Launcher.java


示例6: query

import android.provider.LiveFolders; //导入依赖的package包/类
static Cursor query(Context context, LiveFolderInfo info) {
	return context.getContentResolver().query(info.uri, null, null, null,
			LiveFolders.NAME + " ASC");
}
 
开发者ID:yftx,项目名称:fruit.launcher,代码行数:5,代码来源:LiveFolderAdapter.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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