本文整理汇总了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;未经允许,请勿转载。 |
请发表评论