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


Java GestureLibrary.save方法代码示例

本文整理汇总了Java中android.gesture.GestureLibrary.save方法的典型用法代码示例。如果您正苦于以下问题:Java GestureLibrary.save方法的具体用法?Java GestureLibrary.save怎么用?Java GestureLibrary.save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.gesture.GestureLibrary的用法示例。


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

示例1: addGesture

import android.gesture.GestureLibrary; //导入方法依赖的package包/类
@SuppressWarnings({"UnusedDeclaration"})
public void addGesture(View v) {
    if (mGesture != null) {
        final TextView input = (TextView) findViewById(R.id.gesture_name);
        final CharSequence name = input.getText();
        if (name.length() == 0) {
            input.setError(getString(R.string.error_missing_name));
            return;
        }

        final GestureLibrary store = GestureBuilderActivity.getStore();
        store.addGesture(name.toString(), mGesture);
        store.save();

        setResult(RESULT_OK);

        final String path = new File(Environment.getExternalStorageDirectory(),
                "gestures").getAbsolutePath();
        Toast.makeText(this, getString(R.string.save_success, path), Toast.LENGTH_LONG).show();
    } else {
        setResult(RESULT_CANCELED);
    }

    finish();
    
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:27,代码来源:CreateGestureActivity.java

示例2: addGesture

import android.gesture.GestureLibrary; //导入方法依赖的package包/类
public void addGesture(View v) {
    if (mGesture != null) {
        final TextView input = (TextView) findViewById(R.id.gesture_command);
        final CharSequence name = input.getText();
        if (name.length() == 0) {
            input.setError(getString(R.string.error_missing_name_str));
            return;
        }

        final GestureLibrary store = GestureBuilderActivity.getStore();
        store.addGesture(name.toString(), mGesture);
        store.save();

        setResult(RESULT_OK);

        final String path = new File(Environment.getExternalStorageDirectory(),
                "gestures").getAbsolutePath();
        Toast.makeText(this, getString(R.string.save_success_str, path), Toast.LENGTH_LONG).show();
    } else {
        setResult(RESULT_CANCELED);
    }

    finish();
    
}
 
开发者ID:pot8oe,项目名称:mythmote,代码行数:26,代码来源:CreateGestureActivity.java

示例3: addGesture

import android.gesture.GestureLibrary; //导入方法依赖的package包/类
/**
 * Stores the given gesture.
 *
 * @param name    The name of the gesture
 * @param gesture The gesture
 * @param action  The action to perform when the touch gesture is performed
 */
public void addGesture(String name, Gesture gesture, AbstractAction action) {

    GestureLibrary fileLib = GestureLibraries.fromFile(TOUCH_GESTURES_FILE);
    if (fileLib.load()) {
        fileLib.addGesture(name, gesture);
        fileLib.save();
        this.mMap.put(name, action);
        saveHashMap();
        DeLog.d(TAG, "Gesture " + name + " saved");
        sendGestureChangedBroadcast();
    } else {
        DeLog.e(TAG, "Couldn't save gesture " + name);
    }

}
 
开发者ID:alexstyl,项目名称:Touch-Control,代码行数:23,代码来源:GestureManager.java

示例4: removeGesture

import android.gesture.GestureLibrary; //导入方法依赖的package包/类
/**
 * Removes the gesture with the given name from the manager
 *
 * @param name The name of the entry to remove
 * @return Whether it manages to remove an entry or not
 */
public boolean removeGesture(String name) {

    boolean res = false;
    GestureLibrary fileLib = GestureLibraries.fromFile(TOUCH_GESTURES_FILE);
    if (fileLib.load()) {
        fileLib.removeEntry(name);
        fileLib.save();
        res = null != this.mMap.remove(name);
        saveHashMap();
        DeLog.d(TAG, "Gesture " + name + " removed");
        sendGestureChangedBroadcast();
    } else {
        DeLog.e(TAG, "Couldn't save gesture " + name);
    }
    return res;

}
 
开发者ID:alexstyl,项目名称:Touch-Control,代码行数:24,代码来源:GestureManager.java

示例5: addGesture

import android.gesture.GestureLibrary; //导入方法依赖的package包/类
public void addGesture(View v) {
	if (mGesture != null) {
		final TextView input = (TextView) findViewById(R.id.gesture_name);
		final CharSequence name = input.getText();
		if (name.length() == 0) {
			input.setError(getString(R.string.error_missing_name));
			return;
		}

		final GestureLibrary store = SettingsUtil.getGestureLibrary(this);
		store.addGesture(name.toString(), mGesture);
		store.save();

		setResult(RESULT_OK);

		final String path = SettingsUtil.getGestureFile(this)
				.getAbsolutePath();
		Toast.makeText(this, getString(R.string.save_success, path),
				Toast.LENGTH_LONG).show();
	} else {
		setResult(RESULT_CANCELED);
	}

	finish();

}
 
开发者ID:AndrewMurrell,项目名称:minak,代码行数:27,代码来源:SettingsCreateGestureActivity.java


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