Open MossoIsai opened 7 years ago
//bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigation2);
ahBottomNavigation = (AHBottomNavigation) findViewById(R.id.bottom_navigation);
tituloActivity = (TextView) findViewById(R.id.mytext);
iconBack = (ImageView) findViewById(R.id.imgBack);
iconBack.setVisibility(View.INVISIBLE); //HAGO invisible la barra
//Seteando valores del AHBottomNavigation
AHBottomNavigationItem item1 = new AHBottomNavigationItem("Menú", R.drawable.menu);
AHBottomNavigationItem item2 = new AHBottomNavigationItem("Favoritos", R.drawable.favoritos_item);
AHBottomNavigationItem item3 = new AHBottomNavigationItem("Tu orden", R.drawable.item_charola);
AHBottomNavigationItem item4 = new AHBottomNavigationItem("Perfil", R.drawable.item_perfil);
//agregando los item al barrar
ahBottomNavigation.addItem(item1);
ahBottomNavigation.addItem(item2);
ahBottomNavigation.addItem(item3);
ahBottomNavigation.addItem(item4);
//background de la barra
ahBottomNavigation.setDefaultBackgroundColor(Color.parseColor("#FFFAFAFA"));
// Disable the translation inside the CoordinatorLayout
ahBottomNavigation.setBehaviorTranslationEnabled(false);
// Force to tint the drawable (useful for font with icon for example)
ahBottomNavigation.setForceTint(true);
// Display color under navigation bar (API 21+)
// Don't forget these lines in your style-v21
// <item name="android:windowTranslucentNavigation">true</item>
// <item name="android:fitsSystemWindows">true</item>
ahBottomNavigation.setTranslucentNavigationEnabled(true);
// Manage titles
ahBottomNavigation.setTitleState(AHBottomNavigation.TitleState.ALWAYS_SHOW);
ahBottomNavigation.setTitleState(AHBottomNavigation.TitleState.ALWAYS_SHOW);
ahBottomNavigation.setTitleState(AHBottomNavigation.TitleState.ALWAYS_SHOW);
ahBottomNavigation.setTitleState(AHBottomNavigation.TitleState.ALWAYS_SHOW);
// Use colored navigation with circle reveal effect
ahBottomNavigation.setColored(false);
// Establece el item que aparecera seleccionado por default
ahBottomNavigation.setCurrentItem(0);
// Customize notification (title, background, typeface)
//ahBottomNavigation.setNotificationBackgroundColor(Color.parseColor("#F63D2B"));
// Add or remove notification for each item
ahBottomNavigation.setNotification("1", 2);
ahBottomNavigation.setOnTabSelectedListener(new AHBottomNavigation.OnTabSelectedListener() {
@Override
public boolean onTabSelected(int position, boolean wasSelected) {
// Do something cool here...
switch (position) {
case 0:
//seteando el texto del menu
tituloActivity.setText("Menú");
iconBack.setVisibility(View.INVISIBLE);
//Toast.makeText(getApplicationContext(), "Menú", Toast.LENGTH_LONG).show();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
MenuViewController menuViewController = new MenuViewController();
/**menuViewController.setArguments(bundle);**/
fragmentTransaction.replace(R.id.myFragemnt, menuViewController);
fragmentTransaction.commit();
return true;
case 1:
//seteando el texto del menu
tituloActivity.setText("Favoritos");
iconBack.setVisibility(View.INVISIBLE);
// Toast.makeText(getApplicationContext(), "favoritos", Toast.LENGTH_LONG).show();
FragmentManager fragmentManager4 = getSupportFragmentManager();
FragmentTransaction fragmentTransaction4 = fragmentManager4.beginTransaction();
FragmentFavoritos fragmentFavoritos = new FragmentFavoritos();
fragmentTransaction4.replace(R.id.myFragemnt, fragmentFavoritos);
fragmentTransaction4.commit();
return true;
case 2:
//seteando el texto del menu
tituloActivity.setText("Tu orden");
iconBack.setVisibility(View.INVISIBLE);
// Toast.makeText(getApplicationContext(), "Tu orden", Toast.LENGTH_LONG).show();
FragmentManager fragmentManager3 = getSupportFragmentManager();
FragmentTransaction fragmentTransaction3 = fragmentManager3.beginTransaction();
FragmentCharola fragmentCharola3 = new FragmentCharola();
fragmentTransaction3.replace(R.id.myFragemnt, fragmentCharola3);
fragmentTransaction3.commit();
return true;
case 3:
//seteando el texto del menu
tituloActivity.setText("Mi Perfil");
iconBack.setVisibility(View.INVISIBLE);
//Toast.makeText(getApplicationContext(), "Mi Perfil", Toast.LENGTH_LONG).show();
FragmentManager fragmentManager5 = getSupportFragmentManager();
FragmentTransaction fragmentTransaction5 = fragmentManager5.beginTransaction();
FragmentPerfil fragmentCharola5 = new FragmentPerfil();
fragmentTransaction5.replace(R.id.myFragemnt, fragmentCharola5);
fragmentTransaction5.commit();
System.out.print("Estoy dentro de PERFIL");
return true;
}
return true;
}
});
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:design="http://schemas.android.com/apk/res-auto" android:id="@+id/test" android:layout_width="match_parent" android:layout_height="match_parent" android:descendantFocusability="blocksDescendants">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/myFragemnt"
android:orientation="horizontal" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/blanco"
android:layout_gravity="bottom">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@drawable/shadow_bottomnav"
android:layout_gravity="top"/>
<!--<android.support.design.widget.BottomNavigationView
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottomNavigation2"
design:menu="@menu/menu_activity">
</android.support.design.widget.BottomNavigationView>-->
<com.aurelhubert.ahbottomnavigation.AHBottomNavigation
android:id="@+id/bottom_navigation"
android:background="@color/grisLetter"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
//Fragment with editext
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/myFragemntPerfil2" android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gris_staticell"
android:padding="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/datos_personales"
android:textStyle="bold"
android:textSize="40px"
android:textColor="@color/gris_staticell_letter"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:background="@color/grisLetter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:id="@+id/nombreUsuario"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="50px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:background="@color/grisLetter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:id="@+id/emailUsuario"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="50px" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:background="@color/grisLetter"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gris_staticell"
android:padding="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/cambio_passwd"
android:textSize="40px"
android:textStyle="bold"
android:textColor="@color/gris_staticell_letter" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:background="@color/grisLetter"/>
<LinearLayout
android:id="@+id/linearPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:layout_width="320dp"
android:layout_height="wrap_content"
android:textSize="50px"
android:text="@string/astericos"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:background="@drawable/flecha"
android:layout_width="50px"
android:layout_height="50px" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:background="@color/grisLetter"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gris_staticell"
android:padding="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/aviso_legal"
android:textSize="40px"
android:textStyle="bold"
android:textColor="@color/gris_staticell_letter" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:background="@color/grisLetter" />
<LinearLayout
android:id="@+id/linearPoliticas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:layout_width="320dp"
android:layout_height="wrap_content"
android:textSize="50px"
android:text="@string/politicas_privavidad" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:background="@drawable/flecha"
android:layout_width="50px"
android:layout_height="50px" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:background="@color/grisLetter" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gris_staticell"
android:padding="10dp">
<TextView
android:id="@+id/cerrarSession"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/cerrar_session"
android:textColor="@color/colorPrimaryDark"
android:textStyle="bold" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
I am not showing the keyboard when I want to write on an editext