Exemple #1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: @Override public void renderFrame(final com.twilio.video.I420Frame i420Frame)
        public override void renderFrame(I420Frame i420Frame)
        {
            // Capture bitmap and post to main thread
            if (snapshotRequsted.compareAndSet(true, false))
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.graphics.Bitmap bitmap = captureBitmap(i420Frame);
                Bitmap bitmap = captureBitmap(i420Frame);
                handler.post(() =>
                {
                    // Update the bitmap of image view
                    imageView.ImageBitmap = bitmap;

                    // Frames must be released after rendering to free the native memory
                    i420Frame.release();
                });
            }
            else
            {
                i420Frame.release();
            }
        }
Exemple #2
0
 public override void onContentChanged()
 {
     base.onContentChanged();
     android.view.View emptyView = findViewById([email protected]);
     mList = (android.widget.ListView)findViewById([email protected]);
     if (mList == null)
     {
         throw new java.lang.RuntimeException("Your content must have a ListView whose id attribute is "
                                              + "'android.R.id.list'");
     }
     if (emptyView != null)
     {
         mList.setEmptyView(emptyView);
     }
     mList.setOnItemClickListener(mOnClickListener);
     if (mFinishedStart)
     {
         setListAdapter(mAdapter);
     }
     mHandler.post(mRequestFocus);
     mFinishedStart = true;
 }
Exemple #3
0
 public virtual bool onLongClick(android.view.View v)
 {
     mIsInLongpress = true;
     mHandler.post(mRunnable);
     return(true);
 }
Exemple #4
0
 private void ensureList()
 {
     if (mList != null)
     {
         return;
     }
     android.view.View root = getView();
     if (root == null)
     {
         throw new System.InvalidOperationException("Content view not yet created");
     }
     if (root is android.widget.ListView)
     {
         mList = (android.widget.ListView)root;
     }
     else
     {
         mStandardEmptyView = (android.widget.TextView)root.findViewById([email protected]
                                                                         .id.internalEmpty);
         if (mStandardEmptyView == null)
         {
             mEmptyView = root.findViewById(android.R.id.empty);
         }
         else
         {
             mStandardEmptyView.setVisibility(android.view.View.GONE);
         }
         mProgressContainer = root.findViewById([email protected]);
         mListContainer     = root.findViewById([email protected]);
         android.view.View rawListView = root.findViewById(android.R.id.list);
         if (!(rawListView is android.widget.ListView))
         {
             throw new java.lang.RuntimeException("Content has view with id attribute 'android.R.id.list' "
                                                  + "that is not a ListView class");
         }
         mList = (android.widget.ListView)rawListView;
         if (mList == null)
         {
             throw new java.lang.RuntimeException("Your content must have a ListView whose id attribute is "
                                                  + "'android.R.id.list'");
         }
         if (mEmptyView != null)
         {
             mList.setEmptyView(mEmptyView);
         }
         else
         {
             if (mEmptyText != null)
             {
                 mStandardEmptyView.setText(mEmptyText);
                 mList.setEmptyView(mStandardEmptyView);
             }
         }
     }
     mListShown = true;
     mList.setOnItemClickListener(mOnClickListener);
     if (mAdapter != null)
     {
         android.widget.ListAdapter adapter = mAdapter;
         mAdapter = null;
         setListAdapter(adapter);
     }
     else
     {
         // We are starting without an adapter, so assume we won't
         // have our data right away and start with the progress indicator.
         if (mProgressContainer != null)
         {
             setListShown(false, false);
         }
     }
     mHandler.post(mRequestFocus);
 }
 /// <summary>
 /// @brief Execute runnable on the main thread
 /// </summary>
 /// <param name="runnable"> </param>
 public virtual void runOnMainThread(Runnable runnable)
 {
     mHandler.post(runnable);
 }
Exemple #6
0
 public override void show()
 {
     mHandler.post(mShow);
 }