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


C# ListView.SetOnTouchListener方法代码示例

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


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

示例1: OnCreate

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

			_listView = FindViewById <ListView> (Resource.Id.teams);

			var touchListener = new SwipeDismissListViewTouchListener (_listView, 
				                    (ViewModel as TeamsViewModel).RemoveTeamCommand);
			_listView.SetOnTouchListener (touchListener);
			_listView.SetOnScrollListener (touchListener);

			var bindingSet = this.CreateBindingSet<TeamsView, TeamsViewModel> ();
			bindingSet.Bind (this).For (view => view.UndoBarData).To (vm => vm.UndoBarMetaData);
			bindingSet.Apply ();
		}
开发者ID:fatelord,项目名称:chgk,代码行数:15,代码来源:TeamsView.cs

示例2: OnCreate

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

            SetContentView (Resource.Layout.AllTotems);

            //Action bar
            InitializeActionBar (SupportActionBar);
            title = ActionBarTitle;
            query = ActionBarQuery;
            search = ActionBarSearch;
            back = ActionBarBack;

            totemList = _appController.Totems;

            totemAdapter = new TotemAdapter (this, totemList);
            allTotemListView = FindViewById<ListView> (Resource.Id.all_totem_list);
            allTotemListView.Adapter = totemAdapter;
            allTotemListView.FastScrollEnabled = true;

            title.Text = "Totems";
            query.Hint = "Zoek totem";

            //hide keyboard when scrolling through list
            allTotemListView.SetOnTouchListener(new MyOnTouchListener(this, query));

            LiveSearch ();

            _appController.detailMode = AppController.DetailMode.NORMAL;

            allTotemListView.ItemClick += ShowDetail;

            search.Visibility = ViewStates.Visible;
            search.Click += (sender, e) => ToggleSearch ();

            //hide keybaord when enter is pressed
            query.EditorAction += (sender, e) => {
                if (e.ActionId == ImeAction.Search)
                    KeyboardHelper.HideKeyboard(this);
                else
                    e.Handled = false;
            };
        }
开发者ID:FrederickEskens,项目名称:Totem,代码行数:43,代码来源:TotemsActivity.cs

示例3: OnCreate

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

            // Get employee
            EmployeeNumber= Intent.GetStringExtra("EmployeeNumber");
            selectedEmployee = EmployeeManagement.GetInstance().Employees.Where(L => L.Number == EmployeeNumber).FirstOrDefault();
            if (selectedEmployee == null) return;

            // Set up Listview
            SetContentView(Resource.Layout.CheckLogMaster);
            LogAdapter = new LogAdapter(this, selectedEmployee);
            listView = FindViewById<ListView>(Resource.Id.checklogs);
            listView.Adapter = LogAdapter;

            var LogName = this.FindViewById<TextView>(Resource.Id.NameForLog);
            LogName.Text = selectedEmployee.Name.ToString();

            var TotalHours = this.FindViewById<TextView>(Resource.Id.TotalHour);
            TotalHours.Text = "Total Hours: " + selectedEmployee.TotalHours;

            //editButton = this.FindViewById<Button>(Resource.Id.EditButton);
            addTimeButton = this.FindViewById<Button>(Resource.Id.AddTimeButton);

            //editButton.Click += EditButton_Click;
            addTimeButton.Click += AddTimeButton_Click;
            listView.SetOnTouchListener(this);

            // Gestures
            gestureDetector = new GestureDetector(this);
            listView.SetOnTouchListener(this);

            var _message = this.FindViewById<TextView>(Resource.Id.message);
            _message.Text = (selectedEmployee.Logs.Count == 0)?"There are no Transactions":"";
        }
开发者ID:CarolineCao,项目名称:example_timePilot,代码行数:35,代码来源:EmployeeLogsActivity.cs

示例4: OnCreate

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

            SetContentView (Resource.Layout.AllEigenschappen);

            //Action bar
            InitializeActionBar (SupportActionBar);
            title = ActionBarTitle;
            query = ActionBarQuery;
            search = ActionBarSearch;
            back = ActionBarBack;

            mToastShort = Toast.MakeText (this, "", ToastLength.Short);
            mToastLong = Toast.MakeText (this, "", ToastLength.Long);

            currProfiel = _appController.CurrentProfiel;
            IsProfileNull = (currProfiel == null);
            eigenschappenList = _appController.Eigenschappen;

            //listener to pass to EigenschapAdapter containing context
            mListener = new MyOnCheckBoxClickListener (this);

            eigenschapAdapter = new EigenschapAdapter (this, _appController.Eigenschappen, mListener);
            allEigenschappenListView = FindViewById<ListView> (Resource.Id.all_eigenschappen_list);
            allEigenschappenListView.Adapter = eigenschapAdapter;

            title.Text = IsProfileNull ? "Eigenschappen" : "Selectie";
            query.Hint = "Zoek eigenschap";

            //hide keyboard when scrolling through list
            allEigenschappenListView.SetOnTouchListener(new MyOnTouchListener(this, query));

            //initialize progress dialog used when calculating totemlist
            progress = new ProgressDialog(this);
            progress.SetMessage("Totems zoeken...");
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);

            LiveSearch ();

            sharedPrefs = GetSharedPreferences("data", FileCreationMode.Private);

            var vind = FindViewById<LinearLayout> (Resource.Id.vind);
            vind.Click += VindTotem;

            bottomBar = FindViewById<RelativeLayout> (Resource.Id.bottomBar);

            search.Visibility = ViewStates.Visible;
            search.Click += (sender, e) => ToggleSearch ();

            //hide keyboard when enter is pressed
            query.EditorAction += (sender, e) => {
                if (e.ActionId == ImeAction.Search)
                    KeyboardHelper.HideKeyboard(this);
                else
                    e.Handled = false;
            };
        }
