void TabOnTabSelected(object sender, ActionBar.TabEventArgs tabEventArgs) { ActionBar.Tab tab = (ActionBar.Tab)sender; Log.Debug(Tag, "The tab {0} has been selected.", tab.Text); Fragment frag = _fragments[tab.Position]; tabEventArgs.FragmentTransaction.Replace(Resource.Id.frameLayout1, frag); }
protected void initializeActionBar(){ if(playerEnabled){ actionBar = (ActionBar) GameObject.FindObjectOfType (typeof (ActionBar)); actionBar.setPlayer(this); actionBar.initializeBasicAttack(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Response); userDao = new UserDao(); postService = new PostService(); audioService = new SendAudioService(); deliverPostService = new SendPostService(); actionBar = SupportActionBar; actionBar.SetHomeButtonEnabled(false); actionBar.SetDisplayHomeAsUpEnabled(false); actionBar.SetDisplayUseLogoEnabled(false); actionBar.SetDisplayShowHomeEnabled(false); actionBar.Title = "Responder"; chronometer = FindViewById<TextView>(Resource.Id.recording_lenght); previewRecord = FindViewById<ImageView>(Resource.Id.record_image); message = FindViewById<EditText>(Resource.Id.criar_topico_conteudo); submit = FindViewById<Button>(Resource.Id.criar_topico_submit); submit.Click += new System.EventHandler(submit_Click); record = FindViewById<ImageButton>(Resource.Id.btn_gravar); record.Click += new System.EventHandler(record_Click); ServiceLocator.Dispatcher = new DispatchAdapter(this); ServiceLocator.Recorder = new RecordAdapter(); timer = new System.Timers.Timer(1000); timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); timer.Enabled = true; }
void TabOnTabSelected(object sender, ActionBar.TabEventArgs tabEventArgs) { var tab = (ActionBar.Tab)sender; Fragment frag = _fragments[tab.Position]; tabEventArgs.FragmentTransaction.Replace(Resource.Id.frameLayout1, frag); }
public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) { this.RunOnUiThread(() => { Toast.MakeText(this, "OnTabUnselected " + tab.Text, ToastLength.Long).Show(); }); }
void SetupTabs(ActionBar actionBar) { for (int i = 0; i < actionBar.TabCount; i++) { ActionBar.Tab tab = actionBar.GetTabAt(i); if (TabIsEmpty(tab)) TabSetup(tab, GetTabIconId(i)); } }
public void OnTabSelected (ActionBar.Tab tab, FragmentTransaction ft) { TitlesFragment titleFrag = (TitlesFragment) FragmentManager.FindFragmentById (Resource.Id.frag_title); titleFrag.PopulateTitles (tab.Position); titleFrag.SelectPosition (0); }
/// <summary> /// Gets the action bar for selecting the different options. /// </summary> public static ActionBar ToActionBar(bool isHorizontal) { Load(); ActionBar result = new ActionBar(isHorizontal); AddToggles(result); return result; }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { Fragment fragment = tab.Tag as Fragment; if (fragment != null) { ft.Replace(R.Ids.itemDetailFragmentContainer, fragment); } }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { StationInventoryListFragment fragment = tab.Tag as StationInventoryListFragment; if (fragment != null) { ft.Replace(R.Ids.stationInventoryFragmentContainer, fragment); } }
private void OnHomeTabSelected(object sender, ActionBar.TabEventArgs e) { var alertDialogBuilder = new AlertDialog.Builder(this); alertDialogBuilder.SetMessage("Home tab selected!"); var dialog = alertDialogBuilder.Create(); dialog.Show(); }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { PilotListCounterFragment fragment = tab.Tag as PilotListCounterFragment; if (fragment != null) { ft.Replace(R.Ids.pilotsOnlineFragmentContainer, fragment); } }
public void OnTabSelected (ActionBar.Tab tab, FragmentTransaction ft) { FragmentManager.PopBackStack (null, FragmentManager.PopBackStackInclusive); Log.Debug (Tag, "The tab {0} has been selected.", tab.Text); Fragment frag = _fragments [tab.Position]; ft.Replace (Resource.Id.content_frame, frag); }
/// <summary> /// Adds the option toggles to the given ActionBar. /// </summary> public static void AddToggles(ActionBar bar) { foreach (IRoleFillerRule rule in AllRules) { IRoleFillerRule local = rule; bar.AddToggle(local.Name, (bool b) => MarkActive(local, b), ActiveRules.Contains(local)); } }
public static ActionBar.Tab GetViewPageTab(this ViewPager viewPager, ActionBar actionBar, string name) { var tab = actionBar.NewTab(); tab.SetText(name); tab.TabSelected += (o, e) => { viewPager.SetCurrentItem(actionBar.SelectedNavigationIndex, false); }; return tab; }
void ActionBarTabsSetup(ActionBar actionBar) { for (var i = 0; i < actionBar.NavigationItemCount; ++i) { var tab = actionBar.GetTabAt(i); var id = GetImageFromFilename(i); if (id != 0) TabSetup(tab, id); } }
public void AddActionBar(ActionBar actionBar) { if (actionBars.Count > actionBar.id) { actionBars[actionBar.id] = actionBar.gameObject; } else { while (actionBars.Count < actionBar.id) { actionBars.Add(null); } actionBars.Add(actionBar.gameObject); } UpdateActions(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.SimpleList); coursesViewModel = new CoursesViewModel(); FindViewById<TextView>(Resource.Id.screen_title).Text = "Cursos Disponíveis"; ListView list = FindViewById<ListView>(Resource.Id.list); adapter = new SimpleListAdapter<Course>(this, coursesViewModel.listContent); list.Adapter = adapter; list.ItemClick += new EventHandler<Android.Widget.AdapterView.ItemClickEventArgs>(list_ItemClick); actionBar = SupportActionBar; actionBar.SetHomeButtonEnabled(false); actionBar.SetDisplayHomeAsUpEnabled(false); actionBar.SetDisplayUseLogoEnabled(false); actionBar.SetDisplayShowHomeEnabled(false); actionBar.Title = "Cursos"; ServiceLocator.Messenger.Subscribe<BaseViewMessage>(m => { switch (m.Content.message) { case BaseViewMessage.MessageTypes.CONNECTION_ERROR: ServiceLocator.Dispatcher.invoke(() => { Toast.MakeText(this, "Erro de conexão", ToastLength.Short).Show(); dialog.Dismiss(); }); break; case BaseViewMessage.MessageTypes.CLASS_CONNECTION_OK: ServiceLocator.Dispatcher.invoke(() => { ServiceLocator.Dispatcher.invoke(() => { intent = new Intent(this, typeof(ClassActivity)); StartActivity(intent); }); }); break; case BaseViewMessage.MessageTypes.COURSE_CONNECTION_OK: ServiceLocator.Dispatcher.invoke(() => { //TODO refresh. }); break; default: break; } }); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.SimpleList); discussionViewModel = new DiscussionsViewModel(); FindViewById<TextView>(Resource.Id.screen_title).Text = "Fóruns Disponíveis"; ListView list = FindViewById<ListView>(Resource.Id.list); adapter = new SimpleListAdapter<Discussion>(this, discussionViewModel.discussions); list.Adapter = adapter; list.ItemClick += new System.EventHandler<AdapterView.ItemClickEventArgs>(list_ItemClick); actionBar = SupportActionBar; actionBar.SetHomeButtonEnabled(false); actionBar.SetDisplayHomeAsUpEnabled(false); actionBar.SetDisplayUseLogoEnabled(false); actionBar.SetDisplayShowHomeEnabled(false); actionBar.Title = "Fóruns"; ServiceLocator.Messenger.Subscribe<BaseViewMessage>(m => { switch (m.Content.message) { case BaseViewMessage.MessageTypes.CONNECTION_ERROR: ServiceLocator.Dispatcher.invoke(() => { Toast.MakeText(this, "Erro de conexão", ToastLength.Short).Show(); dialog.Dismiss(); }); break; case BaseViewMessage.MessageTypes.FUTURE_POSTS_LOADED: ServiceLocator.Dispatcher.invoke(() => { intent = new Intent(this, typeof(PostActivity)); StartActivity(intent); }); break; case BaseViewMessage.MessageTypes.NO_NEW_POSTS: ServiceLocator.Dispatcher.invoke(() => { Toast.MakeText(this, "Não há novos posts", ToastLength.Short).Show(); dialog.Dismiss(); }); break; default: break; } }); }
void TabSetup(ActionBar.Tab tab, int resourceId) { if (resourceId != 0) { //if (Droid.OS.Build.VERSION.SdkInt > Droid.OS.BuildVersionCodes.JellyBeanMr1) { // ImageView iv = new ImageView(activity); // iv.SetImageResource(resourceId); // iv.SetPadding(-25, 8, -25, 16); // tab.SetCustomView(iv); //} else { tab.SetIcon(resourceId); tab.SetText(""); //} } tab.TabSelected -= TabOnTabSelected; tab.TabSelected += TabOnTabSelected; }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { switch (tab.Position) { case 0: //Show content of tab1 break; case 1: //Show content of tab2 break; default: break; } }
/// <summary> /// Creates a new EventSchedulerWindow. /// </summary> public EventSchedulerWindow() { IEnumerable<EventSignature> allSignatures = EventLibrary.Instance.GetSignatures(); allSignatures = allSignatures.Where((EventSignature sig) => !sig.AffectsWorldState()); foreach (EventSignature sig in allSignatures) { allEvents.Add(new SchedulerEventArguments(sig, 0.0f, false)); } existingCollectionSelector = new ActionBar(true, true, false); foreach(EventCollection collection in EventCollectionManager.Instance.AllCollections) { EventCollection localCollection = collection; existingCollectionSelector.AddToggle(collection.Name, (bool b) => { if (b) Set(localCollection); }); } }
private void Init() { importSelection = new ActionBar(false, true, false); //Add all available narratives to the selection of available files. foreach (string name in serializer.OfferNames()) { string localName = name; importSelection.AddToggle(name, (bool val) => { if (val) { importFileName = exportFileName = localName; } else { importFileName = null; } }); } path = serializer.DirectoryPath; }
void TabSetup(ActionBar.Tab tab, int resID) { var linLay = new LinearLayout(activity) { LayoutParameters = new LayoutParams(LayoutParams.WrapContent, 180), Orientation = Orientation.Vertical, }; linLay.SetHorizontalGravity(Android.Views.GravityFlags.Center); var imageView = new ImageView(activity); imageView.SetImageResource(resID); imageView.SetPadding(-35, 4, -35, 0); imageView.SetMinimumWidth(60); var textView = new TextView(activity) { Text = tab.Text }; linLay.AddView(imageView); linLay.AddView(textView); tab.SetCustomView(linLay); }
async void TabOnTabSelected(object sender, ActionBar.TabEventArgs tabEventArgs) { int count=0; try{ ActionBar.Tab tab = (ActionBar.Tab)sender; Fragment fragment = fragmentsTab [tab.Position]; selectFragment = fragment; tabEventArgs.FragmentTransaction.Replace (Resource.Id.tabMainFrame,fragment); if(selectFragment.GetType()==typeof(FragmentTabRecent)){ count =(selectFragment as FragmentTabRecent).listTeams.Count; }else if(selectFragment.GetType()==typeof(FragmentTabLive)){ count=(selectFragment as FragmentTabLive).listTeams.Count; }else if(selectFragment.GetType()==typeof(FragmentTabUpcoming)){ count=(selectFragment as FragmentTabUpcoming).listTeams.Count; } if(count==0) await OnRefresh(); }catch{ } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.AboutDialog); if (ActionBar != null) { this.Title = ActionBar.Title = GetString(Resource.String.about_title); ActionBar.SetDisplayUseLogoEnabled(false); ActionBar.SetIcon(new ColorDrawable(Color.Transparent)); ActionBar.SetHomeButtonEnabled(false); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetDisplayShowHomeEnabled(true); ActionBar.SetDisplayShowTitleEnabled(true); } var frag = new AboutFragment(); FragmentManager.BeginTransaction() .Replace(Resource.Id.aboutContent, frag) .Commit(); }
public override void InitializeScreen() { SetContentView(Resource.Layout.layout_customer_details); SetScreenTitle(GetString(Resource.String.component_swap)); ActionBar.SetDisplayHomeAsUpEnabled(true); //init productsList = new List <SwapProduct>(); nameTextView = FindViewById <TextView>(Resource.Id.textView_customer_name); idNumberTextView = FindViewById <TextView>(Resource.Id.textView_idnumber); phoneNumberTextView = FindViewById <TextView>(Resource.Id.textView_customer_phone); previousButton = FindViewById <Button>(Resource.Id.button_previous); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView_products); UpdateScreen(); layoutManager = new LinearLayoutManager(this); recyclerView.SetLayoutManager(layoutManager); adapter = new ProductsAdapter(productsList, this); adapter.ItemClick += OnItemClick; recyclerView.SetAdapter(adapter); SetListeners(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Country); this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait; ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); count1_button = FindViewById <FrameLayout>(Resource.Id.country1); count2_button = FindViewById <FrameLayout>(Resource.Id.country2); count3_button = FindViewById <FrameLayout>(Resource.Id.country3); count4_button = FindViewById <FrameLayout>(Resource.Id.country4); count5_button = FindViewById <FrameLayout>(Resource.Id.country5); count6_button = FindViewById <FrameLayout>(Resource.Id.country6); count1_button.Click += Count1_button_Click; count2_button.Click += Count2_button_Click; count3_button.Click += Count3_button_Click; count4_button.Click += Count4_button_Click; count5_button.Click += Count5_button_Click; count6_button.Click += Count6_button_Click; }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); RequestWindowFeature (WindowFeatures.ActionBar); SetContentView (Resource.Layout.Main); ActionBar.NavigationMode = ActionBarNavigationMode.Standard; ActionBar.SetTitle(Resource.String.actionbar_title); ActionBar.SetDisplayShowTitleEnabled (true); lstQuickNote = FindViewById<ListView> (Resource.Id.listView1); CopyDatabase (); objDb = new DatabaseManager (); myList = objDb.ViewAll (); lstQuickNote.Adapter = new DataAdapter (this, myList); lstQuickNote.ItemClick += OnlstQuickNoteClick; lstQuickNote.ItemLongClick += listView_ItemLongClick; }
private void AddTab(string tabText, int iconResourceId, Fragment view) { var tab = ActionBar.NewTab(); tab.SetText(tabText); tab.SetIcon(iconResourceId); tab.TabSelected += delegate(object sender, ActionBar.TabEventArgs e) { // Check for existing Fragment in the container. var fragment = FragmentManager.FindFragmentById(Resource.Id.fragmentContainer); // Remove the existing Fragment if it exists. if (fragment != null) { e.FragmentTransaction.Remove(fragment); } // Add the Fragment that should be added. e.FragmentTransaction.Add(Resource.Id.fragmentContainer, view); }; tab.TabUnselected += (sender, e) => e.FragmentTransaction.Remove(view); ActionBar.AddTab(tab); }
public TIEFO() : base() { Type = FullType = "TIE/FO Fighter"; IconicPilots.Add(Faction.Imperial, typeof(OmegaLeader)); ManeuversImageUrl = "https://vignette.wikia.nocookie.net/xwing-miniatures/images/4/4f/MI_TIE-FO-FIGHTER.png"; Firepower = 2; Agility = 3; MaxHull = 3; MaxShields = 1; SubFaction = SubFaction.FirstOrder; PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Tech); ActionBar.AddPrintedAction(new TargetLockAction()); ActionBar.AddPrintedAction(new BarrelRollAction()); ActionBar.AddPrintedAction(new EvadeAction()); AssignTemporaryManeuvers(); HotacManeuverTable = new AI.TIEFOTable(); factions.Add(Faction.Imperial); faction = Faction.Imperial; SkinName = "First Order"; SoundShotsPath = "TIE-Fire"; ShotsCount = 2; for (int i = 1; i < 8; i++) { SoundFlyPaths.Add("TIE-Fly" + i); } }
private void AddTab(string text, int iconId, Fragment view) { var tab = ActionBar.NewTab(); tab.SetText(text); //tab.SetIcon(iconId); tab.TabSelected += (sender, e) => { var fragment = FragmentManager.FindFragmentById(Resource.Id.fragmentContainer); if (fragment != null) { e.FragmentTransaction.Remove(fragment); } e.FragmentTransaction.Add(Resource.Id.fragmentContainer, view); }; tab.TabUnselected += (sender, e) => { e.FragmentTransaction.Remove(view); }; ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); SetTitle(Resource.String.scan_license_plates); Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn); SetContentView(Resource.Layout.LicensePlateActivity); InitLicensePlateResultView(); scanView = FindViewById <LicensePlateScanView>(Resource.Id.license_plate_scan_view); scanView.SetConfigFromAsset("LicensePlateConfig.json"); scanView.InitAnyline(MainActivity.LicenseKey, this); scanView.CameraOpened += (s, e) => { Log.Debug(TAG, "Camera opened successfully. Frame resolution " + e.Width + " x " + e.Height); }; scanView.CameraError += (s, e) => { Log.Error(TAG, "OnCameraError: " + e.Event.Message); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_room); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.Title = "Connecting..."; messageContainer = (LinearLayout)FindViewById(Resource.Id.messages); colors = new Dictionary <String, Color>(); unusedColors = new HashSet <Color>(); foreach (String str in Utility.LightColors) { unusedColors.Add(Color.ParseColor(str)); } listener = new RoomListener(Intent.GetStringExtra("address"), Intent.GetIntExtra("port", 0), Intent.GetStringExtra("username"), Intent.GetStringExtra("password")); listener.OnRoomUpdate += UpdateInfoRoom; listener.OnConnect += Connected; listener.OnMessageReceived += AddMessage; listener.OnStatusReceived += AddStatusMessage; ((ImageButton)FindViewById(Resource.Id.sendMessageButton)).Click += SendMessage; ((ScrollView)FindViewById(Resource.Id.scrollMessages)).SystemUiVisibilityChange += OnScroll; messageContainer.LayoutChange += (o, e) => { if (bottomReached) { ((ScrollView)FindViewById(Resource.Id.scrollMessages)).FullScroll(FocusSearchDirection.Down); } }; newMessage = MediaPlayer.Create(this, Resource.Raw.sound_in); new Thread(StartListening).Start(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this.Title = Intent.GetStringExtra("MyData") ?? "Data not available"; SetContentView(Resource.Layout.Main); ActionBar.SetDisplayHomeAsUpEnabled(true); //var listview = FindViewById<ListView>(Resource.Id.gridview); List <Wine> myArr; myArr = SampleData(); int x; var gridview = FindViewById <GridView>(Resource.Id.gridview); myArr = SampleData(); GridViewAdapter adapter = new GridViewAdapter(this, myArr); gridview.Adapter = adapter; //gridview.SetColumnWidth(1); gridview.SetNumColumns(2); gridview.SetVerticalSpacing(2); gridview.SetHorizontalSpacing(1); gridview.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args) { //Toast.MakeText(this, args.Position.ToString(), ToastLength.Short).Show(); x = args.Position; if (x == 0 || x == 1 || x == 2 || x == 3) { var intent = new Intent(this, typeof(detailViewActivity)); StartActivity(intent); } }; }
public override void InitializeScreen() { SetContentView(Resource.Layout.layout_product_components); SetScreenTitle(GetString(Resource.String.component_swap)); ActionBar.SetDisplayHomeAsUpEnabled(true); //init productComponentsList = new List <ProductComponent>(); productTextView = FindViewById <TextView>(Resource.Id.textView_product_name); instructionsTextView = FindViewById <TextView>(Resource.Id.textView_instructions); noComponentsTextView = FindViewById <TextView>(Resource.Id.textView_no_components); previousButton = FindViewById <Button>(Resource.Id.button_previous); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView_products); UpdateScreen(); layoutManager = new LinearLayoutManager(this); recyclerView.SetLayoutManager(layoutManager); recyclerView.AddItemDecoration(new SpaceItemDecoration(this, Resource.Dimension.recycler_items_space, true, true)); adapter = new ProductComponentsAdapter(_productComponentsResponse, this, _product, _customerDetailsResponse); recyclerView.SetAdapter(adapter); SetListeners(); }
private void CycleGravity(object sender, EventArgs e) { var lp = (ActionBar.LayoutParams)custom_view.LayoutParameters; GravityFlags new_gravity = GravityFlags.NoGravity; switch ((GravityFlags)lp.Gravity & GravityFlags.HorizontalGravityMask) { case GravityFlags.Left: new_gravity = GravityFlags.CenterHorizontal; break; case GravityFlags.CenterHorizontal: new_gravity = GravityFlags.Right; break; case GravityFlags.Right: new_gravity = GravityFlags.Left; break; } lp.Gravity = ((GravityFlags)lp.Gravity & ~GravityFlags.HorizontalGravityMask | new_gravity); ActionBar.SetCustomView(custom_view, lp); }
public ARC170() : base() { Type = FullType = "ARC-170"; IconicPilots.Add(Faction.Rebel, typeof(NorraWexley)); ShipBaseArcsType = Arcs.BaseArcsType.ArcRear; ManeuversImageUrl = "https://vignette.wikia.nocookie.net/xwing-miniatures/images/2/2f/MR_ARC-170.png"; Firepower = 2; Agility = 1; MaxHull = 6; MaxShields = 3; PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Torpedo); PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Crew); PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Astromech); ActionBar.AddPrintedAction(new TargetLockAction()); AssignTemporaryManeuvers(); HotacManeuverTable = new AI.Arc170Table(); factions.Add(Faction.Rebel); faction = Faction.Rebel; SkinName = "ARC-170"; SoundShotsPath = "XWing-Laser"; ShotsCount = 2; for (int i = 1; i < 4; i++) { SoundFlyPaths.Add("XWing-Fly" + i); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); activity = this; /*Creation of tabs.*/ ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab tab = ActionBar.NewTab(); //Tab for ñcals. tab.SetText(Resource.String.tab_ListAlcohol); tab.TabSelected += Tab_TabSelectedListAlcohol; ActionBar.AddTab(tab); //Tab for alcohol calendar. tab = ActionBar.NewTab(); tab.SetText(Resource.String.tab_CalendarAlcohol); tab.TabSelected += Tab_TabSelectedCalendarAlcohol; ActionBar.AddTab(tab); //Going to selected tab. SetContentView(Resource.Layout.helpform_ParametersConnector); }
private void AddTab(string tabText, Fragment view) { var tab = ActionBar.NewTab(); tab.SetText(tabText); tab.TabSelected += delegate(object sender, ActionBar.TabEventArgs e) { var fragment = FragmentManager.FindFragmentById(Resource.Id.fragment_content); if (fragment != null) { e.FragmentTransaction.Remove(fragment); } e.FragmentTransaction.Add(Resource.Id.fragment_content, view); }; tab.TabUnselected += delegate(object sender, ActionBar.TabEventArgs e) { e.FragmentTransaction.Remove(view); }; ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; SetContentView(Resource.Layout.MainInterface); //Create tabs for the interface: ActionBar.Tab tab1 = ActionBar.NewTab(); tab1.SetText(Resources.GetString(Resource.String.tab_1)); tab1.TabSelected += (sender, args) => { //textLocation = FindViewById<TextView> (Resource.Id.textAddress); //textLocation.Text = "You are NOWHERE!!!!! YOU DON'T EXIST!"; }; ActionBar.AddTab(tab1); ActionBar.Tab tab2 = ActionBar.NewTab(); tab2.SetText(Resources.GetString(Resource.String.tab_2)); tab2.TabSelected += (sender, args) => { }; ActionBar.AddTab(tab2); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Store); // Toolbar var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(toolbar); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); gv = GlobalVariables.Instance; score = FindViewById <TextView>(Resource.Id.storeScoreText); storeListView = FindViewById <ListView>(Resource.Id.storeListView); Updatestats(); StoreAdapter adapter = new StoreAdapter(this, gv.storeItemList); storeListView.Adapter = adapter; }
/// <summary>Users of this fragment must call this method to set up the navigation drawer interactions. /// </summary> /// <remarks>Users of this fragment must call this method to set up the navigation drawer interactions. /// </remarks> /// <param name="fragmentId">The android:id of this fragment in its activity's layout. /// </param> /// <param name="drawerLayout">The DrawerLayout containing this fragment's UI.</param> public virtual void SetUp(int fragmentId, DrawerLayout drawerLayout) { mFragmentContainerView = Activity.FindViewById(fragmentId); mDrawerLayout = drawerLayout; mDrawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow, GravityCompat.Start); ActionBar actionBar = GetActionBar(); actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.SetHomeButtonEnabled(true); // ActionBarDrawerToggle ties together the the proper interactions // between the navigation drawer and the action bar app icon. // calls onPrepareOptionsMenu() // calls onPrepareOptionsMenu() // Defer code dependent on restoration of previous instance state. mDrawerLayout.DrawerOpened += async(sender, e) => { mDrawerToggle.OnDrawerOpened(e.DrawerView); if (!IsAdded) { return; } Activity.InvalidateOptionsMenu(); mDrawerToggle.SyncState(); }; mDrawerLayout.DrawerClosed += async(sender, e) => { mDrawerToggle.OnDrawerClosed(e.DrawerView); if (!IsAdded) { return; } Activity.InvalidateOptionsMenu(); mDrawerToggle.SyncState(); }; mDrawerLayout.SetDrawerListener(mDrawerToggle); }
public BWing() : base() { Type = FullType = "B-Wing"; IconicPilots.Add(Faction.Rebel, typeof(KeyanFarlander)); ManeuversImageUrl = "https://vignette.wikia.nocookie.net/xwing-miniatures/images/3/32/MR_B-WING.png"; Firepower = 3; Agility = 1; MaxHull = 3; MaxShields = 5; PrintedUpgradeIcons.Add(Upgrade.UpgradeType.System); PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Cannon); PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Torpedo); PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Torpedo); ActionBar.AddPrintedAction(new TargetLockAction()); ActionBar.AddPrintedAction(new BarrelRollAction()); AssignTemporaryManeuvers(); HotacManeuverTable = new AI.BWingTable(); factions.Add(Faction.Rebel); faction = Faction.Rebel; SkinName = "Teal"; SoundShotsPath = "XWing-Laser"; ShotsCount = 3; for (int i = 1; i < 4; i++) { SoundFlyPaths.Add("XWing-Fly" + i); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Setup1); this.Window.AddFlags(Android.Views.WindowManagerFlags.Fullscreen); ActionBar.Hide(); this.TitleFormatted = Android.Text.Html.FromHtml("<font color='#FF8000'>" + this.Title + "</font>"); PermissionLayout = FindViewById <LinearLayout>(Resource.Id.PermissionLayout); ToolsLayout = FindViewById <LinearLayout>(Resource.Id.ToolsLayout); button1 = FindViewById <Button>(Resource.Id.button1); button1.SystemUiVisibility = (StatusBarVisibility)SystemUiFlags.HideNavigation; button2 = FindViewById <Button>(Resource.Id.button2); button1.Click += ShowToolsLayout; PermissionLayout.Visibility = ViewStates.Visible; ToolsLayout.Visibility = ViewStates.Gone; button2.Visibility = ViewStates.Gone; button1.Visibility = ViewStates.Visible; if (!CheckPermissions(Global.Permissions)) { button2.Visibility = ViewStates.Visible; button1.Visibility = ViewStates.Gone; button2.Click += ReqPermission; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.SetHomeButtonEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); // Set our view from the "main" layout resource SetContentView(Resource.Layout.NewConversation); var contactAdapter = new ContactAdapter(this); var contentListView = FindViewById <ListView> (Resource.Id.ContactsListView); contentListView.Adapter = contactAdapter; contentListView.ItemClick += (sender, e) => { // Get selected contact infos var contact = (Contact)contentListView.GetItemAtPosition(e.Position); var intent = new Intent(this, typeof(ConversationActivity)); intent.PutExtra("normalizedPhone", contact.NormalizedNumber); StartActivity(intent); }; }
public void AdaptShipToSecondEdition() { ShipBaseArcsType = BaseArcsType.ArcDefault; Maneuvers["2.L.T"] = MovementComplexity.Normal; Maneuvers["2.R.T"] = MovementComplexity.Normal; MaxHull = 7; ShipBaseSize = BaseSize.Medium; ActionBar.RemovePrintedAction(typeof(BarrelRollAction)); ActionBar.AddPrintedAction(new BarrelRollAction() { IsRed = true }); PrintedUpgradeIcons.Remove(Upgrade.UpgradeType.SalvagedAstromech); PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Astromech); ShipAbilities.Add(new Abilities.SecondEdition.DeadToRights()); IconicPilots[Faction.Scum] = typeof(CartelExecutioner); }
public ProtectorateStarfighter() : base() { Type = FullType = "Protectorate Starfighter"; IconicPilots.Add(Faction.Scum, typeof(ConcordDawnAce)); ManeuversImageUrl = "https://vignette.wikia.nocookie.net/xwing-miniatures/images/8/83/MS_PROTECTORATE-STARFIGHTER.png"; ShipIconLetter = 'M'; Firepower = 3; Agility = 3; MaxHull = 4; MaxShields = 0; PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Torpedo); ActionBar.AddPrintedAction(new TargetLockAction()); ActionBar.AddPrintedAction(new BarrelRollAction()); ActionBar.AddPrintedAction(new BoostAction()); AssignTemporaryManeuvers(); HotacManeuverTable = new AI.ProtectorateStarfighterTable(); factions.Add(Faction.Scum); faction = Faction.Scum; SkinName = "Protectorate Starfighter"; SoundShotsPath = "TIE-Fire"; ShotsCount = 3; for (int i = 1; i < 8; i++) { SoundFlyPaths.Add("TIE-Fly" + i); } }
public EWing() : base() { Type = FullType = "E-Wing"; IconicPilots.Add(Faction.Rebel, typeof(KnaveSquadronPilot)); ManeuversImageUrl = "https://vignette.wikia.nocookie.net/xwing-miniatures/images/a/aa/MR_E-WING.png"; Firepower = 3; Agility = 3; MaxHull = 2; MaxShields = 3; PrintedUpgradeIcons.Add(Upgrade.UpgradeType.System); PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Torpedo); PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Astromech); ActionBar.AddPrintedAction(new TargetLockAction()); ActionBar.AddPrintedAction(new EvadeAction()); ActionBar.AddPrintedAction(new BarrelRollAction()); AssignTemporaryManeuvers(); HotacManeuverTable = new AI.EWingTable(); factions.Add(Faction.Rebel); faction = Faction.Rebel; SkinName = "Red"; SoundShotsPath = "XWing-Laser"; ShotsCount = 3; for (int i = 1; i < 4; i++) { SoundFlyPaths.Add("XWing-Fly" + i); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.SetDisplayShowHomeEnabled(true); historyList = new List <TranslationDataObject>(); string dbPath = ""; SQLiteConnection db = null; // Get the path to the database that was deployed in Assets dbPath = Path.Combine( System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "pigTranslatorDB.db3"); db = new SQLiteConnection(dbPath); historyList = db.Table <TranslationDataObject>().ToList(); // Instantiate our custom listView adapter ListAdapter = new TranslationDataAdapter(this, historyList); // This is all you need to do to enable fast scrolling ListView.FastScrollEnabled = true; }
public TIEAdvanced() : base() { Type = FullType = "TIE Advanced"; IconicPilots.Add(Faction.Imperial, typeof(DarthVader)); ManeuversImageUrl = "https://vignette1.wikia.nocookie.net/xwing-miniatures/images/8/85/MI_TIE-ADVANCED.png"; ShipIconLetter = 'A'; Firepower = 2; Agility = 3; MaxHull = 3; MaxShields = 2; PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Missile); ActionBar.AddPrintedAction(new EvadeAction()); ActionBar.AddPrintedAction(new BarrelRollAction()); ActionBar.AddPrintedAction(new TargetLockAction()); AssignTemporaryManeuvers(); HotacManeuverTable = new AI.TIEAdvancedTable(); factions.Add(Faction.Imperial); faction = Faction.Imperial; SkinName = "Gray"; SoundShotsPath = "TIE-Fire"; ShotsCount = 2; for (int i = 1; i < 8; i++) { SoundFlyPaths.Add("TIE-Fly" + i); } }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); accountId = Intent.GetStringExtra("accountId"); SetContentView(Resource.Layout.Result); ActionBar.SetDisplayHomeAsUpEnabled(true); mainList = FindViewById <ListView>(Resource.Id.Result_MainList); dataGrouper.InputDataCollection = datas; adapter = new TransactionGroupsAdapter(this, dataGrouper.GroupedDataCollection); mainList.Adapter = adapter; await MainActivity.helper.RealtimeInquireAsync(accountId, datas); FindViewById <ProgressBar>(Resource.Id.Result_ProgressBar).Visibility = ViewStates.Gone; if (datas.Count == 0) { FindViewById <TextView>(Resource.Id.Result_EmptyHint).Visibility = ViewStates.Visible; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.SetTheme(ChangeTheme.getTheme()); SetContentView(Resource.Layout.Settings); var transaction = FragmentManager.BeginTransaction(); var setFragment = new SettingsFragment(); transaction.Replace(Resource.Id.container, setFragment); transaction.Commit(); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(toolbar); ActionBar.Title = "Asetukset"; ActionBar.SetHomeButtonEnabled(true); // Takaisin-painike päällä ActionBar.SetDisplayHomeAsUpEnabled(true); ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(ApplicationContext); prefs.RegisterOnSharedPreferenceChangeListener(this); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // The Action Bar is a window feature. The feature must be requested // before setting a content view. Normally this is set automatically // by your Activity's theme in your manifest. The provided system // theme Theme.WithActionBar enables this for you. Use it as you would // use Theme.NoTitleBar. You can add an Action Bar to your own themes // by adding the element <item name="android:windowActionBar">true</item> // to your style definition. Window.RequestFeature(WindowFeatures.ActionBar); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); //view = Window.DecorView.RootView; view = FindViewById(Resource.Id.fragmentContainer); view.DrawingCacheEnabled = true; this.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.SetTitle(Resource.String.Title); ActionBar.SetSubtitle(Resource.String.SubTitle); ActionBar.SetDisplayShowTitleEnabled(false); ActionBar.SetDisplayHomeAsUpEnabled(false); AddTab("", Resource.Drawable.ic_action_share, new GridViewFragment()); AddTab("", Resource.Drawable.ic_tab_camera, new CameraTabFragment()); AddTab("", Resource.Drawable.ic_tab_note, new NoteTabFragment()); if (bundle != null) { this.ActionBar.SelectTab(this.ActionBar.GetTabAt(bundle.GetInt("tab"))); } }
private void InitializeTabs(Bundle savedInstanceState) { var summaryTab = ActionBar.NewTab() .SetText(Resource.String.Summary); var expensesTab = ActionBar.NewTab() .SetText(Resource.String.Expenses); var scheduleTab = ActionBar.NewTab() .SetText(Resource.String.Schedule); summaryTab.TabSelected += OnSummaryTabSelected; expensesTab.TabSelected += OnExpensesTabSelected; scheduleTab.TabSelected += OnScheduleTabSelected; ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.AddTab(summaryTab); ActionBar.AddTab(expensesTab); ActionBar.AddTab(scheduleTab); int selectedTabIndex = Math.Max(0, Math.Min(ActionBar.TabCount - 1, savedInstanceState?.GetInt(SelectedTabIndexKey) ?? 0)); ActionBar.SelectTab(ActionBar.GetTabAt(selectedTabIndex)); }
public void OnTabReselected (ActionBar.Tab tab, FragmentTransaction ft) { }
/// <summary> /// Adds a context menu for the given smart object. /// </summary> private void AddObjectContextMenu(SmartObject obj) { contextMenuArea = new Rect( Event.current.mousePosition.x + scrollPosition.x, Mathf.Min(Event.current.mousePosition.y + scrollPosition.y - parent.HEIGHT_BARS, height - 85 + scrollPosition.y), 250, 70); contextMenu = new ActionBar(false); //Close the context menu on cancel contextMenu.AddButton("Cancel", () => contextMenu = null); //Offer to remove the object.. contextMenu.AddButton("Remove", () => { RemoveSmartObject(obj); contextMenu = null; }); //..but only if it does not participate in any events contextMenu.SetActive("Remove", manager.GetInvolvedInEvents(obj).Count == 0); }
/// <summary> /// Creates a context menu for the "Fill In With" action. On back, goes back /// to the previous context menu. /// </summary> private void CreateFillInWithContextMenU(ActionBar oldContextMenu) { this.contextMenu = new ActionBar(false); this.contextMenu.AddButton("Back", () => this.contextMenu = oldContextMenu); FillInOptionsSerializer.AddToggles(this.contextMenu); this.contextMenu.AddButton("Fill In", () => { FillIn(null); this.contextMenu = null; }); }
/// <summary> /// Adds a new menu when right clicking an event, which offers some options /// for the given event. /// </summary> private void AddEventContextMenu(EventStub evnt) { contextMenu = new ActionBar(false); contextMenuArea = new Rect( Event.current.mousePosition.x + scrollPosition.x, Mathf.Min(Event.current.mousePosition.y + scrollPosition.y - parent.HEIGHT_BARS, height - 140 + scrollPosition.y), 250, 125); //Close the context menu on cancel contextMenu.AddButton("Cancel", () => contextMenu = null); //Clear the event's parameters on Clear Params contextMenu.AddButton("Clear Params", () => { for (int i = 0; i < evnt.NrOfNeededRoles; i++) { evnt.GetSelectorForIndex(i).TrySet(null); } contextMenu = null; }); //Remove the event from the manager and GUI contextMenu.AddButton("Remove", () => { RemoveEvent(evnt); CalculateEventAndObjectPositions(); contextMenu = null; }); //Fill in missing parameters contextMenu.AddButton("Fill In", () => { FillIn(evnt); contextMenu = null; }); //Fill in missing parameters after selecting rules contextMenu.AddButton("Fill In With", () => { CreateFillInWithContextMenU(contextMenu); }); //Highlight the event contextMenu.AddButton("Highlight", () => { SetEventColor(evnt, Color.cyan); contextMenu = null; }); //Configure the camera for the event contextMenu.AddButton("Camera", () => { SelectCameraArguments(evnt); contextMenu = null; }); }
/// <summary> /// Renders all the rectangles, and the lines between them if wanted. /// </summary> /// <param name="height">The height of the main window rectangle on screen.</param> /// <param name="width">The width of the main window rectangle on screen.</param> public void Render(float height, float width) { //handle zoom float zoom = Input.GetAxis("GUI Zoom"); if (Mathf.Abs(zoom) >= 0.1f) { float oldZoomLevel = zoomLevel; zoomLevel = Mathf.Clamp(zoomLevel + zoom * STEP_ZOOM, MIN_ZOOM, MAX_ZOOM); float scale = zoomLevel / oldZoomLevel; CalculateEventAndObjectPositions(); Vector2 mouseLocal = new Vector2( Mathf.Clamp(Event.current.mousePosition.x, 0, width), Mathf.Clamp(Event.current.mousePosition.y, 0, height)); //makes the zoom center around the mouse cursor scrollPosition = (scrollPosition + mouseLocal) * scale - mouseLocal; } this.MARGIN_BETWEEN = GUI.skin.button.margin.right; this.height = height; //handle end of drag/drop currentMousePosition = Event.current.mousePosition + scrollPosition; if (Event.current.type == EventType.mouseUp) { drawingParticipantConnection = false; if (draggingParticipant) { OnEndParticipantDrag(); } if (draggingEvent) { OnEndEventDrag(); } draggingParticipant = false; draggingEvent = false; } //remove events from the GUI that were deleted from the manager. List<EventStub> removedFromManager = new List<EventStub>(rectangleForEvent.Keys.Except(manager.AllEvents)); if (removedFromManager.Count() > 0) { foreach (EventStub evnt in removedFromManager) { RemoveEvent(evnt, false); } CalculateEventAndObjectPositions(); } //Add objects in all events that are not in the GUI (e.g. FillIn, WaypointGeneration) foreach(EventStub evnt in manager.AllEvents) { foreach (SmartObject obj in evnt.InvolvedObjects) { AddSmartObject(obj); } } //add events to the GUI which were added directly to the manager List<EventStub> missingInGUI = new List<EventStub>(manager.AllEvents.Except(rectangleForEvent.Keys)); foreach (EventStub evnt in missingInGUI.OrderBy((EventStub evnt) => manager.GetLevelForEvent(evnt))) { AddFinishedEvent(evnt, false); } //calculate the maximum level of any event maxLevel = 0; foreach (EventStub evnt in manager.AllEvents) { maxLevel = Mathf.Max(maxLevel, manager.GetLevelForEvent(evnt)); } GUI.enabled = contextMenu == null; this.totalHeight = zoomLevel * (maxLevel * HEIGHT_LEVEL + HEIGHT_OBJECT_RECT + MARGIN_TOP); //makes sure that if trying to place the event in the last level, extra space in GUI is allocated float totalHeight = Mathf.Max(this.totalHeight, draggingEvent ? eventDragRect.Position.yMax : 0); scrollPosition = GUI.BeginScrollView(new Rect(0, 0, width, height), scrollPosition, new Rect(0, 0, zoomLevel * (MARGIN_BETWEEN + maxNrOfEventsInLevel * (WIDTH_EVENT_RECT + MARGIN_BETWEEN)) + totalObjectWidth, totalHeight)); foreach (ContentRectangle<SmartObject> rect in rectangleForObject.Values) { rect.Render(); int objectLevel = manager.GetLevelForObject(rect.containedObject); if (ShowLines) { //draw the "life line" of the given object Vector3 startPoint = new Vector3( rect.Position.xMin + rect.Position.width / 2, rect.Position.yMin + rect.Position.height, 0); Vector3 endPoint = new Vector3( rect.Position.xMin + rect.Position.width / 2, rect.Position.yMax + zoomLevel * ((objectLevel > 0 ? objectLevel - 1 : objectLevel) * HEIGHT_LEVEL + HEIGHT_BETWEEN), 0); DrawLine(startPoint, endPoint, lineColorForObject[rect.containedObject]); } } foreach (ContentRectangle<EventStub> rect in rectangleForEvent.Values) { rect.Render(); } GUI.enabled = true; if (ShowLines) { foreach (EventStub evnt in rectangleForEvent.Keys) { DrawLines(evnt); } } if (contextMenu != null) { GUILayout.BeginArea(contextMenuArea); contextMenu.Render(true, false); GUILayout.EndArea(); } if (drawingParticipantConnection || draggingEvent) { OnContinueDraw(); } if (draggingParticipant) { OnContinueDrag(); } if (contextMenu != null && Event.current.type == EventType.mouseDown) { contextMenu = null; } GUI.EndScrollView(); }