Пример #1
0
 private void insertIconView()
 {
     android.view.LayoutInflater inflater = getInflater();
     mIconView = (android.widget.ImageView)inflater.inflate([email protected]
                                                            .list_menu_item_icon, this, false);
     addView(mIconView, 0);
 }
Пример #2
0
        private bool setupTitle(android.widget.LinearLayout topPanel)
        {
            bool hasTitle = true;

            if (mCustomTitleView != null)
            {
                // Add the custom title view directly to the topPanel layout
                android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
                                                                  (android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams
                                                                  .WRAP_CONTENT);
                topPanel.addView(mCustomTitleView, 0, lp);
                // Hide the title template
                android.view.View titleTemplate = mWindow.findViewById([email protected]_template
                                                                       );
                titleTemplate.setVisibility(android.view.View.GONE);
            }
            else
            {
                bool hasTextTitle = !android.text.TextUtils.isEmpty(mTitle);
                mIconView = (android.widget.ImageView)mWindow.findViewById([email protected]
                                                                           .icon);
                if (hasTextTitle)
                {
                    mTitleView = (android.widget.TextView)mWindow.findViewById([email protected]
                                                                               .alertTitle);
                    mTitleView.setText(mTitle);
                    if (mIconId > 0)
                    {
                        mIconView.setImageResource(mIconId);
                    }
                    else
                    {
                        if (mIcon != null)
                        {
                            mIconView.setImageDrawable(mIcon);
                        }
                        else
                        {
                            if (mIconId == 0)
                            {
                                mTitleView.setPadding(mIconView.getPaddingLeft(), mIconView.getPaddingTop(), mIconView
                                                      .getPaddingRight(), mIconView.getPaddingBottom());
                                mIconView.setVisibility(android.view.View.GONE);
                            }
                        }
                    }
                }
                else
                {
                    // Hide the title template
                    android.view.View titleTemplate = mWindow.findViewById([email protected]_template
                                                                           );
                    titleTemplate.setVisibility(android.view.View.GONE);
                    mIconView.setVisibility(android.view.View.GONE);
                    topPanel.setVisibility(android.view.View.GONE);
                    hasTitle = false;
                }
            }
            return(hasTitle);
        }
Пример #3
0
            public virtual android.view.View createIndicatorView()
            {
                android.content.Context     context  = this._enclosing.getContext();
                android.view.LayoutInflater inflater = (android.view.LayoutInflater)context.getSystemService
                                                           (android.content.Context.LAYOUT_INFLATER_SERVICE);
                android.view.View tabIndicator = inflater.inflate(this._enclosing.mTabLayoutId, this
                                                                  ._enclosing.mTabWidget, false);
                // tab widget is the parent
                // no inflate params
                android.widget.TextView tv = (android.widget.TextView)tabIndicator.findViewById([email protected]
                                                                                                .id.title);
                android.widget.ImageView iconView = (android.widget.ImageView)tabIndicator.findViewById
                                                        ([email protected]);
                // when icon is gone by default, we're in exclusive mode
                bool exclusive = iconView.getVisibility() == android.view.View.GONE;
                bool bindIcon  = !exclusive || android.text.TextUtils.isEmpty(this.mLabel);

                tv.setText(this.mLabel);
                if (bindIcon && this.mIcon != null)
                {
                    iconView.setImageDrawable(this.mIcon);
                    iconView.setVisibility(android.view.View.VISIBLE);
                }
                if (context.getApplicationInfo().targetSdkVersion <= android.os.Build.VERSION_CODES
                    .DONUT)
                {
                    // Donut apps get old color scheme
                    tabIndicator.setBackgroundResource([email protected]_indicator_v4);
                    tv.setTextColor(context.getResources().getColorStateList([email protected]
                                                                             .tab_indicator_text_v4));
                }
                return(tabIndicator);
            }
Пример #4
0
 private static android.view.View getPermissionItemView(android.content.Context context
                                                        , android.view.LayoutInflater inflater, java.lang.CharSequence grpName, java.lang.CharSequence
                                                        permList, bool dangerous, android.graphics.drawable.Drawable icon)
 {
     android.view.View permView = inflater.inflate([email protected]_permission_item
                                                   , null);
     android.widget.TextView permGrpView = (android.widget.TextView)permView.findViewById
                                               ([email protected]_group);
     android.widget.TextView permDescView = (android.widget.TextView)permView.findViewById
                                                ([email protected]_list);
     android.widget.ImageView imgView = (android.widget.ImageView)permView.findViewById
                                            ([email protected]_icon);
     imgView.setImageDrawable(icon);
     if (grpName != null)
     {
         permGrpView.setText(grpName);
         permDescView.setText(permList);
     }
     else
     {
         permGrpView.setText(permList);
         permDescView.setVisibility(android.view.View.GONE);
     }
     return(permView);
 }
