Example #1
0
 private void setupContent(android.widget.LinearLayout contentPanel)
 {
     mScrollView = (android.widget.ScrollView)mWindow.findViewById([email protected]
                                                                   .id.scrollView);
     mScrollView.setFocusable(false);
     // Special case for users that only want to display a String
     mMessageView = (android.widget.TextView)mWindow.findViewById([email protected].
                                                                  id.message);
     if (mMessageView == null)
     {
         return;
     }
     if (mMessage != null)
     {
         mMessageView.setText(mMessage);
     }
     else
     {
         mMessageView.setVisibility(android.view.View.GONE);
         mScrollView.removeView(mMessageView);
         if (mListView != null)
         {
             contentPanel.removeView(mWindow.findViewById([email protected]));
             contentPanel.addView(mListView, new android.widget.LinearLayout.LayoutParams(android.view.ViewGroup
                                                                                          .LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT));
             contentPanel.setLayoutParams(new android.widget.LinearLayout.LayoutParams(android.view.ViewGroup
                                                                                       .LayoutParams.MATCH_PARENT, 0, 1.0f));
         }
         else
         {
             contentPanel.setVisibility(android.view.View.GONE);
         }
     }
 }
Example #2
0
        private void initTitle()
        {
            if (mTitleLayout == null)
            {
                android.view.LayoutInflater inflater = android.view.LayoutInflater.from(getContext
                                                                                            ());
                inflater.inflate([email protected]_bar_title_item, this);
                mTitleLayout = (android.widget.LinearLayout)getChildAt(getChildCount() - 1);
                mTitleView   = (android.widget.TextView)mTitleLayout.findViewById([email protected]
                                                                                  .id.action_bar_title);
                mSubtitleView = (android.widget.TextView)mTitleLayout.findViewById([email protected]
                                                                                   .id.action_bar_subtitle);
                if (mTitleStyleRes != 0)
                {
                    mTitleView.setTextAppearance(mContext, mTitleStyleRes);
                }
                if (mSubtitleStyleRes != 0)
                {
                    mSubtitleView.setTextAppearance(mContext, mSubtitleStyleRes);
                }
            }
            mTitleView.setText(mTitle);
            mSubtitleView.setText(mSubtitle);
            bool hasTitle    = !android.text.TextUtils.isEmpty(mTitle);
            bool hasSubtitle = !android.text.TextUtils.isEmpty(mSubtitle);

            mSubtitleView.setVisibility(hasSubtitle ? VISIBLE : GONE);
            mTitleLayout.setVisibility(hasTitle || hasSubtitle ? VISIBLE : GONE);
            if (mTitleLayout.getParent() == null)
            {
                addView(mTitleLayout);
            }
        }
Example #3
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);
        }
        private void showPermissions()
        {
            switch (mCurrentState)
            {
            case android.widget.AppSecurityPermissions.State.NO_PERMS:
            {
                displayNoPermissions();
                break;
            }

            case android.widget.AppSecurityPermissions.State.DANGEROUS_ONLY:
            {
                displayPermissions(true);
                break;
            }

            case android.widget.AppSecurityPermissions.State.NORMAL_ONLY:
            {
                displayPermissions(false);
                break;
            }

            case android.widget.AppSecurityPermissions.State.BOTH:
            {
                displayPermissions(true);
                if (mExpanded)
                {
                    displayPermissions(false);
                    mShowMoreIcon.setImageDrawable(mShowMaxIcon);
                    mShowMoreText.setText([email protected][email protected]_hide);
                    mNonDangerousList.setVisibility(android.view.View.VISIBLE);
                }
                else
                {
                    mShowMoreIcon.setImageDrawable(mShowMinIcon);
                    mShowMoreText.setText([email protected][email protected]_show_all);
                    mNonDangerousList.setVisibility(android.view.View.GONE);
                }
                mShowMore.setVisibility(android.view.View.VISIBLE);
                break;
            }
            }
        }