Пример #1
0
        private void SplashInit()
        {
            NextButton        = FindViewById <ImageButton>(Resource.Id.next_button);
            SkipButton        = FindViewById <Button>(Resource.Id.skip_button);
            SkipButton.Click += SkipToEnd;;
            NextButton.Click += NextButton_Click;

            FindViewById <TextView>(Resource.Id.goto_login).Click += Goto_LoginPage;
            ConstraintLayout      pagesHolder     = FindViewById <ConstraintLayout>(Resource.Id.pages_holder);
            PagesGestureListener  gestureListener = new PagesGestureListener(this);
            GestureDetectorCompat gestureDetector = new GestureDetectorCompat(this, gestureListener);

            pagesHolder.SetOnTouchListener(new PagesGestureRecognizer(gestureDetector));
            FindViewById <ImageView>(Resource.Id.number_signup).Click   += PhoneImageViewBtn_Click;
            FindViewById <ImageView>(Resource.Id.google_signup).Click   += GoogleSignup_Click;
            FindViewById <ImageView>(Resource.Id.facebook_signup).Click += FacebookSignup_Click;
            FindViewById <ImageView>(Resource.Id.email_signup).Click    += EmailLayout_Click;
            SplashBaseLayout = FindViewById <RelativeLayout>(Resource.Id.base_layout);

            IndicatorLayout indicators = FindViewById <IndicatorLayout>(Resource.Id.indicatorLayout);

            indicators.NumberOfIndicators = 3;

            FastFitPath            = FindViewById <ImageView>(Resource.Id.fast_fit_path_imageview);
            FastFitInitialDrawable = FastFitPath.Drawable;
        }
Пример #2
0
        private void init(Context context, IAttributeSet attrs)
        {
            CoreUtility.ExecuteMethod("init", delegate()
            {
                mGestureListener    = new CustomGestureListener(this);
                mDragHelperCallback = new CustomViewDragHelper(this);

                if (attrs != null && context != null)
                {
                    TypedArray a = context.Theme.ObtainStyledAttributes(
                        attrs,
                        Resource.Styleable.SwipeRevealLayout,
                        0, 0
                        );

                    mDragEdge         = a.GetInteger(Resource.Styleable.SwipeRevealLayout_dragEdge, DRAG_EDGE_LEFT);
                    mMinFlingVelocity = a.GetInteger(Resource.Styleable.SwipeRevealLayout_flingVelocity, DEFAULT_MIN_FLING_VELOCITY);
                    mMode             = a.GetInteger(Resource.Styleable.SwipeRevealLayout_mode, MODE_NORMAL);

                    mMinDistRequestDisallowParent = a.GetDimensionPixelSize(
                        Resource.Styleable.SwipeRevealLayout_minDistRequestDisallowParent,
                        dpToPx(DEFAULT_MIN_DIST_REQUEST_DISALLOW_PARENT)
                        );
                }

                mDragHelper = ViewDragHelper.Create(this, 1.0f, mDragHelperCallback);
                mDragHelper.SetEdgeTrackingEnabled(ViewDragHelper.EdgeAll);

                mGestureDetector = new GestureDetectorCompat(context, mGestureListener);
            });
        }