Пример #5
0
            public override android.view.View getView(int position, android.view.View convertView
                                                      , android.view.ViewGroup parent)
            {
                int itemViewType = this.getItemViewType(position);

                switch (itemViewType)
                {
                case ITEM_VIEW_TYPE_FOOTER:
                {
                    if (convertView == null || convertView.getId() != ITEM_VIEW_TYPE_FOOTER)
                    {
                        convertView = android.view.LayoutInflater.from(this._enclosing.getContext()).inflate
                                          ([email protected]_chooser_view_list_item, parent, false);
                        convertView.setId(ITEM_VIEW_TYPE_FOOTER);
                        android.widget.TextView titleView = (android.widget.TextView)convertView.findViewById
                                                                ([email protected]);
                        titleView.setText(java.lang.CharSequenceProxy.Wrap(this._enclosing.mContext.getString
                                                                               ([email protected][email protected]_chooser_view_see_all)));
                    }
                    return(convertView);
                }

                case ITEM_VIEW_TYPE_ACTIVITY:
                {
                    if (convertView == null || convertView.getId() != [email protected]_item)
                    {
                        convertView = android.view.LayoutInflater.from(this._enclosing.getContext()).inflate
                                          ([email protected]_chooser_view_list_item, parent, false);
                    }
                    android.content.pm.PackageManager packageManager = this._enclosing.mContext.getPackageManager
                                                                           ();
                    // Set the icon
                    android.widget.ImageView iconView = (android.widget.ImageView)convertView.findViewById
                                                            ([email protected]);
                    android.content.pm.ResolveInfo activity = (android.content.pm.ResolveInfo) this.getItem
                                                                  (position);
                    iconView.setImageDrawable(activity.loadIcon(packageManager));
                    // Set the title.
                    android.widget.TextView titleView_1 = (android.widget.TextView)convertView.findViewById
                                                              ([email protected]);
                    titleView_1.setText(activity.loadLabel(packageManager));
                    // Highlight the default.
                    if (this.mShowDefaultActivity && position == 0 && this.mHighlightDefaultActivity)
                    {
                        convertView.setActivated(true);
                    }
                    else
                    {
                        convertView.setActivated(false);
                    }
                    return(convertView);
                }

                default:
                {
                    throw new System.ArgumentException();
                }
                }
            }
Пример #6
0
 public ChildViewCache(android.view.View v)
 {
     mText1      = (android.widget.TextView)v.findViewById([email protected]);
     mText2      = (android.widget.TextView)v.findViewById([email protected]);
     mIcon1      = (android.widget.ImageView)v.findViewById([email protected]);
     mIcon2      = (android.widget.ImageView)v.findViewById([email protected]);
     mIconRefine = (android.widget.ImageView)v.findViewById([email protected]_query
                                                            );
 }
        public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Set view, remember ImageView for icon and setup onclick listener.
            View v = inflater.inflate(R.layout.device_picker, container, false);

            mIcon = (ImageView)v.findViewById(R.id.devicePickerIcon);
            mIcon.OnClickListener = this;
            return(v);
        }
Пример #8
0
 /// <summary>
 /// Called by bindView() to set the image for an ImageView but only if
 /// there is no existing ViewBinder or if the existing ViewBinder cannot
 /// handle binding to an ImageView.
 /// </summary>
 /// <remarks>
 /// Called by bindView() to set the image for an ImageView but only if
 /// there is no existing ViewBinder or if the existing ViewBinder cannot
 /// handle binding to an ImageView.
 /// By default, the value will be treated as an image resource. If the
 /// value cannot be used as an image resource, the value is used as an
 /// image Uri.
 /// This method is called instead of
 /// <see cref="setViewImage(ImageView, int)">setViewImage(ImageView, int)</see>
 /// if the supplied data is not an int or Integer.
 /// </remarks>
 /// <param name="v">ImageView to receive an image</param>
 /// <param name="value">the value retrieved from the data set</param>
 /// <seealso cref="setViewImage(ImageView, int)"></seealso>
 public virtual void setViewImage(android.widget.ImageView v, string value)
 {
     try
     {
         v.setImageResource(System.Convert.ToInt32(value));
     }
     catch (System.ArgumentException)
     {
         v.setImageURI(Sharpen.Util.ParseUri(value));
     }
 }
