List of usage examples for android.view GestureDetector GestureDetector
public GestureDetector(Context context, OnGestureListener listener)
From source file:org.tomahawk.tomahawk_android.views.TomahawkScrollView.java
/** * Construct a {@link org.tomahawk.tomahawk_android.views.TomahawkScrollView} *//*from ww w .java 2 s . c om*/ public TomahawkScrollView(Context context) { super(context); mGestureDetector = new GestureDetector(context, new ShouldSwipeDetector()); }
From source file:it.jaschke.alexandria.BarcodeReaderActivity.java
@Override public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.barcode_capture); mPreview = (CameraPreview) findViewById(R.id.camera_preview); mGraphicOverlay = (GraphicOverlay<BarcodeGraphic>) findViewById(R.id.graphic_overlay); gestureDetector = new GestureDetector(this, new CaptureGestureListener()); createCameraSource();//w ww .ja v a2 s . c o m }
From source file:com.example.topnewgrid.choosephotos.choosephotos.photoviewer.photoviewerinterface.ViewPagerBitmapActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_view_pager_view); ViewPager mViewPager = (HackyViewPager) findViewById(R.id.view_pager); // setContentView(mViewPager); header = (RelativeLayout) findViewById(R.id.header); photoView = new PhotoView(this); receiveBmList = (List<Bitmap>) ApplicationContent.get("mImageBm"); this.index = this.getIntent().getIntExtra(CURRENT_INDEX, 0); mViewPager.setAdapter(new SamplePagerAdapter()); mViewPager.setCurrentItem(index);// w w w. ja va 2 s. c om tapGestureDetector = new GestureDetector(this, new TapGestureListener()); }
From source file:org.tomahawk.tomahawk_android.views.AlbumArtViewPager.java
public AlbumArtViewPager(Context context) { super(context); mGestureDetector = new GestureDetector(context, new ShouldSwipeDetector()); }
From source file:org.apache.cordova.core.Gesture.java
/** * Register a standardized gesture handler. * ('tap', 'swipe', 'handgrab', ...?) which basic gestures to standardize? * * @param name The name of the gesture handler * @param config Allow passing a JSON array of configuration parameters that we pass to the GestureHandler? *///from w w w . j av a2 s .co m public void registerGesture(String name) throws GestureInvalidExpection { TestWebView view = (TestWebView) webView; GestureDetector gesture; if (name.equals("tap")) { TestWebViewGesture listener = new TapListener(); listener.setWebView(view); gesture = new GestureDetector(cordova.getActivity(), listener); } else { throw new GestureInvalidExpection("The gesture " + name + " is not available"); } // Register touch handler... view.registerGestureHandler(name, gesture); LOG.d(LOG_TAG, "Registered event handler " + name); }
From source file:zuo.biao.library.base.BaseFragmentActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); //setContentView?ActivityonCreate gestureDetector = new GestureDetector(this, this);//?? }
From source file:pw.dedominic.airc.fragment.AddEditServerFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_addedit_server, null); final GestureDetector gesture = new GestureDetector(getActivity(), new LeftSwipeDetect(getActivity())); view.setOnTouchListener(new View.OnTouchListener() { @Override// www . j a va 2s . c o m public boolean onTouch(View v, MotionEvent event) { return gesture.onTouchEvent(event); } }); name = (EditText) view.findViewById(R.id.title_text); host = (EditText) view.findViewById(R.id.hostname_text); port = (EditText) view.findViewById(R.id.port_text); nick = (EditText) view.findViewById(R.id.nick_text); nick.setText(callback.getSettings().getDefaultNick()); pass = (EditText) view.findViewById(R.id.pass_text); nick_pass = (EditText) view.findViewById(R.id.nickpass_text); tls = (CheckBox) view.findViewById(R.id.tls_check); saveBtn = (Button) view.findViewById(R.id.save_button); cancelBtn = (Button) view.findViewById(R.id.cancel_button); saveBtn.setOnClickListener(this); cancelBtn.setOnClickListener(this); if (getArguments() != null) { editServer((Server) getArguments().get("editable")); } return view; }
From source file:org.tomahawk.tomahawk_android.views.AlbumArtViewPager.java
public AlbumArtViewPager(Context context, AttributeSet attrs) { super(context, attrs); mGestureDetector = new GestureDetector(context, new ShouldSwipeDetector()); }
From source file:org.tomahawk.tomahawk_android.views.TomahawkScrollView.java
/** * Construct a {@link org.tomahawk.tomahawk_android.views.TomahawkScrollView} *///from www. j av a 2s .c o m public TomahawkScrollView(Context context, AttributeSet attrs) { super(context, attrs); mGestureDetector = new GestureDetector(context, new ShouldSwipeDetector()); }
From source file:com.geekandroid.sdk.base.BaseActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); colorMatrix = new ColorMatrix(); mGestureDetector = new GestureDetector(this, this); }