public void OnNetworkChange() { if (receiver.GetStatus()) { tvNetworkNotification.Animate().TranslationY(0).Alpha(0f).SetListener(this); } else { tvNetworkNotification.Animate().TranslationY(0).Alpha(1.0f).SetListener(this); } }
private void ShowExpanded() { if (_isExpanded) { return; } _isExpanded = true; _sectionEvent.Visibility = ViewStates.Visible; _sectionEvent.Animate().TranslationY(0).Start(); ShowItem(_actionButtonAddEvent); ShowItem(_textViewAddEvent); if (SupportsAddHoliday) { _sectionHoliday.Visibility = ViewStates.Visible; _sectionHoliday.Animate().TranslationY(0).Start(); ShowItem(_actionButtonAddHoliday); ShowItem(_textViewAddHoliday); } _textViewAddTask.Visibility = ViewStates.Visible; _textViewAddTask.Animate().Alpha(1).Start(); _expandedBackground.Visibility = ViewStates.Visible; _expandedBackground.Animate().Alpha(1).Start(); }
public void ChangeLoading(int logoResID, string text) { logoImage.Animate().Alpha(0).SetDuration(400).WithEndAction(new Runnable(() => { logoImage.SetImageResource(logoResID); logoImage.Animate().Alpha(1).SetDuration(300).Start(); var length = View.Width; explanation.Animate().TranslationX(length).SetDuration(150).WithEndAction(new Runnable(() => { explanation.Text = text; explanation.TranslationX = -length; explanation.Animate().TranslationX(0).SetDuration(150).Start(); })).Start(); if (extraExplanation.Visibility == ViewStates.Visible) { extraExplanation.Animate() .Alpha(0) .SetDuration(150) .WithEndAction(new Runnable(() => extraExplanation.Visibility = ViewStates.Invisible)).Start(); } })).Start(); }
private void RunCountdown(int countdownTime, Action onFinished) { UpdateCountdownLabel(countdownTime); ViewPropertyAnimator animator = _label.Animate().ScaleX(0).ScaleY(0).Alpha(0.0f).SetDuration(1000); if (countdownTime > 0) { animator.WithEndAction(new Runnable(() => RunCountdown(countdownTime - 1, onFinished))); } else { animator.WithStartAction(new Runnable(onFinished)); animator.WithEndAction(new Runnable(() => _label.Visibility = ViewStates.Visible)); } animator.Start(); }
void ShowSwipeDown() { if (!setup) { ActionBar.Hide(); if (bar1Fade != null) { bar1Fade.Cancel(); bar1Fade = null; } if (bar2Fade != null) { bar2Fade.Cancel(); bar2Fade = null; } loadingBars.Visibility = ViewStates.Visible; swipeText.TranslationY = -(ActionBar.Height + swipeText.Height + 4); swipeText.Visibility = ViewStates.Visible; swipeText.Animate().TranslationY(0).SetStartDelay(50).Start(); accumulatedDeltaY = 0; setup = true; } }
private void ShowFinish() { btnFinish.Visibility = ViewStates.Visible; btnFinish.Animate().TranslationY(0 - DpToPixels(5, this)).SetInterpolator(new DecelerateInterpolator()) .SetDuration(500).Start(); }
public void FadeOut() { textView.Animate().Alpha(0).SetDuration(FadeDuration).Start(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); ActionBar.Hide(); this.Window.ClearFlags(WindowManagerFlags.Fullscreen); //to hide SetContentView(Resource.Layout.Main); androidSetup(); enterSolve.Click += (object sender, EventArgs e) => { androidMatAppProcess(); }; enterClear.Click += (object sender, EventArgs e) => { sol.resetExpressionList(); sol = new StringObserver(); AndroidInterface.resetTheDisplayList(); sol.theVariableList = new List <string>(); theStringInput.Text = ""; theVariableAdapter = new VariableListAdapter(this, sol.theVariableList); theVariableList.Adapter = theVariableAdapter; if (prefix) { theVariableAdapter = new VariableListAdapter(this, thePrefixList); theVariableList.Adapter = theVariableAdapter; } if (constants) { theVariableAdapter = new VariableListAdapter(this, theConstantList); theVariableList.Adapter = theVariableAdapter; } if (functions) { theVariableAdapter = new VariableListAdapter(this, theSimpleFunctionList); theVariableList.Adapter = theVariableAdapter; } if (matfunctions) { theVariableAdapter = new VariableListAdapter(this, theMatrixFunctions); theVariableList.Adapter = theVariableAdapter; } }; plus.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "+"); theStringInput.SetSelection(pos + 1); }; minus.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "-"); theStringInput.SetSelection(pos + 1); }; multiply.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "*"); theStringInput.SetSelection(pos + 1); }; divide.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "/"); theStringInput.SetSelection(pos + 1); }; power.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "^("); theStringInput.SetSelection(pos + 2); }; semiColon.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, ";"); theStringInput.SetSelection(pos + 1); }; smallBraketEnd.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, ")"); theStringInput.SetSelection(pos + 1); }; factorial.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "!"); theStringInput.SetSelection(pos + 1); }; smallBraketStart.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "("); theStringInput.SetSelection(pos + 1); }; squareBraketEnd.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "]"); theStringInput.SetSelection(pos + 1); }; squareBraketStart.Click += (object sender, EventArgs e) => { int pos = theStringInput.SelectionStart; theStringInput.Text = theStringInput.Text.Insert(theStringInput.SelectionStart, "["); theStringInput.SetSelection(pos + 1); }; cleanInput.Click += (object sender, EventArgs e) => { theStringInput.Text = ""; }; theVariableList.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { string toBeAdded = string.Empty; if (variable) { toBeAdded = (sol.theVariableList[e.Position]); } else if (prefix) { toBeAdded = (thePrefixList[e.Position]); } else if (constants) { toBeAdded = (theConstantList[e.Position]); toBeAdded = MatApp.theConstantList.constantInputManager(toBeAdded); } else if (functions) { toBeAdded = theSimpleFunctionList[e.Position]; toBeAdded = (cUnderstander.binCommandInputManager(toBeAdded)); } else if (matfunctions) { toBeAdded = theMatrixFunctions[e.Position]; toBeAdded = cUnderstander.matrixFunctionInputManager(toBeAdded); } int pos = theStringInput.SelectionStart; string theIn = theStringInput.Text; if (!string.IsNullOrWhiteSpace(theIn) && theIn.Length != theStringInput.SelectionStart) { theIn = theIn.Remove(theStringInput.SelectionStart); } MatappAI.InputIntelligence intel = new MatappAI.InputIntelligence(theIn, toBeAdded); intel.constants = MatApp.theConstantList.getConstantListForIntelligence(); intel.variables = sol.theVariableList; intel.prefix = thePrefixList; intel.function = theSimpleFunctionList; intel.matfunctions = theMatrixFunctionListForIntelligence; intel.Process(); string r = intel.getResult(); theStringInput.Text = theStringInput.Text.Insert(pos, r); theStringInput.SetSelection(pos + r.Length); }; ShowVariable.Click += (object sender, EventArgs e) => { variable = true; constants = false; prefix = false; functions = false; matfunctions = false; // if (theStringInput.Text == "") { theStringInput.Hint = "ƒ(x)"; } androidSideBarButtonAction(); theVariableAdapter = new VariableListAdapter(this, sol.theVariableList); theVariableList.Adapter = theVariableAdapter; }; ShowPrefix.Click += (object sender, EventArgs e) => { variable = false; constants = false; prefix = true; functions = false; matfunctions = false; if (theStringInput.Text == "") { theStringInput.Hint = "ƒ(x)"; } androidSideBarButtonAction(); theVariableAdapter = new VariableListAdapter(this, thePrefixList); theVariableList.Adapter = theVariableAdapter; }; ShowConstants.Click += (object sender, EventArgs e) => { variable = false; constants = true; prefix = false; functions = false; matfunctions = false; if (theStringInput.Text == "") { theStringInput.Hint = "ƒ(x)"; } androidSideBarButtonAction(); theVariableAdapter = new VariableListAdapter(this, theConstantList); theVariableList.Adapter = theVariableAdapter; }; ShowFunctions.Click += (object sender, EventArgs e) => { variable = false; constants = false; prefix = false; functions = true; matfunctions = false; if (theStringInput.Text == "") { theStringInput.Hint = "ƒ(x)"; } androidSideBarButtonAction(); theVariableAdapter = new VariableListAdapter(this, theSimpleFunctionList); theVariableList.Adapter = theVariableAdapter; }; ShowMatrixFunctions.Click += (object sender, EventArgs e) => { variable = false; constants = false; prefix = false; functions = false; matfunctions = true; if (theStringInput.Text == "") { theStringInput.Hint = "[ 3 3 ; 3 3] a 2x2 matrix"; } androidSideBarButtonAction(); theVariableAdapter = new VariableListAdapter(this, theMatrixFunctions); theVariableList.Adapter = theVariableAdapter; }; theStringInput.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => { if (theSolutionOutput.Alpha == 0 && theReportMessageView.Alpha == 1) { theSolutionOutput.Animate().AlphaBy(1.0f).SetDuration(500).Start(); theReportMessageView.Animate().AlphaBy(-1.0f).SetDuration(500).Start(); } }; } // end method on create