Android Open Source - ReqDroid Tela Principal Activity






From Project

Back to project page ReqDroid.

License

The source code is released under:

GNU General Public License

If you think the Android project ReqDroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Este arquivo esta sujeito aos termos e condicoes definidos
 * no arquivo 'LICENSE.txt, o qual e parte deste pacote de codigo fonte.
 *///www.  jav  a  2s .  c  om

package com.vrs.reqdroid.activities;


import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;

import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import com.vrs.reqdroid.R;


/**
 * Implementa a tela principal do sistema.
 *
 * @author Vinicius Rodrigues Silva <vinicius.rodsilva@gmail.com>
 * @version 1.0
 */
public class TelaPrincipalActivity extends ActionBarActivity {

    private static String projetoSelecionado;
    private static int idProjetoSelecionado;
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        AbreTelaNovoProjeto();
        AbreTelaAbrirProjeto();
        //mostraProjetosRecentes();
    }

    /**
     * Abre a tela de criacao de um novo projeto ao clicar no botao "Novo projeto".
     */
    private void AbreTelaNovoProjeto()
    {
        final Intent i = new Intent(TelaPrincipalActivity.this, TelaNovoProjetoActivity.class);
        final LinearLayout botaoNovo = (LinearLayout) findViewById(R.id.layoutNovoProjeto);

        botaoNovo.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) 
            {
                startActivity(i);
            }  
        });
    }
    
    /**
     * Abre a tela para abrir um projeto existente ao clicar no botao "Abrir projeto".
     */
    private void AbreTelaAbrirProjeto()
    {
      final Intent i = new Intent(TelaPrincipalActivity.this, TelaAbrirProjetoActivity.class);
      final LinearLayout botaoAbrir = (LinearLayout) findViewById(R.id.layoutAbrirProjeto);

        botaoAbrir.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) 
            {
                startActivity(i);
            }  
        });  
    }

    /*private void mostraProjetosRecentes()
    {
        //Possivel nova funcionalidade.
    }*/

    @Override
    public void onConfigurationChanged(Configuration newConfig) 
    {
      super.onConfigurationChanged(newConfig);
      setContentView(R.layout.main); 
      AbreTelaNovoProjeto();
      AbreTelaAbrirProjeto();
   } 
    
   @Override
    public void onBackPressed() {
         //finish();
         Intent intent = new Intent(Intent.ACTION_MAIN);
         intent.addCategory(Intent.CATEGORY_HOME);
         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         startActivity(intent);
   }

   @Override
   public boolean onCreateOptionsMenu(Menu menu) {
       MenuInflater inflater = getMenuInflater();
       inflater.inflate(R.menu.menu_aplicativo, menu);
       return true;
   }
   
   @Override
   public boolean onOptionsItemSelected(MenuItem item) {
       switch (item.getItemId()) {
           case R.id.menusobre:     
                     Intent i = new Intent(TelaPrincipalActivity.this, TelaSobreActivity.class);  
                     startActivity(i);  
                             break;
       }
       return true;
   }
}




Java Source Code List

com.vrs.reqdroid.activities.DrawerPrincipalActivity.java
com.vrs.reqdroid.activities.MainActivity.java
com.vrs.reqdroid.activities.TelaAbrirProjetoActivity.java
com.vrs.reqdroid.activities.TelaEditarEscopoActivity.java
com.vrs.reqdroid.activities.TelaEscopoActivity.java
com.vrs.reqdroid.activities.TelaHipoteseDetalhadaActivity.java
com.vrs.reqdroid.activities.TelaNovoProjetoActivity.java
com.vrs.reqdroid.activities.TelaPrincipalActivity.java
com.vrs.reqdroid.activities.TelaRequisitoAtrasadoDetalhadoActivity.java
com.vrs.reqdroid.activities.TelaRequisitoDetalhadoActivity.java
com.vrs.reqdroid.activities.TelaSobreActivity.java
com.vrs.reqdroid.dao.BDGerenciador.java
com.vrs.reqdroid.dao.IOperacoesBD.java
com.vrs.reqdroid.fragments.CaracteristicasUsuarioFragment.java
com.vrs.reqdroid.fragments.DependenciasFragment.java
com.vrs.reqdroid.fragments.HipotesesEDependenciasFragment.java
com.vrs.reqdroid.fragments.HipotesesFragment.java
com.vrs.reqdroid.fragments.ProjetosListFragment.java
com.vrs.reqdroid.fragments.RequisitosAtrasadosFragment.java
com.vrs.reqdroid.fragments.RequisitosFragment.java
com.vrs.reqdroid.models.Dependencia.java
com.vrs.reqdroid.models.Projeto.java
com.vrs.reqdroid.util.AlertsUtil.java
com.vrs.reqdroid.util.DependenciasUtils.java
com.vrs.reqdroid.util.DrawerPrincipalAdapter.java
com.vrs.reqdroid.util.HipotesesUtils.java
com.vrs.reqdroid.util.IRequisito.java
com.vrs.reqdroid.util.ListViewDependenciasAdapter.java
com.vrs.reqdroid.util.ListViewHipotesesAdapter.java
com.vrs.reqdroid.util.ListViewProjetosAdapter.java
com.vrs.reqdroid.util.ListViewRequisitosAdapter.java
com.vrs.reqdroid.util.ListViewRequisitosAtrasadosAdapter.java
com.vrs.reqdroid.util.ProjetoUtils.java
com.vrs.reqdroid.util.RequisitosAtrasadosUtils.java
com.vrs.reqdroid.util.RequisitosUtils.java