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


Java GestureDetectorCompat.setOnDoubleTapListener方法代码示例

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


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

示例1: Attacher

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
 
开发者ID:lanyuanxiaoyao,项目名称:PicKing,代码行数:17,代码来源:Attacher.java

示例2: initTracker

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
private void initTracker() {
    if (!Utils.hasExternalStoragePermission(this)) {
        ActivityCompat.requestPermissions(
                this,
                new String[] {
                        Manifest.permission.READ_EXTERNAL_STORAGE,
                        Manifest.permission.WRITE_EXTERNAL_STORAGE
                },
                Constants.REQUEST_CODE_PERMISSION_EXTERNAL_STORAGE);
    }

    // TODO(youngseokyoon): consolidate the Tracker into UserActionLogger
    mLogger = UserActionLogger.getInstance(this);
    mGestureListener = new GestureListener(this);
    mGestureDetector = new GestureDetectorCompat(this, mGestureListener);
    mGestureDetector.setOnDoubleTapListener(mGestureListener);
}
 
开发者ID:vanadium-archive,项目名称:reader,代码行数:18,代码来源:BaseReaderActivity.java

示例3: Attacher

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override
                public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
 
开发者ID:gzsll,项目名称:TLint,代码行数:18,代码来源:Attacher.java

示例4: onCreate

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_unlock);

    mDetector = new GestureDetectorCompat(this, this);
    // Set the gesture detector as the double tap
    // listener.
    mDetector.setOnDoubleTapListener(this);

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
 
开发者ID:Jayant11,项目名称:LockScreen-Oreo,代码行数:13,代码来源:UnlockActivity.java

示例5: Window

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public Window(MainService context, int contentView){

        this.context = context;

        LayoutInflater inflater = (LayoutInflater) this.context.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        windowManager = (WindowManager) this.context.getSystemService(Context.WINDOW_SERVICE);
        window = inflater.inflate(R.layout.window, null);
        mRealDisplaySize = this.context.getRealDisplaySize();
        params = getDefaultParams();

        WindowView mWindowView = (WindowView) window.findViewById(R.id.window_view);
        ResizeView mResizeView = (ResizeView) window.findViewById(R.id.resize_view);
        mWindowView.setWindowListener(this);
        mResizeView.setWindowListener(this);
        GestureDetectorCompat detectorCompat = new GestureDetectorCompat(context, this);
        detectorCompat.setOnDoubleTapListener(this);
        mWindowView.setDetector(detectorCompat);

        RelativeLayout relativeLayout = (RelativeLayout) window.findViewById(R.id.content_view);
        relativeLayout.addView(inflater.inflate(contentView, relativeLayout, false));

        windowManager.addView(window, params);

        // Hacky way to check if we are fullscreen
        WindowManager.LayoutParams p = new WindowManager.LayoutParams();
        p.width = 1;
        p.height = WindowManager.LayoutParams.MATCH_PARENT;
        p.type = WindowManager.LayoutParams.TYPE_PHONE;
        p.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
        p.format = PixelFormat.TRANSPARENT;
        p.gravity = Gravity.END | Gravity.TOP;
        mHeightView = new View(context);
        windowManager.addView(mHeightView, p);
    }
 
开发者ID:0x1bad1d3a,项目名称:Kaku,代码行数:36,代码来源:Window.java

示例6: onCreate

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
public void onCreate(SurfaceHolder surfaceHolder) {
    super.onCreate(surfaceHolder);
    drawScript = new LWQSurfaceHolderDrawScript(surfaceHolder);
    gestureDetectorCompat = new GestureDetectorCompat(LWQWallpaperService.this, this);
    gestureDetectorCompat.setOnDoubleTapListener(this);
    EventBus.getDefault().register(this);
    LWQWallpaperController wallpaperController = LWQWallpaperControllerHelper.get();
    if (!wallpaperController.activeWallpaperLoaded()) {
        wallpaperController.retrieveActiveWallpaper();
    }
}
 
开发者ID:stanidesis,项目名称:quotograph,代码行数:13,代码来源:LWQWallpaperService.java

示例7: init

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
/**
 * initializes standards
 */
