private void showMinorPopupWindow()
 {
     if (mMinors.Count() > 0 && minorAdapter != null)
     {
         if (mListPopupWindow == null)
         {
             mListPopupWindow = new ListPopupWindow(this);
             mListPopupWindow.SetAdapter(minorAdapter);
             mListPopupWindow.Width      = (ViewGroup.LayoutParams.MatchParent);
             mListPopupWindow.Height     = (ViewGroup.LayoutParams.WrapContent);
             mListPopupWindow.AnchorView = (mCommonToolbar);
             mListPopupWindow.Modal      = (true);
             mListPopupWindow.ItemClick += (sender, e) =>
             {
                 var position = e.Position;
                 minorAdapter.setChecked(position);
                 if (position > 0)
                 {
                     currentMinor = mMinors[position];
                 }
                 else
                 {
                     currentMinor = "";
                 }
                 int current = mViewPager.CurrentItem;
                 EventManager.refreshSubCategory(currentMinor, types[current]);
                 mListPopupWindow.Dismiss();
                 mCommonToolbar.Title = (mMinors[position]);
             };
         }
         mListPopupWindow.Show();
     }
 }
		protected override void OnCreate (Android.OS.Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			var mActionBar = ActionBar;
			mActionBar.SetDisplayHomeAsUpEnabled(true);
			mActionBar.SetDisplayShowCustomEnabled(true);
			mActionBar.SetIcon(new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent)));    
			mActionBar.SetDisplayShowTitleEnabled(false);
			LayoutInflater mInflater = LayoutInflater.From(this);
			View mCustomView = mInflater.Inflate(Resource.Layout.samplelist_layout, null);

			selectedGroup= (Group)MainActivity.SelectedIntent.GetSerializableExtra("sample");
			SampleLayout sampleLayouts= new SampleLayout(MainActivity.context,selectedGroup.samples);
			mActionBar.CustomView = mCustomView;
			Sample selectedSample=(Sample)selectedGroup.samples[selectedIndex];

			SetContentView(Resource.Layout.SamplePage);
			ImageView imageButton = (ImageView) mCustomView
				.FindViewById(Resource.Id.imageButton);
			Context wrapper = new ContextThemeWrapper(this, Android.Resource.Style.Theme);
		    ListPopupWindow popupWindow = new ListPopupWindow(wrapper);
			popupWindow.SetBackgroundDrawable(Resources.GetDrawable(Resource.Drawable.listpopup));
				
			imageButton.Click += (object sender, EventArgs e) => {

				popupWindow.Show();
			};
			popupWindow.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {

				Sample subSamples = (Sample) selectedGroup.samples[e.Position];
				selectedIndex = e.Position;
				RefreshSample(subSamples);
				popupWindow.Dismiss();

			};

			RelativeLayout settingButton = (RelativeLayout) mCustomView
				.FindViewById(Resource.Id.settingsParent);
			settingButton.Click += (object sender, EventArgs e) => {

				onProperyWindowClick();
			};
			if(selectedGroup.samples.Count<=1)
			{
				imageButton.Visibility = ViewStates.Invisible;
				
			}
			popupWindow.AnchorView = imageButton;
			popupWindow.Width = measureContentWidth(sampleLayouts);
			popupWindow.SetAdapter(sampleLayouts);
			RefreshSample (selectedSample);
		}
        protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            var mActionBar = ActionBar;

            mActionBar.SetDisplayHomeAsUpEnabled(true);
            mActionBar.SetDisplayShowCustomEnabled(true);
            mActionBar.SetIcon(new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent)));
            mActionBar.SetDisplayShowTitleEnabled(false);
            LayoutInflater mInflater   = LayoutInflater.From(this);
            View           mCustomView = mInflater.Inflate(Resource.Layout.samplelist_layout, null);

            selectedGroup = (Group)MainActivity.SelectedIntent.GetSerializableExtra("sample");
            SampleLayout sampleLayouts = new SampleLayout(MainActivity.context, selectedGroup.samples);

            mActionBar.CustomView = mCustomView;
            Sample selectedSample = (Sample)selectedGroup.samples[selectedIndex];

            SetContentView(Resource.Layout.SamplePage);
            ImageView imageButton = (ImageView)mCustomView
                                    .FindViewById(Resource.Id.imageButton);
            Context         wrapper     = new ContextThemeWrapper(this, Android.Resource.Style.Theme);
            ListPopupWindow popupWindow = new ListPopupWindow(wrapper);

            popupWindow.SetBackgroundDrawable(Resources.GetDrawable(Resource.Drawable.listpopup));

            imageButton.Click += (object sender, EventArgs e) => {
                popupWindow.Show();
            };
            popupWindow.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
                Sample subSamples = (Sample)selectedGroup.samples[e.Position];
                selectedIndex = e.Position;
                RefreshSample(subSamples);
                popupWindow.Dismiss();
            };

            RelativeLayout settingButton = (RelativeLayout)mCustomView
                                           .FindViewById(Resource.Id.settingsParent);

            settingButton.Click += (object sender, EventArgs e) => {
                onProperyWindowClick();
            };
            if (selectedGroup.samples.Count <= 1)
            {
                imageButton.Visibility = ViewStates.Invisible;
            }
            popupWindow.AnchorView = imageButton;
            popupWindow.Width      = measureContentWidth(sampleLayouts);
            popupWindow.SetAdapter(sampleLayouts);
            RefreshSample(selectedSample);
        }
 private void initAutoList()
 {
     mAutoAdapter     = new AutoCompleteAdapter(this, mAutoList);
     mListPopupWindow = new ListPopupWindow(this);
     mListPopupWindow.SetAdapter(mAutoAdapter);
     mListPopupWindow.Width      = (ViewGroup.LayoutParams.MatchParent);
     mListPopupWindow.Height     = (ViewGroup.LayoutParams.WrapContent);
     mListPopupWindow.AnchorView = (mCommonToolbar);
     mListPopupWindow.ItemClick += (sender, e) =>
     {
         mListPopupWindow.Dismiss();
         TextView tv  = e.View.FindViewById <TextView>(Resource.Id.tvAutoCompleteItem);
         String   str = tv.Text.ToString();
         search(str);
     };
 }
