protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.Window.SetSoftInputMode(SoftInput.AdjustResize); ActionBar.SetDisplayUseLogoEnabled(false); ActionBar.SetIcon(new ColorDrawable(Color.Transparent)); ActionBar.SetHomeButtonEnabled(false); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetDisplayShowHomeEnabled(true); ActionBar.SetDisplayShowTitleEnabled(true); ActionBar.SetBackgroundDrawable(new ColorDrawable(Color.Transparent.FromHex(DataManager.Get <ISettingsManager>().Settings.NavigationBarColor))); //back var iconId = Resources.GetIdentifier("up", "id", "android"); var abBack = FindViewById <ImageView>(iconId); abBack.Colorize(DataManager.Get <ISettingsManager> ().Settings.TintColor); //colore titolo var titleId = Resources.GetIdentifier("action_bar_title", "id", "android"); var abTitle = FindViewById <TextView>(titleId); abTitle.SetTextColor(Color.Transparent.FromHex(DataManager.Get <ISettingsManager>().Settings.TintColor)); this.Title = ActionBar.Title = "Login"; _contentView = new FrameLayout(this); //_contentView.SetBackgroundColor(Color.Red); _contentView.Id = 12345; this.AddContentView(_contentView, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); Action onSuccess = (Action)ActivitiesBringe.GetObject("loginSuccess"); LoginFragment fragment = new LoginFragment(); fragment.LoginSuccess = onSuccess; FragmentManager.BeginTransaction() .Add(_contentView.Id, fragment).Commit(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this.SetContentView(Resource.Layout.ContentsTable); if (ActionBar != null) { ActionBar.SetDisplayUseLogoEnabled(false); ActionBar.SetIcon(new ColorDrawable(Color.Transparent)); ActionBar.SetHomeButtonEnabled(false); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetDisplayShowHomeEnabled(true); ActionBar.SetDisplayShowTitleEnabled(true); } this.Title = "Contenuti"; _currentPage = Intent.GetIntExtra("currentPage", 0); _pubblicazione = (Pubblicazione)ActivitiesBringe.GetObject("pub"); _documento = (Documento)ActivitiesBringe.GetObject("doc"); _pdfCore = (MuPDFCore)ActivitiesBringe.GetObject("pdfCore"); ViewPager viewPager = (ViewPager)this.FindViewById <ViewPager>(Resource.Id.pagesViewPager); ArrayList fragments = getFragments(); TitleFragmentAdapter ama = new TitleFragmentAdapter(this.SupportFragmentManager, fragments); viewPager.Adapter = ama; TabPageIndicator indicator = this.FindViewById <TabPageIndicator> (Resource.Id.pagesIndicator); indicator.SetViewPager(viewPager); /*StateListDrawable bgColorList = new StateListDrawable(); * * bgColorList.AddState(new int[] { Android.Resource.Attribute.StateActivated }, new ColorDrawable(Color.Transparent.FromHex("ff0000"))); * bgColorList.AddState(new int[] { }, new ColorDrawable(Color.Transparent)); * * indicator.Background = bgColorList;*/ viewPager.CurrentItem = Intent.GetIntExtra("currentItem", 0); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _currentPage = Intent.GetIntExtra("currentPage", 0); _pubblicazione = (Pubblicazione)ActivitiesBringe.GetObject("pub"); _documento = (Documento)ActivitiesBringe.GetObject("doc"); _pdfCore = (MuPDFCore)ActivitiesBringe.GetObject("pdfCore"); SetContentView(Resource.Layout.SearchDialog); Window.SetSoftInputMode(SoftInput.AdjustNothing); if (ActionBar != null) { this.Title = ActionBar.Title = GetString(Resource.String.search); ActionBar.SetDisplayUseLogoEnabled(false); ActionBar.SetIcon(new ColorDrawable(Color.Transparent)); ActionBar.SetHomeButtonEnabled(false); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetDisplayShowHomeEnabled(true); ActionBar.SetDisplayShowTitleEnabled(true); } _pageList = (ListView)FindViewById <ListView>(Resource.Id.pageList); _searchView = (SearchView)FindViewById <SearchView>(Resource.Id.searchView); int searchPlateId = _searchView.Context.Resources.GetIdentifier("android:id/search_plate", null, null); View searchPlate = _searchView.FindViewById(searchPlateId); searchPlate.Background.Colorize(DataManager.Get <ISettingsManager>().Settings.ButtonColor); _searchView.Focusable = true; _searchView.Iconified = false; _searchView.RequestFocusFromTouch(); _searchView.QueryTextChange += (sender, e) => { SearchPages(e.NewText); }; _searchView.QueryTextSubmit += (sender, e) => { _searchView.ClearFocus(); }; _pageList.ItemClick += (sender, e) => { var art = _articoli[e.Position]; Intent myIntent = new Intent(this, typeof(ViewerScreen)); myIntent.PutExtra("doc", art.IdDocumento); myIntent.PutExtra("page", (art.Index - 1).ToString()); myIntent.PutExtra("action", "page"); SetResult(Result.Ok, myIntent); Finish(); }; //paramentro ricerca var str = ActivitiesBringe.GetObject("search"); if (str != null) { string search = (string)str; _searchView.SetQuery(search, true); _searchView.RequestFocus(); } }