private ExtraStringView CreateExtraSection(string key, string value, bool isProtected) { LinearLayout layout = new LinearLayout(this, null) { Orientation = Orientation.Vertical }; LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); layout.LayoutParameters = layoutParams; View viewInflated = LayoutInflater.Inflate(Resource.Layout.entry_extrastring_title, null); TextView keyView = viewInflated.FindViewById <TextView>(Resource.Id.entry_title); if (key != null) { keyView.Text = key; } layout.AddView(viewInflated); RelativeLayout valueViewContainer = (RelativeLayout)LayoutInflater.Inflate(Resource.Layout.entry_extrastring_value, null); var valueView = valueViewContainer.FindViewById <TextView>(Resource.Id.entry_extra); var valueViewVisible = valueViewContainer.FindViewById <TextView>(Resource.Id.entry_extra_visible); if (value != null) { valueView.Text = value; valueViewVisible.Text = value; } SetPasswordTypeface(valueViewVisible); if (isProtected) { RegisterProtectedTextView(valueView, valueViewVisible); } else { valueView.Visibility = ViewStates.Gone; } layout.AddView(valueViewContainer); var stringView = new ExtraStringView(layout, valueView, valueViewVisible, keyView); _stringViews.Add(key, stringView); RegisterTextPopup(valueViewContainer, valueViewContainer.FindViewById(Resource.Id.extra_vdots), key, isProtected); return(stringView); }
private ExtraStringView CreateExtraSection(string key, string value, bool isProtected) { LinearLayout layout = new LinearLayout(this, null) {Orientation = Orientation.Vertical}; LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); layout.LayoutParameters = layoutParams; View viewInflated = LayoutInflater.Inflate(Resource.Layout.entry_extrastring_title, null); TextView keyView = viewInflated.FindViewById<TextView>(Resource.Id.entry_title); if (key != null) keyView.Text = key; layout.AddView(viewInflated); RelativeLayout valueViewContainer = (RelativeLayout) LayoutInflater.Inflate(Resource.Layout.entry_extrastring_value, null); var valueView = valueViewContainer.FindViewById<TextView>(Resource.Id.entry_extra); if (value != null) valueView.Text = value; SetPasswordTypeface(valueView); if (isProtected) { RegisterProtectedTextView(valueView); valueView.TransformationMethod = PasswordTransformationMethod.Instance; } layout.AddView(valueViewContainer); var stringView = new ExtraStringView(layout, valueView, keyView); _stringViews.Add(key, stringView); RegisterTextPopup(valueViewContainer, valueViewContainer.FindViewById(Resource.Id.extra_vdots), key, isProtected); return stringView; }