Пример #9
0
 public virtual void setViewImage(android.widget.ImageView arg0, java.lang.String arg1)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.widget.SimpleAdapter._setViewImage11916, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.widget.SimpleAdapter.staticClass, global::android.widget.SimpleAdapter._setViewImage11916, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1));
     }
 }
		protected internal override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_draw_bitmap;

			mImageView = (ImageView) findViewById(R.id.imageView1);
			mTextView = (TextView) findViewById(R.id.textView5);

			Button button = (Button) findViewById(R.id.button1);
			button.OnClickListener = this;
			button = (Button) findViewById(R.id.button2);
			button.OnClickListener = this;
		}
Пример #11
0
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_draw_bitmap;

            mImageView = (ImageView)findViewById(R.id.imageView1);
            mTextView  = (TextView)findViewById(R.id.textView5);

            Button button = (Button)findViewById(R.id.button1);

            button.OnClickListener = this;
            button = (Button)findViewById(R.id.button2);
            button.OnClickListener = this;
        }
		public override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_writingbuddy_edittext;

			EditText editInput = (EditText) findViewById(R.id.edit_input);
			mOutputImageView = (ImageView) findViewById(R.id.image_output);

			mWritingBuddy = new SlookWritingBuddy(editInput);

			Button enableButton = (Button) findViewById(R.id.btn_enable);
			enableButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);

			Button modeButton = (Button) findViewById(R.id.btn_enable_image);
			modeButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);

		}
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_writingbuddy_edittext;

            EditText editInput = (EditText)findViewById(R.id.edit_input);

            mOutputImageView = (ImageView)findViewById(R.id.image_output);

            mWritingBuddy = new SlookWritingBuddy(editInput);

            Button enableButton = (Button)findViewById(R.id.btn_enable);

            enableButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);

            Button modeButton = (Button)findViewById(R.id.btn_enable_image);

            modeButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);
        }
Пример #14
0
 /// <summary>Create a new instance.</summary>
 /// <remarks>Create a new instance.</remarks>
 /// <param name="context">The application environment.</param>
 /// <param name="attrs">A collection of attributes.</param>
 /// <param name="defStyle">The default style to apply to this view.</param>
 public ActivityChooserView(android.content.Context context, android.util.AttributeSet
                            attrs, int defStyle) : base(context, attrs, defStyle)
 {
     mModelDataSetOberver    = new _DataSetObserver_118(this);
     mOnGlobalLayoutListener = new _OnGlobalLayoutListener_132(this);
     android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs
                                                                                     , [email protected], defStyle, 0);
     mInitialActivityCount = attributesArray.getInt([email protected]_initialActivityCount
                                                    , android.widget.ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT
                                                    );
     android.graphics.drawable.Drawable expandActivityOverflowButtonDrawable = attributesArray
                                                                               .getDrawable([email protected]_expandActivityOverflowButtonDrawable
                                                                                            );
     attributesArray.recycle();
     android.view.LayoutInflater inflater = android.view.LayoutInflater.from(mContext);
     inflater.inflate([email protected]_chooser_view, this, true);
     mCallbacks = new android.widget.ActivityChooserView.Callbacks(this);
     mActivityChooserContent = (android.widget.LinearLayout)findViewById([email protected]
                                                                         .id.activity_chooser_view_content);
     mActivityChooserContentBackground = mActivityChooserContent.getBackground();
     mDefaultActivityButton            = (android.widget.FrameLayout)findViewById([email protected]
                                                                                  .id.default_activity_button);
     mDefaultActivityButton.setOnClickListener(mCallbacks);
     mDefaultActivityButton.setOnLongClickListener(mCallbacks);
     mDefaultActivityButtonImage = (android.widget.ImageView)mDefaultActivityButton.findViewById
                                       ([email protected]);
     mExpandActivityOverflowButton = (android.widget.FrameLayout)findViewById([email protected]
                                                                              .id.expand_activities_button);
     mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
     mExpandActivityOverflowButtonImage = (android.widget.ImageView)mExpandActivityOverflowButton
                                          .findViewById([email protected]);
     mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable
                                                         );
     mAdapter = new android.widget.ActivityChooserView.ActivityChooserViewAdapter(this
                                                                                  );
     mAdapter.registerDataSetObserver(new _DataSetObserver_239(this));
     android.content.res.Resources resources = context.getResources();
     mListPopupMaxWidth = System.Math.Max(resources.getDisplayMetrics().widthPixels /
                                          2, resources.getDimensionPixelSize([email protected]_prefDialogWidth
                                                                             ));
 }
		public override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_print_bitmap;

			mImageView = (ImageView) findViewById(R.id.imageView1);
			mTextView = (TextView) findViewById(R.id.textView4);
			mWidthEdit = (EditText) findViewById(R.id.editText2);
			mWidthRadioGroup = (RadioGroup) findViewById(R.id.radioGroup2);
			mWidthRadioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this);

			Button button = (Button) findViewById(R.id.button1);
			button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);

			button = (Button) findViewById(R.id.button2);
			button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);

			IntentFilter filter = new IntentFilter();
			filter.addAction(MainActivity.ACTION_COMPLETE_PROCESS_BITMAP);
			registerReceiver(mReceiver, filter);
		}
