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); } }
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); }