本文整理汇总了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();
}
示例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();
}
示例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);
}
}
示例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;
}
示例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();
}