Пример #16
0
 /// <summary>
 /// Sets the drawable in an image view, makes sure the view is only visible if there
 /// is a drawable.
 /// </summary>
 /// <remarks>
 /// Sets the drawable in an image view, makes sure the view is only visible if there
 /// is a drawable.
 /// </remarks>
 private void setViewDrawable(android.widget.ImageView v, android.graphics.drawable.Drawable
                              drawable, int nullVisibility)
 {
     // Set the icon even if the drawable is null, since we need to clear any
     // previous icon.
     v.setImageDrawable(drawable);
     if (drawable == null)
     {
         v.setVisibility(nullVisibility);
     }
     else
     {
         v.setVisibility(android.view.View.VISIBLE);
         // This is a hack to get any animated drawables (like a 'working' spinner)
         // to animate. You have to setVisible true on an AnimationDrawable to get
         // it to start animating, but it must first have been false or else the
         // call to setVisible will be ineffective. We need to clear up the story
         // about animated drawables in the future, see http://b/1878430.
         drawable.setVisible(false, false);
         drawable.setVisible(true, false);
     }
 }
Пример #17
0
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_advanced_camera_capturer;

            localMedia        = LocalMedia.create(this);
            videoView         = (VideoView)findViewById(R.id.video_view);
            toggleFlashButton = (Button)findViewById(R.id.toggle_flash_button);
            takePictureButton = (Button)findViewById(R.id.take_picture_button);
            pictureImageView  = (ImageView)LayoutInflater.inflate(R.layout.picture_image_view, null);
            pictureDialog     = (new AlertDialog.Builder(this)).setView(pictureImageView).setTitle(null).setPositiveButton([email protected], new OnClickListenerAnonymousInnerClassHelper(this))
                                .create();

            if (!checkPermissionForCamera())
            {
                requestPermissionForCamera();
            }
            else
            {
                addCameraVideo();
            }
        }
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_custom_renderer;

            localMedia             = LocalMedia.create(this);
            localVideoView         = (VideoView)findViewById(R.id.local_video);
            snapshotImageView      = (ImageView)findViewById(R.id.image_view);
            tapForSnapshotTextView = (TextView)findViewById(R.id.tap_video_snapshot);

            /*
             * Check camera permissions. Needed in Android M.
             */
            if (!checkPermissionForCamera())
            {
                requestPermissionForCamera();
            }
            else
            {
                addVideo();
            }
        }
		public override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_custom_renderer;

			localMedia = LocalMedia.create(this);
			localVideoView = (VideoView) findViewById(R.id.local_video);
			snapshotImageView = (ImageView) findViewById(R.id.image_view);
			tapForSnapshotTextView = (TextView) findViewById(R.id.tap_video_snapshot);

			/*
			 * Check camera permissions. Needed in Android M.
			 */
			if (!checkPermissionForCamera())
			{
				requestPermissionForCamera();
			}
			else
			{
				addVideo();
			}
		}
Пример #20
0
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_print_bitmap;

            mImageView       = (ImageView)findViewById(R.id.imageView1);
            mTextView        = (TextView)findViewById(R.id.textView4);
            mWidthEdit       = (EditText)findViewById(R.id.editText2);
            mWidthRadioGroup = (RadioGroup)findViewById(R.id.radioGroup2);
            mWidthRadioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this);

            Button button = (Button)findViewById(R.id.button1);

            button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);

            button = (Button)findViewById(R.id.button2);
            button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);

            IntentFilter filter = new IntentFilter();

            filter.addAction(MainActivity.ACTION_COMPLETE_PROCESS_BITMAP);
            registerReceiver(mReceiver, filter);
        }
