protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.MyHealth_Main); //toolbar = (Toolbar)FindViewById (Resource.Id.tool_bar); //SetActionBar (toolbar); /*listData = new ListDataHolder (); recyclerView = FindViewById <RecyclerView> (Resource.Id.recyclerView); mLayoutManager = new LinearLayoutManager (this); recyclerView.SetLayoutManager (mLayoutManager); recyclerAdapter = new RecyclerViewAdapter (this, listData); recyclerView.SetAdapter (recyclerAdapter);*/ adapter = new MyHealth_ViewPagerAdapter (SupportFragmentManager); pager = FindViewById <ViewPager> (Resource.Id.pager); pager.Adapter = adapter; tabs = FindViewById<MyHealth_SlidingTabScrollView> (Resource.Id.tabs); tabs.ViewPager = pager; toolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.app_bar); toolbar.SetBackgroundColor (Color.ParseColor ("#009688")); SetSupportActionBar (toolbar); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _persoon = Gegevens.GetPerson(); _groep = Gegevens.CurrentGroup(); SetContentView(Resource.Layout.Betaalscherm); _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar); ImageView Avatar = _toolbar.FindViewById<ImageView>(Resource.Id.Avatar); TextView Title = _toolbar.FindViewById<TextView>(Resource.Id.Title); Title.Text = _groep.groepsnaam; foreach (var lid in _persoon.KrijgSchuldGroep(_groep)) { deelnemers.Add(new ListItem(lid.Key, Resource.Drawable.iconn, lid.Value, _groep)); } _adapter = new ListItemAdapter(ListItem.Session, deelnemers); _adapter.ItemClick += OnItemClick; _adapter.ItemLongClick += (sender, e) => {}; _recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerview); _recyclerView.SetMinimumHeight(ConvertDptoPx(listItemHeight*deelnemers.Count)); _recyclerView.SetLayoutManager(new LinearLayoutManager(this)); _recyclerView.SetScrollContainer(true); _recyclerView.NestedScrollingEnabled = false; _recyclerView.SetAdapter(_adapter); SetSupportActionBar(_toolbar); SupportActionBar.Title = ""; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar); if (_toolbar != null) { SetSupportActionBar(_toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); _toolbar.NavigationClick += delegate { OnBackPressed(); }; } _adapter = new ContactsListAdapter(this); _adapter.ItemClick += OnItemClick; var contactsListView = FindViewById<RecyclerView>(Resource.Id.contactsListView); contactsListView.SetAdapter(_adapter); contactsListView.SetLayoutManager(new LinearLayoutManager(contactsListView.Context)); ItemTouchHelper.Callback callback = new ContactsListCallBacks(_adapter, this); ItemTouchHelper itemTouchHelper = new ItemTouchHelper(callback); itemTouchHelper.AttachToRecyclerView(contactsListView); contactsListView.SetItemAnimator(new DefaultItemAnimator()); }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate (Resource.Layout.ProjectListFragment, container, false); recyclerView = view.FindViewById<RecyclerView> (Resource.Id.ProjectListRecyclerView); recyclerView.SetLayoutManager (new LinearLayoutManager (Activity)); recyclerView.AddItemDecoration (new ShadowItemDecoration (Activity)); recyclerView.AddItemDecoration (new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList)); emptyStateLayout = view.FindViewById<LinearLayout> (Resource.Id.ProjectListEmptyState); searchEmptyState = view.FindViewById<LinearLayout> (Resource.Id.ProjectListSearchEmptyState); tabLayout = view.FindViewById<TabLayout> (Resource.Id.WorkspaceTabLayout); newProjectFab = view.FindViewById<AddProjectFab> (Resource.Id.AddNewProjectFAB); toolBar = view.FindViewById<Toolbar> (Resource.Id.ProjectListToolbar); var activity = (Activity)Activity; activity.SetSupportActionBar (toolBar); activity.SupportActionBar.SetDisplayHomeAsUpEnabled (true); activity.SupportActionBar.SetTitle (Resource.String.ChooseTimeEntryProjectDialogTitle); HasOptionsMenu = true; newProjectFab.Click += OnNewProjectFabClick; tabLayout.SetOnTabSelectedListener (this); return view; }
public override void SetContentView(int layoutResID) { var contentView = (ViewGroup) LayoutInflater.From(this).Inflate( Resource.Layout.Settings, new LinearLayout(this), false); actionbar = contentView.FindViewById<Toolbar>(Resource.Id.toolbar); actionbar.SetNavigationOnClickListener(this); ViewGroup contentWrapper = (ViewGroup) contentView.FindViewById(Resource.Id.content_wrapper); LayoutInflater.From(this).Inflate(layoutResID, contentWrapper, true); Window.SetContentView(contentView); }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.MySoal_MainPager); adapter = new MySoal_ViewPagerAdapter (SupportFragmentManager); mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.myDrawer); mDrawerToggle = new Android.Support.V7.App.ActionBarDrawerToggle (this, mDrawerLayout, Resource.String.open_drawer, Resource.String.close_drawer); mDrawerLayout.SetDrawerListener (mDrawerToggle); leftListView = (LinearLayout)FindViewById (Resource.Id.leftListView); lvMMLListed = (ListView)FindViewById (Resource.Id.lvMMLListed); pager = FindViewById <ViewPager> (Resource.Id.pager); pager.Adapter = adapter; tabs = FindViewById<MySoal_SlidingTabScrollView> (Resource.Id.tabs); tabs.ViewPager = pager; toolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.app_bar); toolbar.SetBackgroundColor (Color.ParseColor ("#F44336")); SetSupportActionBar (toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled (true); SupportActionBar.SetHomeButtonEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled (true); MenuListItem = new List<LeftMenuListItems> (); MenuListItem.Add (new LeftMenuListItems(){ LeftMenuDrawerLabel = "Dashboard", LeftMenuDrawerIconID = Resource.Drawable.home3 }); MenuListItem.Add (new LeftMenuListItems(){ LeftMenuDrawerLabel = "My Soal", LeftMenuDrawerIconID = Resource.Drawable.cup2 }); MenuListItem.Add (new LeftMenuListItems(){ LeftMenuDrawerLabel = "My Health", LeftMenuDrawerIconID = Resource.Drawable.heart2 }); MenuListItem.Add (new LeftMenuListItems(){ LeftMenuDrawerLabel = "My Skool", LeftMenuDrawerIconID = Resource.Drawable.shield2 }); lvMMLListed.Adapter = new MainActivityAdapters (this, MenuListItem); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //setup toolbar switch (IoC.UserInfo.Employee.PrivledgeLevel) { case "Admin": { SetContentView(Resource.Layout.EventDetails_Admin); break; } case "Moderator": { SetContentView(Resource.Layout.EventDetails_Moderator); break; } default: { SetContentView(Resource.Layout.EventDetails_User); break; } } _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.event_details, this); Name = FindViewById<TextView>(Resource.Id.NameText); Date = FindViewById<TextView>(Resource.Id.DateText); Time = FindViewById<TextView>(Resource.Id.TimeText); Location = FindViewById<TextView>(Resource.Id.LocationText); Category = FindViewById<TextView>(Resource.Id.Category); Description = FindViewById<TextView>(Resource.Id.DescriptionText); Name.Text = Intent.GetStringExtra("Name") ?? "Data not available"; Date.Text = Intent.GetStringExtra("Date") ?? "Data not available"; Time.Text = Intent.GetStringExtra("Time") ?? "Data not available"; Location.Text = Intent.GetStringExtra("Location") ?? "Data not available"; Category.Text = Intent.GetStringExtra("Category") ?? "Data not available"; Description.Text = Intent.GetStringExtra("Description") ?? "Data not available"; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); //Resolve Stuff using (var scope = App.Container.BeginLifetimeScope()) { cartService = App.Container.Resolve <ICartService>(); _Adapter = App.Container.Resolve <InventoryAdapter>(); } // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); _RecylerView = FindViewById <RecyclerView>(Resource.Id.recycler_view); _LayoutManager = new LinearLayoutManager(this); _RecylerView.SetLayoutManager(_LayoutManager); _RecylerView.SetAdapter(_Adapter); }
protected override Task <bool> OnPushAsync(Page view, bool animated) { var retVal = base.OnPushAsync(view, animated); var activity = (Activity)_context; _toolbar = activity.FindViewById <AToolbar>(Resource.Id.toolbar); if (_toolbar != null && view is IntroPage) { if (_toolbar.NavigationIcon != null) { _toolbar.NavigationIcon = Android.Support.V4.Content.ContextCompat.GetDrawable(_context, Resource.Drawable.home); //toolbar.SetNavigationIcon(Resource.Drawable.Back); } } return(retVal); //return base.OnPushAsync(view, animated); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); model = new AuthorDataStoreSql(); viewModel = new ItemsViewModel <Author>(model); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); var recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); recyclerView.HasFixedSize = true; recyclerView.SetAdapter(adapter = new ItemsAdapter(this, viewModel)); addBtn = FindViewById <FloatingActionButton>(Resource.Id.fab); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.offline); recyclerView = FindViewById <RecyclerView>(Resource.Id.offlineRecyclerView); recyclerView.SetLayoutManager(recyLayoutManager = new LinearLayoutManager(this, (int)Orientation.Vertical, false)); recyclerView.SetAdapter(adapter = new RecyAdapter()); adapter.OnItemClick += Adapter_OnItemClick; toolbar = FindViewById <widget.Toolbar>(Resource.Id.offlineToolbar); toolbar.Title = "Offline"; toolbar.SetBackgroundColor(Android.Graphics.Color.ParseColor("#4CAF50")); toolbar.SetTitleTextColor(Android.Graphics.Color.ParseColor("#ffffff")); MyGlobal.ChangeStatusBarColor(Window, "#4CAF50"); MyGlobal.database.GetAllOfflineArticalList(MyGlobal.UidGenerator(), this); }
protected override void InitializeViews(View fragmentView) { mainRecyclerView = fragmentView.FindViewById <RecyclerView>(Resource.Id.MainRecyclerView); runningEntryCardFrame = fragmentView.FindViewById(Resource.Id.MainRunningTimeEntryFrame); playButton = fragmentView.FindViewById <FloatingActionButton>(Resource.Id.MainPlayButton); stopButton = fragmentView.FindViewById <FloatingActionButton>(Resource.Id.MainStopButton); coordinatorLayout = fragmentView.FindViewById <CoordinatorLayout>(Resource.Id.MainCoordinatorLayout); timeEntryCard = fragmentView.FindViewById(Resource.Id.MainContentArea); timeEntryCardTimerLabel = fragmentView.FindViewById <TextView>(Resource.Id.MainRunningTimeEntryTimerLabel); timeEntryCardDescriptionLabel = fragmentView.FindViewById <TextView>(Resource.Id.MainRunningTimeEntryDescription); timeEntryCardAddDescriptionLabel = fragmentView.FindViewById <TextView>(Resource.Id.MainRunningTimeEntryAddDescriptionLabel); timeEntryCardDotContainer = fragmentView.FindViewById(Resource.Id.MainRunningTimeEntryProjectDotContainer); timeEntryCardDotView = fragmentView.FindViewById(Resource.Id.MainRunningTimeEntryProjectDotView); timeEntryCardProjectClientTaskLabel = fragmentView.FindViewById <TextView>(Resource.Id.MainRunningTimeEntryProjectClientTaskLabel); refreshLayout = fragmentView.FindViewById <SwipeRefreshLayout>(Resource.Id.MainSwipeRefreshLayout); emptyStateViewStub = fragmentView.FindViewById <ViewStub>(Resource.Id.EmptyStateViewStub); welcomeBackStub = fragmentView.FindViewById <ViewStub>(Resource.Id.WelcomeBackViewStub); toolbar = fragmentView.FindViewById <Toolbar>(Resource.Id.Toolbar); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_exercise_add); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar_exercise_add); toolbar.Title = "Add a New Exercise Activity"; SetSupportActionBar(toolbar); DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view_exercise_add); navigationView.SetNavigationItemSelectedListener(this); AppCompatButton addExerciseButton = FindViewById <AppCompatButton>(Resource.Id.add_exercise_button); _hours = FindViewById <AppCompatEditText>(Resource.Id.exercise_hours); addExerciseButton.Click += async delegate { addExerciseButton.Enabled = false; string status = await OnAddExercisePressed(); if (status == "Success") { Finish(); } else { addExerciseButton.Enabled = true; RunOnUiThread(() => { Toast.MakeText(this, status, ToastLength.Long).Show(); }); } }; }
public override void SetContentView(int layoutResID) { fullView = (DrawerLayout)LayoutInflater.Inflate(Resource.Layout.AcBase, null); FrameLayout activityContainer = fullView.FindViewById <FrameLayout>(Resource.Id.activity_content); LayoutInflater.Inflate(layoutResID, activityContainer, true); base.SetContentView(fullView); Android.Support.V7.Widget.Toolbar toolbar = fullView.FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SetTitle(Resource.String.app_name); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.edit); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.navigationView); navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity = this; SyncfusionLicenseProvider.RegisterLicense("NDExOTM3QDMxMzgyZTM0MmUzMFZrM0k1K3BzaklSVVlIMGROOVVVK3dWYnJmUTJYUVNHUTNsMTZVY0d4aUE9"); Context context = this; res = context.Resources; SessionManager.SetLocale(res); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); Android.Support.V7.App.ActionBarDrawerToggle toggle = new Android.Support.V7.App.ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.SetNavigationItemSelectedListener(this); GridViewMain = FindViewById <RecyclerView>(Resource.Id.gridView_main); GridViewMain.SetLayoutManager(new GridLayoutManager(this, 2)); LoadProgressBar = FindViewById <ContentLoadingProgressBar>(Resource.Id.load_progress_bar); ProgressView = FindViewById <TextView>(Resource.Id.load_progress_bar_text); EncryptView = FindViewById <TextView>(Resource.Id.load_progress_bar_text_encrypt); SyncLayout = FindViewById <LinearLayout>(Resource.Id.sync_layout); FindViewById <ImageButton>(Resource.Id.btn_floating_action).Click += (o, e) => { if (SessionManager.User.IsAuthenticated) { SyncData(); } }; Title = res.GetString(Resource.String.app_title); // WorkRequest = PeriodicWorkRequest.Builder.From<DownloadsWorker>(TimeSpan.FromMinutes(20)).Build(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); toolbar = (Toolbar)FindViewById(Resource.Id.toolbar); toolbar.Title = "Home Page"; toolbar.InflateMenu(Resource.Menu.ToolbarMenu); SetupRecyclerView(); //toolbar.MenuItemClick += (sender, e) => //{ // var msg = ""; // switch (e.Item.ItemId) // { // case Resource.Id.discard: // msg = "Discard"; // break; // case Resource.Id.search: // msg = "Search"; // break; // case Resource.Id.edit: // msg = "Edit"; // break; // case Resource.Id.settings: // msg = "Setting"; // break; // case Resource.Id.exit: // msg = "Exit"; // break; // } // Toast.MakeText(this, msg, ToastLength.Short).Show(); //}; }
//This method is USELESS... 'cause I'm populating the list in the fetching method itself :D //private void InitData() //{ // listData.Add(new ChapterDetailData() // { // instructorChapterNumber = "Chapter 01", //For Chapter Number // instructorChapterName = "Introduction to Python 03" //For Chapter Name // }); //} private void FindViews() { //ToolBar Layout chapterListToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.instructorChapterListToolbar); chapterListBanner = FindViewById <ImageView>(Resource.Id.instructorChapterListBanner); chapterListInstructorName = FindViewById <EditText>(Resource.Id.chapterListInstructorName); chapterListLabel1 = FindViewById <TextView>(Resource.Id.chapterListLabel1); chapterListLabel2 = FindViewById <TextView>(Resource.Id.chapterListLabel2); //RecyclerView Layout chapterListRecyclerView = FindViewById <RecyclerView>(Resource.Id.chapterListInstructorList); chapterListRecyclerView.HasFixedSize = true; layoutManager = new LinearLayoutManager(this); chapterListRecyclerView.SetLayoutManager(layoutManager); recycleAdapter2 = new chapterRecycleViewAdapter(listData, this); chapterListRecyclerView.SetAdapter(recycleAdapter2); //Fonts Typeface tf = Typeface.CreateFromAsset(Assets, "CerebriSans-Regular.otf"); chapterListLabel1.SetTypeface(tf, TypefaceStyle.Bold); chapterListLabel2.SetTypeface(tf, TypefaceStyle.Bold); chapterListInstructorName.SetTypeface(tf, TypefaceStyle.Normal); //Set Toolbar Title and Banner depending upon the Click of Course chapterListToolbar.Title = "Default ToolBar"; //var imageBitmap = GetImageBitmapFromUrl(language_image); //chapterListBanner.SetImageBitmap(imageBitmap); chapterListToolbar.Title = language_name; //chapterListBanner; updateChapterListBanner(language_id); //If adding anything in this block, add after these 3 lines SetSupportActionBar(chapterListToolbar); if (SupportActionBar != null) { SupportActionBar.SetDisplayHomeAsUpEnabled(true); } }
protected override void OnCreate(Bundle savedInstanceState) { UserID = app.GetString("USERID", string.Empty); _lang = app.GetString("Language", "en"); ChangeLanguage(_lang); Fade slide = new Fade(FadingMode.In); Explode explode = new Explode(); Window.EnterTransition = slide; Window.ExitTransition = explode; // Create your application here base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.search_activity); mToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); mBottomNav = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation_view); mBottomCardView = FindViewById <CardView>(Resource.Id.bottom_cardview); mLoaderContent = FindViewById <RelativeLayout>(Resource.Id.relativeLayout); mBottomNav.SetOnNavigationItemSelectedListener(this); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); txtSearch = FindViewById <TextView>(Resource.Id.txtSearch); imgSearch = FindViewById <ImageView>(Resource.Id.imgSearchView); InitDecoration(); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.SetDisplayHomeAsUpEnabled(true); var hint = Resources.GetString(Resource.String.hint_search_in); SupportActionBar.Title = hint + " Wanunuzi"; SetUpRecyclerView(recyclerView); SearchOffset = string.Empty; search += ActivitySearch_search; progressBar.Visibility = ViewStates.Invisible; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); myDrawer = FindViewById <DrawerLayout>(Resource.Id.myDrawer); myToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.myToolbar); _toggle = new ActionBarDrawerToggle(this, myDrawer, myToolbar, 0, 1); lstBuildings = FindViewById <RecyclerView>(Resource.Id.BuildingMainListView); refreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); refreshLayout.SetColorSchemeColors(Color.Red, Color.Green, Color.Blue, Color.Yellow); btnRahn = FindViewById <Button>(Resource.Id.btnRahn); btnForoush = FindViewById <Button>(Resource.Id.btnForoush); btnMosharekat = FindViewById <Button>(Resource.Id.btnMosharekat); btnPishForoush = FindViewById <Button>(Resource.Id.btnPishForoush); SetSupportActionBar(myToolbar); SetUi(); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(true); if (savedInstanceState != null) { SupportActionBar.SetTitle(savedInstanceState.GetString("DrawerState") == "Opened" ? Resource.String.OpenDrawer : Resource.String.CloseDrawer); } else { SupportActionBar.SetTitle(Resource.String.CloseDrawer); } refreshLayout.Refresh += SwipeRefreshLayoutMain_Refresh; btnRahn.Click += BtnRahnOnClick; btnForoush.Click += BtnForoushOnClick; btnMosharekat.Click += BtnMosharekatOnClick; btnPishForoush.Click += BtnPishForoushOnClick; btnRahn.PerformClick(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); newTaskFragment = new NewTaskFragment(this); historyFragment = new HistoryFragment(this); donationFragment = new DonationFragment(); preferenceFragment = new PreferenceFragment(this); toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.mainToolBar); SetSupportActionBar(toolbar); navigation = FindViewById <Google.Android.Material.BottomNavigation.BottomNavigationView>(Resource.Id.navigation); navigation.SetOnNavigationItemSelectedListener(this); ChangeFragment(newTaskFragment); MobileAds.Initialize(this); if (!ExtractRAdManager.UserHasDonated(this)) { interstitialAd = ExtractRAdManager.LoadAdInBackground(this); } if (AppCompatDelegate.DefaultNightMode == AppCompatDelegate.ModeNightYes) { navigation.ItemIconTintList = Android.Content.Res.ColorStateList.ValueOf(Android.Graphics.Color.GhostWhite); navigation.ItemTextColor = Android.Content.Res.ColorStateList.ValueOf(Android.Graphics.Color.GhostWhite); } else if (AppCompatDelegate.DefaultNightMode == AppCompatDelegate.ModeNightNo) { string accentColorString = "#" + GetColor(Resource.Color.colorAccent).ToString("X"); Android.Graphics.Color accentColor = Android.Graphics.Color.ParseColor(accentColorString); navigation.ItemIconTintList = Android.Content.Res.ColorStateList.ValueOf(accentColor); navigation.ItemTextColor = Android.Content.Res.ColorStateList.ValueOf(accentColor); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.InformationViews); mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); mLeftDrawer = FindViewById <ListView>(Resource.Id.left_drawer); CreateElements(); SetSupportActionBar(mToolbar); mLeftDataSet = new List <string>(); mLeftDataSet.Add("Главная страница"); mLeftDataSet.Add("Аккаунт"); mLeftDataSet.Add("О нас"); mLeftAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet); mLeftDrawer.Adapter = mLeftAdapter; SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(true); mLeftDrawer.ChoiceMode = ChoiceMode.Single; mLeftDrawer.ItemClick += (sender, e) => { string s_item = mLeftDrawer.GetItemAtPosition(e.Position).ToString(); if (s_item == "Главная страница") { var intent = new Intent(this, typeof(MainActivity)); StartActivity(intent); } else { if (s_item == "Аккаунт") { Toast.MakeText(this, "Тут будет авторизация!", ToastLength.Short).Show(); } else { Toast.MakeText(this, "Тут будет информация о нас!", ToastLength.Short).Show(); } } }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ActivityWebView); mName = Intent.GetStringExtra("name"); mHtmlBase64 = Intent.GetStringExtra("htmlbase64"); int mScale = Intent.GetIntExtra("zoom", 0); int mTop = Intent.GetIntExtra("top", 0); int mLeft = Intent.GetIntExtra("left", 0); mToolbar = FindViewById <SupportToolbar>(Resource.Id.Toolbar); mToolbar.Title = mName; SetSupportActionBar(mToolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); var base64EncodedBytes = Convert.FromBase64String(mHtmlBase64); html = Encoding.UTF8.GetString(base64EncodedBytes); mReportAddr = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/Download/1C_Files/Report.html"; mWebView = (WebView)FindViewById(Resource.Id.WebView); mWebView.Settings.BuiltInZoomControls = true; mWebView.Settings.DisplayZoomControls = true; var customWebViewClient = new CustomWebViewClient(); customWebViewClient.OnPageLoaded += (sender, b) => { if (mScale != 0) { mWebView.SetInitialScale(mScale); mWebView.ScrollTo(mLeft, mTop); } }; mWebView.SetWebViewClient(customWebViewClient); mWebView.LoadData(html_preprocessor(html), "text/html", "UTF-8"); }
protected override void OnCreate(Bundle savedInstanceState) { SetContentView(Resource.Layout.activity_main); SupportToolbar toolbar = FindViewById <SupportToolbar>(Resource.Id.mainToolbar); SetSupportActionBar(toolbar); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); SupportActionBar.SetDisplayHomeAsUpEnabled(true); _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); _navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); if (_navigationView != null) { SetupDrawerContent(_navigationView); } var projectName = savedInstanceState?.GetString("projectName"); var previousMenuItem = savedInstanceState?.GetInt("menuItem"); if (projectName != null) { CurrentProject = ProjectsLogic.DownloadProjects().Find(p => p.Name == projectName); CurrentProject.ProjectRules = RulesHelper.DownloadRules(Assets); ActivateProjectSubmenu(CurrentProject); } if (previousMenuItem != null && _navigationView != null) { _previousMenuItem = _navigationView.Menu.FindItem((int)previousMenuItem); _previousMenuItem.SetChecked(true); } _searchQuery = savedInstanceState?.GetString("searchQuery") ?? string.Empty; base.OnCreate(savedInstanceState); if (savedInstanceState == null) { LoadProjectsListFragment(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.invoicesedit_activity); // Setup toolbar Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); toolbar.SetTitle(Resource.String.applicationname); // Set toolbar title here if (toolbar != null) { SetSupportActionBar(toolbar); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); } var repository = new Repository(); int invoiceId = this.Intent.Extras.GetInt("InvoiceId"); Invoice invoice = repository.GetInvoices().Where(x => x.Id == invoiceId).FirstOrDefault(); // To handle animations. If we don't do this, the animation will stutter upon page load. TextInputLayout textInputLayoutInvoiceReferenceNumber = FindViewById <TextInputLayout>(Resource.Id.textInputLayoutInvoiceReferenceNumber); TextInputLayout textInputLayoutInvoiceBillTo = FindViewById <TextInputLayout>(Resource.Id.textInputLayoutInvoiceBillTo); TextInputLayout textInputLayoutInvoiceAmount = FindViewById <TextInputLayout>(Resource.Id.textInputLayoutInvoiceAmount); textInputLayoutInvoiceReferenceNumber.HintAnimationEnabled = false; textInputLayoutInvoiceBillTo.HintAnimationEnabled = false; textInputLayoutInvoiceAmount.HintAnimationEnabled = false; TextView referenceNumberTextView = FindViewById <TextView>(Resource.Id.invoiceReferenceNumber); TextView billToTextView = FindViewById <TextView>(Resource.Id.invoiceBillTo); TextView amountTextView = FindViewById <TextView>(Resource.Id.invoiceAmount); referenceNumberTextView.Text = invoice.ReferenceNumber; billToTextView.Text = invoice.BillTo; amountTextView.Text = invoice.Amount.ToString(); // re-enable animations again textInputLayoutInvoiceReferenceNumber.HintAnimationEnabled = true; textInputLayoutInvoiceBillTo.HintAnimationEnabled = true; textInputLayoutInvoiceAmount.HintAnimationEnabled = true; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar); SetSupportActionBar(mToolbar); bToolbar = FindViewById <SupportToolbar>(Resource.Id.lower_toolbar); bToolbar.InflateMenu(Resource.Menu.bot_menu); bToolbar.MenuItemClick += bToolbar_Click; mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); mLeftDrawer = FindViewById <ListView>(Resource.Id.left_menu); Dictionary <string, string[]> menu = new Dictionary <string, string[]>(); menu.Add("File", new string[] { "New", "Open", "Save", "Save as..", "Save in cloud", "Load from cloud", "Exit" }); menu.Add("Window", new string[] { "Rename", "Close", "Close all" }); menu.Add("Plugins", new string[] { "Simple Figure", "Figure with text" }); menu.Add("Skins", new string[] { "Dark", "Light", "Pink" }); menu.Add("Language", new string[] { "English", "Ukrainian", "Russian" }); menu.Add("Help", new string[] { "About..", "Show help.." }); mLeftDrawer.Adapter = new CustomAdapter(this, menu); mDrawerToggle = new LeftMenuToggler( this, //Host Activity mDrawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); mDrawerLayout.SetDrawerListener(mDrawerToggle); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(false); mDrawerToggle.SyncState(); }
public override void OnViewAdded(Android.Views.View child) { base.OnViewAdded(child); if (child.GetType() == typeof(Support.Toolbar)) { toolbar = (Support.Toolbar)child; } for (int i = 0; i < toolbar.ChildCount; i++) { var item = toolbar.GetChildAt(i); if (item.GetType() == typeof(ImageButton)) { ImageButton ib = item as ImageButton; ib.SetImageResource(Resource.Drawable.hollowstar); } } }
protected override void OnCreate(Android.OS.Bundle savedInstanceState) { base.OnCreate(savedInstanceState); toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); imgProfile = FindViewById <ImageView>(Resource.Id.imgProfile); txtUserName = FindViewById <TextView>(Resource.Id.txtUserName); btCall = FindViewById <ImageButton>(Resource.Id.btCall); recyclerCallHistory = FindViewById <RecyclerView>(Resource.Id.recycleHistory); RecyclerAdapter = new CallHistoryAdapter(this); LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false); recyclerCallHistory.SetLayoutManager(layoutManager); recyclerCallHistory.SetAdapter(RecyclerAdapter); }
private void FnSetUpControls() { mToolbar = thisFragmentView.FindViewById <SupportToolbar>(Resource.Id.toolbarTitle); mRlContents = thisFragmentView.FindViewById <RelativeLayout>(Resource.Id.rlContents); mCardviewRunnerAppearance = thisFragmentView.FindViewById <CardView>(Resource.Id.cardviewCustomerAppearance); mTxtInputLayoutRunnerName = thisFragmentView.FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutCustomerName); mTxtInputLayoutMobileNumber = thisFragmentView.FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutMobileNumber); mTxtInputLayoutRunnerAddress = thisFragmentView.FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutCustomerAddress); mEtRunnerName = thisFragmentView.FindViewById <EditText>(Resource.Id.etCustomerName); mEtMobileNumber = thisFragmentView.FindViewById <EditText>(Resource.Id.etMobileNumber); mEtRunnerAddress = thisFragmentView.FindViewById <EditText>(Resource.Id.etCustomerAddress); mLlSaveButtonContainer = thisFragmentView.FindViewById <LinearLayout>(Resource.Id.llSaveButtonContainer); mBtnSaveRunner = thisFragmentView.FindViewById <Button>(Resource.Id.btnSaveCustomer); mToolbar.Visibility = ViewStates.Gone; mEtRunnerName.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(Runner_NAME_MAX_LENGTH) }); mEtMobileNumber.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(MOBILE_NUMBER_MAX_LENGTH) }); mEtRunnerAddress.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(ADDRESS_MAX_LENGTH) }); }
public void CustomizeToolbarAndViewPager() { toolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar_invite); TextView toolbarTitle = FindViewById <TextView>(Resource.Id.toolbar_title); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(false); toolbarTitle.Text = "Добавление и поиск"; progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar); contentLayout = FindViewById <LinearLayout>(Resource.Id.mainContentLayout); recyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view); inviteAdapter = new InviteAdapter(invitesList); inviteAdapter.ItemClick += InviteAdapter_ItemClick; recyclerView.SetAdapter(inviteAdapter); layoutManager = new LinearLayoutManager(this); recyclerView.SetLayoutManager(layoutManager); }
private void SetRecyclerViewLayoutHeight(ExpandableListView layout, Android.Support.V7.Widget.Toolbar layoutBelow) { int searchToolBarHeight = mToolBar.Height; int checkoutButtonHeight = rlCheckoutCartButtonContainer.Height; int recyclerViewHeight = layout.Height; int calculatedHeight = recyclerViewHeight - checkoutButtonHeight; int _topMargin = 0; int _bottomMargin = 0; int _leftMargin = 0; //dpToPixel(5); int _rightMargin = 0; //dpToPixel(5); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, calculatedHeight); layoutParams.SetMargins(_leftMargin, _topMargin, _rightMargin, _bottomMargin); layoutParams.AddRule(LayoutRules.Below, layoutBelow.Id); layout.LayoutParameters = layoutParams; layout.RequestLayout(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); recyclerView = (RecyclerView)FindViewById(Resource.Id.myRecyclerView); searchButton = (ImageView)FindViewById(Resource.Id.searchButton); searchText = (EditText)FindViewById(Resource.Id.searchText); service = new CarService(); cars = System.Threading.Tasks.Task.Run(() => service.GetAll())?.Result; searchText.TextChanged += OnSearchTextChanged; SetupRecycleView(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.ListaPratos); mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view); toolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar); TextView mTitle = (TextView)toolbar.FindViewById(Resource.Id.toolbar_title); mTitle.SetText("Resultados", TextView.BufferType.Normal); mLayoutManager = new LinearLayoutManager(this); mRecyclerView.SetLayoutManager(mLayoutManager); mAdapter = new PratoAdapter(pratoList); mAdapter.ItemClick += OnItemClick; mRecyclerView.SetAdapter(mAdapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(false); tabLayout = FindViewById <TabLayout>(Resource.Id.tabLayout); viewPager = FindViewById <ViewPager>(Resource.Id.viewPager); dataModelList = new List <RecyclerViewDataModel>(); loadData(); viewPager.Adapter = recyclerViewFragmentPagerAdapter; tabLayout.SetupWithViewPager(viewPager); }
private void InitToolbar() { try { TopChatToolBar = FindViewById <Toolbar>(Resource.Id.toolbar); if (TopChatToolBar != null) { TopChatToolBar.SetTitleTextColor(Color.White); SetSupportActionBar(TopChatToolBar); SupportActionBar.SetDisplayShowCustomEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); } } catch (Exception e) { Console.WriteLine(e); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_mainAllEvents); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); View hv = navigationView.GetHeaderView(0); Fullname = hv.FindViewById <TextView>(Resource.Id.Fullname); id = hv.FindViewById <TextView>(Resource.Id.ID); imageSrc = hv.FindViewById <ImageView>(Resource.Id.imageView); navigationView.SetNavigationItemSelectedListener(this); Dsql1 = req(Dsql1); string Full = Dsql1.Secondname + " " + Dsql1.Name; Fullname.Text = Full; id.Text = "ID - " + Sessions.GetSession(); int resourceId = (int)typeof(Resource.Drawable).GetField(Dsql1.image).GetValue(null); imageSrc.SetImageResource(resourceId); Devents = GetEvents(); recycler = FindViewById <RecyclerView>(Resource.Id.recycler); recycler.HasFixedSize = true; layoutManager = new LinearLayoutManager(this); recycler.SetLayoutManager(layoutManager); adapter = new RecyclerViewAdapterEvents(Devents, this); adapter.ItemClick += OnItemClick; recycler.SetAdapter(adapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); lib = new TicTacToeLib(); currentBoard = lib.CreateEmptyBoard(); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); tile1 = FindViewById <AppCompatTextView>(Resource.Id.textView1); tile2 = FindViewById <AppCompatTextView>(Resource.Id.textView2); tile3 = FindViewById <AppCompatTextView>(Resource.Id.textView3); tile4 = FindViewById <AppCompatTextView>(Resource.Id.textView4); tile5 = FindViewById <AppCompatTextView>(Resource.Id.textView5); tile6 = FindViewById <AppCompatTextView>(Resource.Id.textView6); tile7 = FindViewById <AppCompatTextView>(Resource.Id.textView7); tile8 = FindViewById <AppCompatTextView>(Resource.Id.textView8); tile9 = FindViewById <AppCompatTextView>(Resource.Id.textView9); tile1.SetOnTouchListener(this); tile2.SetOnTouchListener(this); tile3.SetOnTouchListener(this); tile4.SetOnTouchListener(this); tile5.SetOnTouchListener(this); tile6.SetOnTouchListener(this); tile7.SetOnTouchListener(this); tile8.SetOnTouchListener(this); tile9.SetOnTouchListener(this); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += FabOnClick; reset_puzzle(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); handler = new Handler(); StatusBarCompat.SetOrdinaryToolBar(this); toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); toolbar.SetNavigationIcon(Resource.Drawable.back_24dp); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); toolbar.SetNavigationOnClickListener(this); var packageInfo = this.PackageManager.GetPackageInfo(this.PackageName, 0); var txtVersion = FindViewById <TextView>(Resource.Id.txtVersion); txtVersion.Text = packageInfo.VersionName; FindViewById <LinearLayout>(Resource.Id.layoutSurvey).Click += (object sender, EventArgs e) => { Intent intent = new Intent(Intent.ActionSendto); intent.AddFlags(ActivityFlags.NewTask); intent.SetData(Android.Net.Uri.Parse("mailto:" + Resources.GetString(Resource.String.survey_email))); if (intent.ResolveActivity(this.PackageManager) != null) { intent.PutExtra(Intent.ExtraSubject, "来自 " + packageInfo.PackageName + " - " + packageInfo.VersionName + " 的反馈意见"); intent.PutExtra(Intent.ExtraText, "设备信息:Android " + Build.VERSION.Release + " - " + Build.Manufacturer + " - " + Build.Model + "\n(如果涉及隐私请手动删除这个内容)\n\n"); StartActivity(intent); } else { Toast.MakeText(this, "系统中没有安装邮件客户端", ToastLength.Short).Show(); } }; FindViewById <LinearLayout>(Resource.Id.layoutQQ).Click += (object sender, EventArgs e) => { sharesWidget.Open("http://shang.qq.com/wpa/qunwpa?idkey=5c281d37638467fb0f411484dcd513b89ba82b58decb8518cc2523b95232dd9b", "博客园第三方APP开发交流群"); }; FindViewById <LinearLayout>(Resource.Id.layoutOpenSourceUrl).Click += (object sender, EventArgs e) => { sharesWidget.Open(Resources.GetString(Resource.String.open_source_url), "博客园第三方Android客户端,Xamarin App,Material Design风格"); }; sharesWidget = new UMengSharesWidget(this); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); switch (IoC.UserInfo.Employee.PrivledgeLevel) { case "Admin": { SetContentView(Resource.Layout.Overtime_Admin); break; } case "Moderator": { SetContentView(Resource.Layout.Overtime_Moderator); break; } default: { SetContentView(Resource.Layout.Overtime_User); break; } } _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.overtime_schedule, this); Button overtimeBtn = FindViewById<Button>(Resource.Id.ButtonOvertime); overtimeBtn.Click += delegate { Intent browse = new Intent(Intent.ActionView, Android.Net.Uri.Parse("https://drive.google.com/open?id=0B2kq5WLtKIJHRUtsT0x3cWlPQ1k")); StartActivity(browse); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.ReportListView); _applicantReport = JsonConvert.DeserializeObject<Applicant> (Intent.GetStringExtra ("Applicant")); _progressDialog = new ProgressDialog(this); _progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner); _progressDialog.SetMessage("Loading . . ."); _progressDialog.Show(); //If the device is portrait, then show the RecyclerView in a vertical list, //else show it in horizontal list. _layoutManager = Resources.Configuration.Orientation == Android.Content.Res.Orientation.Portrait ? new LinearLayoutManager(this, LinearLayoutManager.Vertical, false) : new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false); //Experiement with a GridLayoutManger! You can create some cool looking UI! //This create a gridview with 2 rows that scrolls horizontally. // _layoutManager = new GridLayoutManager(this, 2, GridLayoutManager.Horizontal, false); //Create a reference to our RecyclerView and set the layout manager; _recyclerView = FindViewById<RecyclerView>(Resource.Id.reportRecyclerListView); _recyclerView.SetLayoutManager(_layoutManager); //Get our crew member data. This could be a web service. _reportList.Add (_applicantReport); //Create the adapter for the RecyclerView with our crew data, and set //the adapter. Also, wire an event handler for when the user taps on each //individual item. _adapter = new ReportViewAdapter(_reportList,this.Resources); _adapter.ItemClick += OnItemClick; _recyclerView.SetAdapter(_adapter); _progressDialog.Dismiss(); /************TOOLBAR******************************************************/ _toolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar); _drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout); _leftDrawer = FindViewById<ListView>(Resource.Id.left_drawer); _rightDrawer = FindViewById<ListView>(Resource.Id.right_drawer); //tag left and right drawer for case statment when clicked _leftDrawer.Tag = 0; _rightDrawer.Tag = 1; //Set action support toolbar with private class variable SetSupportActionBar(_toolbar); //***********LEFT DATA SET******************************/ //Left data set, these are the buttons you see when you click on the drawers _leftDataSet = new List<string>(); //my_profile has a string in the string xml file in values directory _leftDataSet.Add(GetString(Resource.String.main_menu)); //log_out has a string in the string xml file in values directory _leftDataSet.Add(GetString(Resource.String.log_out)); _leftAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, _leftDataSet); _leftDrawer.Adapter = _leftAdapter; //click event for the left drawer this._leftDrawer.ItemClick += LeftDrawerRowClick; //***********RIGHT DATA SET******************************/ _rightDataSet = new List<string>(); //support has a string in the string xml file in values directory _rightDataSet.Add(GetString (Resource.String.help_popup)); //rentproof has a string in the string xml file in values directory _rightDataSet.Add(GetString(Resource.String.support)); _rightAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, _rightDataSet); _rightDrawer.Adapter = _rightAdapter; this._rightDrawer.ItemClick += RightDrawerRowClick; //constructor for navigation bar _drawerToggle = new NavigationBar( this, //Host Activity _drawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); //set drawerlistener _drawerLayout.SetDrawerListener(_drawerToggle); //set home button SupportActionBar.SetDisplayHomeAsUpEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled(true); _drawerToggle.SyncState(); if (bundle != null){ if (bundle.GetString("DrawerState") == "Opened"){ SupportActionBar.SetTitle(Resource.String.openDrawer); } else{ SupportActionBar.SetTitle(Resource.String.closeDrawer); } } else{ //This is the first the time the activity is ran SupportActionBar.SetTitle(Resource.String.closeDrawer); } //*****************END OF ONCREATE TOOLBAR*********** }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.My_BackgroundReports); _progressDialog = new ProgressDialog(this); _progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner); _progressDialog.SetMessage("Loading Team . . ."); _progressDialog.Show(); //If the device is portrait, then show the RecyclerView in a vertical list, //else show it in horizontal list. _layoutManager = Resources.Configuration.Orientation == Android.Content.Res.Orientation.Portrait ? new LinearLayoutManager(this, LinearLayoutManager.Vertical, false) : new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false); //Experiement with a GridLayoutManger! You can create some cool looking UI! //This create a gridview with 2 rows that scrolls horizontally. // _layoutManager = new GridLayoutManager(this, 2, GridLayoutManager.Horizontal, false); //Create a reference to our RecyclerView and set the layout manager; _recyclerView = FindViewById<RecyclerView>(Resource.Id.mainActivity_recyclerView); _recyclerView.SetLayoutManager(_layoutManager); //Get our crew member data. This could be a web service. SharedData.CrewManifest = await BackgroundCheck_List_Data.GetAllCrewAsync(); //Create the adapter for the RecyclerView with our crew data, and set //the adapter. Also, wire an event handler for when the user taps on each //individual item. _adapter = new BackgroundCheckRecyclerViewAdapter(SharedData.CrewManifest, this.Resources); _adapter.ItemClick += OnItemClick; _recyclerView.SetAdapter(_adapter); _progressDialog.Dismiss(); mToolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar); mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout); mLeftDrawer = FindViewById<ListView>(Resource.Id.left_drawer); mRightDrawer = FindViewById<ListView>(Resource.Id.right_drawer); mLeftDrawer.Tag = 0; mRightDrawer.Tag = 1; SetSupportActionBar(mToolbar); mLeftDataSet = new List<string>(); mLeftDataSet.Add(GetString(Resource.String.my_profile)); mLeftDataSet.Add(GetString(Resource.String.log_out)); mLeftAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet); mLeftDrawer.Adapter = mLeftAdapter; //this.mLeftDrawer.ItemClick += mLeftDrawer_ItemClick; //this.mRightDrawer.ItemClick += mRightDrawer_ItemClick; mRightDataSet = new List<string>(); mRightDataSet.Add(GetString(Resource.String.drawer_faq)); mRightDataSet.Add(GetString (Resource.String.support)); mRightDataSet.Add(GetString(Resource.String.rentproof_summary)); mRightAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, mRightDataSet); mRightDrawer.Adapter = mRightAdapter; mDrawerToggle = new NavigationBar( this, //Host Activity mDrawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); mDrawerLayout.SetDrawerListener(mDrawerToggle); SupportActionBar.SetDisplayHomeAsUpEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled(true); mDrawerToggle.SyncState(); if (bundle != null){ if (bundle.GetString("DrawerState") == "Opened"){ SupportActionBar.SetTitle(Resource.String.openDrawer); } else{ SupportActionBar.SetTitle(Resource.String.closeDrawer); } } else{ //This is the first the time the activity is ran SupportActionBar.SetTitle(Resource.String.closeDrawer); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Groepscherm); _persoon = Gegevens.GetPerson(); _groep = Gegevens.CurrentGroup(); _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar); TextView title = _toolbar.FindViewById<TextView>(Resource.Id.Title); title.Text = _groep.groepsnaam; SetSupportActionBar(_toolbar); SupportActionBar.Title = ""; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); _participantsRecyclerView = FindViewById<RecyclerView>(Resource.Id.participantsrecyclerview); _participantsRecyclerView.SetLayoutManager(new LinearLayoutManager(this)); _participantsRecyclerView.SetScrollContainer(false); _participantsRecyclerView.NestedScrollingEnabled = false; _swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipe_refresh); _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.mainColor); _swipeRefreshLayout.SetOnRefreshListener(this); CardView historyCardView = FindViewById<CardView>(Resource.Id.history_card_view); Button cameraButton = FindViewById<Button>(Resource.Id.buttonCamera); Button textButton = FindViewById<Button>(Resource.Id.buttonText); Button leaveButton = FindViewById<Button>(Resource.Id.buttonLeave); leaveButton.Click += (sender, e) => { DatabaseInterface.RemoveFromGroup(_persoon.Id, _groep.groepsnaam, _persoon.Id, _persoon.Password); Finish(); }; historyCardView.Click += (sender, e) => { var activity = new Intent(this, typeof(Historyscherm)); StartActivity(activity); }; cameraButton.Click += (sender, e) => { var activity = new Intent(this, typeof(CameraActivity)); StartActivityForResult(activity, 1); }; textButton.Click += (sender, e) => { var activity = new Intent(this, typeof(Nieuwschuld)); StartActivity(activity); }; CreateParticipantsEnvironment(); }
protected override void OnCreate (Bundle savedInstanceState) { Bundle bundle = Intent.Extras; var TicketListDetails = Seguimiento_Adapter.DetallesTicket; var TicketID = Convert.ToInt32 (Intent.GetStringExtra ("TicketID").ToString ()); List<TicketDetail> ListResults = TicketListDetails.FindAll (x => x.TicketID == TicketID); base.OnCreate (savedInstanceState); SetContentView (Resource.Layout.layout_detalle); _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBarSeguimientoDetalle); //_supporttoolbar.SetTitle(Resource.String.Seguimiento); var ToolbarTitle = FindViewById<TextView> (Resource.Id.toolbar_titleDetalle); var ToolbarBack = FindViewById<ImageView> (Resource.Id.toolbar_backSeg); ToolbarTitle.SetText (Resource.String.Seguimiento); ToolbarBack.SetImageResource (Resource.Drawable.Back48x48); SetSupportActionBar(_supporttoolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(false); var listView = FindViewById<ListView> (Resource.Id.ListDetalle); listView.Adapter = new SeguimientoDetail_Adapter (ListResults, this); Typeface font = Typeface.CreateFromAsset (Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf"); var btnEnviar = FindViewById<Button> (Resource.Id.btnEnviarComentario); var txtComentario = FindViewById<EditText> (Resource.Id.txtNewComment); //btnEnviar.SetBackgroundResource (Resource.Drawable.selectors); btnEnviar.SetTypeface (font,TypefaceStyle.Normal); _supporttoolbar.Click += (object sender, EventArgs e) => { StartActivity (typeof(MainActivity)); }; ToolbarBack.Click += (object sender, EventArgs e) => { base.OnBackPressed (); }; btnEnviar.Click += (object sender, EventArgs e) => { btnEnviar.SetBackgroundColor (Color.White); btnEnviar.SetTextColor (Color.Orange); var string_key = "41f579fc-1445-4065-ab10-c06d50e724d3"; //cocoservices.tinnova.mx.COCOService servicio = new Navigation_View.cocoservices.tinnova.mx.COCOService (); services_911consumidor_com.COCOService servicio = new Navigation_View.services_911consumidor_com.COCOService (); try { var resultado = 0; resultado = servicio.CreateTicketDetail (new Navigation_View.services_911consumidor_com.TicketDetailDTO { TIC_ID = Convert.ToInt32 (TicketID.ToString ()), Message = txtComentario.Text.Trim (), DetailDate = DateTime.Now, Subject = "Mensaje Consumidor", Status = new Navigation_View.services_911consumidor_com.StatusDTO { Id = 12, OBJ_ID = 5 }, Agent = new Navigation_View.services_911consumidor_com.UserDTO { UserId = string.Empty } }, string_key); if (resultado != 0) { new Android.Support.V7.App.AlertDialog.Builder (this) .SetMessage ("Su comentario ha sido registrado. Gracias") .SetPositiveButton ("OK", delegate { Console.WriteLine ("OK"); }) .SetTitle ("ATENCIÓN") .Show (); } } catch (Exception ex) { new Android.Support.V7.App.AlertDialog.Builder (this) .SetMessage ("Ocurrio un error: " + ex.Message.ToString ()) .SetTitle ("ATENCIÓN") .SetPositiveButton ("OK", delegate { Console.WriteLine ("OK"); }) .Show (); } finally { txtComentario.Text = ""; } StartActivity (typeof(MainActivity)); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.MainPageLayout); mToolBar = FindViewById<SupportToolBar> (Resource.Id.toolbar); mDrawerLayout = FindViewById<DrawerLayout> (Resource.Id.drawer_layout); mLeftDrawer = FindViewById<ListView> (Resource.Id.left_drawer); mDrawerContent = FindViewById<RelativeLayout> (Resource.Id.relative_layout); mBottomListView = FindViewById<ListView> (Resource.Id.left_drawer_bottom); leftDrawerItems=this.Resources.GetStringArray (Resource.Array.left_Menu_items); leftDrawerBottomItems=this.Resources.GetStringArray (Resource.Array.left_Menu_bottom_items); ArrayAdapter<String> leftDrawerAdapter = new ArrayAdapter<String> (this, Android.Resource.Layout.SimpleListItem1, leftDrawerItems); mLeftDrawer.Adapter = leftDrawerAdapter; ArrayAdapter<String> leftDrawerBottomAdapter = new ArrayAdapter<String> (this, Android.Resource.Layout.SimpleListItem1,leftDrawerBottomItems); mBottomListView.Adapter = leftDrawerBottomAdapter; mLeftDrawer.OnItemClickListener = this; //mBottomListView.OnItemClickListener = this; mBottomListView.ItemClick += mBottomListView_ItemClick; SetSupportActionBar (mToolBar); mDrawerToggle = new MyActionBarDrawToggle (this, mDrawerLayout, Resource.String.openDrawer, Resource.String.closeDrawer); mDrawerLayout.SetDrawerListener (mDrawerToggle); SupportActionBar.SetHomeButtonEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled (true); mDrawerToggle.SyncState (); if (bundle != null) { if (bundle.GetString ("DrawerState") == "Opened") { SupportActionBar.SetTitle (Resource.String.openDrawer); } else { SupportActionBar.SetTitle (Resource.String.closeDrawer); } } else { //the activity is first run SupportActionBar.SetTitle (Resource.String.closeDrawer); } if (bundle == null) { //first launch firstLaunchFlag = 1; //selectItem (0); } string myIntentGet = Intent.GetStringExtra ("notificationToGuZhang"); if (myIntentGet != null) { if (myIntentGet.Equals("toGuZhang")) { //guzhang selectItem (2); } } else { //huojing selectItem (0); } }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); string parameterValue = this.Intent.GetStringExtra ("message"); if (!string.IsNullOrEmpty (parameterValue)) { } #region Re-defining Variables _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _supporttoolbar.SetTitle(Resource.String.boletin); SetSupportActionBar(_supporttoolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(false); _supporttoolbar.Visibility = ViewStates.Gone; // _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); // // _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); // Button btnBoletin = FindViewById<Button>(Resource.Id.btnBoletin); // Button btnAsesoria = FindViewById<Button>(Resource.Id.btnAsesoria); // Button btnSeguimiento = FindViewById<Button>(Resource.Id.btnSeguimiento); news = new NewsFragment(); tips = new TipsFragment(); ticket = new TicketFragment(); ticketJuridico = new TicketJuridicoFragment(); seguimiento = new SeguimientoFragment(); mStackFragments = new Stack<SupportFragment>(); #endregion Android.Support.V4.App.FragmentTransaction tx = SupportFragmentManager.BeginTransaction(); tx.Add(Resource.Id.layout_content, news); tx.Add(Resource.Id.layout_content, tips); tx.Add (Resource.Id.layout_content, ticket); tx.Add (Resource.Id.layout_content, ticketJuridico); tx.Add (Resource.Id.layout_content, seguimiento); tx.Hide(news); tx.Hide (ticket); tx.Hide (ticketJuridico); tx.Hide (seguimiento); mCurrentFragment = tips; tx.Commit(); _supporttoolbar.Click += (object sender, EventArgs e) => { StartActivity (typeof(MainActivity)); }; #region CommentCode // btnBoletin.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.boletin); // fragment = new NewsFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // // btnAsesoria.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.QuejasDenuncias); // fragment = new TicketFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // // btnSeguimiento.Click += (object sender, EventArgs e) => // { // Android.Support.V4.App.Fragment fragment = null; // _supporttoolbar.SetTitle(Resource.String.Seguimiento); // fragment = new SeguimientoFragment (); // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_contentMain, fragment).Commit (); // }; // _navigationview.NavigationItemSelected += (sender, e) => { // Android.Support.V4.App.Fragment fragment = null; // switch (e.MenuItem.ItemId) { // case Resource.Id.nav_news: // _supporttoolbar.SetTitle(Resource.String.boletin); // fragment = new NewsFragment (); // break; // case Resource.Id.nav_monedero: // _supporttoolbar.SetTitle(Resource.String.monedero); // fragment = new TipsFragment (); // break; // case Resource.Id.nav_ticket: // _supporttoolbar.SetTitle(Resource.String.QuejasDenuncias); // fragment = new TicketFragment (); // break; // case Resource.Id.nav_ticket_juridico: // _supporttoolbar.SetTitle(Resource.String.Apoyo_Juridico); // fragment = new TicketJuridicoFragment (); // break; // case Resource.Id.nav_seguimiento: // _supporttoolbar.SetTitle(Resource.String.Seguimiento); // fragment = new SeguimientoFragment (); // break; // } // // // // SupportFragmentManager.BeginTransaction ().Replace (Resource.Id.layout_content, fragment).Commit (); // _drawer.CloseDrawers (); // // }; #endregion }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _persoon = Gegevens.GetPerson(); _groep = Gegevens.CurrentGroup(); SetContentView(Resource.Layout.Nieuwschuldscherm); _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar); ImageView Avatar = _toolbar.FindViewById<ImageView>(Resource.Id.Avatar); TextView Title = _toolbar.FindViewById<TextView>(Resource.Id.Title); TextView item = FindViewById<TextView>(Resource.Id.pending_text); CardView Boodschap = FindViewById<CardView>(Resource.Id.pending_card_view); CardView Schuld = FindViewById<CardView>(Resource.Id.participants_card_view); LinearLayout layout = FindViewById<LinearLayout>(Resource.Id.layout1); ScrollView Scroll = FindViewById<ScrollView>(Resource.Id.scrollSchuld); layout.RemoveView (Boodschap); Title.Text = _groep.groepsnaam; MakeRecycleViewList (); Button confirm = FindViewById<Button>(Resource.Id.buttonConfirm); Button add = FindViewById<Button>(Resource.Id.buttonAdd); bool keer = false; confirm.Click += (sender, e) => { // check eerst of alle productprijzen ingevuld zijn foreach (var product in deelnemers) { if (product.Name == "" || product.StringValue == "") { Toast.MakeText(this, "Please fill in all fields", ToastLength.Long).Show(); return; } //sommige toestellen kunnen geen komma's invoeren product.StringValue = product.StringValue.Replace('.', ','); } //sluit als het nodig is het keyboard af InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService); imm.HideSoftInputFromWindow(add.WindowToken, 0); layout.RemoveViewsInLayout(0, layout.ChildCount); if(!keer) { //invullen van de reden van de debt ReasonAlert(); } for(int t = 0; t < deelnemers.Count; t++) //verwijder producten die uitgevinkt zijn if(!deelnemers[t].State || !IsNumber(deelnemers[t].StringValue)) {deelnemers.Remove(deelnemers[t]); t--;} else if (!keer) { lijst += deelnemers[t].Name + "-" + (Math.Round(System.Convert.ToDouble(deelnemers[t].StringValue)*100)).ToString() + "-"; } layout.AddView(Boodschap); layout.AddView(Schuld); //als alle boodschappen zijn langs gekomen if (deelnemers.Count == 1 && keer) { MaakNieuwSchuld(); confirm.Text = "Send"; deelnemers.Remove(deelnemers.First()); } //versuren v/d schuld else if (deelnemers.Count == 0) { VerstuurSchuld(); Finish();} else{ _adapter.NotifyDataSetChanged(); MaakNieuwSchuld(); groep.Clear(); if(keer) deelnemers.Remove(deelnemers.First()); item.Text = deelnemers.First().Name + " " + deelnemers.First().StringValue; confirm.Text = "Next"; keer = true; MakeRecycleViewPayers(); } }; add.Click += (sender, e) => { //haalt het toetsenbord weg InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService); imm.HideSoftInputFromWindow(add.WindowToken, 0); _adapter.NotifyDataSetChanged(); Scroll.PageScroll(FocusSearchDirection.Down); MakeRecycleViewList(); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.ReportProfilePageView); //Verify that this does not return an empty string or null var applicantReportJson = Intent.GetStringExtra ("Applicant"); //Verify that this does not return null; If it does, then your something wrong with your Applicant class _applicantReport = JsonConvert.DeserializeObject<Applicant> (applicantReportJson); FindViewById<TextView>(Resource.Id.txtReportProfilePageCreatedAt).Text = _applicantReport.CreatedAt; FindViewById<TextView>(Resource.Id.txtReportProfilePageFirstName).Text = _applicantReport.FirstName; FindViewById<TextView>(Resource.Id.txtReportProfilePageLastName).Text = _applicantReport.LastName; FindViewById<TextView> (Resource.Id.txtReportProfilePageGender).Text = _applicantReport.Gender; FindViewById<TextView>(Resource.Id.txtReportProfilePageDOB).Text = _applicantReport.DateOfBirth;; FindViewById<TextView>(Resource.Id.txtReportProfilePageTelephone).Text = _applicantReport.Telephone; FindViewById<TextView>(Resource.Id.txtReportProfilePageMobile).Text = _applicantReport.Mobile; FindViewById<TextView>(Resource.Id.txtReportProfilePageCountry).Text = _applicantReport.Country; //_ProfilePhoto = FindViewById<ImageView>(Resource.Id.imgReportProfilePage); var index = Intent.GetIntExtra("index", -1); if(index < 0) { return; } /************TOOLBAR******************************************************/ _toolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar); _drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout); _leftDrawer = FindViewById<ListView>(Resource.Id.left_drawer); _rightDrawer = FindViewById<ListView>(Resource.Id.right_drawer); //tag left and right drawer for case statment when clicked _leftDrawer.Tag = 0; _rightDrawer.Tag = 1; //Set action support toolbar with private class variable SetSupportActionBar(_toolbar); //***********LEFT DATA SET******************************/ //Left data set, these are the buttons you see when you click on the drawers _leftDataSet = new List<string>(); //my_profile has a string in the string xml file in values directory _leftDataSet.Add(GetString(Resource.String.main_menu)); //log_out has a string in the string xml file in values directory _leftDataSet.Add(GetString(Resource.String.log_out)); _leftAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, _leftDataSet); _leftDrawer.Adapter = _leftAdapter; //click event for the left drawer this._leftDrawer.ItemClick += LeftDrawerRowClick; //***********RIGHT DATA SET******************************/ _rightDataSet = new List<string>(); //support has a string in the string xml file in values directory _rightDataSet.Add(GetString (Resource.String.help_popup)); //rentproof has a string in the string xml file in values directory _rightDataSet.Add(GetString(Resource.String.support)); _rightAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, _rightDataSet); _rightDrawer.Adapter = _rightAdapter; this._rightDrawer.ItemClick += RightDrawerRowClick; //constructor for navigation bar _drawerToggle = new NavigationBar( this, //Host Activity _drawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); //set drawerlistener _drawerLayout.SetDrawerListener(_drawerToggle); //set home button SupportActionBar.SetDisplayHomeAsUpEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled(true); _drawerToggle.SyncState(); if (bundle != null){ if (bundle.GetString("DrawerState") == "Opened"){ SupportActionBar.SetTitle(Resource.String.openDrawer); } else{ SupportActionBar.SetTitle(Resource.String.closeDrawer); } } else{ //This is the first the time the activity is ran SupportActionBar.SetTitle(Resource.String.closeDrawer); } //*****************END OF ONCREATE TOOLBAR*********** }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SetContentView(Resource.Layout.ApplicantInfoInputView); _SubmitQueryInfo = FindViewById<Button>(Resource.Id.btntxtApplicantInfoInputSubmit); _SubmitQueryInfo.Click += async (sender, e) => { var model = new Applicant { FirstName = FindViewById<EditText>(Resource.Id.txtApplicantInfoInputFirstName).Text, LastName = FindViewById<EditText>(Resource.Id.txtApplicantInfoInputLastName).Text, Gender = FindViewById<EditText>(Resource.Id.txtApplicantInfoInputGender).Text, DateOfBirth = FindViewById<EditText>(Resource.Id.txtApplicantInfoInputDateOfBirth).Text, Mobile = FindViewById<EditText>(Resource.Id.txtApplicantInfoInputInputMobile).Text, Country = FindViewById<EditText>(Resource.Id.txtApplicantInfoInputCountry).Text }; try { // create new applicant (applicant is returned with ID) var applicant = await OnFido.API.OnFidoService.CreateApplicant(model); applicant = await OnFido.API.OnFidoService.GetApplicantById(applicant.Id); // pass applicant info to recycler view var applicanInfo = new Intent(this, typeof (ReportMainController)); applicanInfo.PutExtra("Applicant",JsonConvert.SerializeObject(applicant)); this.StartActivity(applicanInfo); //finish activity Finish(); } catch (Exception) { throw; } }; /************TOOLBAR******************************************************/ _toolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar); _drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout); _leftDrawer = FindViewById<ListView>(Resource.Id.left_drawer); _rightDrawer = FindViewById<ListView>(Resource.Id.right_drawer); //tag left and right drawer for case statment when clicked _leftDrawer.Tag = 0; _rightDrawer.Tag = 1; //Set action support toolbar with private class variable SetSupportActionBar(_toolbar); //***********LEFT DATA SET******************************/ //Left data set, these are the buttons you see when you click on the drawers _leftDataSet = new List<string>(); //my_profile has a string in the string xml file in values directory _leftDataSet.Add(GetString(Resource.String.main_menu)); //log_out has a string in the string xml file in values directory _leftDataSet.Add(GetString(Resource.String.log_out)); _leftAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, _leftDataSet); _leftDrawer.Adapter = _leftAdapter; //click event for the left drawer this._leftDrawer.ItemClick += LeftDrawerRowClick; //***********RIGHT DATA SET******************************/ _rightDataSet = new List<string>(); //support has a string in the string xml file in values directory _rightDataSet.Add(GetString (Resource.String.help_popup)); //rentproof has a string in the string xml file in values directory _rightDataSet.Add(GetString(Resource.String.support)); _rightAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, _rightDataSet); _rightDrawer.Adapter = _rightAdapter; this._rightDrawer.ItemClick += RightDrawerRowClick; //constructor for navigation bar _drawerToggle = new NavigationBar( this, //Host Activity _drawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); //set drawerlistener _drawerLayout.SetDrawerListener(_drawerToggle); //set home button SupportActionBar.SetDisplayHomeAsUpEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled(true); _drawerToggle.SyncState(); if (bundle != null){ if (bundle.GetString("DrawerState") == "Opened"){ SupportActionBar.SetTitle(Resource.String.openDrawer); } else{ SupportActionBar.SetTitle(Resource.String.closeDrawer); } } else{ //This is the first the time the activity is ran SupportActionBar.SetTitle(Resource.String.closeDrawer); } //*****************END OF ONCREATE TOO }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.profile_edit_activity); mToolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(mToolbar); SupportActionBar.SetDisplayShowHomeEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); svProfile = FindViewById<ScrollView>(Resource.Id.svProfile); txtName = FindViewById<EditText>(Resource.Id.edit_profile_name); txtAddress = FindViewById<EditText>(Resource.Id.edit_profile_address); txtUsername = FindViewById<EditText>(Resource.Id.edit_profile_username); txtPassword = FindViewById<EditText>(Resource.Id.edit_profile_password); txtPort = FindViewById<EditText>(Resource.Id.edit_profile_port); radioEnigma1 = FindViewById<RadioButton>(Resource.Id.rbEnigma1); radioEnigma2 = FindViewById<RadioButton>(Resource.Id.rbEnigma2); switchStreaming = FindViewById<SwitchCompat>(Resource.Id.switch_streaming); txtStreamingPort = FindViewById<EditText>(Resource.Id.edit_streaming_port); switchTranscoding = FindViewById<SwitchCompat>(Resource.Id.switch_transcoding); txtTranscodingPort = FindViewById<EditText>(Resource.Id.edit_transcoding_port); cbUseSsl = FindViewById<CheckBox>(Resource.Id.cbUseSsl); layoutStreaming = FindViewById<LinearLayout>(Resource.Id.layout_Streaming); layoutTranscoding = FindViewById<LinearLayout>(Resource.Id.layout_Transcoding); //update controls content if (bundle != null && bundle.ContainsKey(profileNameKey)) { //restore state editProfileName = bundle.GetString(profileOriginalNameKey); txtName.Text = bundle.GetString(profileNameKey); txtAddress.Text = bundle.GetString(profileAddressKey); txtUsername.Text = bundle.GetString(profileUsernameKey); txtPassword.Text = bundle.GetString(profilePasswordKey); txtPort.Text = bundle.GetString(profilePortKey); radioEnigma1.Checked = bundle.GetBoolean(profileEnigma1Key); radioEnigma2.Checked = bundle.GetBoolean(profileEnigma2Key); switchStreaming.Checked = bundle.GetBoolean(profileStreamingKey); txtStreamingPort.Text = bundle.GetString(profileStreamingPortKey); switchTranscoding.Checked = bundle.GetBoolean(profileTranscodingKey); txtTranscodingPort.Text = bundle.GetString(profileTranscodingPortKey); cbUseSsl.Checked = bundle.GetBoolean(profileUseSslKey); isDirty = bundle.GetBoolean(isDirtyKey); } else if (Intent != null && Intent.HasExtra(ProfilesFragment.profileNameKey)) { //edit existing profile SignalMeterProfile profile = null; editProfileName = Intent.GetStringExtra(ProfilesFragment.profileNameKey); if (ConnectionManager.Profiles != null) { profile = ConnectionManager.Profiles.FirstOrDefault(x => x.Name == editProfileName); if (profile == null) profile = new SignalMeterProfile(); } else profile = new SignalMeterProfile(); txtName.Text = profile.Name; txtAddress.Text = profile.Address; txtUsername.Text = profile.Username; txtPassword.Text = profile.Password; txtPort.Text = profile.HttpPort.ToString(); radioEnigma1.Checked = profile.Enigma == global::Krkadoni.Enigma.Enums.EnigmaType.Enigma1; radioEnigma2.Checked = profile.Enigma == global::Krkadoni.Enigma.Enums.EnigmaType.Enigma2; switchStreaming.Checked = profile.Streaming; txtStreamingPort.Text = profile.StreamingPort == 0 ? string.Empty : profile.StreamingPort.ToString(); switchTranscoding.Checked = profile.Transcoding; txtTranscodingPort.Text = profile.TranscodingPort == 0 ? string.Empty : profile.TranscodingPort.ToString(); cbUseSsl.Checked = profile.UseSsl; } else { //create new profile } //add event handlers txtName.TextChanged += (sender, e) => isDirty = true; txtAddress.TextChanged += (sender, e) => isDirty = true; txtUsername.TextChanged += (sender, e) => isDirty = true; txtPassword.TextChanged += (sender, e) => isDirty = true; txtPort.TextChanged += (sender, e) => isDirty = true; radioEnigma1.CheckedChange += (sender, e) => isDirty = true; radioEnigma2.CheckedChange += (sender, e) => isDirty = true; txtStreamingPort.TextChanged += (sender, e) => isDirty = true; txtTranscodingPort.TextChanged += (sender, e) => isDirty = true; cbUseSsl.CheckedChange += (sender, e) => isDirty = true; switchStreaming.CheckedChange += (sender, e) => { isDirty = true; layoutStreaming.Visibility = switchStreaming.Checked ? ViewStates.Visible : ViewStates.Gone; if (switchStreaming.Checked) svProfile.Post(() => svProfile.ScrollTo(0, svProfile.Bottom)); }; switchTranscoding.CheckedChange += (sender, e) => { isDirty = true; layoutTranscoding.Visibility = switchTranscoding.Checked ? ViewStates.Visible : ViewStates.Gone; if (switchTranscoding.Checked) svProfile.Post(() => svProfile.ScrollTo(0, svProfile.Bottom)); }; SupportActionBar.Title = string.IsNullOrEmpty(editProfileName) ? GetString(Resource.String.action_add_profile) : editProfileName; layoutStreaming.Visibility = switchStreaming.Checked ? ViewStates.Visible : ViewStates.Gone; layoutTranscoding.Visibility = switchTranscoding.Checked ? ViewStates.Visible : ViewStates.Gone; }