• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GestureLibraries类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.gesture.GestureLibraries的典型用法代码示例。如果您正苦于以下问题:Java GestureLibraries类的具体用法?Java GestureLibraries怎么用?Java GestureLibraries使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.gestures_list);

    mAdapter = new GesturesAdapter(this);
    setListAdapter(mAdapter);

    if (sStore == null) {
        sStore = GestureLibraries.fromFile(mStoreFile);
    }
    mEmpty = (TextView) findViewById(android.R.id.empty);
    loadGestures();

    registerForContextMenu(getListView());
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:18,代码来源:GestureBuilderActivity.java


示例2: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.save_gesture);
    Log.d(TAG, "path = " + Environment.getExternalStorageDirectory().getAbsolutePath());

    openOptionsMenu();

    gLib = GestureLibraries.fromFile(getExternalFilesDir(null) + "/" + "gesture.txt");
    gLib.load();

    GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.save_gesture);
    gestures.addOnGestureListener(mGestureListener);

    resetEverything();
}
 
开发者ID:manangandhi7,项目名称:Gesture-Builder,代码行数:17,代码来源:SaveGestureActivity.java


示例3: listBanav

import android.gesture.GestureLibraries; //导入依赖的package包/类
/**
 * badha gestures laine emne list ma mukse
 */
private void listBanav() {
    try {
        mGestureList = new ArrayList<GestureHolder>();
        gLib = GestureLibraries.fromFile(getExternalFilesDir(null) + "/" + "gesture.txt");
        gLib.load();
        Set<String> gestureSet = gLib.getGestureEntries();
        for(String gestureNaam: gestureSet){
            ArrayList<Gesture> list = gLib.getGestures(gestureNaam);
            for(Gesture g : list) {
                mGestureList.add(new GestureHolder(g, gestureNaam));
            }
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:manangandhi7,项目名称:Gesture-Builder,代码行数:20,代码来源:GestureListActivity.java


示例4: initGesture

import android.gesture.GestureLibraries; //导入依赖的package包/类
private void initGesture() {
	final GestureLibrary gestureLibrary = GestureLibraries.fromRawResource(
			context, R.raw.gestures);
	gestureLibrary.load();

	gestureOverlayView
			.addOnGesturePerformedListener(new OnGesturePerformedListener() {

				@Override
				public void onGesturePerformed(GestureOverlayView overlay,
						Gesture gesture) {
					ArrayList<Prediction> arrayList = gestureLibrary
							.recognize(gesture);

					Prediction prediction = arrayList.get(0);
					if (prediction.score >= 3.0) {
						if (prediction.name.equals("back")) {
							Toast.makeText(context, "退出",
									Toast.LENGTH_SHORT).show();
							finish();
						}

					} else {
						Toast.makeText(context, "手势不存在", Toast.LENGTH_SHORT)
								.show();
					}

				}
			});

}
 
开发者ID:chenyufeng1991,项目名称:BaiduMap-TrafficAssistant,代码行数:32,代码来源:MainActivity.java


示例5: addGesture

import android.gesture.GestureLibraries; //导入依赖的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


示例6: removeGesture

import android.gesture.GestureLibraries; //导入依赖的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


示例7: getOverlayContentView

import android.gesture.GestureLibraries; //导入依赖的package包/类
/**
 * Add the content view of the activity into a GestureOverlayView and return the new view
 *
 * @param contentView the original content view of the activity
 * @param packageName the package name of the app who uses this library
 * @param rawId       the resource identifier of the gesture file in your raw folder
 * @return the new contentView wrapped in a GestureOverlayView
 */
public static View getOverlayContentView(final View contentView, final String packageName,
                                         int rawId) {
    //load the gestures
    final GestureLibrary gestureLib = GestureLibraries
            .fromRawResource(contentView.getContext(), rawId);
    if (!gestureLib.load()) {
        Log.w(TAG, "could not load gestures");
        return contentView;
    }

    GestureOverlayView gestureOverlayView = new GestureOverlayView(contentView.getContext());
    gestureOverlayView.setGestureColor(Color.TRANSPARENT);
    gestureOverlayView.setUncertainGestureColor(Color.TRANSPARENT);
    gestureOverlayView.addView(contentView);
    gestureOverlayView
            .addOnGesturePerformedListener(new GestureOverlayView.OnGesturePerformedListener() {
                @Override
                public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
                    //load all gestures
                    ArrayList<Prediction> predictions = gestureLib.recognize(gesture);
                    //the only received prediction should be "netural"
                    for (Prediction prediction : predictions) {
                        if (prediction.score > 1.0) {
                            showDialog(contentView.getContext(), packageName);
                        }
                    }
                }
            });
    return gestureOverlayView;
}
 
开发者ID:Netural,项目名称:AboutApp,代码行数:39,代码来源:AboutAppOverlay.java


示例8: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    setContentView(R.layout.create_gesture);
    
    path =getIntent().getExtras().getString("path");
    
    mDoneButton = findViewById(R.id.done);
    
    if (sStore == null) {
        sStore = GestureLibraries.fromFile(mStoreFile);
    }

    GestureOverlayView overlay = (GestureOverlayView) findViewById(R.id.gestures_overlay);
    overlay.addOnGestureListener(new GesturesProcessor());
}
 
开发者ID:kshark27,项目名称:UltraExplorer,代码行数:18,代码来源:CreateGestureActivity.java


示例9: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    //
    Gson gson = new Gson();
    SharedPreferences prefs = getSharedPreferences("MyPref", MODE_PRIVATE);
    String wrapperStr = prefs.getString("memMap", null);
    MapWrapper wrapper = gson.fromJson(wrapperStr, MapWrapper.class);
    this.keys = wrapper.getKeys();
    this.values = wrapper.getValues(keys);
    //

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_hand_writing_train);
    generateHashMap(memMap, keys,values);

    keyList.addAll(myNewHashMap.keySet());
    valueList.addAll(myNewHashMap.values());

    textView2 = (TextView)findViewById(R.id.textView2);

    textView2.setText("The first one of map : "+myNewHashMap.get(keyList.get(0))+", write "+keyList.get(0));
    MediaPlayer.create(handWritingTrain.this,audio[keyList.get(0)]).start();
    textView4 = (TextView)findViewById(R.id.textView4);

    gestureResult = (TextView)findViewById(R.id.gestureresult);
    gestureOverlayView = (GestureOverlayView)findViewById(R.id.gestures);

    gestureLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);
    gestureLibrary.load();

    gestureOverlayView.addOnGesturePerformedListener(gesturePerformedListener);

}
 
