本文整理汇总了Java中android.gesture.Gesture.toBitmap方法的典型用法代码示例。如果您正苦于以下问题:Java Gesture.toBitmap方法的具体用法?Java Gesture.toBitmap怎么用?Java Gesture.toBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.gesture.Gesture
的用法示例。
在下文中一共展示了Gesture.toBitmap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadInBackground
import android.gesture.Gesture; //导入方法依赖的package包/类
@Override
public List<NamedGesture> loadInBackground() {
DeLog.i(TAG, "onLoadInBackground called");
if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
DeLog.e(TAG, "Media not mounted");
return null;
}
List<NamedGesture> mGestures = null;
if (mLibrary.load()) {
mGestures = new ArrayList<>();
for (String name : mLibrary.getGestureEntries()) {
for (Gesture gesture : mLibrary.getGestures(name)) {
final NamedGesture namedGesture = new NamedGesture(gesture, name);
// TODO For performance and memory efficiency, the thumbnails need to be loaded off the Loader
// it was done this way for simplicity reason
Bitmap thumbnail = gesture.toBitmap(mWidth, mHeight, mInset, mColor);
namedGesture.setThumbnail(thumbnail);
mGestures.add(namedGesture);
}
}
}
Collections.sort(mGestures);
return mGestures;
}
示例2: doInBackground
import android.gesture.Gesture; //导入方法依赖的package包/类
@Override
protected Integer doInBackground(Void... params) {
if (isCancelled()) return STATUS_CANCELLED;
if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
return STATUS_NO_STORAGE;
}
final GestureLibrary store = sStore;
if (store.load()) {
for (String name : store.getGestureEntries()) {
if (isCancelled()) break;
for (Gesture gesture : store.getGestures(name)) {
final Bitmap bitmap = gesture.toBitmap(mThumbnailSize, mThumbnailSize,
mThumbnailInset, mPathColor);
final NamedGesture namedGesture = new NamedGesture();
namedGesture.gesture = gesture;
namedGesture.name = name;
mAdapter.addBitmap(namedGesture.gesture.getID(), bitmap);
publishProgress(namedGesture);
}
}
return STATUS_SUCCESS;
}
return STATUS_NOT_LOADED;
}
示例3: doInBackground
import android.gesture.Gesture; //导入方法依赖的package包/类
@Override
protected Integer doInBackground(Void... params) {
if (isCancelled())
return STATUS_CANCELLED;
if (!Environment.MEDIA_MOUNTED.equals(Environment
.getExternalStorageState())) {
return STATUS_NO_STORAGE;
}
final GestureLibrary store = SettingsUtil.getGestureLibrary(mThis);
if (store.load()) {
for (String name : store.getGestureEntries()) {
if (isCancelled())
break;
for (Gesture gesture : store.getGestures(name)) {
final Bitmap bitmap = gesture.toBitmap(mThumbnailSize,
mThumbnailSize, mThumbnailInset, mPathColor);
final NamedGesture namedGesture = new NamedGesture();
namedGesture.gesture = gesture;
namedGesture.name = name;
mAdapter.addBitmap(namedGesture.gesture.getID(), bitmap);
publishProgress(namedGesture);
}
}
return STATUS_SUCCESS;
}
return STATUS_NOT_LOADED;
}