private void init() {
	background = new Paint();
	background.setColor(Color.rgb(57,75,133));

	lines = new Paint();
	lines.setColor(Color.rgb(243,173,30));

	buttons = new Paint();
	buttons.setColor(Color.WHITE);

	// point in time text
	pitText = new Paint();
	pitText.setTextAlign(Paint.Align.LEFT);
	pitText.setColor(Color.LTGRAY);
	pitText.setTextSize(50);
	
	// point in time + time frame text
	pitplusText = new Paint();
	pitplusText.setTextAlign(Paint.Align.RIGHT);
	pitplusText.setColor(Color.LTGRAY);
	pitplusText.setTextSize(50);

	// time frames text
	tfText = new Paint();
	tfText.setTextAlign(Paint.Align.CENTER);
	tfText.setColor(Color.LTGRAY);
	tfText.setTextSize(50);
	
	selectedTfText = new Paint();
	selectedTfText.setTextAlign(Paint.Align.CENTER);
	selectedTfText.setColor(Color.BLACK);
	selectedTfText.setTextSize(50);

	detector = new GestureDetectorCompat(this.getContext(), this);
	detector.setOnDoubleTapListener(this);

	Log.d(TAG, "created");
}
 
开发者ID:lkastler,项目名称:Timeslider,代码行数:42,代码来源:TimesliderView.java

示例8: onCreate

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "onCreate");
    /** NO_TITLE  SCREEN_ON   FULLSCREEN */
    Window win = getWindow();
    win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    win.requestFeature(Window.FEATURE_NO_TITLE);
    /**摄像头方向*/
    isOritationLanscape = getIntent().getBooleanExtra("oritation_landscape", false);
    if (isOritationLanscape) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        setContentView(R.layout.activity_streaming_landscape);
    } else {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        setContentView(R.layout.activity_streaming_portrait);
    }
    /**推流视频宽度*/
    mVideoWidth = getIntent().getIntExtra("res_w", 1280);
    /**推流视频高度*/
    mVideoHeight = getIntent().getIntExtra("res_h", 720);
    /**视频帧率*/
    mFrameRate = getIntent().getIntExtra("frame_rate", 15);
    /**视频码率*/
    mBitrate = getIntent().getIntExtra("bitrate", 1024) * 1000;
    /**推流地址*/
    mStreamingUrl = getIntent().getStringExtra("push_url");

    initUIElements();

    /**摄像头为前置摄像头*/
    mCurrentCamera = LiveConfig.CAMERA_FACING_FRONT;
    /**是否开始散光灯*/
    isFlashOn = false;
    initUIEventHandler();
    /**推流状态的监听*/
    initStateListener();
    /**初始化推流会话*/
    initRTMPSession(mCameraView.getHolder());

    mDetector = new GestureDetectorCompat(this, this);
    mDetector.setOnDoubleTapListener(this);
}
 
开发者ID:LiuJunb,项目名称:Android-LSS,代码行数:45,代码来源:StreamingActivity.java

示例9: onCreate

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_locked_screen);


        startService(new Intent(this, LockScreenService.class).setAction(Intent.ACTION_SYNC));
        if (!isMyServiceRunning(LockScreenService.class)) {
            startService(new Intent(this, LockScreenService.class).setAction(Intent.ACTION_SYNC));
        }

        this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);


   /*
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

       View view = (View) findViewById(R.id.layout);
        view.startAnimation(AnimationUtils.loadAnimation(
                context, R.anim.right_out;
        ));
*/
        // Instantiate the gesture detector with the
        // application context and an implementation of
        // GestureDetector.OnGestureListener
        mDetector = new GestureDetectorCompat(this, this);
        // Set the gesture detector as the double tap
        // listener.
        mDetector.setOnDoubleTapListener(this);


        txtTime = (TextView) findViewById(R.id.textClock2);
        TimeFace = Typeface.createFromAsset(getAssets(), "Roboto-Light.ttf");
        txtTime.setTypeface(TimeFace);
        txtDate = (TextView) findViewById(R.id.date);
        batteryStatus = (TextView) findViewById(R.id.test);

        this.mHandler = new Handler();
        this.mHandler.postDelayed(m_Runnable, 500);

        init();
        reset();
    }
 
开发者ID:Jayant11,项目名称:LockScreen-Oreo,代码行数:45,代码来源:LockedScreen.java

示例10: ItemGestureListener

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public ItemGestureListener(Context context, Item item, ItemGestureCallback callback) {
    detector = new GestureDetectorCompat(context, this);
    detector.setOnDoubleTapListener(this);
    this.item = item;
    this.callback = callback;
}
 
开发者ID:OpenLauncherTeam,项目名称:openlauncher,代码行数:7,代码来源:ItemGestureListener.java

示例11: init

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
private void init(Context context){
    mDetector = new GestureDetectorCompat(context, this);
    mDetector.setOnDoubleTapListener(this);
}
 
开发者ID:0x1bad1d3a,项目名称:Kaku,代码行数:5,代码来源:ResizeView.java