开发者ID:MemoryGroup,项目名称:442repo,代码行数:35,代码来源:handWritingTrain.java


示例10: init

import android.gesture.GestureLibraries; //导入依赖的package包/类
private void init() {
    iLanguage();
    app = (ApplicationUtil) GestureActivity.this.getApplication();
    tvShow = (TextView) findViewById(R.id.tv_show);
    tvShow.setText(strShow);
    tvGestureGuide = (TextView) findViewById(R.id.tv_gesture_guide);
    tvGestureGuide.setText(strGestureGuide);
    final List<String> lLetter = new ArrayList<>();
    List<String> lString = new ArrayList<>();
    lLetter.add("c");
    lString.add(strCmd);
    lLetter.add("t");
    lString.add(strTaskManager);
    lLetter.add("e/z");
    lString.add(strExplorer);
    lLetter.add("s");
    lString.add(strDeviceManager);
    lLetter.add("d");
    lString.add(strDiskManager);
    lLetter.add("r");
    lString.add(strRegistryEditor);
    lLetter.add("j");
    lString.add(strCalculator);
    lLetter.add("n");
    lString.add(strNotepad);
    lLetter.add("h/p");
    lString.add(strPaint);
    lLetter.add("w/x");
    lString.add(strWrite);
    lLetter.add("b/l");
    lString.add(strBrowser);
    govTouch = (GestureOverlayView) findViewById(R.id.gov_touch);
    govTouch.setGestureStrokeType(GestureOverlayView.GESTURE_STROKE_TYPE_MULTIPLE);
    govTouch.setFadeOffset(1500);
    govTouch.setGestureColor(Color.WHITE);
    govTouch.setGestureStrokeWidth(20);
    govTouch.addOnGesturePerformedListener(new GestureOverlayView.OnGesturePerformedListener() {

        @Override
        public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
            ArrayList<Prediction> predictions = mGestureLib
                    .recognize(gesture);
            if (predictions.size() > 0) {
                Prediction prediction = predictions.get(0);
                if (prediction.score > 1.0) {
                    String tmp = GestureUtil.getCommand(prediction.name);
                    if (!tmp.equals("")) {
                        sendMessage("remote", tmp);
                    }
                }
            }
        }
    });
    if (mGestureLib == null) {
        mGestureLib = GestureLibraries.fromRawResource(this, R.raw.gestures);
        mGestureLib.load();
    }
    btnGestureProblem = (LinearLayout) findViewById(R.id.btn_gesture_problem);
    btnGestureProblem.setOnClickListener(this);
    btnBack = (Button) findViewById(R.id.btn_back);
    btnBack.setOnClickListener(this);
}
 
