public void OnPrepared(IMediaPlayer p0) { mLoadingAnim.Stop(); startText = startText + "【完成】\n视频缓冲中..."; mPrepareText.SetText(startText, BufferType.Normal); mVideoPrepareLayout.Visibility = ViewStates.Gone; }
public override void OnPreDrag(View rootView) { animationLoading.Stop(); if (animationLoading != null && animationLoading.NumberOfFrames > 0) { ImageIcon.SetImageDrawable(animationLoading.GetFrame(0)); } }
void ShowProgress(bool busy) { if (error) { mapView.Visibility = ViewStates.Invisible; errorImage.Visibility = ViewStates.Visible; pager.Visibility = ViewStates.Gone; } else { errorImage.Visibility = ViewStates.Gone; mapView.Visibility = busy ? ViewStates.Invisible : ViewStates.Visible; pager.Visibility = busy ? ViewStates.Gone : ViewStates.Visible; } refresher.Enabled = !busy; progressBar.Visibility = busy ? ViewStates.Visible : ViewStates.Gone; if (busy) { coffeeProgress.Start(); } else { coffeeProgress.Stop(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); navView = FindViewById <NavigationView>(Resource.Id.nav_view); LoaderView = FindViewById <RelativeLayout>(Resource.Id.LoaderView); LoaderImage = FindViewById <ImageView>(Resource.Id.LoaderImage); LoaderView = FindViewById <RelativeLayout>(Resource.Id.LoaderView); ListViewMarsh = FindViewById <ListView>(Resource.Id.ListViewMarsh); ListViewPO = FindViewById <ListView>(Resource.Id.ListViewPO); ImageView DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu); DrawerImage.Click += DrawerImage_Click; AnimationLoader = (AnimationDrawable)LoaderImage.Drawable; AnimationLoader.Start(); HeaderView = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false); navView.AddHeaderView(HeaderView); navView.NavigationItemSelected += NavView_NavigationItemSelected; new Thread(new ThreadStart(delegate //поток для загрузки данных { var user = User.GetInstance(0, "", "", GetString(Resource.String.token)); var marshruts = Marshruts.GetMarshruts(); marshruts[0].GetPromPynkt(); RunOnUiThread(() => ListViewMarsh.Adapter = new ArrayAdapter <Marshrut> (this, Android.Resource.Layout.SimpleListItem1, marshruts)); RunOnUiThread(() => AnimationLoader.Stop()); RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible); })).Start(); }
private void StopButtonsClick(object sender, EventArgs e) { _calendarImageView.ClearAnimation(); _heartImageView.ClearAnimation(); _buddiesImageView.ClearAnimation(); _animation?.Stop(); }
private void SpinnerPoEnd_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e) { if (SpinnerPoEnd.SelectedItemPosition != -1) { LoaderView.Visibility = ViewStates.Visible; AnimationLoader.Start(); new Thread(new ThreadStart(delegate //поток для загрузки данных { var cost = Prices.GetPrice(routs[SpinnerRouts.SelectedItemPosition].PromPynkt[SpinnerPoStart.SelectedItemPosition].id, ObratPO[SpinnerPoEnd.SelectedItemPosition].id, routs[SpinnerRouts.SelectedItemPosition].id); if (cost != "false") { trips = Trips.GetTripsOnDate(TripDate.ToString("yyyy-MM-dd"), routs[SpinnerRouts.SelectedItemPosition].PromPynkt[SpinnerPoStart.SelectedItemPosition].id.ToString(), ObratPO[SpinnerPoEnd.SelectedItemPosition].id.ToString(), routs[SpinnerRouts.SelectedItemPosition].id.ToString()); ListViewTripsParmetr.Height = Convert.ToInt32(function.convertDpToPixel(90, this)) * trips.Count; RunOnUiThread(() => ListViewTrips.Adapter = new TripsAdapter(this, trips)); RunOnUiThread(() => AnimationLoader.Stop()); RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible); } else { RunOnUiThread(() => ListViewTrips.Adapter = null); RunOnUiThread(() => AnimationLoader.Stop()); RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible); RunOnUiThread(() => function.AlertDialogShow("Предупреждение", "Между выбранными пунктами не осуществляется перевозка.", this)); } })).Start(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.BronLayout); //---Переменные для работы NAvigationView drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); navView = FindViewById <NavigationView>(Resource.Id.nav_view); DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu); LoaderView = FindViewById <RelativeLayout>(Resource.Id.LoaderView); LoaderImage = FindViewById <ImageView>(Resource.Id.LoaderImage); //---Переменные для работы с Activity ListViewTrips = FindViewById <ListView>(Resource.Id.ListViewTrips); SpinnerRouts = FindViewById <Spinner>(Resource.Id.SpinnerRouts); SpinnerPoStart = FindViewById <Spinner>(Resource.Id.SpinnerPoStart); SpinnerPoEnd = FindViewById <Spinner>(Resource.Id.SpinnerPoEnd); TextViewData = FindViewById <TextView>(Resource.Id.TextViewData); TextViewData.Click += TextViewData_Click; SpinnerRouts.ItemSelected += SpinnerRouts_ItemSelected; SpinnerPoStart.ItemSelected += SpinnerPoStart_ItemSelected; SpinnerPoEnd.ItemSelected += SpinnerPoEnd_ItemSelected; AnimationLoader = (AnimationDrawable)LoaderImage.Drawable; AnimationLoader.Start(); ListViewTrips.DividerHeight = 0; ListViewTripsParmetr = ListViewTrips.LayoutParameters; ListViewTrips.ItemClick += ListViewTrips_ItemClick; DrawerImage.Click += DrawerImage_Click; HeaderView = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false); navView.AddHeaderView(HeaderView); navView.NavigationItemSelected += NavView_NavigationItemSelected; new Thread(new ThreadStart(delegate //поток для загрузки данных { ObratPO = new List <IApi>(); TripDate = DateTime.Today; RunOnUiThread(() => TextViewData.Text = TripDate.ToString("dd.MM.yyyy")); routs = Routs.GetMarshruts(); routs[0].GetPromPynkt(); for (int i = routs[0].PromPynkt.Count - 1; i >= 0; i--) { ObratPO.Add(routs[0].PromPynkt[i]); } RunOnUiThread(() => SpinnerRouts.Adapter = new RoutAdapter(this, routs)); RunOnUiThread(() => SpinnerPoStart.Adapter = new PromPynktAdapter(this, routs[0].PromPynkt)); RunOnUiThread(() => SpinnerPoEnd.Adapter = new PromPynktAdapter(this, ObratPO)); trips = Trips.GetTripsOnDate(TripDate.ToString("yyyy-MM-dd"), routs[0].PromPynkt[0].id.ToString(), ObratPO[0].id.ToString(), routs[0].id.ToString()); ListViewTripsParmetr.Height = Convert.ToInt32(function.convertDpToPixel(90, this)) * trips.Count; RunOnUiThread(() => ListViewTrips.Adapter = new TripsAdapter(this, trips)); RunOnUiThread(() => AnimationLoader.Stop()); RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible); })).Start(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); //MapView = FindViewById<WebView>(Resource.Id.MapView); drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); navView = FindViewById <NavigationView>(Resource.Id.nav_view); LoaderView = FindViewById <RelativeLayout>(Resource.Id.LoaderView); LoaderImage = FindViewById <ImageView>(Resource.Id.LoaderImage); ListViewMarsh = FindViewById <ListView>(Resource.Id.ListViewMarsh); ListViewPO = FindViewById <ListView>(Resource.Id.ListViewPO); ImageView DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu); ButtonBron = FindViewById <Button>(Resource.Id.ButtonBron); DrawerImage.Click += DrawerImage_Click; ButtonBron.Click += ButtonBron_Click; AnimationLoader = (AnimationDrawable)LoaderImage.Drawable; AnimationLoader.Start(); HeaderView = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false); navView.AddHeaderView(HeaderView); navView.NavigationItemSelected += NavView_NavigationItemSelected; ListViewMarsh.ChoiceMode = ChoiceMode.Single; ListViewMarsh.DividerHeight = 0; ListViewMarsh.ItemClick += ListViewMarsh_ItemClick; ListViewPO.DividerHeight = 0; var paramMarsh = ListViewMarsh.LayoutParameters; var paramPO = ListViewPO.LayoutParameters; //MapView.Settings.JavaScriptEnabled = true; new Thread(new ThreadStart(delegate //поток для загрузки данных { var user = User.GetInstance(0, "", "", GetString(Resource.String.token)); marshruts = Routs.GetMarshruts(); foreach (var item in marshruts) { item.GetPromPynkt(); } //RunOnUiThread(() => MapView.LoadUrl("http://orion38.pro/maps/maps.php?url_map=" + marshruts[0].url_map)); paramMarsh.Height = Convert.ToInt32(function.convertDpToPixel(45, this)) * marshruts.Count; paramPO.Height = Convert.ToInt32(function.convertDpToPixel(35, this)) * (marshruts[0].PromPynkt.Count + 1); RunOnUiThread(() => ListViewMarsh.Adapter = new RoutAdapter(this, marshruts)); RunOnUiThread(() => ListViewPO.Adapter = new PromPynktAdapter(this, marshruts[0].PromPynkt)); RunOnUiThread(() => AnimationLoader.Stop()); RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible); })).Start(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button play = FindViewById <Button>(Resource.Id.btn_paly); Button stop = (Button)FindViewById(Resource.Id.btn_stop); ImageView imageView = FindViewById <ImageView>(Resource.Id.anim); // 获取AnimationDrawable动画对象 AnimationDrawable anim = (AnimationDrawable)imageView.Background; // 开始播放动画 play.Click += delegate { anim.Start(); }; // 停止播放动画 stop.Click += delegate { anim.Stop(); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); ImageView circle = (ImageView)FindViewById <ImageView> (Resource.Id.circle); circleAnimation = (AnimationDrawable)circle.Drawable; circle.Touch += delegate(object sender, View.TouchEventArgs e) { if (e.Event.Action == MotionEventActions.Down) { Console.WriteLine("Circle was pressed"); circleAnimation.Stop(); circle.SetImageResource(Resource.Drawable.circle); } if (e.Event.Action == MotionEventActions.Up) { Console.WriteLine("Circle is not pressed"); circle.SetImageDrawable(circleAnimation); circleAnimation.Run(); //circleAnimation.Start(); } }; //SetContentView(new CircleView(this)); }
protected override async void OnCreate ( Bundle bundle ) { //AndroidCrapApplication.ApplicationLogger.LogDebug("MEMORY 4 : {0}", // GC.GetTotalMemory(false)); base.OnCreate(bundle); SetContentView(Resource.Layout.SplashScreenLayout); _progressCount = FindViewById <TextView>(Resource.Id.ProgressCount); ImageView splashProgress = FindViewById <ImageView>(Resource.Id.SplashProgress); splashProgress.SetBackgroundResource(Resource.Drawable.ProgressSphere); AnimationDrawable splashAnimation = splashProgress.Background as AnimationDrawable; Exception loadingException = null; //AndroidCrapApplication.ApplicationLogger.LogDebug("MEMORY 5 : {0}", // GC.GetTotalMemory(false)); splashAnimation?.Start(); _loadingContext = this; if (_loadingTask == null) { _loadingTask = CreateLoadingTask ( GetString(Resource.String.SplashTextFormat), updateText: (progressText) => UpdateText(progressText), getContext: () => { return(GetContext()); } ); } //AndroidCrapApplication.ApplicationLogger.LogDebug("MEMORY 6 : {0}", // GC.GetTotalMemory(false)); try { await _loadingTask; } catch (Exception exception) { loadingException = exception; } finally { _loadingTask = null; splashAnimation?.Stop(); splashAnimation?.Dispose(); splashAnimation = null; splashProgress = null; } /*// http://stackoverflow.com/questions/477572/strange-out-of-memory-issue-while-loading-an-image-to-a-bitmap-object * * Java.Lang.JavaSystem.RunFinalization(); * Java.Lang.JavaSystem.Gc(); * Java.Lang.JavaSystem.RunFinalization(); * System.Runtime.GCSettings.LargeObjectHeapCompactionMode * = System.Runtime.GCLargeObjectHeapCompactionMode.CompactOnce; * GC.Collect();*/ if (loadingException != null) { AndroidCrapApplication.ShowExceptionAndExit(this, loadingException); return; } //AndroidCrapApplication.ApplicationLogger.LogDebug("MEMORY 7 : {0}", // GC.GetTotalMemory(false)); }
protected override void OnPause() { base.OnPause(); _alarmDrawable.Stop(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.BronForm); //---Переменные для работы NAvigationView drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); navView = FindViewById <NavigationView>(Resource.Id.nav_view); DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu); LoaderView = FindViewById <RelativeLayout>(Resource.Id.LoaderView); LoaderImage = FindViewById <ImageView>(Resource.Id.LoaderImage); //---Переменные для работы Activity m1 = FindViewById <Button>(Resource.Id.m1); m2 = FindViewById <Button>(Resource.Id.m2); m3 = FindViewById <Button>(Resource.Id.m3); m4 = FindViewById <Button>(Resource.Id.m4); m5 = FindViewById <Button>(Resource.Id.m5); m6 = FindViewById <Button>(Resource.Id.m6); m7 = FindViewById <Button>(Resource.Id.m7); m8 = FindViewById <Button>(Resource.Id.m8); m9 = FindViewById <Button>(Resource.Id.m9); m10 = FindViewById <Button>(Resource.Id.m10); m11 = FindViewById <Button>(Resource.Id.m11); m12 = FindViewById <Button>(Resource.Id.m12); m14 = FindViewById <Button>(Resource.Id.m14); ButtonBron = FindViewById <Button>(Resource.Id.ButtonBron); SpinnerTypeTicket = FindViewById <Spinner>(Resource.Id.SpinnerTypeTicket); SpinnerSpots = FindViewById <Spinner>(Resource.Id.SpinnerSpots); TextViewSelectRout = FindViewById <TextView>(Resource.Id.TextViewSelectRout); TextViewData = FindViewById <TextView>(Resource.Id.TextViewData); TextViewCost = FindViewById <TextView>(Resource.Id.TextViewCost); TextViewPoStart = FindViewById <TextView>(Resource.Id.TextViewPoStart); TextViewPoEnd = FindViewById <TextView>(Resource.Id.TextViewPoEnd); EditTextFIO = FindViewById <EditText>(Resource.Id.EditTextFIO); EditTextPhone = FindViewById <EditText>(Resource.Id.EditTextPhone); FinishLayout = FindViewById <RelativeLayout>(Resource.Id.FinishLayout); ButtonBronFinish = FindViewById <Button>(Resource.Id.ButtonBronFinish); ButtonFullFinish = FindViewById <Button>(Resource.Id.ButtonFullFinish); //---------------------------- FinishLayout.Visibility = ViewStates.Invisible; ButtonBronFinish.Click += ButtonBronFinish_Click; ButtonFullFinish.Click += ButtonFullFinish_Click;; AnimationLoader = (AnimationDrawable)LoaderImage.Drawable; AnimationLoader.Start(); DrawerImage.Click += DrawerImage_Click; HeaderView = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false); navView.AddHeaderView(HeaderView); navView.NavigationItemSelected += NavView_NavigationItemSelected; EditTextPhone.TextChanged += EditTextPhone_TextChanged; ButtonBron.Click += ButtonBron_Click; RoutsID = Intent.GetStringExtra("RoutsID"); TripID = Intent.GetStringExtra("TripID"); TripDate = Intent.GetStringExtra("TripDate"); StartPOText = Intent.GetStringExtra("StartPOText"); StartPOId = Intent.GetStringExtra("StartPOId"); EndPOText = Intent.GetStringExtra("EndPOText"); EndPOId = Intent.GetStringExtra("EndPOId"); TextViewPoStart.Text = StartPOText; TextViewPoEnd.Text = EndPOText; //---Массив мест SpisokForSpinnerSpots = new List <int>(); ObratPO = new List <IApi>(); spots = new List <Button>(); spots.Add(m1); spots.Add(m2); spots.Add(m3); spots.Add(m4); spots.Add(m5); spots.Add(m6); spots.Add(m7); spots.Add(m8); spots.Add(m9); spots.Add(m10); spots.Add(m11); spots.Add(m12); spots.Add(m14); new Thread(new ThreadStart(delegate //поток для загрузки данных { bilets = TypeBilets.GetTypeBilets(); routs = Routs.GetMarshruts(); foreach (var item in routs) { if (item.id.ToString() == RoutsID) { SelectRout = item; break; } } GetsSpots = Trips.GetMesta(Convert.ToInt32(TripID), Convert.ToInt32(RoutsID), Convert.ToInt32(StartPOId), Convert.ToInt32(EndPOId)); RunOnUiThread(() => CheckSvMestaOnShema(GetsSpots, spots, SpisokForSpinnerSpots)); RunOnUiThread(() => SpinnerSpots.Adapter = new SpotsAdapter(this, SpisokForSpinnerSpots)); RunOnUiThread(() => SpinnerTypeTicket.Adapter = new TicketAdapter(this, bilets)); cost = Prices.GetPrice(Convert.ToInt32(StartPOId), Convert.ToInt32(EndPOId), Convert.ToInt32(RoutsID)); if (bilets[0].fix == 1) { cost = bilets[0].cost.ToString(); } else { cost = (Convert.ToDouble(cost) * bilets[0].cost).ToString(); } RunOnUiThread(() => TextViewCost.Text = cost); RunOnUiThread(() => TextViewSelectRout.Text = SelectRout.name); RunOnUiThread(() => TextViewData.Text = DateTime.ParseExact(TripDate, "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy")); RunOnUiThread(() => AnimationLoader.Stop()); RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible); RunOnUiThread(() => SpinnerTypeTicket.ItemSelected += SpinnerTypeTicket_ItemSelected); })).Start(); }
public override void Dismiss() { ad_Loading?.Stop(); base.Dismiss(); }
public override View GetView(int position, View convertView, ViewGroup parent) { try { if (convertView == null) { if (_activity != null) { convertView = _activity.LayoutInflater.Inflate(Resource.Layout.MusicPlayListTrackListItem, parent, false); } else if (parent != null) { LayoutInflater inflater = (LayoutInflater)parent.Context.GetSystemService(Context.LayoutInflaterService); convertView = inflater.Inflate(Resource.Layout.MusicPlayListTrackListItem, parent, false); } else { return(convertView); } } if (convertView != null) { GetFieldComponents(convertView); if (_trackTitle != null) { _trackTitle.Text = _tracksList[position].TrackName.Trim(); } if (_artist != null) { _artist.Text = _tracksList[position].TrackArtist.Trim(); } if (_duration != null) { DurationHelper.Duration duration = DurationHelper.ConvertMillisToDuration((long)_tracksList[position].TrackDuration); _duration.Text = string.Format("{0:00}:{1:00}:{2:00}", duration.Hours, duration.Minutes, duration.Seconds); } if (((MusicPlayListTracksActivity)_activity).GetSelectedListItemIndex() == position) { Log.Info(TAG, "GetView: Determined selected track at position - " + position.ToString()); convertView.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); if (_trackTitle != null) { _trackTitle.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); } if (_artist != null) { _artist.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); } if (_duration != null) { _duration.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); } if (_mainLayout != null) { _mainLayout.SetBackgroundColor(Color.Argb(255, 19, 75, 127)); } Log.Info(TAG, "GetView: Detected selected item, set background dark"); } else { convertView.SetBackgroundDrawable(null); if (_trackTitle != null) { _trackTitle.SetBackgroundDrawable(null); } if (_artist != null) { _artist.SetBackgroundDrawable(null); } if (_duration != null) { _duration.SetBackgroundDrawable(null); } if (_mainLayout != null) { _mainLayout.SetBackgroundDrawable(null); } } var isPlaying = ((MusicPlayListTracksActivity)_activity).IsPlaying; var isPaused = ((MusicPlayListTracksActivity)_activity).IsPaused; var playingIndex = ((MusicPlayListTracksActivity)_activity).GetCurrentlyPlayingIndex; if (isPlaying || isPaused) { Log.Info(TAG, "GetView: Playing or paused, position - " + position.ToString() + ", playingIndex - " + playingIndex.ToString()); if (playingIndex == position) { if (_wave != null) { Log.Info(TAG, "GetView: Setting animation..."); _wave.SetBackgroundResource(Resource.Drawable.wave); AnimationDrawable background = (AnimationDrawable)_wave.Background; _wave.Visibility = ViewStates.Visible; if (isPaused) { Log.Info(TAG, "GetView: Paused, stopping animation playback"); background.Stop(); } if (isPlaying && !isPaused) { Log.Info(TAG, "GetView: Playing, starting animation playback"); background.Stop(); background.Start(); } } } else { if (_wave != null) { _wave.Visibility = ViewStates.Invisible; } } } } } catch (Exception e) { Log.Error(TAG, "GetView: Exception - " + e.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(_activity, e, _activity.GetString(Resource.String.ErrorMusicPlayListTracksGetView), "MusicPlayListTracksListAdapter.GetView"); } } return(convertView); }