示例12: onCreate

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
  protected void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      won = false;
      setTitle("2048");
      setContentView(R.layout.activity_main);
      SharedPreferences data =
          getSharedPreferences("com.jbapps.twenty48", MODE_PRIVATE);
      highScore = data.getInt("highScore", 0);
      model = new Model();
      textView1 = (TextView)findViewById(R.id.textView1);
      textView2 = (TextView)findViewById(R.id.textView2);
      textView3 = (TextView)findViewById(R.id.textView3);
      textView4 = (TextView)findViewById(R.id.textView4);
      textView5 = (TextView)findViewById(R.id.textView5);
      textView6 = (TextView)findViewById(R.id.textView6);
      textView7 = (TextView)findViewById(R.id.textView7);
      textView8 = (TextView)findViewById(R.id.textView8);
      textView9 = (TextView)findViewById(R.id.textView9);
      textView10 = (TextView)findViewById(R.id.textView10);
      textView11 = (TextView)findViewById(R.id.textView11);
      textView12 = (TextView)findViewById(R.id.textView12);
      textView13 = (TextView)findViewById(R.id.textView13);
      textView14 = (TextView)findViewById(R.id.textView14);
      textView15 = (TextView)findViewById(R.id.textView15);
      textView16 = (TextView)findViewById(R.id.textView16);
      scoreView = (TextView)findViewById(R.id.textView17);
      highScoreView = (TextView)findViewById(R.id.textView18);
      textViews = new ArrayList<TextView>();
      textViews.add(textView1);
      textViews.add(textView2);
      textViews.add(textView3);
      textViews.add(textView4);
      textViews.add(textView5);
      textViews.add(textView6);
      textViews.add(textView7);
      textViews.add(textView8);
      textViews.add(textView9);
      textViews.add(textView10);
      textViews.add(textView11);
      textViews.add(textView12);
      textViews.add(textView13);
      textViews.add(textView14);
      textViews.add(textView15);
      textViews.add(textView16);
      mDetector = new GestureDetectorCompat(this, this);
      mDetector.setOnDoubleTapListener(this);
      GridLayout gridLayout = (GridLayout) findViewById(R.id.gridLayout1);
      gridLayout.addOnLayoutChangeListener(new OnLayoutChangeListener() {
	@Override
	public void onLayoutChange(View view, int arg1, int arg2, int arg3,
			int arg4, int arg5, int arg6, int arg7, int arg8) {
		int sideLength;
		if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
			sideLength = view.getWidth() / 4;
		} else {
			sideLength = view.getHeight() / 4;
		}
		for (TextView text : textViews)
        {
            text.setWidth(sideLength);
            text.setHeight(sideLength);
            text.setGravity(Gravity.CENTER);
        }
	}
});
      update();
  }
 
开发者ID:mrjbanksy,项目名称:twenty48,代码行数:70,代码来源:MainActivity.java

示例13: TouchGestureDetector

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public TouchGestureDetector(Context context, OnTouchGestureListener listener) {
	mGestureDetector = new GestureDetectorCompat(context, listener);
	mGestureDetector.setOnDoubleTapListener(listener);
	mScaleGestureDetector = new ScaleGestureDetector(context, listener);
	ScaleGestureDetectorCompat.setQuickScaleEnabled(mScaleGestureDetector, false);
}
 
开发者ID:yrom,项目名称:AcFun-Area63,代码行数:7,代码来源:TouchGestureDetector.java

示例14: onCreate

import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    Log.d(TAG, "=== Starting demo");

    // comment the following two lines if the log is too verbose
    SystemOutLogProvider prov = new SystemOutLogProvider();
    com.lightstreamer.client.LightstreamerClient.setLoggerProvider(prov);
    
    checkPlayServices();
    
    String serverAddress = getResources().getString(R.string.host);
    String adapterName = "DEMO";
    String senderId = getResources().getString(R.string.sender_id);
    LsClient.instance.initClient(serverAddress, adapterName, getApplicationContext(), senderId);

    GestureControls gs = new GestureControls();
    mDetector = new GestureDetectorCompat(this,gs);
    mDetector.setOnDoubleTapListener(gs);
    
    this.handler = new Handler();
    
    getSupportActionBar().setTitle(R.string.lightstreamer);
    
    setContentView(R.layout.stocks);

    if (findViewById(R.id.fragment_container) != null) {
        
        //single fragment view (phone)

        if (savedInstanceState != null) {
            return;
        }

        StocksFragment firstFragment = new StocksFragment();

        firstFragment.setArguments(getIntent().getExtras());

        getSupportFragmentManager().beginTransaction()
                .add(R.id.fragment_container, firstFragment).commit();
    }
}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-MPNStockList-client-android,代码行数:44,代码来源:StockListDemo.java


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