Пример #3
0
        protected override void OnAttached()
        {
            // Get the Android View corresponding to the Element that the effect is attached to
            view = Control == null ? Container : Control;

            // Get access to the TouchEffect class in the .NET Standard library
            TouchTracking.TouchEffect touchEffect =
                (TouchTracking.TouchEffect)Element.Effects.
                FirstOrDefault(e => e is TouchTracking.TouchEffect);

            if (touchEffect != null && view != null)
            {
                formsElement = Element;

                libTouchEffect = touchEffect;

                // Save fromPixels function
                fromPixels = view.Context.FromPixels;

                tapDetector = new InternalGestureDetector
                {
                    TapAction = motionEvent =>
                    {
                        libTouchEffect.OnTapAction(formsElement);
                    },
                };

                gestureRecognizer = new GestureDetectorCompat(view.Context, tapDetector);

                // Set event handler on View
                view.Touch += OnTouch;
            }
        }
 public void Init()
 {
     mGestureListener = new mGesture();
     mGestureDetector = new GestureDetectorCompat(Context, mGestureListener);
     mCloseScroller = ScrollerCompat.Create(Context);
     mOpenScroller = ScrollerCompat.Create(Context);
 }
        public AndroidInputContext(View hostView,
                                   Context context,
                                   BaseInputHandler inputHandler,
                                   IDisplayMetrics displayMetrics)
        {
            _hostView           = hostView;
            _inputHandler       = inputHandler;
            _activeInputActions = InputAction.None;

            var viewConfig = ViewConfiguration.Get(context) ?? throw new NotSupportedException();

            _maximumFlingVelocity = viewConfig.ScaledMaximumFlingVelocity;
            _minimumFlingVelocity = viewConfig.ScaledMinimumFlingVelocity;

            _touchSlop = viewConfig.ScaledTouchSlop;


            if (displayMetrics.ZoomLevel.AreEqualEnough(1.0))
            {
                _dpiRatio          = 1;
                _isOffsetPositions = false;
            }
            else
            {
                _dpiRatio          = 1 / displayMetrics.ZoomLevel;
                _isOffsetPositions = true;
            }

            _gestureDetector = new GestureDetectorCompat(context, this);
            _gestureDetector.SetOnDoubleTapListener(this);

            hostView.SetOnTouchListener(this);
        }
Пример #6
0
        private void InitControl()
        {
            userDateTime = DateTime.Now;
            detector     = new GestureDetectorCompat(view.Context, new GestureListener()
            {
                GoNextMonth     = () => GoNextMonth(),
                GoPreviousMonth = () => GoPreviousMonth()
            });

            btnPrev        = view.FindViewById <ImageView>(Resource.Id.calendar_prev_button);
            btnNext        = view.FindViewById <ImageView>(Resource.Id.calendar_next_button);
            txtDateDay     = view.FindViewById <TextView>(Resource.Id.date_display_day);
            txtDateYear    = view.FindViewById <TextView>(Resource.Id.date_display_year);
            txtDisplayDate = view.FindViewById <TextView>(Resource.Id.date_display_date);
            txtInfo        = view.FindViewById <TextView>(Resource.Id.txtInfo);
            btnSelection   = view.FindViewById <Button>(Resource.Id.date_selection);
            btnToday       = view.FindViewById <Button>(Resource.Id.date_display_today);
            gridView       = view.FindViewById <ExpandableHeightGridView>(Resource.Id.calendar_grid);

            btnPrev.Click      += BtnPrev_Click;
            btnNext.Click      += BtnNext_Click;
            btnToday.Click     += BtnToday_Click;
            btnSelection.Click += BtnSelection_Click;
            gridView.IsExpanded = true;
            gridView.SetOnTouchListener(new TouchListener(detector));
        }
        public SwipeTouchListener(Context context)
        {
            var listener = new SwipeGestureListener();

            listener.Swiped += OnSwiped;

            gestureDetector = new GestureDetectorCompat(context, listener);
        }
Пример #8
0
        public OnSwipeTouchListener(Context ctx)
        {
            //GestureListener gestureListener = new GestureListener();
            GestureDetectorListener gestureListener = new GestureDetectorListener();

            gestureListener.SwipeEvent -= GestureListener_SwipeEvent;
            gestureListener.SwipeEvent += GestureListener_SwipeEvent;
            gestureDetector             = new GestureDetectorCompat(ctx, gestureListener);
        }
