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);
        }
예제 #3
0
 public void onClickToc(object sender, EventArgs e)
 {
     gone(rlReadAaSet, rlReadMark);
     if (!mTocListPopupWindow.IsShowing)
     {
         visible(mTvBookReadTocTitle);
         gone(mTvBookReadReading, mTvBookReadCommunity, mTvBookReadChangeSource);
         mTocListPopupWindow.InputMethodMode = ListPopupWindowInputMethodMode.Needed;
         mTocListPopupWindow.SoftInputMode   = SoftInput.AdjustResize;
         mTocListPopupWindow.Show();
         mTocListPopupWindow.SetSelection(currentChapter - 1);
         mTocListPopupWindow.ListView.FastScrollEnabled = (true);
     }
 }
        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 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;
		}