Example #5
0
        private void Handlers_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Add || e.Action == NotifyCollectionChangedAction.Replace)
            {
                foreach (HandlerInfoViewModel item in e.NewItems)
                {
                    item.HandlerEvent += (o, args) =>
                    {
                        switch (args.EventType)
                        {
                        case HandlerEventType.Start:
                            ServerModel.Server.StartJobScript(args.HandlerId);
                            break;

                        case HandlerEventType.Stop:
                            ServerModel.Server.StopJobScript(args.HandlerId);
                            break;

                        case HandlerEventType.Pause:
                            ServerModel.Server.PauseJobScript(args.HandlerId);
                            break;

                        case HandlerEventType.Disable:
                            ServerModel.Server.DisableJobScript(args.HandlerId);
                            break;

                        case HandlerEventType.Enable:
                            ServerModel.Server.EnableJobScript(args.HandlerId);
                            break;

                        case HandlerEventType.Delete:
                            ServerModel.Server.RemoveJobScript(args.HandlerId);
                            break;

                        case HandlerEventType.ShowLog:
                            var dialogViewModel = new ListPopupWindowViewModel();
                            dialogViewModel.LogInfo = ServerModel.Server.GetJobLog(args.HandlerId).LogEntries.Select(x => new LogEntryViewModel(x)).ToList();
                            var dialog = new ListPopupWindow(dialogViewModel);
                            dialog.ShowDialog();
                            break;
                        }
                    };
                }
            }
        }
        public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            mRootView = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_tracks_dropdown, null);
            mTitle    = (TextView)mRootView.FindViewById(Resource.Id.track_title);
            mAbstract = (TextView)mRootView.FindViewById(Resource.Id.track_abstract);

            mRootView.Click += (sender, e) => {
                mListPopupWindow = new ListPopupWindow(Activity);
                mListPopupWindow.SetAdapter(mAdapter);
                mListPopupWindow.Modal = true;
                mListPopupWindow.SetContentWidth(400);
                mListPopupWindow.AnchorView = mRootView;
                mListPopupWindow.SetOnItemClickListener(this);
                mListPopupWindow.Show();
                mListPopupWindow.SetOnDismissListener(this);
            };

            return(mRootView);
        }
Example #7
0
 private void initTocList()
 {
     mTocListAdapter     = new TocListAdapter(this, mChapterList, bookId, currentChapter);
     mTocListPopupWindow = new ListPopupWindow(this);
     mTocListPopupWindow.SetAdapter(mTocListAdapter);
     mTocListPopupWindow.Width      = (ViewGroup.LayoutParams.MatchParent);
     mTocListPopupWindow.Height     = (ViewGroup.LayoutParams.WrapContent);
     mTocListPopupWindow.AnchorView = (mLlBookReadTop);
     mTocListPopupWindow.ItemClick += (sender, e) => {
         mTocListPopupWindow.Dismiss();
         currentChapter = e.Position + 1;
         mTocListAdapter.setCurrentChapter(currentChapter);
         startRead = false;
         showDialog();
         readCurrentChapter();
         hideReadBar();
     };
     mTocListPopupWindow.DismissEvent += (sender, e) => {
         gone(mTvBookReadTocTitle);
         visible(mTvBookReadReading, mTvBookReadCommunity, mTvBookReadChangeSource);
     };
 }
 public void OnDismiss()
 {
     mListPopupWindow = null;
 }
		public override Android.Views.View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			mRootView = (ViewGroup)inflater.Inflate (Resource.Layout.fragment_tracks_dropdown, null);
			mTitle = (TextView)mRootView.FindViewById (Resource.Id.track_title);
			mAbstract = (TextView)mRootView.FindViewById (Resource.Id.track_abstract);
	
			mRootView.Click += (sender, e) => {
				mListPopupWindow = new ListPopupWindow (Activity);
				mListPopupWindow.SetAdapter (mAdapter);
				mListPopupWindow.Modal = true;
				mListPopupWindow.SetContentWidth (400);
				mListPopupWindow.AnchorView = mRootView;
				mListPopupWindow.SetOnItemClickListener (this);
				mListPopupWindow.Show ();
				mListPopupWindow.SetOnDismissListener (this);
			};

			return mRootView;
		}
		public void OnDismiss ()
		{
			mListPopupWindow = null;
		}