开发者ID:1anc3r,项目名称:AirFree-Client,代码行数:63,代码来源:GestureActivity.java


示例11: TouchGesturesLoader

import android.gesture.GestureLibraries; //导入依赖的package包/类
public TouchGesturesLoader(Context context) {
    super(context);
    this.mLibrary = GestureLibraries.fromFile(GestureManager.TOUCH_GESTURES_FILE);
    this.mListener = new TouchGesturesChangedListener();

    this.mWidth = context.getResources().getDimensionPixelSize(R.dimen.gesture_icon_width);
    this.mHeight = context.getResources().getDimensionPixelSize(R.dimen.gesture_icon_height);
    this.mColor = context.getResources().getColor(R.color.accent);
    this.mInset = context.getResources().getDimensionPixelOffset(R.dimen.gesture_thumbnail_inset);
}
 
开发者ID:alexstyl,项目名称:Touch-Control,代码行数:11,代码来源:TouchGesturesLoader.java


示例12: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_overlay_new);
    blurBackground();
    mOverlay = (GestureOverlayView) findViewById(R.id.gesture_overlay);

    if (mLibrary == null) {
        mLibrary = GestureLibraries.fromFile(GestureManager.TOUCH_GESTURES_FILE);
    }
    if (!mLibrary.load()) {
        finish();
    }
}
 
开发者ID:alexstyl,项目名称:Touch-Control,代码行数:15,代码来源:SimpleOverlayActivity.java


示例13: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_unlockwithgesture);
    GestureOverlayView view = (GestureOverlayView) findViewById(R.id.gestureOverlayView);
    view.addOnGestureListener(new GestureProcessor());
    File gestureFile = new File(Environment.getDataDirectory() + "/data/" + getPackageName(), AppLockApplication.GESTUREFILE);
    library = GestureLibraries.fromFile(gestureFile);
    Bundle bundle = getIntent().getExtras();
    mPackage = bundle.getString(Intent.EXTRA_TEXT);
    unlockSelf = bundle.getBoolean(AppLockApplication.UNLOCK_SELF);
    changeLock = false;
    changeLock = bundle.getBoolean(AppLockApplication.CHANGELOCK);
}
 
开发者ID:adarshahd,项目名称:SimpleAppLock,代码行数:15,代码来源:UnlockWithGesture.java


示例14: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    changeLock = getIntent().getBooleanExtra(AppLockApplication.CHANGELOCK, false);
    String message = changeLock ? getString(R.string.change_gesture) : getString(R.string.create_gesture);
    setContentView(R.layout.layout_unlockwithgesture);
    File gestureFile = new File(Environment.getDataDirectory() + "/data/" + getPackageName(), AppLockApplication.GESTUREFILE);
    GestureOverlayView gestureOverlayView = (GestureOverlayView) findViewById(R.id.gestureOverlayView);
    gestureOverlayView.addOnGestureListener(new GestureProcessor());
    findViewById(R.id.id_ll_icon).setVisibility(View.GONE);
    findViewById(R.id.id_btn_forgot_gesture).setVisibility(View.GONE);
    ((TextView)findViewById(R.id.tv_unlock_message)).setText(message);
    first = true;
    library = GestureLibraries.fromFile(gestureFile);
}
 
开发者ID:adarshahd,项目名称:SimpleAppLock,代码行数:16,代码来源:SetupGestureLock.java


