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


Java Gesture.toBitmap方法代码示例

本文整理汇总了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;
}
 
开发者ID:alexstyl,项目名称:Touch-Control,代码行数:26,代码来源:TouchGesturesLoader.java

示例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;
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:31,代码来源:GestureBuilderActivity.java

示例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;
}
 
开发者ID:AndrewMurrell,项目名称:minak,代码行数:34,代码来源:SettingsActivity.java


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