Пример #21
0
 public virtual android.view.View getPermissionsView()
 {
     mInflater = (android.view.LayoutInflater)mContext.getSystemService(android.content.Context
                                                                        .LAYOUT_INFLATER_SERVICE);
     mPermsView = (android.widget.LinearLayout)mInflater.inflate([email protected]
                                                                 .app_perms_summary, null);
     mShowMore     = mPermsView.findViewById([email protected]_more);
     mShowMoreIcon = (android.widget.ImageView)mShowMore.findViewById([email protected]
                                                                      .id.show_more_icon);
     mShowMoreText = (android.widget.TextView)mShowMore.findViewById([email protected]
                                                                     .id.show_more_text);
     mDangerousList = (android.widget.LinearLayout)mPermsView.findViewById([email protected]
                                                                           .id.dangerous_perms_list);
     mNonDangerousList = (android.widget.LinearLayout)mPermsView.findViewById([email protected]
                                                                              .id.non_dangerous_perms_list);
     mNoPermsView = mPermsView.findViewById([email protected]_permissions);
     // Set up the LinearLayout that acts like a list item.
     mShowMore.setClickable(true);
     mShowMore.setOnClickListener(this);
     mShowMore.setFocusable(true);
     // Pick up from framework resources instead.
     mDefaultGrpLabel = mContext.getString([email protected][email protected]_permission_group
                                           );
     mPermFormat = mContext.getString([email protected][email protected]_format);
     mNormalIcon = mContext.getResources().getDrawable([email protected]_text_dot
                                                       );
     mDangerousIcon = mContext.getResources().getDrawable([email protected]
                                                          .ic_bullet_key_permission);
     mShowMaxIcon = mContext.getResources().getDrawable([email protected]_close_holo_dark
                                                        );
     mShowMinIcon = mContext.getResources().getDrawable([email protected]_open_holo_dark
                                                        );
     // Set permissions view
     setPermissions(mPermsList);
     return(mPermsView);
 }
Пример #22
0
		public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{

			// Set view, remember ImageView for icon and setup onclick listener.
			View v = inflater.inflate(R.layout.device_picker, container, false);
			mIcon = (ImageView) v.findViewById(R.id.devicePickerIcon);
			mIcon.OnClickListener = this;
			return v;
		}
Пример #23
0
 /// <summary>
 /// Called by bindView() to set the image for an ImageView but only if
 /// there is no existing ViewBinder or if the existing ViewBinder cannot
 /// handle binding to an ImageView.
 /// </summary>
 /// <remarks>
 /// Called by bindView() to set the image for an ImageView but only if
 /// there is no existing ViewBinder or if the existing ViewBinder cannot
 /// handle binding to an ImageView.
 /// This method is called instead of
 /// <see cref="setViewImage(ImageView, string)">setViewImage(ImageView, string)</see>
 /// if the supplied data is an int or Integer.
 /// </remarks>
 /// <param name="v">ImageView to receive an image</param>
 /// <param name="value">the value retrieved from the data set</param>
 /// <seealso cref="setViewImage(ImageView, string)">setViewImage(ImageView, string)</seealso>
 public virtual void setViewImage(android.widget.ImageView v, int value)
 {
     v.setImageResource(value);
 }
Пример #24
0
 public IconLoader(ImageView imageView)
 {
     mImageView  = imageView;
     mIconsCache = IconCache.Instance;
 }
		public override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_advanced_camera_capturer;

			localMedia = LocalMedia.create(this);
			videoView = (VideoView) findViewById(R.id.video_view);
			toggleFlashButton = (Button) findViewById(R.id.toggle_flash_button);
			takePictureButton = (Button) findViewById(R.id.take_picture_button);
			pictureImageView = (ImageView) LayoutInflater.inflate(R.layout.picture_image_view, null);
			pictureDialog = (new AlertDialog.Builder(this)).setView(pictureImageView).setTitle(null).setPositiveButton([email protected], new OnClickListenerAnonymousInnerClassHelper(this))
				   .create();

			if (!checkPermissionForCamera())
			{
				requestPermissionForCamera();
			}
			else
			{
				addCameraVideo();
			}
		}
		public SnapshotVideoRenderer(ImageView imageView)
		{
			this.imageView = imageView;
		}
 public virtual void update()
 {
     android.app.ActionBar.Tab tab    = this.mTab;
     android.view.View         custom = tab.getCustomView();
     if (custom != null)
     {
         this.addView(custom);
         this.mCustomView = custom;
         if (this.mTextView != null)
         {
             this.mTextView.setVisibility(android.view.View.GONE);
         }
         if (this.mIconView != null)
         {
             this.mIconView.setVisibility(android.view.View.GONE);
             this.mIconView.setImageDrawable(null);
         }
     }
     else
     {
         if (this.mCustomView != null)
         {
             this.removeView(this.mCustomView);
             this.mCustomView = null;
         }
         android.graphics.drawable.Drawable icon = tab.getIcon();
         java.lang.CharSequence             text = tab.getText();
         if (icon != null)
         {
             if (this.mIconView == null)
             {
                 android.widget.ImageView iconView = new android.widget.ImageView(this.getContext(
                                                                                      ));
                 android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
                                                                   (android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams
                                                                   .WRAP_CONTENT);
                 lp.gravity = android.view.Gravity.CENTER_VERTICAL;
                 iconView.setLayoutParams(lp);
                 this.addView(iconView, 0);
                 this.mIconView = iconView;
             }
             this.mIconView.setImageDrawable(icon);
             this.mIconView.setVisibility(android.view.View.VISIBLE);
         }
         else
         {
             if (this.mIconView != null)
             {
                 this.mIconView.setVisibility(android.view.View.GONE);
                 this.mIconView.setImageDrawable(null);
             }
         }
         if (text != null)
         {
             if (this.mTextView == null)
             {
                 android.widget.TextView textView = new android.widget.TextView(this.getContext(),
                                                                                null, [email protected]);
                 textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
                 android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
                                                                   (android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams
                                                                   .WRAP_CONTENT);
                 lp.gravity = android.view.Gravity.CENTER_VERTICAL;
                 textView.setLayoutParams(lp);
                 this.addView(textView);
                 this.mTextView = textView;
             }
             this.mTextView.setText(text);
             this.mTextView.setVisibility(android.view.View.VISIBLE);
         }
         else
         {
             if (this.mTextView != null)
             {
                 this.mTextView.setVisibility(android.view.View.GONE);
                 this.mTextView.setText(null);
             }
         }
         if (this.mIconView != null)
         {
             this.mIconView.setContentDescription(tab.getContentDescription());
         }
     }
 }