Пример #9
0
 private void Setup(Context context, IAttributeSet attrs, int defStyleAttr)
 {
     compactCalendarController = new CompactCalendarController(new Paint(), new OverScroller(context),
                                                               new Rect(), attrs, context, Color.Argb(255, 233, 84, 81),
                                                               Color.Argb(255, 64, 64, 64), Color.Argb(255, 219, 219, 219), VelocityTracker.Obtain());
     gestureListener  = new CalendarGestureListener(this);
     gestureDetector  = new GestureDetectorCompat(context, gestureListener);
     animationHandler = new AnimationHandler(compactCalendarController, this);
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.main_activity);

            mDismissOverlayView = FindViewById <DismissOverlayView> (Resource.Id.dismiss_overlay);
            mDismissOverlayView.SetIntroText(Resource.String.intro_text);
            mDismissOverlayView.ShowIntroIfNecessary();
            mGestureDetector = new GestureDetectorCompat(this, new LongPressListener(this));
        }
Пример #11
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.main_activity);

			mDismissOverlayView = FindViewById<DismissOverlayView> (Resource.Id.dismiss_overlay);
			mDismissOverlayView.SetIntroText (Resource.String.intro_text);
			mDismissOverlayView.ShowIntroIfNecessary ();
			mGestureDetector = new GestureDetectorCompat (this, new LongPressListener (this));
		}
Пример #12
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.main_activity);

			WatchViewStub stub = (WatchViewStub)FindViewById (Resource.Id.stub);
			stub.SetOnLayoutInflatedListener (this);

			dismissOverlayView = (DismissOverlayView)FindViewById (Resource.Id.dismiss_overlay);
			gestureDetector = new GestureDetectorCompat (this, new LongPressListener (this));
		}
Пример #13
0
        public PdfView(Context context, FormView.PDFView formView) : base(context)
        {
            SetupPaint();

            _formView              = formView;
            OnDoubleTapListener    = new TapManager(Context, this);
            _gestureManager        = new GestureManager(Context, this);
            _gestureDetectorCompat = new GestureDetectorCompat(Context, _gestureManager);
            _gestureDetectorCompat.SetOnDoubleTapListener(OnDoubleTapListener);
            _scaleDetector           = new ScaleGestureDetector(Context, new ScaleManager(this));
            _onPdfPageRenderListener = new OnPdfPageRenderListener(this, false);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.main_activity);

            WatchViewStub stub = (WatchViewStub)FindViewById(Resource.Id.stub);

            stub.SetOnLayoutInflatedListener(this);

            dismissOverlayView = (DismissOverlayView)FindViewById(Resource.Id.dismiss_overlay);
            gestureDetector    = new GestureDetectorCompat(this, new LongPressListener(this));
        }
Пример #15
0
        private void AttachedGestureListener()
        {
            var context = Context;

            _displayMetrics      = context.Resources.DisplayMetrics;
            _tapDetector.Density = _displayMetrics.Density;

            if (_gestureRecognizer == null)
            {
                _gestureRecognizer = new GestureDetectorCompat(context, _tapDetector);
            }

            Touch += ControlOnTouch;
        }
        /// <summary>
        /// Attaches the touch events ascociated with a Tap
        /// called after the effect is attached to the view
        /// </summary>
        protected override void OnAttached()
        {
            var control = Control ?? Container;

            var context = control.Context;

            displayMetrics = context.Resources.DisplayMetrics;
            //tapDetector.Density = displayMetrics.Density;
            if (gestureRecognizer == null)
            {
                gestureRecognizer = new GestureDetectorCompat(context, tapDetector);
            }
            control.Touch += ControlOnTouch;

            OnElementPropertyChanged(new PropertyChangedEventArgs(String.Empty));
        }
        private void Init()
        {
            MIN_FLING     = Dp2px(15);
            MAX_VELOCITYX = -Dp2px(500);

            LayoutParameters = (new AbsListView.LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent));
            mGestureListener = new GestureListerner(this);
            mGestureDetector = new GestureDetectorCompat(Context, mGestureListener);

            // mScroller = ScrollerCompat.create(getContext(), new
            // BounceInterpolator());
            if (mCloseInterpolator != null)
            {
                mCloseScroller = ScrollerCompat.Create(Context, mCloseInterpolator);
            }
            else
            {
                mCloseScroller = ScrollerCompat.Create(Context);
            }
            if (mOpenInterpolator != null)
            {
                mOpenScroller = ScrollerCompat.Create(Context, mOpenInterpolator);
            }
            else
            {
                mOpenScroller = ScrollerCompat.Create(Context);
            }

            LayoutParams contentParams = new LayoutParams(
                LayoutParams.MatchParent, LayoutParams.WrapContent);

            ContentView.LayoutParameters = (contentParams);
            if (ContentView.Id < 1)
            {
                ContentView.Id = CONTENT_VIEW_ID;
            }

            MenuView.Id = (MENU_VIEW_ID);
            MenuView.LayoutParameters = new LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);

            AddView(ContentView);
            AddView(MenuView);
        }
