コード例 #1
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			int paramLength = this.Intent.GetIntExtra (AlarmClock.ExtraLength, 0);

			if (Log.IsLoggable (Tag, LogPriority.Debug))
				Log.Debug (Tag, "SetTimerActivity:onCreate=" + paramLength);
			
			if (paramLength > 0 && paramLength <= 86400) {
				long durationMillis = paramLength * 1000;
				SetupTimer (durationMillis);
				Finish ();
				return;
			}

			var res = this.Resources;
			for (int i = 0; i < NumberOfTimes; i++) {
				timeOptions [i] = new ListViewItem (
					res.GetQuantityString (Resource.Plurals.timer_minutes, i + 1, i + 1),
					(i + 1) * 60 * 1000);
			}

			SetContentView (Resource.Layout.timer_set_timer);

			// Initialize a simple list of countdown time options.
			wearableListView = FindViewById<WearableListView> (Resource.Id.times_list_view);
			wearableListView.SetAdapter (new TimerWearableListViewAdapter (this));
			wearableListView.SetClickListener (this);
		}
コード例 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Log.Error("Flowpilots", "Main Activity Started");

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

            _listView = FindViewById <WearableListView>(Resource.Id.wearable_list);
            // Assign an adapter to the list
            var adapter = new Adapter(this, _elements);

            _listView.SetAdapter(adapter);

            // Set a click listener
            _listView.SetClickListener(this);

            #region Step 3
            // Register the local broadcast receiver, defined in step 3.
            var messageFilter   = new IntentFilter(Intent.ActionSend);
            var messageReceiver = new MessageReceiver();
            LocalBroadcastManager.GetInstance(this).RegisterReceiver(messageReceiver, messageFilter);

            #endregion
        }
コード例 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            int paramLength = this.Intent.GetIntExtra(AlarmClock.ExtraLength, 0);

            if (Log.IsLoggable(Tag, LogPriority.Debug))
            {
                Log.Debug(Tag, "SetTimerActivity:onCreate=" + paramLength);
            }

            if (paramLength > 0 && paramLength <= 86400)
            {
                long durationMillis = paramLength * 1000;
                SetupTimer(durationMillis);
                Finish();
                return;
            }

            var res = this.Resources;

            for (int i = 0; i < NumberOfTimes; i++)
            {
                timeOptions [i] = new ListViewItem(
                    res.GetQuantityString(Resource.Plurals.timer_minutes, i + 1, i + 1),
                    (i + 1) * 60 * 1000);
            }

            SetContentView(Resource.Layout.timer_set_timer);

            // Initialize a simple list of countdown time options.
            wearableListView = FindViewById <WearableListView> (Resource.Id.times_list_view);
            wearableListView.SetAdapter(new TimerWearableListViewAdapter(this));
            wearableListView.SetClickListener(this);
        }
コード例 #4
0
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.ListFragment, container, false);
            headerTextView = view.FindViewById<TextView> (Resource.Id.ListTitleTextView);

            listView = view.FindViewById<WearableListView> (Resource.Id.RecentTimeEntriesList);
            listAdapter = new RecentListAdapter (Activity, Activity);
            listView.SetAdapter (listAdapter);
            listView.SetGreedyTouchMode (true);
            listView.AddOnScrollListener (this);
            listView.SetClickListener (this);
            return view;
        }
コード例 #5
0
        protected override void AfterInit()
        {
            header           = FindViewById <TextView>(Resource.Id.header);
            wearableListView = FindViewById <WearableListView>(Resource.Id.wearable_List);
            wearableAdapter  = new WearableAdapter(this, new List <ServiceItem>());
            wearableListView.SetAdapter(wearableAdapter);
            wearableListView.Click += WearableListView_Click;
            wearableListView.TopEmptyRegionClick  += WearableListView_TopEmptyRegionClick;
            wearableListView.AbsoluteScrollChange += WearableListView_AbsoluteScrollChange;

            // Request data from mobile
            RequestDataFromMobile();
        }
コード例 #6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.ListFragment, container, false);

            headerTextView = view.FindViewById <TextView> (Resource.Id.ListTitleTextView);

            listView    = view.FindViewById <WearableListView> (Resource.Id.RecentTimeEntriesList);
            listAdapter = new RecentListAdapter(Activity, Activity);
            listView.SetAdapter(listAdapter);
            listView.SetGreedyTouchMode(true);
            listView.AddOnScrollListener(this);
            listView.SetClickListener(this);
            return(view);
        }