Пример #28
0
 public virtual void setImageResource(int resid)
 {
     android.widget.ImageView image = (android.widget.ImageView) this.getNextView();
     image.setImageResource(resid);
     showNext();
 }
Пример #29
0
 public SnapshotVideoRenderer(ImageView imageView)
 {
     this.imageView = imageView;
 }
Пример #30
0
		public SearchView(android.content.Context context, android.util.AttributeSet attrs
			) : base(context, attrs)
		{
			mShowImeRunnable = new _Runnable_137(this);
			mUpdateDrawableStateRunnable = new _Runnable_148(this);
			mOnClickListener = new _OnClickListener_787(this);
			mTextKeyListener = new _OnKeyListener_836(this);
			mOnEditorActionListener = new _OnEditorActionListener_1059(this);
			mOnItemClickListener = new _OnItemClickListener_1233(this);
			mOnItemSelectedListener = new _OnItemSelectedListener_1244(this);
			mTextWatcher = new _TextWatcher_1530(this);
			android.view.LayoutInflater inflater = (android.view.LayoutInflater)context.getSystemService
				(android.content.Context.LAYOUT_INFLATER_SERVICE);
			inflater.inflate([email protected]_view, this, true);
			mSearchButton = findViewById([email protected]_button);
			mQueryTextView = (android.widget.SearchView.SearchAutoComplete)findViewById([email protected]
				.id.search_src_text);
			mQueryTextView.setSearchView(this);
			mSearchEditFrame = findViewById([email protected]_edit_frame);
			mSearchPlate = findViewById([email protected]_plate);
			mSubmitArea = findViewById([email protected]_area);
			mSubmitButton = findViewById([email protected]_go_btn);
			mCloseButton = (android.widget.ImageView)findViewById([email protected]_close_btn
				);
			mVoiceButton = findViewById([email protected]_voice_btn);
			mSearchHintIcon = (android.widget.ImageView)findViewById([email protected]_mag_icon
				);
			mSearchButton.setOnClickListener(mOnClickListener);
			mCloseButton.setOnClickListener(mOnClickListener);
			mSubmitButton.setOnClickListener(mOnClickListener);
			mVoiceButton.setOnClickListener(mOnClickListener);
			mQueryTextView.setOnClickListener(mOnClickListener);
			mQueryTextView.addTextChangedListener(mTextWatcher);
			mQueryTextView.setOnEditorActionListener(mOnEditorActionListener);
			mQueryTextView.setOnItemClickListener(mOnItemClickListener);
			mQueryTextView.setOnItemSelectedListener(mOnItemSelectedListener);
			mQueryTextView.setOnKeyListener(mTextKeyListener);
			mQueryTextView.setOnFocusChangeListener(new _OnFocusChangeListener_265(this));
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.SearchView, 0, 0);
			setIconifiedByDefault(a.getBoolean([email protected]_iconifiedByDefault
				, true));
			int maxWidth = a.getDimensionPixelSize([email protected]_maxWidth
				, -1);
			if (maxWidth != -1)
			{
				setMaxWidth(maxWidth);
			}
			java.lang.CharSequence queryHint = a.getText([email protected]_queryHint
				);
			if (!android.text.TextUtils.isEmpty(queryHint))
			{
				setQueryHint(queryHint);
			}
			int imeOptions = a.getInt([email protected]_imeOptions, -1
				);
			if (imeOptions != -1)
			{
				setImeOptions(imeOptions);
			}
			int inputType = a.getInt([email protected]_inputType, -1);
			if (inputType != -1)
			{
				setInputType(inputType);
			}
			a.recycle();
			bool focusable = true;
			a = context.obtainStyledAttributes(attrs, [email protected], 0, 
				0);
			focusable = a.getBoolean([email protected]_focusable, focusable);
			a.recycle();
			setFocusable(focusable);
			mVoiceWebSearchIntent = new android.content.Intent(android.speech.RecognizerIntent
				.ACTION_WEB_SEARCH);
			mVoiceWebSearchIntent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
			mVoiceWebSearchIntent.putExtra(android.speech.RecognizerIntent.EXTRA_LANGUAGE_MODEL
				, android.speech.RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
			mVoiceAppSearchIntent = new android.content.Intent(android.speech.RecognizerIntent
				.ACTION_RECOGNIZE_SPEECH);
			mVoiceAppSearchIntent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
			mDropDownAnchor = findViewById(mQueryTextView.getDropDownAnchor());
			if (mDropDownAnchor != null)
			{
				mDropDownAnchor.addOnLayoutChangeListener(new _OnLayoutChangeListener_313(this));
			}
			updateViewsVisibility(mIconifiedByDefault);
			updateQueryHint();
		}