Пример #18
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here

            // Activityテーマを設定
            base.SetTheme(Resource.Style.ARActivityTheme);

            // 説明文を表示
            SetContentView(Resource.Layout.OverlayView);
            var textView = FindViewById <TextView>(Resource.Id.textView1);
            var label    = GetString(Resource.String.marker_description);

            textView.SetText(label, TextView.BufferType.Normal);

            // フェードアウト処理
            Animation.FadeOut(textView);

            GestureDetect         = new GestureDetectorCompat(this, this);
            ScaleGestureDetect    = new ScaleGestureDetector(this, this);
            RotationGestureDetect = new RotationGestureDetector(this);
        }
Пример #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            base.OnCreate(savedInstanceState);

            SetContentView(LayoutId);

            gestureDetector = new GestureDetectorCompat(this, new WindowGestureListener(this));

            nextButton = FindViewById(Resource.Id.next);

            doneButton = FindViewById(Resource.Id.done);

            skipButton = FindViewById(Resource.Id.skip);

            backButton = FindViewById(Resource.Id.back);

            _vibrator = (Vibrator)this.GetSystemService(VibratorService);

            _pagerAdapter = new PagerAdapter(SupportFragmentManager, fragments);

            _pager = (AppIntroViewPager)FindViewById(Resource.Id.view_pager);

            doneButton.Click += DoneButtonOnClick;

            skipButton.Click += SkipButtonOnClick;

            nextButton.Click += NextButtonOnClick;

            backButton.Click += BackButtonOnClick;

            _pager.Adapter = _pagerAdapter;
            _pager.AddOnPageChangeListener(new PagerOnPageChangeListener(this));
            _pager.SetOnNextPageRequestedListener(this);
            SetScrollDurationFactor(DEFAULT_SCROLL_DURATION_FACTOR);
        }
Пример #20
0
 public CustomMDPRenderer()
     : base()
 {
     mDetector = new GestureDetectorCompat(Context, new MyGestureListener(this));
 }
Пример #21
0
 public TouchListener(GestureDetectorCompat detector)
 {
     this.detector = detector;
 }
Пример #22
0
 public RecyclerItemClickListener(Context context)
 {
     _getstureDetector = new GestureDetectorCompat(context, new SingleTap());
 }
Пример #23
0
 public MyMasterDetailPageRenderer() : base()
 {
     this.mDetector = new GestureDetectorCompat(Context, new MyGestureListener(this));
 }
 public RecyclerViewItemOnItemTouchListener(RecyclerView rv, RecyclerViewItemOnGestureListener simpleOnGestureListener)
 {
     m_RecyclerView    = rv;
     m_GestureDetector = new GestureDetectorCompat(rv.Context, simpleOnGestureListener);
 }
Пример #25
0
 public MyMasterDetailPageRenderer()
     : base()
 {
     this.mDetector = new GestureDetectorCompat(Context, new MyGestureListener(this));
 }
Пример #26
0
 public PagesGestureRecognizer(GestureDetectorCompat detector)
 {
     Detector = detector;
 }
Пример #27
0
        public RecyclerItemClickListener(Context context, RecyclerView recyclerView, IOnRecyclerClickListener listener)
        {
            mListener = listener;

            mGestureDetector = new GestureDetectorCompat(context, new GestureListener(mListener, recyclerView));
        }