本文整理汇总了C#中Java类的典型用法代码示例。如果您正苦于以下问题:C# Java类的具体用法?C# Java怎么用?C# Java使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Java类属于命名空间,在下文中一共展示了Java类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DestroyItem
public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object objectValue) {
//var vp = (ViewPager)container;
//var chd = container.GetChildAt(position);
//不能 Dispose, 如果释放了,会在 FinishUpdate 的时候, 报错
//chd.Dispose();
//container.RemoveView((View)chd);
}
示例2: Evaluate
public Java.Lang.Object Evaluate(float t, Java.Lang.Object startValue, Java.Lang.Object endValue)
{
var start = (PathPoint)startValue;
var end = (PathPoint)endValue;
float x, y;
if (end.Operation == PathPointOperation.Curve)
{
float oneMinusT = 1 - t;
x = oneMinusT * oneMinusT * oneMinusT * start.X +
3 * oneMinusT * oneMinusT * t * end.Control0X +
3 * oneMinusT * t * t * end.Control1X +
t * t * t * end.X;
y = oneMinusT * oneMinusT * oneMinusT * start.Y +
3 * oneMinusT * oneMinusT * t * end.Control0Y +
3 * oneMinusT * t * t * end.Control1Y +
t * t * t * end.Y;
}
else if (end.Operation == PathPointOperation.Line)
{
x = start.X + t * (end.X - start.X);
y = start.Y + t * (end.Y - start.Y);
}
else
{
x = end.X;
y = end.Y;
}
return PathPoint.MoveTo(x, y);
}
示例3: OnFailure
public void OnFailure(Request request, Java.IO.IOException exception)
{
if (onFailure != null)
{
onFailure(request, exception);
}
}
示例4: FilterFormatted
public Java.Lang.ICharSequence FilterFormatted(Java.Lang.ICharSequence source, int start, int end, global::Android.Text.ISpanned dest, int dstart, int dend)
{
var s = source.ToString();
var d = dest.ToString();
var proposal = d.Remove(dstart, dend - dstart).Insert(dstart, s.Substring(start, end - start));
if (_onChangeDelegate(proposal))
return null;
else
{
var r = new Java.Lang.String(d.Substring(dstart, dend - dstart));
if (source is ISpanned)
{
// This spannable thing here, is needed to copy information about which part of
// the string is being under composition by the keyboard (or other spans). A
// spannable string has support for extra information to the string, besides
// its characters and that information must not be lost!
var ssb = new SpannableString(r);
var spannableEnd = (end <= ssb.Length()) ? end : ssb.Length();
global::Android.Text.TextUtils.CopySpansFrom((ISpanned)source, start, spannableEnd, null, ssb, 0);
return ssb;
}
else
return r;
}
}
示例5: OnFailure
public void OnFailure(ICall call, Java.IO.IOException exception)
{
if (onFailure != null)
{
onFailure(call, exception);
}
}
示例6: ArrayList
/// <summary>
/// Private ctor
/// </summary>
private ArrayList(Java.Util.IList<object> list, bool isFixedSize, bool isReadOnly, bool isSynchronized)
{
this.list = list;
this.isFixedSize = isFixedSize;
this.isReadOnly = isReadOnly;
this.isSynchronized = isSynchronized;
}
示例7: CreateFadeOutAnimation
public static ObjectAnimator CreateFadeOutAnimation(Java.Lang.Object target, int duration, EventHandler endAnimationHandler)
{
ObjectAnimator oa = ObjectAnimator.OfFloat(target, ALPHA, INVISIBLE);
oa.SetDuration(duration).AnimationEnd += endAnimationHandler;
return oa;
}
示例8: CreateSocket
public override Java.Net.Socket CreateSocket(string host, int port, Java.Net.InetAddress localHost, int localPort)
{
SSLSocket socket = (SSLSocket)_factory.CreateSocket(host, port, localHost, localPort);
socket.SetEnabledProtocols(socket.GetSupportedProtocols());
return socket;
}
示例9: OnTextChanged
async protected override void OnTextChanged(Java.Lang.ICharSequence text, int start, int lengthBefore, int lengthAfter)
{
base.OnTextChanged(text, start, lengthBefore, lengthAfter);
UpdateCharacterCount(StringUtils.TrimWhiteSpaceAndNewLine(Text));
if (Validate != null)
{
Validate();
}
if (Text.Length <= 2 || !Text.Contains("@"))
{
if (SuggestionsView != null)
{
SuggestionsView.Visibility = ViewStates.Gone;
}
return;
}
if (Text.Substring(Text.Length - 1) == " " || Text.Substring(Text.Length - 1) == "@")
{
SuggestionsView.Visibility = ViewStates.Gone;
return;
}
int startSelection = SelectionStart;
string selectedWord = "";
int length = 0;
foreach (string currentWord in Text.Split(' '))
{
Console.WriteLine(currentWord);
length = length + currentWord.Length + 1;
if (length > startSelection)
{
selectedWord = currentWord;
break;
}
}
Console.WriteLine("Selected word is: " + selectedWord);
if (!selectedWord.Contains("@") || selectedWord.IndexOf('@') != 0)
{
SuggestionsView.Visibility = ViewStates.Gone;
return;
}
try
{
List<User> users = await TenServices.SearchFollowingUsers(selectedWord);
SuggestionsView.BindDataToView(users);
}
catch (RESTError e)
{
Console.WriteLine(e.Message);
}
}
示例10: PerformFiltering
protected override Filter.FilterResults PerformFiltering (Java.Lang.ICharSequence constraint)
{
FilterResults results = new FilterResults();
if (constraint != null) {
var searchFor = constraint.ToString ();
Console.WriteLine ("searchFor:" + searchFor);
var matchList = new List<string>();
// find matches, IndexOf means look for the input anywhere in the items
// but it isn't case-sensitive by default!
var matches = from i in customAdapter.AllItems
where i.IndexOf(searchFor) >= 0
select i;
foreach (var match in matches) {
matchList.Add (match);
}
customAdapter.MatchItems = matchList.ToArray ();
Console.WriteLine ("resultCount:" + matchList.Count);
// not sure if the Java array/FilterResults are used
Java.Lang.Object[] matchObjects;
matchObjects = new Java.Lang.Object[matchList.Count];
for (int i = 0; i < matchList.Count; i++) {
matchObjects[i] = new Java.Lang.String(matchList[i]);
}
results.Values = matchObjects;
results.Count = matchList.Count;
}
return results;
}
示例11: Parse
public static Java.Lang.ICharSequence Parse(Context context, IList<IIconModule> modules, Java.Lang.ICharSequence text, View target = null)
{
context = context.ApplicationContext;
// Analyse the text and replace {} blocks with the appropriate character
// Retain all transformations in the accumulator
var builder = new SpannableStringBuilder(text);
RecursivePrepareSpannableIndexes(context, text.ToString(), builder, modules, 0);
var isAnimated = HasAnimatedSpans(builder);
// If animated, periodically invalidate the TextView so that the
// CustomTypefaceSpan can redraw itself
if (isAnimated)
{
if (target == null)
throw new ArgumentException("You can't use \"spin\" without providing the target View.");
if (!(target is IHasOnViewAttachListener))
throw new ArgumentException(target.Class.SimpleName + " does not implement " +
"HasOnViewAttachListener. Please use IconTextView, IconButton or IconToggleButton.");
((IHasOnViewAttachListener)target).SetOnViewAttachListener(new MyListener(target));
}
else if (target is IHasOnViewAttachListener)
{
((IHasOnViewAttachListener)target).SetOnViewAttachListener(null);
}
return builder;
}
示例12: GetItemPosition
/// <summary>
/// Called when the host view is attempting to determine if an item's position has changed. We
/// </summary>
/// <param name="objectValue"></param>
/// <returns></returns>
public override int GetItemPosition(Java.Lang.Object objectValue)
{
if (objectValue.Equals(Wizard.PreviousStep))
return PositionUnchanged;
return PositionNone; //Indicates that the item is no longer present in the adapter.. Forces a screen reload.. causing the updated context data to appear
}
示例13: OnPostExecute
/// <summary>
/// Called after the bitmap is loaded.
/// </summary>
/// <param name="result">Result of the DoInBackground function.</param>
protected override void OnPostExecute(Java.Lang.Object result)
{
base.OnPostExecute(result);
if (IsCancelled)
{
result = null;
Log.Debug("TT", "OnPostExecute - Task Cancelled");
}
else
{
using (Bitmap bmpResult = result as Bitmap)
{
if (_imageViewReference != null && bmpResult != null)
{
ImageView imageView = (ImageView)_imageViewReference.Get();
AsyncImageTask asyncImageTask = GetAsyncImageTask(imageView);
if(this == asyncImageTask && imageView != null) {
imageView.SetImageBitmap(bmpResult);
// if (!pLRUCache.ContainsKey(path))
// pLRUCache.Add(path, bmpResult);
}
}
}
}
}
示例14: RemoveCallbacks
public void RemoveCallbacks(Action action, Java.Lang.Object token)
{
var runnable = Java.Lang.Thread.RunnableImplementor.Remove (action);
if (runnable == null)
return;
RemoveCallbacks (runnable, token);
runnable.Dispose ();
}
示例15: handler
void IWebSocketListener.OnFailure(Java.IO.IOException exception, Response response)
{
var handler = Failure;
if (handler != null)
{
handler(sender, new FailureEventArgs(exception, response));
}
}