Пример #31
0
		private void initStackView()
		{
			configureViewAnimator(NUM_ACTIVE_VIEWS, 1);
			setStaticTransformationsEnabled(true);
			android.view.ViewConfiguration configuration = android.view.ViewConfiguration.get
				(getContext());
			mTouchSlop = configuration.getScaledTouchSlop();
			mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
			mActivePointerId = INVALID_POINTER;
			mHighlight = new android.widget.ImageView(getContext());
			mHighlight.setLayoutParams(new android.widget.StackView.LayoutParams(this, mHighlight
				));
			addViewInLayout(mHighlight, -1, new android.widget.StackView.LayoutParams(this, mHighlight
				));
			mClickFeedback = new android.widget.ImageView(getContext());
			mClickFeedback.setLayoutParams(new android.widget.StackView.LayoutParams(this, mClickFeedback
				));
			addViewInLayout(mClickFeedback, -1, new android.widget.StackView.LayoutParams(this
				, mClickFeedback));
			mClickFeedback.setVisibility(INVISIBLE);
			mStackSlider = new android.widget.StackView.StackSlider(this);
			if (sHolographicHelper == null)
			{
				sHolographicHelper = new android.widget.StackView.HolographicHelper(mContext);
			}
			setClipChildren(false);
			setClipToPadding(false);
			// This sets the form of the StackView, which is currently to have the perspective-shifted
			// views above the active view, and have items slide down when sliding out. The opposite is
			// available by using ITEMS_SLIDE_UP.
			mStackMode = ITEMS_SLIDE_DOWN;
			// This is a flag to indicate the the stack is loading for the first time
			mWhichChild = -1;
			// Adjust the frame padding based on the density, since the highlight changes based
			// on the density
			float density = mContext.getResources().getDisplayMetrics().density;
			mFramePadding = (int)System.Math.Ceiling(density * FRAME_PADDING);
		}
Пример #32
0
 public virtual void setImageURI(System.Uri uri)
 {
     android.widget.ImageView image = (android.widget.ImageView) this.getNextView();
     image.setImageURI(uri);
     showNext();
 }
Пример #33
0
			public virtual void update()
			{
				android.app.ActionBar.Tab tab = this.mTab;
				android.view.View custom = tab.getCustomView();
				if (custom != null)
				{
					this.addView(custom);
					this.mCustomView = custom;
					if (this.mTextView != null)
					{
						this.mTextView.setVisibility(android.view.View.GONE);
					}
					if (this.mIconView != null)
					{
						this.mIconView.setVisibility(android.view.View.GONE);
						this.mIconView.setImageDrawable(null);
					}
				}
				else
				{
					if (this.mCustomView != null)
					{
						this.removeView(this.mCustomView);
						this.mCustomView = null;
					}
					android.graphics.drawable.Drawable icon = tab.getIcon();
					java.lang.CharSequence text = tab.getText();
					if (icon != null)
					{
						if (this.mIconView == null)
						{
							android.widget.ImageView iconView = new android.widget.ImageView(this.getContext(
								));
							android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
								(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams
								.WRAP_CONTENT);
							lp.gravity = android.view.Gravity.CENTER_VERTICAL;
							iconView.setLayoutParams(lp);
							this.addView(iconView, 0);
							this.mIconView = iconView;
						}
						this.mIconView.setImageDrawable(icon);
						this.mIconView.setVisibility(android.view.View.VISIBLE);
					}
					else
					{
						if (this.mIconView != null)
						{
							this.mIconView.setVisibility(android.view.View.GONE);
							this.mIconView.setImageDrawable(null);
						}
					}
					if (text != null)
					{
						if (this.mTextView == null)
						{
							android.widget.TextView textView = new android.widget.TextView(this.getContext(), 
								null, [email protected]);
							textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
							android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
								(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams
								.WRAP_CONTENT);
							lp.gravity = android.view.Gravity.CENTER_VERTICAL;
							textView.setLayoutParams(lp);
							this.addView(textView);
							this.mTextView = textView;
						}
						this.mTextView.setText(text);
						this.mTextView.setVisibility(android.view.View.VISIBLE);
					}
					else
					{
						if (this.mTextView != null)
						{
							this.mTextView.setVisibility(android.view.View.GONE);
							this.mTextView.setText(null);
						}
					}
					if (this.mIconView != null)
					{
						this.mIconView.setContentDescription(tab.getContentDescription());
					}
				}
			}
