protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); this.SetContentView(Resource.Layout.activity_control); if(SupportActionBar != null && selectedControl != null) { SupportActionBar.Title = selectedControl.ControlName(); } this.expList = (ExpandableListView)this.FindViewById (Resource.Id.expListView); MoveIndicatorImage (); ExamplesAdapter ea = new ExamplesAdapter(selectedControl.Examples()); this.expList.SetAdapter(ea); for (int i = 0; i < ea.GroupCount; i++ ) { expList.ExpandGroup(i); } this.expList.ChildClick += (object sender, ExpandableListView.ChildClickEventArgs e) => { ExampleActivity.selectedExampleFragment = (Android.Support.V4.App.Fragment)ea.GetChild(e.GroupPosition, e.ChildPosition); Intent exampleIntent = new Intent(this, typeof(ExampleActivity)); this.StartActivity(exampleIntent); e.Handled = true; }; }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); // Lich hoc theo HK // var rootView = inflater.Inflate(Resource.Layout.LichHoc_HK, container, false); // ListView listView = rootView.FindViewById<ListView>(Resource.Id.listLH); // // var t= BLichHoc.MakeDataFromXml(SQLite_Android.GetConnection ()); // List<LichHoc> listLH = BLichHoc.GetAll (SQLite_Android.GetConnection ()); // List<chiTietLH> listCT = new List<chiTietLH> (); // foreach (var item in listLH) { // listCT.AddRange(BLichHoc.GetCTLH (SQLite_Android.GetConnection (), item.Id)); // // } // // // LichHocHKAdapter adapter = new LichHocHKAdapter (Activity, listCT); // listView.Adapter = adapter; //Theo Tuan var rootView = inflater.Inflate(Resource.Layout.LichHoc_Tuan, container, false); listView = rootView.FindViewById<ExpandableListView>(Resource.Id.listLH_Tuan); progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressLHTuan); LoadData (); return rootView; }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); Title = "C# Client Library Tests"; RequestWindowFeature (WindowFeatures.Progress); SetContentView (Resource.Layout.Harness); this.runStatus = FindViewById<TextView> (Resource.Id.RunStatus); this.list = FindViewById<ExpandableListView> (Resource.Id.List); this.list.SetAdapter (new TestListAdapter (this, App.Listener)); this.list.ChildClick += (sender, e) => { Intent testIntent = new Intent (this, typeof(TestActivity)); GroupDescription groupDesc = (GroupDescription)this.list.GetItemAtPosition (e.GroupPosition); TestDescription desc = groupDesc.Tests.ElementAt (e.ChildPosition); testIntent.PutExtra ("name", desc.Test.Name); testIntent.PutExtra ("desc", desc.Test.Description); testIntent.PutExtra ("log", desc.Log); StartActivity (testIntent); }; SetProgressBarVisibility (true); }
public bool OnGroupClick(ExpandableListView parent, View.View v, int groupPosition, long id) { var args = new GroupClickEventArgs(v, groupPosition, id); GroupClick.Invoke(parent, args); return(args.IsHandled); }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //Theo Tuan var rootView = inflater.Inflate (Resource.Layout.LichHoc_Tuan, container, false); listView_Tuan = rootView.FindViewById<ExpandableListView> (Resource.Id.listLH_Tuan); listView_Tuan.GroupClick += (sender, e) => { listView_ItemClick(sender,e); }; isfirst = true; progress = rootView.FindViewById<ProgressBar> (Resource.Id.progressLHTuan); lbl_TuNgay = rootView.FindViewById<TextView> (Resource.Id.lbl_TuNgay); lbl_DenNgay = rootView.FindViewById<TextView> (Resource.Id.lbl_DenNgay); lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_Tuan); LinearLayout linear_ThoiGian= rootView.FindViewById<LinearLayout> (Resource.Id.linear_LH_Tuan_ThoiGian); TextView txtNotify = rootView.FindViewById<TextView> (Resource.Id.txtNotify_LH_Tuan); //RadioGroup radioGroup = rootView.FindViewById<RadioGroup>(Resource.Id.radioGroup2); //button btnTuanTruoc = rootView.FindViewById<Button> (Resource.Id.btnTuanTruoc); btnTuanKe = rootView.FindViewById<Button> (Resource.Id.btnTuanKe); //bundle bundle=this.Arguments; check = bundle.GetBoolean ("Remind"); autoupdate = bundle.GetBoolean ("AutoUpdateData"); LichHoc lh = BLichHoc.GetLast (SQLite_Android.GetConnection ()); if (lh != null) { btnTuanTruoc.Enabled = true; btnTuanKe.Enabled = true; btnTuanTruoc.SetBackgroundResource(Android.Resource.Color.HoloBlueDark); btnTuanKe.SetBackgroundResource(Android.Resource.Color.HoloBlueDark); // radioGroup.Visibility = ViewStates.Visible; linear_ThoiGian.Visibility = ViewStates.Visible; txtNotify.Visibility = ViewStates.Gone; LoadData_Tuan (DateTime.Today); } else { progress.Visibility = ViewStates.Gone; btnTuanTruoc.Enabled = false; btnTuanKe.Enabled = false; btnTuanTruoc.SetBackgroundResource(Android.Resource.Color.DarkerGray); btnTuanKe.SetBackgroundResource(Android.Resource.Color.DarkerGray); // radioGroup.Visibility = ViewStates.Gone; linear_ThoiGian.Visibility = ViewStates.Gone; txtNotify.Visibility = ViewStates.Visible; txtNotify.Text = "Hiện tại lịch học chưa có dữ liệu. Xin vui lòng thử lại sau!!!"; } // button event btnTuanTruoc.Click += new EventHandler (btnTuanTruoc_Click); btnTuanKe.Click += new EventHandler (btnTuanKe_Click); return rootView; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); view = inflater.Inflate(Resource.Layout.subCategoriesFragment, null); expListView = view.FindViewById<ExpandableListView>(Resource.Id.myExpandableListview); position = Arguments.GetInt("position"); int id = DataRepository.TopCategories[position].Id; expListView.SetAdapter(new MyExpandableListAdapter(Activity,id)); return view; }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); LbManager.Initialize (Assets.Open(LbManager.BattlesAssetsPath)); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); //Find our controls battleListView = FindViewById<ExpandableListView> (Resource.Id.listBattles); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); listView = FindViewById<ExpandableListView>(Resource.Id.tournamentsList); Data = (ViewModel as SingleTournamentViewModel).Tournaments; var bindingSet = this.CreateBindingSet<SingleTournamentView, SingleTournamentViewModel>(); bindingSet.Bind(this).For(n => n.Data).To(vm => vm.Tournaments); bindingSet.Apply(); }
void ListView_ItemClick(object sender, ExpandableListView.ChildClickEventArgs e) { View view = e.ClickedView; view.Click += delegate { var text_msg = view.FindViewById<TextView>(Resource.Id.Buddylist_textChild); Intent intent = new Intent(); Bundle bu = new Bundle(); bu.PutString("name", text_msg.Text); intent.PutExtras(bu); intent.SetClass(this, typeof(ChatMian)); StartActivity(intent); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); this.SetContentView(Resource.Layout.activity_control); this.expList = (ExpandableListView)this.FindViewById (Resource.Id.expListView); this.Title = currentProvider.ControlName(); ExamplesAdapter ea = new ExamplesAdapter(currentProvider.Examples()); this.expList.SetAdapter(ea); this.expList.ChildClick += (object sender, ExpandableListView.ChildClickEventArgs e) => { ExampleActivity.selectedExampleFragment = (Android.Support.V4.App.Fragment)ea.GetChild(e.GroupPosition, e.ChildPosition); Intent exampleIntent = new Intent(this, typeof(ExampleActivity)); this.StartActivity(exampleIntent); e.Handled = true; }; // Create your application here }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.gatt_services_characteristics); mServiceManager = new ServiceManager (this); Intent intent = Intent; mDeviceName = intent.GetStringExtra (EXTRAS_DEVICE_NAME); mDeviceAddress = intent.GetStringExtra (EXTRAS_DEVICE_ADDRESS); // Sets up UI references. (FindViewById <TextView> (Resource.Id.device_address)).Text = mDeviceAddress; mGattServicesList = FindViewById <ExpandableListView> (Resource.Id.gatt_services_list) ; mGattServicesList.ChildClick += delegate(object sender, ExpandableListView.ChildClickEventArgs e) { if (mGattCharacteristics != null) { var groupPosition = mGattCharacteristics [e.GroupPosition]; BluetoothGattCharacteristic characteristic = groupPosition [e.ChildPosition]; var charaProp = characteristic.Properties; if ((charaProp & GattProperty.Read) > 0) { // If there is an active notification on a characteristic, clear // it first so it doesn't update the data field on the user interface. if (mNotifyCharacteristic != null) { mBluetoothLeService.SetCharacteristicNotification ( mNotifyCharacteristic, false); mNotifyCharacteristic = null; } mBluetoothLeService.ReadCharacteristic (characteristic); } if ((charaProp & GattProperty.Notify) > 0) { mNotifyCharacteristic = characteristic; mBluetoothLeService.SetCharacteristicNotification (characteristic, true); } } }; mConnectionState = FindViewById <TextView> (Resource.Id.connection_state); mDataField = FindViewById <TextView> (Resource.Id.data_value); ActionBar.Title = mDeviceName; ActionBar.SetDisplayHomeAsUpEnabled (true); Intent gattServiceIntent = new Intent(this, typeof (BluetoothLeService)); BindService (gattServiceIntent, mServiceManager, Bind.AutoCreate); }
/// <summary> /// Handles list item click /// </summary> public override bool OnChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { var testRunItem = TestRunContext.Current.GetGroupChild(groupPosition, childPosition); if (testRunItem.Running) { Toast.MakeText(this, "This test is still running.", ToastLength.Short).Show(); return true; } var intent = new Intent(this, GetDetailsActivityType); intent.PutExtra("TestCaseName", testRunItem.TestCaseName); StartActivity(intent); return true; }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); var rootView = inflater.Inflate(Resource.Layout.DiemThi, container, false); listView = rootView.FindViewById<ExpandableListView>(Resource.Id.listDT); progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressDT); // List<User> l = new List<User> (); // System.Diagnostics.Debug.WriteLine("size: " + list.Count); // l.Add(BUser.GetUser (SQLite_Android.GetConnection (),"1111")); LoadData (); return rootView; }
void GroupClicked(object sender, ExpandableListView.GroupClickEventArgs e) { Console.WriteLine ("{0}",e.GroupPosition); var eListView = sender as ExpandableListView; var position = e.GroupPosition; if (oldGroup.HasValue) { if (oldGroup == position && eListView.IsGroupExpanded (position)) { eListView.CollapseGroup (e.GroupPosition); } else { eListView.CollapseGroup ((int) oldGroup); eListView.ExpandGroup (position); eListView.SetSelectedGroup (position); } } else { eListView.ExpandGroup (position); eListView.SetSelectedGroup (position); } oldGroup = position; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); var view = inflater.Inflate(Resource.Layout.MainTaskListFragment, container, false); View header = Activity.LayoutInflater.Inflate(Resource.Layout.MainTaskListHeader, null); mainList = view.FindViewById<ExpandableListView>(Resource.Id.mainActivitiesList); mainList.AddHeaderView(header, null, false); mainList.SetAdapter(new ScenarioListAdapter(Activity, AppData.Session.Categories.ToArray())); mainList.ChildClick += mainList_ChildClick; // When the pull to refresh is activated, pull new data from the server and refresh the list with the new data refresher = view.FindViewById<SwipeRefreshLayout>(Resource.Id.refresher); refresher.Refresh += async delegate { if (!AndroidUtils.IsConnected()) { AndroidUtils.OfflineAlert(Activity); refresher.Refreshing = false; return; } await ServerData.FetchCategories(); refresher.Refreshing = false; ((ScenarioListAdapter) mainList.ExpandableListAdapter).Categories = AppData.Session.Categories.ToArray(); Activity.RunOnUiThread( () => ((ScenarioListAdapter) mainList.ExpandableListAdapter).NotifyDataSetChanged()); }; // If there's only one category, it makes sense to expand it by default if (AppData.Session.Categories.Count == 1) { mainList.ExpandGroup(0, true); } practiceBtn = header.FindViewById<Button>(Resource.Id.practiceAreaBtn); practiceBtn.Click += practiceButton_Click; return view; }
private void OnChildClick(object sender, ExpandableListView.ChildClickEventArgs childClickEventArgs) { var listView = ListView; if (listView == null) return; var newValue = ((MvxExpandableListAdapter)listView.ExpandableListAdapter).GetRawItem( childClickEventArgs.GroupPosition, childClickEventArgs.ChildPosition); if (!newValue.Equals(_currentValue)) { var pos = listView.GetFlatListPosition( ExpandableListView.GetPackedPositionForChild( childClickEventArgs.GroupPosition, childClickEventArgs.ChildPosition)); listView.SetItemChecked(pos, true); _currentValue = newValue; FireValueChanged(newValue); } }
/// <summary> /// A child in the list (an practiceActivity) has been selected. Check to see if existing data for this practiceActivity /// already exists before launching it. /// </summary> private void mainList_ChildClick(object sender, ExpandableListView.ChildClickEventArgs e) { ISpeechingPracticeActivity @this = AppData.Session.Categories[e.GroupPosition].Activities[e.ChildPosition]; Type objectType = @this.GetType(); Type targetActivity = typeof (MainActivity); if (objectType == typeof (Scenario)) targetActivity = typeof (ScenarioActivity); else if (objectType == typeof (Guide)) targetActivity = typeof (GuideActivity); else if (objectType == typeof (Assessment)) targetActivity = typeof (AssessmentActivity); Intent intent = new Intent(Activity, targetActivity); int itemId = @this.Id; intent.PutExtra("ActivityId", itemId); if (!AndroidUtils.IsConnected() && !AndroidUtils.IsActivityAvailableOffline(@this.Id, Activity)) { AndroidUtils.OfflineAlert(Activity, "This practiceActivity has not been downloaded yet and requires an Internet connection to prepare!"); return; } if (AppData.CheckForActivityResultData(itemId)) { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder( Activity) .SetTitle("Existing results found...") .SetMessage( "Re-doing this scenario will wipe any progress for it which hasn't been uploaded. Are you sure you want to do this?") .SetPositiveButton("Continue", (senderAlert, confArgs) => { StartActivity(intent); }) .SetNegativeButton("Cancel", (senderAlert, confArgs) => { }) .SetCancelable(true); alert.Show(); } else { StartActivity(intent); } }
private async void ContractsList_ChildClick(object sender, ExpandableListView.ChildClickEventArgs e) { var contract = countries[e.GroupPosition].Contracts[e.ChildPosition]; if (contract.Downloading) { return; } var progressBar = e.ClickedView.FindViewById<ProgressBar>(Resource.Id.ProgressBar); // Show the progress bar if (!contract.Downloaded) { progressBar.Visibility = ViewStates.Visible; } ///ViewModel.ContractTappedCommand.Execute(contract); await ViewModel.AddOrRemoveContract(contract); //(ContractsList.Adapter as CountryListAdapter).GetChildView(e.GroupPosition) //_countries[groupPosition].Contracts[childPosition]. progressBar.Visibility = ViewStates.Gone; var checkBox = e.ClickedView.FindViewById<CheckBox>(Resource.Id.ContractCheckBox); checkBox.Checked = contract.Downloaded; var stationQuantity = e.ClickedView.FindViewById<TextView>(Resource.Id.StationQuantity); stationQuantity.Text = contract.StationCounterStr; stationQuantity.Visibility = contract.Downloaded ? ViewStates.Visible : ViewStates.Gone; //e.ClickedView.SetBackgroundColor(Color.ParseColor("#676767")); //var checkBox = e.ClickedView.FindViewById<CheckBox>(Resource.Id.ContractCheckBox); //checkBox.SetBinding( // () => contract.Downloaded, // () => checkBox.Checked); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView (Resource.Layout.Checklist); InitializeActionBar (SupportActionBar); ActionBarTitle.Text = "Totemisatie checklist"; sharedPrefs = GetSharedPreferences("checklist", FileCreationMode.Private); var ser = sharedPrefs.GetString("states", "empty"); List<List<bool>> states; if(!ser.Equals("empty")) states = JsonSerializer.DeserializeFromString<List<List<bool>>>(ser); else states = null; expand = FindViewById<ExpandableListView>(Resource.Id.expand); InitializeExpandableListView (); expandAdapater = new ExpendListAdapter(this, dictGroup, states); expand.SetAdapter(expandAdapater); }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.myDrawer); progressBar = FindViewById<ProgressBar> (Resource.Id.loadingProgressBar); leftDrawerLinearLayoutId = (LinearLayout)FindViewById (Resource.Id.left_drawer); azureAdap = new ArrayAdapter<string> (this, Android.Resource.Layout.SimpleListItem1); //Start Expandable mListExView = FindViewById<ExpandableListView> (Resource.Id.expandListView); tempListView = FindViewById<ListView> (Resource.Id.lstViewTemp); //setMasterParent (); //setChild (); adapter = new myListViewAdap (NewParentItems); adapter.setInflater ((LayoutInflater)GetSystemService (Context.LayoutInflaterService), this); mListExView.SetAdapter (adapter); //End Expandable mDrawerToggle = new ActionBarDrawerToggle (this, mDrawerLayout, Resource.Drawable.ic_navigation_drawer, Resource.String.open_drawer, Resource.String.close_drawer); mDrawerLayout.SetDrawerListener (mDrawerToggle); ActionBar.SetDisplayHomeAsUpEnabled (true); ActionBar.SetHomeButtonEnabled (true); ActionBar.SetDisplayShowTitleEnabled (true); //Declaration of Image button and other buttons ImageButton imgBtnPlus = (ImageButton)FindViewById (Resource.Id.buttonNewPanel); Button btnCancel = (Button)FindViewById (Resource.Id.CancelPanel); Button btnSavePanel = (Button)FindViewById (Resource.Id.SavePanel); TableRow tRowSaveCancel = (TableRow)FindViewById (Resource.Id.tRowSaveCancel); //Row of save Button EditText txtidofNewPanel = (EditText)(FindViewById (Resource.Id.txtOfNewPanel)); spinMasterPanel = FindViewById<Spinner> (Resource.Id.spinnerExistingMasterPanel); //Code to add default value in the spinner First = new List<string> (); First.Add ("Select Parent Panel"); spinnerArrayAdapter = new ArrayAdapter<string> (this, Android.Resource.Layout.SimpleSpinnerItem, First); spinnerArrayAdapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem); spinMasterPanel.Adapter = spinnerArrayAdapter; //End appendSpinner (spinMasterPanel, parentItems, spinnerArrayAdapter, First); //Calling spinner to append more parent. imgBtnPlus.Click += (object sender, EventArgs e) => { if (SetTag == 1) { imgBtnPlus.SetImageResource (Resource.Drawable.Multsign); txtidofNewPanel.Visibility = ViewStates.Visible; tRowSaveCancel.Visibility = ViewStates.Visible; spinMasterPanel.Visibility = ViewStates.Visible; SetTag = 0; } else if (SetTag == 0) { imgBtnPlus.SetImageResource (Resource.Drawable.plussign); txtidofNewPanel.Visibility = ViewStates.Gone; tRowSaveCancel.Visibility = ViewStates.Gone; spinMasterPanel.Visibility = ViewStates.Gone; SetTag = 1; } }; btnCancel.Click += delegate { imgBtnPlus.SetImageResource (Resource.Drawable.plussign); tRowSaveCancel.Visibility = ViewStates.Gone; txtidofNewPanel.Visibility = ViewStates.Gone; spinMasterPanel.Visibility = ViewStates.Gone; }; #region SavePanelCLickActivity btnSavePanel.Click += (object sender, EventArgs e) => { imgBtnPlus.SetImageResource (Resource.Drawable.plussign); tRowSaveCancel.Visibility = ViewStates.Gone; txtidofNewPanel.Visibility = ViewStates.Gone; spinMasterPanel.Visibility = ViewStates.Gone; string newPanelText = txtidofNewPanel.Text.Trim (); if (newPanelText != "") { string spinnerItem = spinMasterPanel.SelectedItem.ToString (); // Selected item in the spinner if (spinnerItem != "Select Parent Panel") { child = new List<string> (); child.Add (newPanelText); if (NewParentItems.ContainsKey (spinnerItem)) { NewParentItems [spinnerItem].AddRange (child); dictPanelItemsForMail [spinnerItem].AddRange (child); } else { NewParentItems [spinnerItem] = child; dictPanelItemsForMail [spinnerItem] = child; } } else { child = new List<string> (); NewParentItems [newPanelText] = child; dictPanelItemsForMail [newPanelText] = child; appendSpinner (spinMasterPanel, newListForSpin, spinnerArrayAdapter, First); } child = new List<string> (); childItems.Add (child); myListViewAdap adapterNew = new myListViewAdap (NewParentItems); adapterNew.setInflater ((LayoutInflater)GetSystemService (Context.LayoutInflaterService), this); mListExView.SetAdapter (adapter); //Inflate Expandable Adapter txtidofNewPanel.Text = ""; InputMethodManager inputmanager = (InputMethodManager)GetSystemService (Context.InputMethodService); inputmanager.HideSoftInputFromWindow (txtidofNewPanel.WindowToken, HideSoftInputFlags.None); // To hide the keyboard spinMasterPanel.SetSelection (0, true); } }; #endregion SavePanelActivityEnd // Code to hide keyboard on spinner touch spinMasterPanel.Touch += (object sender, View.TouchEventArgs e) => { InputMethodManager inputmanager = (InputMethodManager)GetSystemService (Context.InputMethodService); inputmanager.HideSoftInputFromWindow (spinMasterPanel.WindowToken, HideSoftInputFlags.None); spinMasterPanel.PerformClick (); }; // code to handle ChildClick Event mListExView.ChildClick += mListExView_ChildClick; connectMaster (1); }
private void listview_ChildClick(object sender, ExpandableListView.ChildClickEventArgs args) { Toast.MakeText(Activity, "Group: "+args.GroupPosition + " Child: "+args.ChildPosition + " Clicked", ToastLength.Short).Show(); }
//@Override public bool OnChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Toast.MakeText(this, childList[groupPosition][childPosition].getName(), ToastLength.Long).Show(); return false; }
//@Override public bool OnGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { return false; }
protected async override void OnCreate (Bundle bundle) { try { base.OnCreate (bundle); SetContentView (Resource.Layout.MakeBookingSesh); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); if (ProgressDialogLogin == null) { ProgressDialogLogin = ProgressDialog.Show(this, "", "Loading..."); } string WorkshopSetId = Intent.GetStringExtra("WorkshopSetId"); _WorkshopSessions = await RESTClass.GetWorkshopSessions("?workshopSetId=" + WorkshopSetId); CreateExpandableListData(); elvExListBox = FindViewById<ExpandableListView> (Resource.Id.elvExListBox); elvExListBox.SetAdapter (new ExpandListSessionAdapter (this, dictGroup)); if (ProgressDialogLogin != null) { ProgressDialogLogin.Dismiss(); ProgressDialogLogin = null; } elvExListBox.ChildClick += delegate(object sender, ExpandableListView.ChildClickEventArgs e) { string itmGroup = lstKeys [e.GroupPosition]; WorkshopSessions itmChild = dictGroup [itmGroup]; }; elvExListBox.GroupExpand += delegate(object sender, ExpandableListView.GroupExpandEventArgs e) { if (lastExpandedPosition != -1 && e.GroupPosition != lastExpandedPosition) { elvExListBox.CollapseGroup(lastExpandedPosition); } lastExpandedPosition = e.GroupPosition; }; // Button btnViewDetails = FindViewById<Button>(Resource.Id.btnViewDetails); // btnViewDetails.Click += delegate { // StartActivity(new Intent(this, typeof(MakeBookingListActivity))); // }; } catch (Exception e) { ErrorHandling.LogError (e, this); } finally { if (ProgressDialogLogin != null) { ProgressDialogLogin.Dismiss(); ProgressDialogLogin = null; } } }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate (Resource.Layout.ChooseCoffee, null); favChecked = false; v.FindViewById<ImageView> (Resource.Id.chosen_logo).SetBackgroundResource (TempStorage.ChosenLogo); coffeeLv = v.FindViewById<ExpandableListView> (Android.Resource.Id.List); payButton = v.FindViewById<Button> (Resource.Id.btnPay); payButton.Click += delegate { ProcessPayments(); }; coffeeAdapter = new ExpandableListAdapter (this.Activity, CoffeeData); coffeeLv.SetAdapter(coffeeAdapter); coffeeLv.SetOnChildClickListener (this); //don't forget! price = "4.50"; return v; }
public bool OnChildClick(ExpandableListView parent, Views.View v, int groupPosition, int childPosition, long id) { var args = new ChildClickEventArgs(v, groupPosition, childPosition, id); ChildClick.Invoke(parent, args); return args.IsHandled; }
void listView_ItemClick(object sender, ExpandableListView.GroupClickEventArgs e){ // content to pass var bundle1 = new Bundle(); bundle1.PutString ("MH", listCT[e.GroupPosition].Id); bundle1.PutString ("TietBD", listCT [e.GroupPosition].TietBatDau); bundle1.PutString ("NgayHoc", listCT [e.GroupPosition].Tuan); bundle1.PutString ("SoTiet", listCT [e.GroupPosition].SoTiet); bundle1.PutString ("Thu", listCT [e.GroupPosition].Thu); bundle1.PutBoolean ("check", false); bundle1.PutBoolean ("isLHT", true); // call fragment Intent myintent = new Intent (Activity, typeof(Remider)); myintent.PutExtra ("RemindValue", bundle1); StartActivity (myintent); }
void mListExView_ChildClick (object sender, ExpandableListView.ChildClickEventArgs e) { azureAdap.Clear (); tempListView.Adapter = azureAdap; progressBar.Visibility = ViewStates.Visible; mDrawerLayout.CloseDrawer (leftDrawerLinearLayoutId); string dictItem = dictPanelItemsForMail [dictPanelItemsForMail.Keys.ElementAt (e.GroupPosition).ToString ()].ElementAt (e.ChildPosition).ToString (); int indexofColon = dictItem.IndexOf (':'); string idOfPanel = dictItem.Substring (indexofColon + 1, (dictItem.Length - indexofColon) - 1); mailItemsCall (idOfPanel); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { try { View view; Int32 lastExpandedPosition = -1; CreateExpandableListData (); if (position == 0) //Current Booking tab { view = LayoutInflater.From (container.Context).Inflate (Resource.Layout.CurrentBookingLayout, container, false); container.AddView (view); flCurrentBookings = container.FindViewById<FrameLayout> (Resource.Id.flCurrentBookings); flNoCurrentBookings = container.FindViewById<FrameLayout> (Resource.Id.flNoCurrentBookings); elvCurrentBookings = container.FindViewById<ExpandableListView> (Resource.Id.elvCurrentBookings); if (dictGroupCurr.Count > 0) { flNoCurrentBookings.Visibility = ViewStates.Gone; flCurrentBookings.Visibility = ViewStates.Visible; elvCurrentBookings.SetAdapter (new ExpandViewBookingAdapter (parent, dictGroupCurr)); elvCurrentBookings.ChildClick += delegate(object sender, ExpandableListView.ChildClickEventArgs e) { string itmGroup = lstKeysCurr [e.GroupPosition]; WorkshopBooking itmChild = dictGroupCurr [itmGroup]; }; elvCurrentBookings.GroupExpand += delegate(object sender, ExpandableListView.GroupExpandEventArgs e) { if (lastExpandedPosition != -1 && e.GroupPosition != lastExpandedPosition) { elvCurrentBookings.CollapseGroup (lastExpandedPosition); } lastExpandedPosition = e.GroupPosition; }; } else { flNoCurrentBookings.Visibility = ViewStates.Visible; flCurrentBookings.Visibility = ViewStates.Gone; } } else //Past Bookings { view = LayoutInflater.From (container.Context).Inflate (Resource.Layout.PastBookings, container, false); container.AddView (view); flPastBookings = container.FindViewById<FrameLayout> (Resource.Id.flPastBookings); flNoPastBookings = container.FindViewById<FrameLayout> (Resource.Id.flNoPastBookings); elvPastBookings = container.FindViewById<ExpandableListView> (Resource.Id.elvPastBookings); if (dictGroupPast.Count > 0) { flNoPastBookings.Visibility = ViewStates.Gone; flPastBookings.Visibility = ViewStates.Visible; elvPastBookings.SetAdapter (new ExpandViewBookingAdapter (parent, dictGroupPast)); elvPastBookings.ChildClick += delegate(object sender, ExpandableListView.ChildClickEventArgs e) { string itmGroup = lstKeysPast [e.GroupPosition]; WorkshopBooking itmChild = dictGroupPast [itmGroup]; }; elvPastBookings.GroupExpand += delegate(object sender, ExpandableListView.GroupExpandEventArgs e) { if (lastExpandedPosition != -1 && e.GroupPosition != lastExpandedPosition) { elvPastBookings.CollapseGroup (lastExpandedPosition); } lastExpandedPosition = e.GroupPosition; }; } else { flNoPastBookings.Visibility = ViewStates.Visible; flPastBookings.Visibility = ViewStates.Gone; } } return view; } catch (Exception e) { ErrorHandling.LogError (e, container.Context); return -1; } }
public bool OnGroupClick(ExpandableListView parent, View.View v, int groupPosition, long id) { var args = new GroupClickEventArgs(v, groupPosition, id); GroupClick.Invoke(parent, args); return args.IsHandled; }
public bool OnChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { //Make a second selection, it adds that into the listitem... headers = new List<string>(CoffeeData.Keys); List<string> defaultHeaders = new List<string> (); defaultHeaders.Add ("Coffee"); defaultHeaders.Add ("Size"); defaultHeaders.Add ("Milk"); string currentKey = headers [groupPosition]; List<string> values = CoffeeData [currentKey]; string fixedKey; int cutOff = currentKey.IndexOf (":"); string newGroupText = ""; if (cutOff > 0) { fixedKey = currentKey.Substring (0, cutOff); newGroupText = string.Empty; newGroupText = string.Concat (fixedKey, ": ", v.FindViewById<TextView> (Resource.Id.txtItemContent).Text); } else { original = string.Empty; if (groupPosition == 0) { original = "Coffee"; } else if (groupPosition == 1) { original = "Milk"; } else if (groupPosition == 2) { original = "Size"; } newGroupText = string.Concat (original, ": ", v.FindViewById<TextView> (Resource.Id.txtItemContent).Text); } headers [groupPosition] = newGroupText; CoffeeData.Remove (currentKey); CoffeeData.Add (headers [groupPosition], values); coffeeLv.CollapseGroup (groupPosition); coffeeAdapter.UpdateData (CoffeeData); if (groupPosition == 0) { TempStorage.Coffee = v.FindViewById<TextView> (Resource.Id.txtItemContent).Text; } else if (groupPosition == 1) { TempStorage.Milk = v.FindViewById<TextView> (Resource.Id.txtItemContent).Text; } else if (groupPosition == 2) { TempStorage.Size = v.FindViewById<TextView> (Resource.Id.txtItemContent).Text; } if (headers [0] != "Coffee" && headers [1] != "Milk" && headers [2] != "Size") { favourite.SetVisible (true); } return true; }