private void InitSwitchers() { _temperatureSwitcher = FindViewById <TextSwitcher>(R.Id.ts_temperature); _temperatureSwitcher.SetFactory(new TextViewFactory(this, R.Style.TemperatureTextView, true)); _temperatureSwitcher.SetCurrentText(_temperatures[0]); _placeSwitcher = FindViewById <TextSwitcher>(R.Id.ts_place); _placeSwitcher.SetFactory(new TextViewFactory(this, R.Style.PlaceTextView, false)); _placeSwitcher.SetCurrentText(_places[0]); _clockSwitcher = FindViewById <TextSwitcher>(R.Id.ts_clock); _clockSwitcher.SetFactory(new TextViewFactory(this, R.Style.ClockTextView, false)); _clockSwitcher.SetCurrentText(_times[0]); _descriptionsSwitcher = FindViewById <TextSwitcher>(R.Id.ts_description); _descriptionsSwitcher.SetInAnimation(this, Android.Resource.Animation.FadeIn); _descriptionsSwitcher.SetOutAnimation(this, Android.Resource.Animation.FadeOut); _descriptionsSwitcher.SetFactory(new TextViewFactory(this, R.Style.DescriptionTextView, false)); _descriptionsSwitcher.SetCurrentText(GetString(_descriptions[0])); _mapSwitcher = FindViewById <ImageSwitcher>(R.Id.ts_map); _mapSwitcher.SetInAnimation(this, R.Animation.fade_in); _mapSwitcher.SetOutAnimation(this, R.Animation.fade_out); _mapSwitcher.SetFactory(new ImageViewFactory(this)); _mapSwitcher.SetImageResource(_maps[0]); _mapLoadListener = new DecodeBitmapTask.Listener( bmp => { (_mapSwitcher.NextView as ImageView)?.SetImageBitmap(bmp); _mapSwitcher.ShowNext(); } ); }
private void InitSwitchers(ImageSwitcher imageSwitcher, TextSwitcher textSwitcher) { imageSwitcher.SetFactory(new ViewFactory()); imageSwitcher.SetInAnimation(Activity, anim[0]); imageSwitcher.SetOutAnimation(Activity, anim[1]); imageSwitcher.SetImageResource(Resource.Drawable.driver_pablo); textSwitcher.SetFactory(this); textSwitcher.SetInAnimation(Activity, anim[0]); textSwitcher.SetOutAnimation(Activity, anim[1]); textSwitcher.SetCurrentText(GetString(Resource.String.partner_desc_txt)); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); recyclerView = (RecyclerView)view.FindViewById(Resource.Id.recycler_view); complimentsSwitcher = (TextSwitcher)view.FindViewById(Resource.Id.ts_compliments); compliValuesSwitcher = (TextSwitcher)view.FindViewById(Resource.Id.ts_compliValues); fullNameTv = view.FindViewById <TextView>(Resource.Id.account_username_tv); drivingSinceTv = view.FindViewById <TextView>(Resource.Id.account_jointime_tv); settingsIv = view.FindViewById <ImageView>(Resource.Id.account_settings_iv); profileIv = view.FindViewById <_BaseCircleImageView>(Resource.Id.acount_profile_iv); ratingTv = view.FindViewById <TextView>(Resource.Id.account_counter_tv); ridesTv = view.FindViewById <TextView>(Resource.Id.account_counter2_tv); //recycler recyclerView.SetAdapter(sliderAdapter); recyclerView.HasFixedSize = true; recyclerView.AddOnScrollListener( new MyRvOnScrollListener( null, (rv, newState) => { if (newState == RecyclerView.ScrollStateIdle) { OnActiveCardChange(); } }) ); layoutManger = (CardSliderLayoutManager)recyclerView.GetLayoutManager(); recyclerView.SetLayoutManager(layoutManger); CardSnapHelper cardSnapHelper = new CardSnapHelper(); cardSnapHelper.AttachToRecyclerView(recyclerView); //switcher complimentsSwitcher.SetFactory(new TextSwitcherUtil(Resource.Style.ComplimentsTextView, false, Activity)); complimentsSwitcher.SetCurrentText(compliments[0]); compliValuesSwitcher.SetFactory(new TextSwitcherUtil(Resource.Style.CompliValuesTextView, false, Activity)); var settingsBtn = view.FindViewById <ImageView>(Resource.Id.account_settings_iv); settingsBtn.Click += SettingsBtn_Click; var qrBtn = view.FindViewById <ImageView>(Resource.Id.account_qr_iv); qrBtn.Click += QrBtn_Click; SetDb(); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); ToggleDestBtn = (FloatingActionButton)view.FindViewById(Resource.Id.togleDestinationFab); locationSwitcher = (TextSwitcher)view.FindViewById(Resource.Id.loc_switcher); cancelTripButton = (FloatingActionButton)view.FindViewById(Resource.Id.cancelTripButton); callRiderButton = (FloatingActionButton)view.FindViewById(Resource.Id.callRiderButton); navigateButton = (FloatingActionButton)view.FindViewById(Resource.Id.navigateButton); tripButton = (Button)view.FindViewById(Resource.Id.tripButton); riderNameText = (TextView)view.FindViewById(Resource.Id.riderNameText); rideInfoLayout = (RelativeLayout)view.FindViewById(Resource.Id.linear_home1); centerMarker = (ImageView)view.FindViewById(Resource.Id.centerMarker); ToggleDestBtn.Click += ToggleDestBtn_Click; SetSwitcher(); }
private void InitInterface(Context context) { textSwitcher = new TextSwitcher(context); textSwitcher.AddView(CreateViewForTextSwitcher(context)); textSwitcher.AddView(CreateViewForTextSwitcher(context)); AddView(textSwitcher, new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent)); textView = new TextView(context); if (Build.VERSION.SdkInt >= Build.VERSION_CODES.M) { textView.SetTextAppearance(Resource.Style.positionIndicator); } else { textView.SetTextAppearance(context, Resource.Style.positionIndicator); } AddView(textView, new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent)); }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); textSwitcher = FindViewById<TextSwitcher> (Resource.Id.text); textSwitcher.SetFactory (this); // Animation in_ = AnimationUtils.LoadAnimation (this, Android.Resource.Animation.SlideInLeft); // Animation out_ = AnimationUtils.LoadAnimation (this, Android.Resource.Animation.SlideOutRight); // textSwitcher.SetInAnimation (in_); // textSwitcher.SetOutAnimation (out_); textSwitcher.SetInAnimation (this, Android.Resource.Animation.SlideInLeft); textSwitcher.SetOutAnimation (this, Android.Resource.Animation.SlideOutRight); hTextView = FindViewById<HTextView> (Resource.Id.text2); seekBar = FindViewById<SeekBar> (Resource.Id.seekbar); seekBar.Max = 20; seekBar.ProgressChanged += (object sender, SeekBar.ProgressChangedEventArgs e) => { hTextView.SetTextSize (ComplexUnitType.Sp, 8 + e.Progress); hTextView.Reset (hTextView.Text); }; seekBar.Progress = 10; radioGroup = FindViewById<RadioGroup> (Resource.Id.typeGroup); radioGroup.CheckedChange += (object sender, RadioGroup.CheckedChangeEventArgs e) => { switch (e.CheckedId) { case Resource.Id.scale: hTextView.SetTextColor (Color.Black); hTextView.SetBackgroundColor (Color.White); hTextView.SetAnimateType (HTextViewType.Scale); break; case Resource.Id.evaporate: hTextView.SetTextColor (Color.Black); hTextView.SetBackgroundColor (Color.White); hTextView.SetAnimateType (HTextViewType.Evaporate); break; case Resource.Id.fall: hTextView.SetTextColor (Color.Black); hTextView.SetBackgroundColor (Color.White); hTextView.SetAnimateType (HTextViewType.Fall); break; case Resource.Id.pixelate: hTextView.SetTextColor (Color.Black); hTextView.SetBackgroundColor (Color.White); hTextView.SetAnimateType (HTextViewType.Pixelate); break; case Resource.Id.sparkle: hTextView.SetTextColor (Color.White); hTextView.SetBackgroundColor (Color.Black); hTextView.SetAnimateType (HTextViewType.Sparkle); break; case Resource.Id.anvil: hTextView.SetTextColor (Color.White); hTextView.SetBackgroundColor (Color.Black); hTextView.SetAnimateType (HTextViewType.Anvil); break; case Resource.Id.line: hTextView.SetTextColor (Color.White); hTextView.SetBackgroundColor (Color.Black); hTextView.SetAnimateType (HTextViewType.Line); break; case Resource.Id.typer: hTextView.SetTextColor (Color.White); hTextView.SetBackgroundColor (Color.Black); hTextView.SetAnimateType (HTextViewType.Typer); break; case Resource.Id.rainbow: hTextView.SetTextColor (Color.White); hTextView.SetBackgroundColor (Color.Black); hTextView.SetAnimateType (HTextViewType.Rainbow); break; } OnClick (radioGroup.FindViewById (e.CheckedId)); }; }