示例15: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gesture_detect);
    gestureOverlayView = (GestureOverlayView)findViewById(R.id.gestures);
  
    gestureLibrary = GestureLibraries.fromFile(Environment.getExternalStorageDirectory()+"/Ultra Explorer/gestures");
    gestureLibrary.load();
  
    gestureOverlayView.addOnGesturePerformedListener(gesturePerformedListener);
}
 
开发者ID:kshark27,项目名称:UltraExplorer,代码行数:13,代码来源:GestureMonitorActivity.java


示例16: onCreate

import android.gesture.GestureLibraries; //导入依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	GestureOverlayView gestureOverlayView = new GestureOverlayView(this);
	View inflate = getLayoutInflater().inflate(R.layout.main, null);
	gestureOverlayView.addView(inflate);
	gestureOverlayView.addOnGesturePerformedListener(this);
	gestureLib = GestureLibraries.fromRawResource(this, R.raw.gestures);
	if (!gestureLib.load()) {
		finish();
	}
	setContentView(gestureOverlayView);
}
 
开发者ID:vogellacompany,项目名称:codeexamples-android,代码行数:15,代码来源:GestureTest.java


示例17: init

import android.gesture.GestureLibraries; //导入依赖的package包/类
private static void init (Context context) {		
	if (glib == null) {
		glib = GestureLibraries.fromRawResource(context, R.raw.gestures);
		glib.load();
	}
}
 
开发者ID:gmud,项目名称:bbsbrowser_android,代码行数:7,代码来源:UserUtil.java


示例18: CreateTheLayout

import android.gesture.GestureLibraries; //导入依赖的package包/类
@SuppressWarnings("static-access")
public void CreateTheLayout() {

	context = this;

	mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
	twifi = (WifiManager) getSystemService(Lock.WIFI_SERVICE);
	cm = (ConnectivityManager) context
			.getSystemService(context.CONNECTIVITY_SERVICE);
	am = (AudioManager) getSystemService(context.AUDIO_SERVICE);

	manager = (TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
	carrierName = manager.getNetworkOperatorName();
	carrier = (TextView) findViewById(R.id.textView2);
	carrier.setText(carrierName.toUpperCase());

	pm = context.getPackageManager();

	gLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);
	gOverlay = (GestureOverlayView) findViewById(R.id.gestureOverlayView1);
	gOverlay.addOnGesturePerformedListener(this);

	battery = (TextView) findViewById(R.id.battery);
	Date = (TextView) findViewById(R.id.date);
	Time = (TextView) findViewById(R.id.time);
	text = (TextView) findViewById(R.id.texts);
	data = (TextView) findViewById(R.id.textView4);
	msgs = (TextView) findViewById(R.id.textView7);
	calls = (TextView) findViewById(R.id.textView5);
	bluetooth = (TextView) findViewById(R.id.textView3);
	wifi = (TextView) findViewById(R.id.textView1);
	sound = (TextView) findViewById(R.id.textView6);
	whats = (TextView) findViewById(R.id.textView8);
	pmm = (TextView) findViewById(R.id.pm);


	policyManager = (DevicePolicyManager) context
			.getSystemService(Context.DEVICE_POLICY_SERVICE);
	adminReceiver = new ComponentName(context, DeviceAdmin.class);
	admin = policyManager.isAdminActive(adminReceiver);

	r0 = (TableLayout) findViewById(R.id.r0);
	r0.setDrawingCacheEnabled(true);
	r0.buildDrawingCache();

	v1 = (View)findViewById(R.id.v1);
	v2 = (View)findViewById(R.id.v2);
}
 
开发者ID:Pi-Developers,项目名称:Pi-Locker,代码行数:49,代码来源:Lock.java


示例19: getGestureLibrary

import android.gesture.GestureLibraries; //导入依赖的package包/类
public static GestureLibrary getGestureLibrary(Context context) {
	if (sGestureLibrary == null)
		sGestureLibrary = GestureLibraries.fromFile(getGestureFile(context));
	return sGestureLibrary;
}
 
开发者ID:AndrewMurrell,项目名称:minak,代码行数:6,代码来源:SettingsUtil.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UTF8Encoding类代码示例发布时间:2022-05-21
下一篇:
Java GetNewApplicationRequest类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap