public override void onPrepareSubMenu(android.view.SubMenu subMenu) { // Clear since the order of items may change. subMenu.clear(); android.widget.ActivityChooserModel dataModel = android.widget.ActivityChooserModel .get(mContext, mShareHistoryFileName); android.content.pm.PackageManager packageManager = mContext.getPackageManager(); int expandedActivityCount = dataModel.getActivityCount(); int collapsedActivityCount = System.Math.Min(expandedActivityCount, mMaxShownActivityCount ); { // Populate the sub-menu with a sub set of the activities. for (int i = 0; i < collapsedActivityCount; i++) { android.content.pm.ResolveInfo activity = dataModel.getActivity(i); subMenu.add(0, i, i, activity.loadLabel(packageManager)).setIcon(activity.loadIcon (packageManager)).setOnMenuItemClickListener(mOnMenuItemClickListener); } } if (collapsedActivityCount < expandedActivityCount) { // Add a sub-menu for showing all activities as a list item. android.view.SubMenu expandedSubMenu = subMenu.addSubMenu(android.view.MenuClass.NONE , collapsedActivityCount, collapsedActivityCount, java.lang.CharSequenceProxy.Wrap (mContext.getString([email protected][email protected]_chooser_view_see_all))); { for (int i_1 = 0; i_1 < expandedActivityCount; i_1++) { android.content.pm.ResolveInfo activity = dataModel.getActivity(i_1); expandedSubMenu.add(0, i_1, i_1, activity.loadLabel(packageManager)).setIcon(activity .loadIcon(packageManager)).setOnMenuItemClickListener(mOnMenuItemClickListener); } } } }
/// <summary> /// Clear all the input state (autotext, autocap, multitap, undo) /// from the specified Editable, going beyond Editable.clear(), which /// just clears the text but not the input state. /// </summary> /// <remarks> /// Clear all the input state (autotext, autocap, multitap, undo) /// from the specified Editable, going beyond Editable.clear(), which /// just clears the text but not the input state. /// </remarks> /// <param name="e">the buffer whose text and state are to be cleared.</param> public static void clear(android.text.Editable e) { e.clear(); e.removeSpan(ACTIVE); e.removeSpan(CAPPED); e.removeSpan(INHIBIT_REPLACEMENT); e.removeSpan(LAST_TYPED); android.text.method.QwertyKeyListener.Replaced[] repl = e.getSpans<android.text.method.QwertyKeyListener .Replaced>(0, e.Length); int count = repl.Length; { for (int i = 0; i < count; i++) { e.removeSpan(repl[i]); } } }
protected internal override bool getChildStaticTransformation(android.view.View child , android.view.animation.Transformation t) { t.clear(); t.setAlpha(child == mSelectedChild ? 1.0f : mUnselectedAlpha); return true; }
public override bool getTransformation(long currentTime, android.view.animation.Transformation t) { int count = mAnimations.size(); java.util.ArrayList<android.view.animation.Animation> animations = mAnimations; android.view.animation.Transformation temp = mTempTransformation; bool more = false; bool started = false; bool ended = true; t.clear(); { for (int i = count - 1; i >= 0; --i) { android.view.animation.Animation a = animations.get(i); temp.clear(); more = a.getTransformation(currentTime, temp, getScaleFactor()) || more; t.compose(temp); started = started || a.hasStarted(); ended = a.hasEnded() && ended; } } if (started && !mStarted) { if (mListener != null) { mListener.onAnimationStart(this); } mStarted = true; } if (ended != mEnded) { if (mListener != null) { mListener.onAnimationEnd(this); } mEnded = ended; } return more; }