Independente da missão de nossa saga, seja esta de alegria ou desgraça, o Brasil tem que ser defendido!
        19
        06

        Android - ProgressDialog Customizado

         
         
        
        
        Classe Customizada:
        
        
        
        
        import android.app.ProgressDialog;
        import android.content.Context;
        import android.graphics.drawable.AnimationDrawable;
        import android.os.Bundle;
        import android.widget.ImageView;
        
        import com.meuprojeto.R;
        
        public class MyCustomProgressDialog extends ProgressDialog {
          private AnimationDrawable animation;
        
          public static ProgressDialog ctor(Context context) {
            MyCustomProgressDialog dialog = new MyCustomProgressDialog(context);
            dialog.setIndeterminate(true);
            dialog.setCancelable(false);
            return dialog;
          }
        
          public MyCustomProgressDialog(Context context) {
            super(context);
          }
        
          public MyCustomProgressDialog(Context context, int theme) {
            super(context, theme);
          }
        
          @Override
          protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.view_custom_progress_dialog);
        
            ImageView la = (ImageView) findViewById(R.id.animation);
            la.setBackgroundResource(R.drawable.custom_progress_dialog_animation);
            animation = (AnimationDrawable) la.getBackground();
          }
        
          @Override
          public void show() {
            super.show();
            animation.start();
          }
        
          @Override
          public void dismiss() {
            super.dismiss();
            animation.stop();
          }
        }
        
        
        
        
        
        
        
        XML da Classe Customizada:
        
        
        
        
        ‹LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:gravity="center"
          android:background="@null"
        ›
          ‹ImageView
            android:id="@+id/animation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scaleType="centerCrop"
            android:adjustViewBounds="true" /›
        ‹/LinearLayout›
        
        
        
        
        
        Implementação da Classe Customizada:
        
        
        
        
        ‹?xml version="1.0" encoding="utf-8"?›
        ‹animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"›
          ‹item android:drawable="@drawable/load1_animation00000" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00001" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00002" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00003" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00004" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00005" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00006" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00007" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00008" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00009" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00010" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00011" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00012" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00013" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00014" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00015" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00016" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00017" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00018" android:duration="150" /›
          ‹item android:drawable="@drawable/load1_animation00019" android:duration="150" /›
        ‹/animation-list›
        
        
        
        
        

        Comentários

        Tipo de Posts
        Parceiros
        Feed

        Entre com o seu e-mail:

        Sobre

        Rafael Nonato Ribeiro Ferreira, graduado em Análise e Desenvolvimento de Sistemas pela Uninove, programador nas linguagens PHP, JavaScript, JQuery e Java, desenvolvedor web HTML e CSS desenvolve e modela em SGBDs Mysql, PostGreSQL e Oracle, atualmente trabalha como Analista e Desenvolvedor de Sistemas, é um brasileiro, cristão, patriota filiado ao PSOL e com convicções politicas próprias conforme será mostrado em seu futuro site www.constituicaoproposta.com.br, nas horas de folga gosta de tocar seu violão e compor letras de múisca, Torço para o São Paulo e para a Portela.

        © Copyright 2012 NRF Informática Soluções. All Rights Reserved.