/// <hide> /// Retrieve the string value for the attribute at <var>index</var> that is /// not allowed to change with the given configurations. /// </hide> /// <param name="index">Index of attribute to retrieve.</param> /// <param name="allowedChangingConfigs"> /// Bit mask of configurations from /// ActivityInfo that are allowed to change. /// </param> /// <returns> /// String holding string data. Any styling information is /// removed. Returns null if the attribute is not defined. /// </returns> public virtual string getNonConfigurationString(int index, int allowedChangingConfigs ) { index *= android.content.res.AssetManager.STYLE_NUM_ENTRIES; int[] data = mData; int type = data[index + android.content.res.AssetManager.STYLE_TYPE]; if ((data[index + android.content.res.AssetManager.STYLE_CHANGING_CONFIGURATIONS] & ~allowedChangingConfigs) != 0) { return(null); } if (type == android.util.TypedValue.TYPE_NULL) { return(null); } else { if (type == android.util.TypedValue.TYPE_STRING) { return(loadStringValueAt(index).ToString()); } } android.util.TypedValue v = mValue; if (getValueAt(index, v)) { android.util.Log.w(android.content.res.Resources.TAG, "Converting to string: " + v); java.lang.CharSequence cs = v.coerceToString(); return(cs != null?cs.ToString() : null); } android.util.Log.w(android.content.res.Resources.TAG, "getString of bad type: 0x" + Sharpen.Util.IntToHexString(type)); return(null); }
public override android.database.Cursor runQueryOnBackgroundThread(java.lang.CharSequence constraint) { string query = (constraint == null) ? string.Empty : constraint.ToString(); android.database.Cursor cursor = null; //mSearchView.getWindow().getDecorView().post(mStartSpinnerRunnable); // TODO: try { cursor = mSearchManager.getSuggestions(mSearchable, query, QUERY_LIMIT); // trigger fill window so the spinner stays up until the results are copied over and // closer to being ready if (cursor != null) { cursor.getCount(); return(cursor); } } catch (java.lang.RuntimeException e) { android.util.Log.w(LOG_TAG, "Search suggestions query threw an exception.", e); } // If cursor is null or an exception was thrown, stop the spinner and return null. // changeCursor doesn't get called if cursor is null // mSearchView.getWindow().getDecorView().post(mStopSpinnerRunnable); // TODO: return(null); }
public virtual java.nio.CharBuffer append(java.lang.CharSequence csq) { if (csq != null) { return(put(csq.ToString())); } return(put("null")); }
/// <summary> /// Inserts the specified CharSequence into this buffer at the specified /// index. /// </summary> /// <remarks> /// Inserts the specified CharSequence into this buffer at the specified /// index. /// <p> /// If the specified CharSequence is /// <code>null</code> /// , the string /// <code>"null"</code> /// is inserted, otherwise the contents of the CharSequence. /// </remarks> /// <param name="index">The index at which to insert.</param> /// <param name="s">The char sequence to insert.</param> /// <returns>this buffer.</returns> /// <exception cref="IndexOutOfRangeException"> /// if /// <code>index < 0</code> /// or /// <code>index > length()</code> /// . /// </exception> /// <since>1.5</since> public java.lang.StringBuffer insert(int index, java.lang.CharSequence s) { lock (this) { insert0(index, s == null ? "null" : s.ToString()); return(this); } }
internal override android.widget.Filter.FilterResults performFiltering(java.lang.CharSequence prefix) { android.widget.Filter.FilterResults results = new android.widget.Filter.FilterResults (); if (this._enclosing.mUnfilteredData == null) { this._enclosing.mUnfilteredData = new java.util.ArrayList <java.util.Map <string, object > >(this._enclosing.mData); } if (prefix == null || prefix.Length == 0) { java.util.ArrayList <java.util.Map <string, object> > list = this._enclosing.mUnfilteredData; results.values = list; results.count = list.size(); } else { string prefixString = prefix.ToString().ToLower(); java.util.ArrayList <java.util.Map <string, object> > unfilteredValues = this._enclosing .mUnfilteredData; int count = unfilteredValues.size(); java.util.ArrayList <java.util.Map <string, object> > newValues = new java.util.ArrayList <java.util.Map <string, object> >(count); { for (int i = 0; i < count; i++) { java.util.Map <string, object> h = unfilteredValues.get(i); if (h != null) { int len = this._enclosing.mTo.Length; { for (int j = 0; j < len; j++) { string str = (string)h.get(this._enclosing.mFrom[j]); string[] words = XobotOS.Runtime.Util.SplitStringRegex(str, " "); int wordCount = words.Length; { for (int k = 0; k < wordCount; k++) { string word = words[k]; if (word.ToLower().StartsWith(prefixString)) { newValues.add(h); break; } } } } } } } } results.values = newValues; results.count = newValues.size(); } return(results); }
public override java.io.Writer append(java.lang.CharSequence csq) { if (csq == null) { csq = java.lang.CharSequenceProxy.Wrap("null"); } write(csq.ToString()); return(this); }
internal virtual void init(java.lang.CharSequence source, android.text.TextPaint paint, int outerwidth, android.text.Layout.Alignment?align, float spacingmult, float spacingadd, android.text.BoringLayout.Metrics metrics, bool includepad, bool trustWidth) { int spacing; if (java.lang.CharSequenceProxy.IsStringProxy(source) && align == android.text.Layout.Alignment .ALIGN_NORMAL) { mDirect = source.ToString(); } else { mDirect = null; } mPaint = paint; if (includepad) { spacing = metrics.bottom - metrics.top; } else { spacing = metrics.descent - metrics.ascent; } if (spacingmult != 1 || spacingadd != 0) { spacing = (int)(spacing * spacingmult + spacingadd + 0.5f); } mBottom = spacing; if (includepad) { mDesc = spacing + metrics.top; } else { mDesc = spacing + metrics.ascent; } if (trustWidth) { mMax = metrics.width; } else { android.text.TextLine line = android.text.TextLine.obtain(); line.set(paint, source, 0, source.Length, android.text.Layout.DIR_LEFT_TO_RIGHT, android.text.Layout.DIRS_ALL_LEFT_TO_RIGHT, false, null); mMax = (int)android.util.FloatMath.ceil(line.metrics(null)); android.text.TextLine.recycle(line); } if (includepad) { mTopPadding = metrics.top - metrics.ascent; mBottomPadding = metrics.bottom - metrics.descent; } }
/// <summary>Utility method that concatenates two strings defined by mPermFormat.</summary> /// <remarks> /// Utility method that concatenates two strings defined by mPermFormat. /// a null value is returned if both str1 and str2 are null, if one of the strings /// is null the other non null value is returned without formatting /// this is to placate initial error checks /// </remarks> private string formatPermissions(string groupDesc, java.lang.CharSequence permDesc ) { if (groupDesc == null) { if (permDesc == null) { return(null); } return(permDesc.ToString()); } groupDesc = canonicalizeGroupDesc(groupDesc); if (permDesc == null) { return(groupDesc); } // groupDesc and permDesc are non null return(string.Format(mPermFormat, groupDesc, permDesc.ToString())); }
public virtual void setCharSequence(java.lang.CharSequence charSequence, int start , int end) { mOffsetShift = System.Math.Max(0, start - WINDOW_WIDTH); int windowEnd = System.Math.Min(charSequence.Length, end + WINDOW_WIDTH); mString = Sharpen.StringHelper.Substring(charSequence.ToString(), mOffsetShift, windowEnd ); mIterator.setText(mString); }
public virtual java.io.PrintStream append(java.lang.CharSequence charSequence) { if (charSequence == null) { print("null"); } else { print(charSequence.ToString()); } return(this); }
protected internal override void onCreate(android.os.Bundle savedInstanceState) { base.onCreate(savedInstanceState); android.os.Bundle extras = getIntent().getExtras(); if (extras == null) { finish(); return; } mNumDeletes = extras.getLong("numDeletes"); mAccount = (android.accounts.Account)extras.getParcelable("account"); mAuthority = extras.getString("authority"); mProvider = extras.getString("provider"); // the order of these must match up with the constants for position used in onItemClick java.lang.CharSequence[] options = new java.lang.CharSequence[] { getResources(). getText([email protected][email protected]_really_delete), getResources().getText( [email protected][email protected]_undo_deletes), getResources().getText([email protected] [email protected]_do_nothing) }; android.widget.ListAdapter adapter = new android.widget.ArrayAdapter <java.lang.CharSequence >(this, android.R.layout.simple_list_item_1, android.R.id.text1, options); android.widget.ListView listView = new android.widget.ListView(this); listView.setAdapter(adapter); listView.setItemsCanFocus(true); listView.setOnItemClickListener(this); android.widget.TextView textView = new android.widget.TextView(this); java.lang.CharSequence tooManyDeletesDescFormat = getResources().getText([email protected] [email protected]_too_many_deletes_desc); textView.setText(java.lang.CharSequenceProxy.Wrap(string.Format(tooManyDeletesDescFormat .ToString(), mNumDeletes, mProvider, mAccount.name))); android.widget.LinearLayout ll = new android.widget.LinearLayout(this); ll.setOrientation(android.widget.LinearLayout.VERTICAL); android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams (android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams .WRAP_CONTENT, 0); ll.addView(textView, lp); ll.addView(listView, lp); // TODO: consider displaying the icon of the account type // AuthenticatorDescription[] descs = AccountManager.get(this).getAuthenticatorTypes(); // for (AuthenticatorDescription desc : descs) { // if (desc.type.equals(mAccount.type)) { // try { // final Context authContext = createPackageContext(desc.packageName, 0); // ImageView imageView = new ImageView(this); // imageView.setImageDrawable(authContext.getResources().getDrawable(desc.iconId)); // ll.addView(imageView, lp); // } catch (PackageManager.NameNotFoundException e) { // } // break; // } // } setContentView(ll); }
internal SpannableStringInternal(java.lang.CharSequence source, int start, int end ) { if (start == 0 && end == source.Length) { mText = source.ToString(); } else { mText = Sharpen.StringHelper.Substring(source.ToString(), start, end); } int initial = [email protected](0); mSpans = new object[initial]; mSpanData = new int[initial * 3]; if (source is android.text.Spanned) { android.text.Spanned sp = (android.text.Spanned)source; object[] spans = sp.getSpans <object>(start, end); { for (int i = 0; i < spans.Length; i++) { int st = sp.getSpanStart(spans[i]); int en = sp.getSpanEnd(spans[i]); int fl = sp.getSpanFlags(spans[i]); if (st < start) { st = start; } if (en > end) { en = end; } setSpan(spans[i], st - start, en - start, fl); } } } }
public virtual java.nio.CharBuffer append(java.lang.CharSequence csq, int start, int end) { if (csq == null) { csq = java.lang.CharSequenceProxy.Wrap("null"); } java.lang.CharSequence cs = csq.SubSequence(start, end); if (cs.Length > 0) { return(put(cs.ToString())); } return(this); }
public sealed override java.nio.CharBuffer get(char[] dst, int dstOffset, int charCount ) { java.util.Arrays.checkOffsetAndCount(dst.Length, dstOffset, charCount); if (charCount > remaining()) { throw new java.nio.BufferUnderflowException(); } int newPosition = _position + charCount; Sharpen.StringHelper.GetCharsForString(sequence.ToString(), _position, newPosition , dst, dstOffset); _position = newPosition; return(this); }
public virtual int compare(android.content.pm.ApplicationInfo aa, android.content.pm.ApplicationInfo ab) { java.lang.CharSequence sa = mPM.getApplicationLabel(aa); if (sa == null) { sa = java.lang.CharSequenceProxy.Wrap(aa.packageName); } java.lang.CharSequence sb = mPM.getApplicationLabel(ab); if (sb == null) { sb = java.lang.CharSequenceProxy.Wrap(ab.packageName); } return(sCollator.compare(sa.ToString(), sb.ToString())); }
public virtual int compare(android.content.pm.PackageItemInfo aa, android.content.pm.PackageItemInfo ab) { java.lang.CharSequence sa = aa.loadLabel(mPM); if (sa == null) { sa = java.lang.CharSequenceProxy.Wrap(aa.name); } java.lang.CharSequence sb = ab.loadLabel(mPM); if (sb == null) { sb = java.lang.CharSequenceProxy.Wrap(ab.name); } return(sCollator.compare(sa.ToString(), sb.ToString())); }
public string getLocalizedString(string name) { // where is value efigs.fnt stored???? //Console( 4824): 12d8:035f getLocalizedString { name = font_name } //Console( 4824): 12d8:035f getLocalizedString { outString = efigs.fnt } string outString = ""; try { System.Console.WriteLine("getLocalizedString " + new { name }); //Log.v("VrLocale", "getLocalizedString for " + name ); int id = getResources().getIdentifier(name, "string", getPackageName()); if (id == 0) { // 0 is not a valid resource id Log.v("VrLocale", name + " is not a valid resource id!!"); } if (id != 0) { outString = name; // https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20160103/oculus360photossdk //outString = getResources().getText(id).ToString(); ////dynamic xResources = getResources(); ////// https://developer.android.com/reference/android/content/res/Resources.html ////java.lang.CharSequence text = xResources.getText(id); java.lang.CharSequence text = getResources().getText(id); //outString = getResources().getText(id).ToString(); outString = text.ToString(); //outString = text.ToString(); System.Console.WriteLine("getLocalizedString " + new { outString }); //Log.v("VrLocale", "getLocalizedString resolved " + name + " to " + outString); //Log.v("VrLocale", "getLocalizedString resolved " + name + " to " + outString); } } catch (System.Exception err) { System.Console.WriteLine("getLocalizedString " + new { err.Message, err.StackTrace }); } return(outString); }
public PackageItemInfo(android.content.pm.PackageItemInfo orig) { name = orig.name; if (name != null) { name = name.Trim(); } packageName = orig.packageName; labelRes = orig.labelRes; nonLocalizedLabel = orig.nonLocalizedLabel; if (nonLocalizedLabel != null) { nonLocalizedLabel = java.lang.CharSequenceProxy.Wrap(nonLocalizedLabel.ToString() .Trim()); } icon = orig.icon; logo = orig.logo; metaData = orig.metaData; }
/// <summary>Retrieve the float value for the attribute at <var>index</var>.</summary> /// <remarks>Retrieve the float value for the attribute at <var>index</var>.</remarks> /// <param name="index">Index of attribute to retrieve.</param> /// <returns>Attribute float value, or defValue if not defined..</returns> public virtual float getFloat(int index, float defValue) { index *= android.content.res.AssetManager.STYLE_NUM_ENTRIES; int[] data = mData; int type = data[index + android.content.res.AssetManager.STYLE_TYPE]; if (type == android.util.TypedValue.TYPE_NULL) { return(defValue); } else { if (type == android.util.TypedValue.TYPE_FLOAT) { return(Sharpen.Util.IntBitsToFloat(data[index + android.content.res.AssetManager. STYLE_DATA])); } else { if (type >= android.util.TypedValue.TYPE_FIRST_INT && type <= android.util.TypedValue .TYPE_LAST_INT) { return(data[index + android.content.res.AssetManager.STYLE_DATA]); } } } android.util.TypedValue v = mValue; if (getValueAt(index, v)) { android.util.Log.w(android.content.res.Resources.TAG, "Converting to float: " + v ); java.lang.CharSequence str = v.coerceToString(); if (str != null) { return(float.Parse(str.ToString())); } } android.util.Log.w(android.content.res.Resources.TAG, "getFloat of bad type: 0x" + Sharpen.Util.IntToHexString(type)); return(defValue); }
/// <summary>Resets the Matcher.</summary> /// <remarks> /// Resets the Matcher. A new input sequence and a new region can be /// specified. Results of a previous find get lost. The next attempt to find /// an occurrence of the Pattern in the string will start at the beginning of /// the region. This is the internal version of reset() to which the several /// public versions delegate. /// </remarks> /// <param name="input">the input sequence.</param> /// <param name="start">the start of the region.</param> /// <param name="end">the end of the region.</param> /// <returns>the matcher itself.</returns> private java.util.regex.Matcher reset(java.lang.CharSequence input, int start_1, int end_1) { if (input == null) { throw new System.ArgumentException(); } if (start_1 < 0 || end_1 < 0 || start_1 > input.Length || end_1 > input.Length || start_1 > end_1) { throw new System.IndexOutOfRangeException(); } this.input = input.ToString(); this._regionStart = start_1; this._regionEnd = end_1; resetForInput(); matchFound = false; findPos = _regionStart; appendPos = 0; return(this); }
/// <summary>Retrieve the current textual label associated with this item.</summary> /// <remarks> /// Retrieve the current textual label associated with this item. This /// will call back on the given PackageManager to load the label from /// the application. /// </remarks> /// <param name="pm"> /// A PackageManager from which the label can be loaded; usually /// the PackageManager from which you originally retrieved this item. /// </param> /// <returns> /// Returns a CharSequence containing the item's label. If the /// item does not have a label, its name is returned. /// </returns> public virtual java.lang.CharSequence loadLabel(android.content.pm.PackageManager pm) { if (nonLocalizedLabel != null) { return(nonLocalizedLabel); } if (labelRes != 0) { java.lang.CharSequence label = pm.getText(packageName, labelRes, getApplicationInfo ()); if (label != null) { return(java.lang.CharSequenceProxy.Wrap(label.ToString().Trim())); } } if (name != null) { return(java.lang.CharSequenceProxy.Wrap(name)); } return(java.lang.CharSequenceProxy.Wrap(packageName)); }
/// <summary> /// Constructs an instance that's initialized with the contents of the /// specified /// <code>CharSequence</code> /// . The capacity of the new builder will be /// the length of the /// <code>CharSequence</code> /// plus 16. /// </summary> /// <param name="seq"> /// the /// <code>CharSequence</code> /// to copy into the builder. /// </param> /// <exception cref="ArgumentNullException"> /// if /// <code>seq</code> /// is /// <code>null</code> /// . /// </exception> public StringBuilder(java.lang.CharSequence seq) : base(seq.ToString()) { }
public override void setTitle(java.lang.CharSequence title) { this.title = title.ToString(); XobotActivityManager.MainForm.Text = title.ToString(); }
/// <summary> /// Inserts the string representation of the specified /// <code>CharSequence</code> /// at the specified /// <code>offset</code> /// . The /// <code>CharSequence</code> /// is converted /// to a String as defined by /// <see cref="CharSequence.ToString()">CharSequence.ToString()</see> /// . If /// <code>s</code> /// is /// <code>null</code> /// , then the String /// <code>"null"</code> /// is inserted. /// </summary> /// <param name="offset">the index to insert at.</param> /// <param name="s"> /// the /// <code>CharSequence</code> /// to insert. /// </param> /// <returns>this builder.</returns> /// <exception cref="IndexOutOfRangeException"> /// if /// <code>offset</code> /// is negative or greater than the current /// <code>length()</code> /// . /// </exception> /// <seealso cref="CharSequence.ToString()">CharSequence.ToString()</seealso> public java.lang.StringBuilder insert(int offset, java.lang.CharSequence s) { insert0(offset, s == null ? "null" : s.ToString()); return(this); }
/// <summary> /// Splits the given /// <code>input</code> /// at occurrences of this pattern. /// <p>If this pattern does not occur in the input, the result is an /// array containing the input (converted from a /// <code>CharSequence</code> /// to /// a /// <code>String</code> /// ). /// <p>Otherwise, the /// <code>limit</code> /// parameter controls the contents of the /// returned array as described below. /// </summary> /// <param name="limit"> /// Determines the maximum number of entries in the resulting /// array, and the treatment of trailing empty strings. /// <ul> /// <li>For n > 0, the resulting array contains at most n /// entries. If this is fewer than the number of matches, the /// final entry will contain all remaining input. /// <li>For n < 0, the length of the resulting array is /// exactly the number of occurrences of the /// <code>Pattern</code> /// plus one for the text after the final separator. /// All entries are included. /// <li>For n == 0, the result is as for n < 0, except /// trailing empty strings will not be returned. (Note that /// the case where the input is itself an empty string is /// special, as described above, and the limit parameter does /// not apply there.) /// </ul> /// </param> public string[] split(java.lang.CharSequence input, int limit) { return(java.util.regex.Splitter.split(this, _pattern, input.ToString(), limit)); }
/// <summary> /// Constructs a StringBuffer and initializes it with the content from the /// specified /// <code>CharSequence</code> /// . The capacity of the new buffer will be /// the length of the /// <code>CharSequence</code> /// plus the default capacity. /// </summary> /// <param name="cs">the content to initialize the instance.</param> /// <exception cref="ArgumentNullException"> /// if /// <code>cs</code> /// is /// <code>null</code> /// . /// </exception> /// <since>1.5</since> public StringBuffer(java.lang.CharSequence cs) : base(cs.ToString()) { }
internal override android.widget.Filter.FilterResults performFiltering(java.lang.CharSequence prefix) { android.widget.Filter.FilterResults results = new android.widget.Filter.FilterResults (); if (this._enclosing.mOriginalValues == null) { lock (this._enclosing.mLock) { this._enclosing.mOriginalValues = new java.util.ArrayList <T>(this._enclosing.mObjects ); } } if (prefix == null || prefix.Length == 0) { java.util.ArrayList <T> list; lock (this._enclosing.mLock) { list = new java.util.ArrayList <T>(this._enclosing.mOriginalValues); } results.values = list; results.count = list.size(); } else { string prefixString = prefix.ToString().ToLower(); java.util.ArrayList <T> values; lock (this._enclosing.mLock) { values = new java.util.ArrayList <T>(this._enclosing.mOriginalValues); } int count = values.size(); java.util.ArrayList <T> newValues = new java.util.ArrayList <T>(); { for (int i = 0; i < count; i++) { T value = values.get(i); string valueText = value.ToString().ToLower(); // First match against the whole, non-splitted value if (valueText.StartsWith(prefixString)) { newValues.add(value); } else { string[] words = XobotOS.Runtime.Util.SplitStringRegex(valueText, " "); int wordCount = words.Length; { // Start at index 0, in case valueText starts with space(s) for (int k = 0; k < wordCount; k++) { if (words[k].StartsWith(prefixString)) { newValues.add(value); break; } } } } } } results.values = newValues; results.count = newValues.size(); } return(results); }
public override string ToString() { return(mTitle.ToString()); }