Sorry my terrible english.
Based on Warpzip answer
res/values/strings.xml ... ... <string name="str_more"><![CDATA[<p><b>This is the header</b><u>( see more ..)</u>]]></string> <string name="str_less"><![CDATA[<p><b>This is the header</b><u>(less ..)</u>]]></string> <string name="str_details"><![CDATA[<p>A long string of text that do not want to show all the time.A long string of text that do not want to show all the time.A long string of text that do not want to show all the time.A long string of text that do not want to show all the time.A long string of text that do not want to show all the time.</p>]]></string> ... ...
In our layout in our layout, we can enable scrollview with a vertical LinearLayout (or with a little RelativeLayout work). In them:
<TextView android:id="@+id/txtvw_header" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:text="@string/str_more" android:textAppearance="?android:attr/textAppearanceMedium" /> <TextView android:id="@+id/txtvw_detail" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/txtvw_tituloEntreTodos" android:text="@string/str_details" android:textAppearance="?android:attr/textAppearanceMedium" />
Finally, our activities
view = inflater.inflate(R.layout.f_entretodos, container, false); info = (TextView) view.findViewById(R.id.txtvw_header); fullinfo = (TextView) view.findViewById(R.id.txtvw_detail); info.setText(Html.fromHtml(getString(R.string.str_more))); fullinfo.setText(Html.fromHtml(getString(R.string.str_detail))); fullinfo.setVisibility(View.GONE); info.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) {
lpaskvan Oct 24 '14 at 19:29 2014-10-24 19:29
source share