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); }
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); tv.setText(this.mLabel); 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); }
private void setBackground(android.widget.LinearLayout topPanel, android.widget.LinearLayout contentPanel, android.view.View customPanel, bool hasButtons, android.content.res.TypedArray a, bool hasTitle, android.view.View buttonPanel) { int fullDark = a.getResourceId([email protected]_fullDark , [email protected]_full_dark); int topDark = a.getResourceId([email protected]_topDark, [email protected]_top_dark); int centerDark = a.getResourceId([email protected]_centerDark , [email protected]_center_dark); int bottomDark = a.getResourceId([email protected]_bottomDark , [email protected]_bottom_dark); int fullBright = a.getResourceId([email protected]_fullBright , [email protected]_full_bright); int topBright = a.getResourceId([email protected]_topBright , [email protected]_top_bright); int centerBright = a.getResourceId([email protected]_centerBright , [email protected]_center_bright); int bottomBright = a.getResourceId([email protected]_bottomBright , [email protected]_bottom_bright); int bottomMedium = a.getResourceId([email protected]_bottomMedium , [email protected]_bottom_medium); android.view.View[] views = new android.view.View[4]; bool[] light = new bool[4]; android.view.View lastView = null; bool lastLight = false; int pos = 0; if (hasTitle) { views[pos] = topPanel; light[pos] = false; pos++; } views[pos] = (contentPanel.getVisibility() == android.view.View.GONE) ? null : contentPanel; light[pos] = mListView != null; pos++; if (customPanel != null) { views[pos] = customPanel; light[pos] = mForceInverseBackground; pos++; } if (hasButtons) { views[pos] = buttonPanel; light[pos] = true; } bool setView_1 = false; for (pos = 0; pos < views.Length; pos++) { android.view.View v = views[pos]; if (v == null) { continue; } if (lastView != null) { if (!setView_1) { lastView.setBackgroundResource(lastLight ? topBright : topDark); } else { lastView.setBackgroundResource(lastLight ? centerBright : centerDark); } setView_1 = true; } lastView = v; lastLight = light[pos]; } if (lastView != null) { if (setView_1) { lastView.setBackgroundResource(lastLight ? (hasButtons ? bottomMedium : bottomBright ) : bottomDark); } else { lastView.setBackgroundResource(lastLight ? fullBright : fullDark); } } // if (hasButtons && (mListView != null)) { // } if ((mListView != null) && (mAdapter != null)) { mListView.setAdapter(mAdapter); if (mCheckedItem > -1) { mListView.setItemChecked(mCheckedItem, true); mListView.setSelection(mCheckedItem); } } }