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


C# RelativeLayout.SetOnTouchListener方法代码示例

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


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

示例1: OnCreate

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Game);

			layMain = FindViewById<RelativeLayout> (Resource.Id.LayoutMain);
			layMain.SetOnTouchListener (this);


			SaveOtions.ReadFromFile ();

			textScore = FindViewById<TextView> (Resource.Id.textView1);

			obrazekSmile = FindViewById<ImageView> (Resource.Id.imageView1);

			casovac = new System.Timers.Timer();
			casovac.AutoReset = true;
			casovac.Elapsed += HandleElapsed;


		}
开发者ID:OndrejMikulec,项目名称:Buttons,代码行数:23,代码来源:Game.cs

示例2: OnCreateView

                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return null;
                    }

                    MediaController = new MediaController( Rock.Mobile.PlatformSpecific.Android.Core.Context );

                    RelativeLayout view = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    view.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                    view.SetBackgroundColor( Android.Graphics.Color.Black );
                    view.SetOnTouchListener( this );

                    VideoPlayer = new VideoView( Activity );
                    VideoPlayer.SetMediaController( MediaController );
                    VideoPlayer.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent );
                    ( (RelativeLayout.LayoutParams)VideoPlayer.LayoutParameters ).AddRule( LayoutRules.CenterInParent );

                    ( ( view as RelativeLayout ) ).AddView( VideoPlayer );

                    VideoPlayer.SetOnPreparedListener( this );
                    VideoPlayer.SetOnErrorListener( this );

                    ProgressBar = new ProgressBar( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ProgressBar.Indeterminate = true;
                    ProgressBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) );
                    ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent );
                    ( (RelativeLayout.LayoutParams)ProgressBar.LayoutParameters ).AddRule( LayoutRules.CenterInParent );
                    view.AddView( ProgressBar );
                    ProgressBar.BringToFront();

                    ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { TryPlayMedia( ); } );

                    return view;
                }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:37,代码来源:NotesWatchFragment.cs

示例3: OnCreateView

                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    base.OnCreateView( inflater, container, savedInstanceState );

                    // get the root control from our .axml
                    var layout = inflater.Inflate(Resource.Layout.Notes, container, false) as RelativeLayout;

                    // get the refresh button from the layout
                    RefreshButton = layout.FindViewById<Button>( Resource.Id.refreshButton );

                    // create our overridden lockable scroll view
                    ScrollView = new LockableScrollView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ScrollView.ScrollBarStyle = ScrollbarStyles.InsideInset;
                    ScrollView.OverScrollMode = OverScrollMode.Always;
                    ScrollView.VerticalScrollbarPosition = ScrollbarPosition.Default;
                    ScrollView.LayoutParameters = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                    ScrollView.Notes = this;
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.CenterHorizontal);
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.Below, Resource.Id.refreshButton);

                    // add it to our main layout.
                    layout.AddView( ScrollView );

                    Indicator = layout.FindViewById<ProgressBar>( Resource.Id.progressBar );
                    Indicator.Visibility = ViewStates.Gone;
                    Indicator.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) );
                    Indicator.BringToFront();

                    // create the layout that will contain the notes
                    ScrollViewLayout = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ScrollView.AddView( ScrollViewLayout );
                    ScrollViewLayout.SetOnTouchListener( this );

                    RefreshButton.Click += (object sender, EventArgs e ) =>
                    {
                        DeleteNote( );

                        PrepareCreateNotes(  );
                    };

                    // if the refresh button isn't enabled, hide it
                    if ( App.Shared.Network.RockGeneralData.Instance.Data.DeveloperModeEnabled == false )
                    {
                        RefreshButton.Visibility = ViewStates.Gone;
                    }

                    // get our power management control
                    PowerManager pm = PowerManager.FromContext( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Notes");

                    ResultView = new UIResultView( layout, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), OnResultViewDone );

                    ResultView.Hide( );

                    // setup the tutorial overlay
                    TutorialBacker = new View( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    TutorialBacker.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                    TutorialBacker.Alpha = 0;
                    TutorialBacker.SetBackgroundColor( Android.Graphics.Color.Black );
                    layout.AddView( TutorialBacker );

                    AnimatingTutorial = false;
                    TutorialOverlay = new ImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    TutorialOverlay.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent );
                    ((RelativeLayout.LayoutParams)TutorialOverlay.LayoutParameters ).AddRule( LayoutRules.CenterInParent );
                    TutorialOverlay.Alpha = 0;
                    TutorialOverlay.SetBackgroundColor( Android.Graphics.Color.Transparent );
                    layout.AddView( TutorialOverlay );

                    NavBarRevealTracker = new NavBarReveal( );

                    return layout;
                }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:73,代码来源:NotesFragment.cs

示例4: OnCreateView

                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return null;
                    }

                    RelativeLayout view = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    view.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                    view.SetBackgroundColor( Android.Graphics.Color.Black );
                    view.SetOnTouchListener( this );

                    ProgressBar = new ProgressBar( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ProgressBar.Indeterminate = true;
                    ProgressBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) );
                    ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent );
                    ( (RelativeLayout.LayoutParams)ProgressBar.LayoutParameters ).AddRule( LayoutRules.CenterInParent );
                    view.AddView( ProgressBar );

                    // setup our media controller for viewing the position of media
                    MediaController = new MediaController( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    MediaController.SetAnchorView( view );

                    ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), 
                        delegate 
                        { 
                            // we know we're bound, so now just retry.
                            ResultView.Hide( );
                            PlayerState = MediaPlayerState.Preparing; 
                            StartAudio( );
                            SyncUI( );
                        });

                    return view;
                }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:36,代码来源:NotesListenFragment.cs

示例5: layoutSlidingTop

        private void layoutSlidingTop()
        {
            containerSliding = FindViewById<RelativeLayout> (Resource.Id.container);
            searchBox = FindViewById<EditText> (Resource.Id.search_box);
            listViewDrugStores = FindViewById<ListView> (Resource.Id.listview_drugstores);
            listViewDrugStores.OnItemClickListener = this;

            containerSliding.SetOnTouchListener (this);
            searchBox.AddTextChangedListener (this);

            handleSpinner ();

            //			listViewDrugStores.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
            //				googleMap.Clear ();
            //				drugLatitude = viewModel.list_drugstore [e.Position].latitude;
            //				drugLongitude = viewModel.list_drugstore [e.Position].longtitude;
            //				drugstoreMarker ();
            //			};
        }
开发者ID:JackNguyen-Developer,项目名称:TroLySo_YTe,代码行数:19,代码来源:MapController.cs


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