开发者ID:FrederickEskens,项目名称:Totem,代码行数:59,代码来源:EigenschappenActivity.cs

示例5: 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;
                    }

                    GroupEntries = new List<GroupFinder.GroupEntry>();
                    MarkerList = new List<Android.Gms.Maps.Model.Marker>();
                    SourceLocation = new GroupFinder.GroupEntry();

                    // limit the address to 90% of the screen so it doesn't conflict with the progress bar.
                    Point displaySize = new Point( );
                    Activity.WindowManager.DefaultDisplay.GetSize( displaySize );
                    //float fixedWidth = displaySize.X / 4.0f;

                    // catch any exceptions thrown, as they'll be related to no map API key
                    try
                    {
                        MapView = new Android.Gms.Maps.MapView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                        MapView.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                        MapView.LayoutParameters.Height = (int) (displaySize.Y * .50f);
                        MapView.GetMapAsync( this );
                        MapView.SetBackgroundColor( Color.Black );

                        MapView.OnCreate( savedInstanceState );
                    }
                    catch
                    {
                        MapView = null;
                        Rock.Mobile.Util.Debug.WriteLine( "GOOGLE MAPS: Unable to create. Verify you have a valid API KEY." );
                    }


                    SearchAddressButton = new Button( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    SearchAddressButton.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent );
                    ControlStyling.StyleButton( SearchAddressButton, ConnectStrings.GroupFinder_SearchButtonLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize );
                    SearchAddressButton.Click += (object sender, EventArgs e ) =>
                    {
                            SearchPage.Show( );
                    };


                    // setup the linear layout containing the "Your Neighborhood is: Horizon" text
                    SearchLayout = new LinearLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    SearchLayout.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent );
                    SearchLayout.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) );
                    SearchLayout.SetGravity( GravityFlags.Center );

                    SearchResultPrefix = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    SearchResultPrefix.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent );
                    SearchResultPrefix.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal );
                    SearchResultPrefix.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize );
                    SearchResultPrefix.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ) );
                    SearchResultPrefix.Text = ConnectStrings.GroupFinder_NoGroupsFound;

                    SearchResultNeighborhood = new TextView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    SearchResultNeighborhood.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent );
                    SearchResultNeighborhood.SetTypeface( Rock.Mobile.PlatformSpecific.Android.Graphics.FontManager.Instance.GetFont( ControlStylingConfig.Font_Regular ), TypefaceStyle.Normal );
                    SearchResultNeighborhood.SetTextSize( Android.Util.ComplexUnitType.Dip, ControlStylingConfig.Small_FontSize );
                    SearchResultNeighborhood.SetTextColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_ActiveTextColor ) );
                    SearchResultNeighborhood.Text = "";


                    Seperator = new View( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    Seperator.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, 0 );
                    Seperator.LayoutParameters.Height = 2;
                    Seperator.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) );

                    ListView = new ListView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ListView.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                    ListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e ) =>
                        {
                            OnClick( e.Position, 0 );
                        };
                    ListView.SetOnTouchListener( this );
                    ListView.Adapter = new GroupArrayAdapter( this );

                    View view = inflater.Inflate(Resource.Layout.Connect_GroupFinder, container, false);
                    view.SetOnTouchListener( this );

                    view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) );

                    LinearLayout groupLayout = view.FindViewById<LinearLayout>( Resource.Id.groupFrame ) as LinearLayout;

                    // setup the address layout, which has the address text, padding, and finally the progress bar.
                    if ( MapView != null )
                    {
                        ( (LinearLayout)groupLayout ).AddView( MapView );
                    }

                    ((LinearLayout)groupLayout).AddView( SearchAddressButton );

                    ((LinearLayout)groupLayout).AddView( SearchLayout );
                    ((LinearLayout)SearchLayout).AddView( SearchResultPrefix );
                    ((LinearLayout)SearchLayout).AddView( SearchResultNeighborhood );

                    ((LinearLayout)groupLayout).AddView( Seperator );
                    ((LinearLayout)groupLayout).AddView( ListView );
//.........这里部分代码省略.........
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:101,代码来源:GroupFinderFragment.cs

示例6: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            if (EmployeeManagement._context == null)
                EmployeeManagement._context = this;
            else
            {
                // DEBUG
                //throw new System.Exception("2rd ");
            }

            AgentApplication.getInstance().addActivity(this);
            //((AgentApplication)this.Application).addActivity(this);

            // Set up Listview
            SetContentView(Resource.Layout.EmployeeMaster);
            employeesAdapter = new EmployeesAdapter(this);
            listView = FindViewById<ListView>(Resource.Id.employees);
            listView.Adapter = employeesAdapter;

            // Dedicate Buttons
            //this.FindViewById<Button>(Resource.Id.editButton).Click += EditButton_Click;
            this.FindViewById<Button>(Resource.Id.addButton).Click += AddButton_Click;
            this.FindViewById<Button>(Resource.Id.settingsButton).Click += SettingsButton_Click;

            // Start thread
            if (initialSettingSet())
            {
                (new Thread(new Action(() => { EmployeeManagement.GetInstance().loadData(false, false); }))).Start();
            }

            // Gestures
            gestureDetector = new GestureDetector(this);
            listView.SetOnTouchListener(this);

            //start GPS
            GPSHelper.GetInstance();
        }
开发者ID:CarolineCao,项目名称:example_timePilot,代码行数:38,代码来源:EmployeeActivity.cs


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