Пример #34
0
		/// <summary>Create a new instance.</summary>
		/// <remarks>Create a new instance.</remarks>
		/// <param name="context">The application environment.</param>
		/// <param name="attrs">A collection of attributes.</param>
		/// <param name="defStyle">The default style to apply to this view.</param>
		public ActivityChooserView(android.content.Context context, android.util.AttributeSet
			 attrs, int defStyle) : base(context, attrs, defStyle)
		{
			mModelDataSetOberver = new _DataSetObserver_118(this);
			mOnGlobalLayoutListener = new _OnGlobalLayoutListener_132(this);
			android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs
				, [email protected], defStyle, 0);
			mInitialActivityCount = attributesArray.getInt([email protected]_initialActivityCount
				, android.widget.ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT
				);
			android.graphics.drawable.Drawable expandActivityOverflowButtonDrawable = attributesArray
				.getDrawable([email protected]_expandActivityOverflowButtonDrawable
				);
			attributesArray.recycle();
			android.view.LayoutInflater inflater = android.view.LayoutInflater.from(mContext);
			inflater.inflate([email protected]_chooser_view, this, true);
			mCallbacks = new android.widget.ActivityChooserView.Callbacks(this);
			mActivityChooserContent = (android.widget.LinearLayout)findViewById([email protected]
				.id.activity_chooser_view_content);
			mActivityChooserContentBackground = mActivityChooserContent.getBackground();
			mDefaultActivityButton = (android.widget.FrameLayout)findViewById([email protected]
				.id.default_activity_button);
			mDefaultActivityButton.setOnClickListener(mCallbacks);
			mDefaultActivityButton.setOnLongClickListener(mCallbacks);
			mDefaultActivityButtonImage = (android.widget.ImageView)mDefaultActivityButton.findViewById
				([email protected]);
			mExpandActivityOverflowButton = (android.widget.FrameLayout)findViewById([email protected]
				.id.expand_activities_button);
			mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
			mExpandActivityOverflowButtonImage = (android.widget.ImageView)mExpandActivityOverflowButton
				.findViewById([email protected]);
			mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable
				);
			mAdapter = new android.widget.ActivityChooserView.ActivityChooserViewAdapter(this
				);
			mAdapter.registerDataSetObserver(new _DataSetObserver_239(this));
			android.content.res.Resources resources = context.getResources();
			mListPopupMaxWidth = System.Math.Max(resources.getDisplayMetrics().widthPixels / 
				2, resources.getDimensionPixelSize([email protected]_prefDialogWidth
				));
		}
Пример #35
0
 public virtual void setImageDrawable(android.graphics.drawable.Drawable drawable)
 {
     android.widget.ImageView image = (android.widget.ImageView) this.getNextView();
     image.setImageDrawable(drawable);
     showNext();
 }
Пример #36
0
			public ChildViewCache(android.view.View v)
			{
				mText1 = (android.widget.TextView)v.findViewById([email protected]);
				mText2 = (android.widget.TextView)v.findViewById([email protected]);
				mIcon1 = (android.widget.ImageView)v.findViewById([email protected]);
				mIcon2 = (android.widget.ImageView)v.findViewById([email protected]);
				mIconRefine = (android.widget.ImageView)v.findViewById([email protected]_query
					);
			}
Пример #37
0
		private void insertIconView()
		{
			android.view.LayoutInflater inflater = getInflater();
			mIconView = (android.widget.ImageView)inflater.inflate([email protected]
				.list_menu_item_icon, this, false);
			addView(mIconView, 0);
		}