Android Open Source - ReqDroid Hipoteses E Dependencias Fragment






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.
 *///w  ww . j a  va 2  s . c  o  m

package com.vrs.reqdroid.fragments;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTabHost;
import android.support.v4.app.NavUtils;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;

import com.vrs.reqdroid.activities.TelaPrincipalActivity;
import com.vrs.reqdroid.R;


/**
 * Implementa a activity que contem as abas (tabs) das telas de hipoteses e dependencias do aplicativo.
 *
 * @author Vinicius Rodrigues Silva <vinicius.rodsilva@gmail.com>
 * @version 1.0
 */
public class HipotesesEDependenciasFragment extends Fragment{


    private FragmentTabHost hipotesesEDependenciasTabHost;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,  Bundle savedInstanceState)
    {
        hipotesesEDependenciasTabHost = new FragmentTabHost(getActivity());
        hipotesesEDependenciasTabHost.setup(getActivity(), getChildFragmentManager(), R.id.tabcontent);

        hipotesesEDependenciasTabHost.addTab(hipotesesEDependenciasTabHost.newTabSpec("tabHipoteses").setIndicator(getResources().getString(R.string.tela_tabs_hed_hipoteses)),
                 HipotesesFragment.class, null);
        hipotesesEDependenciasTabHost.addTab(hipotesesEDependenciasTabHost.newTabSpec("tabDependencias").setIndicator(getResources().getString(R.string.tela_tabs_hed_dependencias)),
                DependenciasFragment.class, null);

        //O Android possui um bug onde as tabs "roubam" o foco das entradas de texto, o codigo abaixo corrige isso.
        //Mas somente para API 12 ou superior
        if ( Build.VERSION.SDK_INT >= 12)
        {
                hipotesesEDependenciasTabHost.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
                @Override
                public void onViewDetachedFromWindow(View v) {}

                @Override
                public void onViewAttachedToWindow(View v) {
                    hipotesesEDependenciasTabHost.getViewTreeObserver().removeOnTouchModeChangeListener(hipotesesEDependenciasTabHost);
                }
            });
        }
        return hipotesesEDependenciasTabHost;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        hipotesesEDependenciasTabHost = null;
    }


    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            // Respond to the action bar's Up/Home button
            case android.R.id.home:
                NavUtils.navigateUpTo(getActivity(), new Intent(getActivity(), TelaPrincipalActivity.class));
                return true;
        }
        return super.onOptionsItemSelected(item);
    }
}




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