<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TextView - Tutorial Android, aprende a programar en Android.</title>
	<atom:link href="http://www.tutorialandroid.com/tag/textview/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tutorialandroid.com</link>
	<description>Tutoriales detallados para programar, desde el principio, aplicaciones para el sistema Android</description>
	<lastBuildDate>Tue, 13 Dec 2011 19:48:59 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.9</generator>
	<item>
		<title>Como hacer que un texto parpadee (fadein y fadeout)</title>
		<link>http://www.tutorialandroid.com/basico/como-hacer-que-un-texto-parpadee-fadein-y-fadeout/</link>
					<comments>http://www.tutorialandroid.com/basico/como-hacer-que-un-texto-parpadee-fadein-y-fadeout/#comments</comments>
		
		<dc:creator><![CDATA[Gonzalo de Córdoba]]></dc:creator>
		<pubDate>Tue, 13 Dec 2011 19:48:49 +0000</pubDate>
				<category><![CDATA[Básico]]></category>
		<category><![CDATA[fadein]]></category>
		<category><![CDATA[fadeout]]></category>
		<category><![CDATA[parpadeo]]></category>
		<category><![CDATA[TextView]]></category>
		<guid isPermaLink="false">http://www.tutorialandroid.com/?p=593</guid>

					<description><![CDATA[<p>Objetivo: Hacer que un texto parpadee en nuestra aplicación Android. Para ello podremos crear una animación, que aplique fadein y fadeout al texto, con intensidad y velocidad deseada. Vamos a crear una Activity Principal que mostrará el texto, creando una &#8230; <a href="http://www.tutorialandroid.com/basico/como-hacer-que-un-texto-parpadee-fadein-y-fadeout/">Sigue leyendo <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="http://www.tutorialandroid.com/basico/como-hacer-que-un-texto-parpadee-fadein-y-fadeout/">Como hacer que un texto parpadee (fadein y fadeout)</a> first appeared on <a href="http://www.tutorialandroid.com">Tutorial Android, aprende a programar en Android.</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span style="text-decoration: underline;"><strong>Objetivo:</strong></span></p>
<div>
<p>Hacer que un<strong> texto parpadee</strong> en nuestra aplicación Android.</p>
<p>Para ello podremos crear una animación, que aplique fadein y fadeout al texto, con intensidad y velocidad deseada.</p>
<div>
<p>Vamos a crear una Activity <strong>Principal</strong> que mostrará el texto, creando una instancia de la clase <strong>TextoParpadeante</strong>. Esta última necesita de dos ficheros XML que , que definirán varios parámetros, tales como la duración .</p>
<p>Vemos unas capturas de pantalla (aunque lo suyo hubiera sido una animación):</p>
<p style="text-align: center;"><img decoding="async" loading="lazy" class="size-full wp-image-599 alignleft" title="TutorialAndroid - Texto parpadeando 1" src="http://www.tutorialandroid.com/wp-content/uploads/2011/12/TutorialAndroid-Texto-parpadeando-1.bmp" alt="TutorialAndroid - Texto parpadeando 1" width="243" height="370" /><a href="http://www.tutorialandroid.com/basico/como-utilizar-formato-html-en-textos/attachment/tutorialandroid-ejemplo-escribir-en-html/" rel="attachment wp-att-578"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-598" title="TutorialAndroid - Texto parpadeando 2" src="http://www.tutorialandroid.com/wp-content/uploads/2011/12/TutorialAndroid-Texto-parpadeando-2.bmp" alt="" width="244" height="372" /><br />
</a></p>
<p>Y a continuación mostramos el texto comentado:</p>
</div>
<p><span style="text-decoration: underline;"><strong>Código fuente Java (Main.java):</strong></span></p>
<p>[sourcecode language=&#8221;java&#8221;]<br />
package textoparpadeo.tutorialandroid.com;<br />
import android.app.Activity;<br />
import android.os.Bundle;<br />
import android.widget.TextView;</p>
<p>public class Main extends Activity {<br />
    /** Called when the activity is first created. */<br />
    @Override<br />
    public void onCreate(Bundle savedInstanceState) {<br />
        super.onCreate(savedInstanceState);<br />
        setContentView(R.layout.main);<br />
        TextView tv = (TextView) findViewById(R.id.vista_texto);<br />
        tv.setText(&quot;Este texto va a parpadear. \n by TutorialAndroid.com&quot;);<br />
	new TextoParpadeante(getBaseContext(),tv);<br />
    }<br />
}<br />
[/sourcecode]</p>
<p><span style="text-decoration: underline;"><strong>Código fuente Java (TextoParpadeante.java):</strong></span></p>
<p>[sourcecode language=&#8221;java&#8221;]<br />
package textoparpadeo.tutorialandroid.com;<br />
import android.content.Context;<br />
import android.view.animation.Animation;<br />
import android.view.animation.AnimationUtils;<br />
import android.view.animation.Animation.AnimationListener;<br />
import android.widget.TextView;</p>
<p>public class TextoParpadeante {<br />
    Context context;<br />
    private TextView texto = null;<br />
    private Animation fadeIn = null;<br />
    private Animation fadeOut = null;<br />
    // Listeners que detectan el fin de la animación<br />
    private LocalFadeInAnimationListener myFadeInAnimationListener = new LocalFadeInAnimationListener();<br />
    private LocalFadeOutAnimationListener myFadeOutAnimationListener = new LocalFadeOutAnimationListener();</p>
<p>    /**<br />
     * Constructor de la clase<br />
     * @param Context context<br />
     * @param TextView text<br />
     */<br />
	public TextoParpadeante(Context context, TextView text){<br />
		this.context = context;<br />
		this.texto = (TextView)text;<br />
	    runAnimations();<br />
	}</p>
<p>    private void launchOutAnimation() {<br />
	    texto.startAnimation(fadeOut);<br />
    }</p>
<p>    /**<br />
     * Performs the actual fade-in<br />
     */<br />
    private void launchInAnimation() {<br />
	    texto.startAnimation(fadeIn);<br />
    }</p>
<p>    /**<br />
     * Comienzo de la animación<br />
     */<br />
    private void runAnimations() {<br />
    	//uso de las animaciones<br />
	    fadeIn = AnimationUtils.loadAnimation(this.context, R.anim.fadein);<br />
	    fadeIn.setAnimationListener( myFadeInAnimationListener );<br />
	    fadeOut = AnimationUtils.loadAnimation(this.context, R.anim.fadeout);<br />
	    fadeOut.setAnimationListener( myFadeOutAnimationListener );<br />
	    // And start<br />
    	launchInAnimation();<br />
    }</p>
<p>    // Runnable que arranca la animación<br />
    private Runnable mLaunchFadeOutAnimation = new Runnable() {<br />
	    public void run() {<br />
	    	launchOutAnimation();<br />
	    }<br />
    };</p>
<p>    private Runnable mLaunchFadeInAnimation = new Runnable() {<br />
	    public void run() {<br />
	    	launchInAnimation();<br />
	    }<br />
    };</p>
<p>    /**<br />
     * Listener para la animacion del Fadeout<br />
     *<br />
     * @author moi<br />
     *<br />
     */<br />
    private class LocalFadeInAnimationListener implements AnimationListener {<br />
	    public void onAnimationEnd(Animation animation) {<br />
		    texto.post(mLaunchFadeOutAnimation);<br />
		}<br />
	    public void onAnimationRepeat(Animation animation){<br />
	    }<br />
	    public void onAnimationStart(Animation animation) {<br />
	    }<br />
    };</p>
<p>    /**<br />
     * Listener de animación para el Fadein<br />
     */<br />
    private class LocalFadeOutAnimationListener implements AnimationListener {<br />
	    public void onAnimationEnd(Animation animation) {<br />
		    texto.post(mLaunchFadeInAnimation);<br />
		}<br />
	    public void onAnimationRepeat(Animation animation) {<br />
	    }<br />
	    public void onAnimationStart(Animation animation) {<br />
	    }<br />
    };<br />
}</p>
<p>[/sourcecode]</p>
<p>Construimos el fichero XML para la vista principal de la aplicación:<br />
<span style="text-decoration: underline;"><strong>Código fuente XML (Main.xml):</strong></span></p>
<p>[sourcecode language=&#8221;xml&#8221;]<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />
&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br />
    android:orientation=&quot;vertical&quot;<br />
    android:layout_width=&quot;fill_parent&quot;<br />
    android:layout_height=&quot;fill_parent&quot;<br />
    &gt;<br />
&lt;TextView<br />
	android:id=&quot;@+id/vista_texto&quot;<br />
    android:layout_width=&quot;fill_parent&quot;<br />
    android:layout_height=&quot;wrap_content&quot;<br />
    android:text=&quot;@string/hello&quot;<br />
    /&gt;<br />
&lt;/LinearLayout&gt;<br />
[/sourcecode]</p>
<p>Y a continuación se implentan los fichero que deben ir en el directorio /res/anim/ de nuestro proyecto:<br />
<span style="text-decoration: underline;"><strong>Código fuente XML (res/anim/fadein.xml):</strong></span></p>
<p>[sourcecode language=&#8221;xml&#8221;]<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />
&lt;alpha<br />
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br />
    android:fromAlpha=&quot;0.1&quot;<br />
    android:toAlpha=&quot;1.0&quot;<br />
    android:duration=&quot;1000&quot;<br />
/&gt;<br />
[/sourcecode]</p>
<p><span style="text-decoration: underline;"><strong>Código fuente XML (<strong>res/anim/</strong>fadeout.xml):</strong></span></p>
<p>[sourcecode language=&#8221;xml&#8221;]<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />
&lt;alpha<br />
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br />
    android:fromAlpha=&quot;1.0&quot;<br />
    android:toAlpha=&quot;0.1&quot;<br />
    android:duration=&quot;1000&quot;<br />
/&gt;<br />
[/sourcecode]</p>
<p><strong>Descárgate el código <a title="http://www.tutorialandroid.com/wp-content/codigosDescargables/TutorialAndroid-Como_programar_usando_HTML_para_texto.zip" href="http://www.tutorialandroid.com/wp-content/codigosDescargables/TutorialAndroid_Como_hacer_texto_parpadeante.zip">aquí</a></strong></p>
</div><p>The post <a href="http://www.tutorialandroid.com/basico/como-hacer-que-un-texto-parpadee-fadein-y-fadeout/">Como hacer que un texto parpadee (fadein y fadeout)</a> first appeared on <a href="http://www.tutorialandroid.com">Tutorial Android, aprende a programar en Android.</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>http://www.tutorialandroid.com/basico/como-hacer-que-un-texto-parpadee-fadein-y-fadeout/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Como dar estilo: color, sombras, tamaño a un texto Textview</title>
		<link>http://www.tutorialandroid.com/basico/como-dar-estilo-color-sombras-tamano-a-un-texto/</link>
					<comments>http://www.tutorialandroid.com/basico/como-dar-estilo-color-sombras-tamano-a-un-texto/#comments</comments>
		
		<dc:creator><![CDATA[Gonzalo de Córdoba]]></dc:creator>
		<pubDate>Wed, 19 Oct 2011 18:38:25 +0000</pubDate>
				<category><![CDATA[Básico]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[Estilo]]></category>
		<category><![CDATA[Formato]]></category>
		<category><![CDATA[Sombras]]></category>
		<category><![CDATA[TextView]]></category>
		<guid isPermaLink="false">http://www.tutorialandroid.com/?p=536</guid>

					<description><![CDATA[<p>Objetivo: Dar formato (color, sombreado, tamaño) a un texto (Textview). Es importante tener nuestros textos correctamente formateados, para ganar visualización en nuestra aplicación. Se pueden realizar formatos tanto en Java como en XML, pero presentaremos el segundo caso, para continuar &#8230; <a href="http://www.tutorialandroid.com/basico/como-dar-estilo-color-sombras-tamano-a-un-texto/">Sigue leyendo <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="http://www.tutorialandroid.com/basico/como-dar-estilo-color-sombras-tamano-a-un-texto/">Como dar estilo: color, sombras, tamaño a un texto Textview</a> first appeared on <a href="http://www.tutorialandroid.com">Tutorial Android, aprende a programar en Android.</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span style="text-decoration: underline;"><strong>Objetivo:</strong></span></p>
<p>Dar formato (color, sombreado, tamaño) a un texto (Textview).</p>
<p>Es importante tener nuestros textos correctamente formateados, para ganar visualización en nuestra aplicación.</p>
<div>
<p>Se pueden realizar formatos tanto en Java como en XML, pero presentaremos el segundo caso, para continuar nuestra filosofía en la web de separar vista-controlador entre estos dos lenguajes.</p>
<p>A continuación se muestra la captura de pantalla de <strong>Cartelera de Cine</strong>, una aplicación Android disponible en Android Market. El nombre de la ciudad es un TextView formateado mediante el XML, que se muestra más abajo. Id variando los diferentes valores mostrados hasta alcanzar el nivel de sombras, color,etc deseado:</p>
<p><img decoding="async" loading="lazy" class="size-medium wp-image-542 aligncenter" title="Captura_cartelera_de_cine" src="http://www.tutorialandroid.com/wp-content/uploads/2011/10/Captura_cartelera_de_cine-300x262.jpg" alt="Captura_cartelera_de_cine" width="300" height="262" srcset="http://www.tutorialandroid.com/wp-content/uploads/2011/10/Captura_cartelera_de_cine-300x262.jpg 300w, http://www.tutorialandroid.com/wp-content/uploads/2011/10/Captura_cartelera_de_cine.jpg 316w" sizes="(max-width: 300px) 100vw, 300px" /></p>
</div>
<p><span style="text-decoration: underline;"><strong>Código fuente XML:</strong></span></p>
<p>[sourcecode language=&#8221;xml&#8221;]<br />
&lt;TextView android:id=&quot;@+id/cartelera_texto_ciudad&quot;<br />
   android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot;<br />
   android:text=&quot;&quot; android:textSize=&quot;30sp&quot; android:textStyle=&quot;bold&quot;<br />
   android:textColor=&quot;#000000&quot; android:shadowColor=&quot;#8a6603&quot;<br />
   android:shadowDx=&quot;3&quot; android:shadowDy=&quot;2&quot; android:shadowRadius=&quot;1.8&quot;<br />
/&gt;<br />
[/sourcecode]</p>
<p>Dicho código pertenece al texto <em>en&#8230;Madrid</em></p><p>The post <a href="http://www.tutorialandroid.com/basico/como-dar-estilo-color-sombras-tamano-a-un-texto/">Como dar estilo: color, sombras, tamaño a un texto Textview</a> first appeared on <a href="http://www.tutorialandroid.com">Tutorial Android, aprende a programar en Android.</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>http://www.tutorialandroid.com/basico/como-dar-estilo-color-sombras-tamano-a-un-texto/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
