protected override void OnCreate(Bundle savedInstanceState) { Log.WriteLine(LogPriority.Debug, TAG, "OnCreate - Enter"); base.OnCreate(savedInstanceState); AppContextLiveData.Instance.SetLocale(this); if (AppContextLiveData.Instance.IsPortrait) { SetContentView(Resource.Layout.PhotoShowActivityPortrait); } else { SetContentView(Resource.Layout.PhotoShowActivityLandscape); } long id = Intent.GetLongExtra("ID", -1); _photodata = Database.GetPhotoDataItem(id); InitializeAppContext(_photodata); InitializeBaseActivityUI(); FindViewById <ImageButton>(Resource.Id.menuButton).SetOnClickListener(this); _displayOverlappedButton = FindViewById <ImageButton>(Resource.Id.buttonDisplayOverlapped); _displayOverlappedButton.SetOnClickListener(this); _saveToDeviceButton = FindViewById <ImageButton>(Resource.Id.buttonSaveToDevice); _saveToDeviceButton.SetOnClickListener(this); _shareButton = FindViewById <ImageButton>(Resource.Id.buttonShare); _shareButton.SetOnClickListener(this); _tiltCorrectorButton = FindViewById <ImageButton>(Resource.Id.buttonTiltCorrector); _tiltCorrectorButton.SetOnClickListener(this); _cropButton = FindViewById <ImageButton>(Resource.Id.buttonCropImage); _cropButton.SetOnClickListener(this); _confirmCloseButtons = FindViewById <LinearLayout>(Resource.Id.confirmCloseButtons); _confirmCloseButtons.Visibility = ViewStates.Gone; FindViewById <ImageButton>(Resource.Id.confirmButton).SetOnClickListener(this); FindViewById <ImageButton>(Resource.Id.closeButton).SetOnClickListener(this); _activityControlBar = FindViewById <LinearLayout>(Resource.Id.PhotoShowActivityControlBar); _mainActivityStatusBar = FindViewById <LinearLayout>(Resource.Id.mainActivityStatusBar); photoView = FindViewById <ScaleImageView>(Resource.Id.photoView); HideControls(); var pictureSize = new System.Drawing.Size(GetPictureWidth(), GetPictureHeight()); _compassView.Initialize(Context, false, pictureSize); var delayedAction = new System.Threading.Timer(o => { LoadImageAndProfile(); }, null, TimeSpan.FromSeconds(0.1), TimeSpan.FromMilliseconds(-1)); Start(); Log.WriteLine(LogPriority.Debug, TAG, "OnCreate - Exit"); }
private void InitializeUIElements() { _activityControlBar = FindViewById <LinearLayout>(Resource.Id.mainActivityControlBar); _menuButton = FindViewById <ImageButton>(Resource.Id.menuButton); _menuButton.SetOnClickListener(this); _pauseButton = FindViewById <ImageButton>(Resource.Id.buttonPause); _pauseButton.SetOnClickListener(this); UpdatePauseButton(); _recordButton = FindViewById <ImageButton>(Resource.Id.buttonRecord); _recordButton.SetOnClickListener(this); _resetCorrectionButton = FindViewById <ImageButton>(Resource.Id.buttonResetCorrector); _resetCorrectionButton.SetOnClickListener(this); _compassView.Initialize(Context, true, Context.Settings.CameraPictureSize); _mainLayout = FindViewById(Resource.Id.sample_main_layout); }
protected void InitializeBaseActivityUI() { AppContextLiveData.Instance.SetLocale(this); _gestureDetector = new GestureDetector(this); _textViewNotification = FindViewById <TextView>(Resource.Id.textViewNotification); _textViewStatusLine = FindViewById <TextView>(Resource.Id.textViewStatusLine); _textViewStatusLine.Selected = true; _distanceSeekBar = FindViewById <DistanceSeekBar>(Resource.Id.seekBarDistance); _distanceSeekBar.Progress = Context.Settings.MaxDistance; _distanceSeekBar.ProgressChanged += OnMaxDistanceChanged; _poiInfo = FindViewById <LinearLayout>(Resource.Id.mainActivityPoiInfo); _poiInfo.SetOnClickListener(this); _poiInfo.Visibility = ViewStates.Gone; _seekBars = FindViewById <LinearLayout>(Resource.Id.mainActivitySeekBars); _seekBars.Visibility = ViewStates.Visible; _displayTerrainButton = FindViewById <ImageButton>(Resource.Id.buttonDisplayTerrain); _displayTerrainButton.SetOnClickListener(this); _displayTerrainButton.SetImageResource(Context.Settings.ShowElevationProfile ? Resource.Drawable.ic_terrain : Resource.Drawable.ic_terrain_off); var _selectCategoryButton = FindViewById <ImageButton>(Resource.Id.buttonCategorySelect); _selectCategoryButton.SetOnClickListener(this); FindViewById <Button>(Resource.Id.buttonWiki).SetOnClickListener(this); FindViewById <Button>(Resource.Id.buttonMap).SetOnClickListener(this); FindViewById <ImageView>(Resource.Id.buttonFavourite).SetOnClickListener(this); _compassView = FindViewById <CompassView>(Resource.Id.compassView1); _compassView.LayoutChange += OnLayoutChanged; }
public override View GetView(int position, View convertView, ViewGroup parent) { var item = tableItems[position]; var view = convertView; if (view == null) { // no view to re-use, create new view = context.LayoutInflater.Inflate(Resource.Layout.ListViewCellGrafico, null); } view.FindViewById <TextView>(Resource.Id.titulo).Text = item.descricao + " (" + item.Quantidade + ")"; LinearLayout layoutGrafico = view.FindViewById <LinearLayout>(Resource.Id.chart); layoutGrafico.RemoveAllViews(); if (item.GraficoPizza != null) { if (item.TipoGrafico == 1) { item.GraficoPizza.RemoveFromParent(); layoutGrafico.AddView(item.GraficoPizza, new Android.Widget.LinearLayout.LayoutParams ( Android.Widget.LinearLayout.LayoutParams.FillParent, Android.Widget.LinearLayout.LayoutParams.FillParent )); } else { item.GraficoBarra.RemoveFromParent(); layoutGrafico.AddView(item.GraficoBarra, new Android.Widget.LinearLayout.LayoutParams ( Android.Widget.LinearLayout.LayoutParams.FillParent, Android.Widget.LinearLayout.LayoutParams.FillParent )); } } else { if (item.TipoGrafico == 1) { item.GraficoLinha.RemoveFromParent(); layoutGrafico.AddView(item.GraficoLinha, new Android.Widget.LinearLayout.LayoutParams ( Android.Widget.LinearLayout.LayoutParams.FillParent, Android.Widget.LinearLayout.LayoutParams.FillParent )); } else { item.GraficoBarra.RemoveFromParent(); layoutGrafico.AddView(item.GraficoBarra, new Android.Widget.LinearLayout.LayoutParams ( Android.Widget.LinearLayout.LayoutParams.FillParent, Android.Widget.LinearLayout.LayoutParams.FillParent )); } } Android.Widget.ImageButton img = view.FindViewById <Android.Widget.ImageButton>(Resource.Id.imgBtnGrafico); if (item.GraficoPizza != null) { img.SetImageResource(Resource.Drawable.ic_chart_timeline_white_36dp); } else { img.SetImageResource(Resource.Drawable.ic_chart_bar_white_36dp); } img.SetOnClickListener(new ImageClick(layoutGrafico, item)); return(view); }