コード例 #7
0
		protected override void OnCreate(Bundle savedInstanceState)
		{
			base.OnCreate(savedInstanceState);
			SetContentView(Resource.Layout.XFitWatchfaceWearableConfigActivity);
			header = FindViewById<TextView>(Resource.Id.Header);

			listView = FindViewById<WearableListView>(Resource.Id.ColorPicker);
			var content = FindViewById<BoxInsetLayout>(Resource.Id.Content);

			content.ApplyWindowInsets = (v, insets) =>
			{
				if (!insets.IsRound)
				{
					v.SetPaddingRelative(
						Resources.GetDimensionPixelSize(Resource.Dimension.ContentPaddingStart),
						v.PaddingTop,
						v.PaddingEnd,
						v.PaddingBottom
					);
				}
				return v.OnApplyWindowInsets(insets);
			};

			listView.HasFixedSize = true;

			listView.Click += (object sender, WearableListView.ClickEventArgs e) =>
			{
				var viewHolder = e.P0;
				var itemViewHolder = viewHolder as ItemViewHolder;

				var state = itemViewHolder.Setting.Value;
				// TODO: save the step count visibility

				Finish();
			};

			listView.AbsoluteScrollChange += (object sender, WearableListView.AbsoluteScrollChangeEventArgs e) =>
			{
				var scroll = e.P0;
				var newTranslation = Math.Min(-scroll, 0);
				header.TranslationY = newTranslation;
			};
		}
コード例 #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.XFitWatchfaceWearableConfigActivity);
            header = FindViewById <TextView>(Resource.Id.Header);

            listView = FindViewById <WearableListView>(Resource.Id.ColorPicker);
            var content = FindViewById <BoxInsetLayout>(Resource.Id.Content);

            content.ApplyWindowInsets = (v, insets) =>
            {
                if (!insets.IsRound)
                {
                    v.SetPaddingRelative(
                        Resources.GetDimensionPixelSize(Resource.Dimension.ContentPaddingStart),
                        v.PaddingTop,
                        v.PaddingEnd,
                        v.PaddingBottom
                        );
                }
                return(v.OnApplyWindowInsets(insets));
            };

            listView.HasFixedSize = true;

            listView.Click += (object sender, WearableListView.ClickEventArgs e) =>
            {
                var viewHolder     = e.P0;
                var itemViewHolder = viewHolder as ItemViewHolder;

                var state = itemViewHolder.Setting.Value;
                XFitWatchfaceConfigHelper.SaveStepCountStatus(googleApiClient, !state);

                Finish();
            };

            listView.AbsoluteScrollChange += (object sender, WearableListView.AbsoluteScrollChangeEventArgs e) =>
            {
                var scroll         = e.P0;
                var newTranslation = Math.Min(-scroll, 0);
                header.TranslationY = newTranslation;
            };
        }
コード例 #9
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.devices);
            devices = FindViewById <WearableListView>(Resource.Id.devices);

            TransporteService service = new TransporteService();

            if (!CrossConnectivity.Current.IsConnected)
            {
                //You are offline, notify the user
                return;
            }
            var lineas = await service.TransporteAhora();

            var carga = FindViewById <ProgressBar>(Resource.Id.cargando);

            carga.Visibility = ViewStates.Invisible;
            devices.SetAdapter(new DevicesAdapter(this, lineas));
        }
コード例 #10
0
		public void OnClick (WearableListView.ViewHolder holder)
		{
			var duration = timeOptions [holder.Position].duration;
			SetupTimer (duration);

		}
コード例 #11
0
 public void OnClick (WearableListView.ViewHolder v)
 {
     var tag = v.ItemView.Tag;
     ((MainActivity)Activity).RequestStartEntry (tag.ToString());
 }
 public void OnClick(WearableListView.ViewHolder viewHolder)
 {
     var colorItemViewHolder = viewHolder as ColorItemViewHolder;
     UpdateConfigDataItem (colorItemViewHolder.ColorItem.GetColor ());
     Finish ();
 }