Q: Wrong scene size with Scene Animation In my app, I use a Fragmentin which I want to animate multiple Scenes. In my onCreateView, I create the frame where Scenewill be animated with myView=inflater.inflate(R.layout.my_fragment_layout,null,false). The corresponding layout is : 
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/MyContainer"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@android:color/black"
          android:orientation="vertical">


After that :


*

*I get the frame with myFrame=(LinearLayout)myView.findViewById(R.id.MyContainer);.

*I create the Viewfor my Scenewith activeView= inflater.inflate(R.layout.my_scene,myFrame,false); (see the xml file below).

*I create the Scenewith myScene =new Scene(myFrame, activeView);
.


and I start a Transitionwith TransitionManager.go(myScene , myTransition);
.
The layout for the Sceneis :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:id="@+id/InterfaceJeu"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@drawable/fond_interface"
          android:orientation="vertical"
          tools:context=".Jeu">

<TextView
    android:id="@+id/TitreJeux"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_marginBottom="@dimen/MargeVerticaleBoutonsInterfaceJeux"
    android:lines="1"
    android:text="@string/app_name"
    android:textColor="#FFFF00"
    android:textSize="35sp"
    android:textStyle="bold"
    android:typeface="serif"/>

<vd63.jeux.Jeu.BoutonInterface
    android:id="@+id/BoutonJouer"
    android:layout_width="wrap_content"
    android:layout_height="0dp"
    android:layout_gravity="center"
    android:layout_marginTop="@dimen/MargeVerticaleBoutonsInterfaceJeux"
    android:layout_weight="1"
    android:background="@drawable/bouton_jouer"
    android:text="@string/BoutonJouer"
    android:textColor="@color/CouleurTexteBoutons"
    android:textSize="25sp"
    android:typeface="serif"/>

<vd63.jeux.Jeu.BoutonInterface
    android:id="@+id/BoutonOptions"
    android:layout_width="wrap_content"
    android:layout_height="0dp"
    android:layout_gravity="center"
    android:layout_marginTop="@dimen/MargeVerticaleBoutonsInterfaceJeux"
    android:layout_weight="1"
    android:background="@drawable/bouton_jouer"
    android:text="@string/BoutonOptions"
    android:textColor="@color/CouleurTexteBoutons"
    android:textSize="25sp"
    android:typeface="serif"/>

<vd63.jeux.Jeu.BoutonInterface
    android:id="@+id/BoutonModeEmploi"
    android:layout_width="wrap_content"
    android:layout_height="0dp"
    android:layout_gravity="center"
    android:layout_marginTop="@dimen/MargeVerticaleBoutonsInterfaceJeux"
    android:layout_weight="1"
    android:background="@drawable/bouton_jouer"
    android:text="@string/BoutonModeEmploi"
    android:textColor="@color/CouleurTexteBoutons"
    android:textSize="25sp"
    android:typeface="serif"/>

<vd63.jeux.Jeu.BoutonInterface
    android:id="@+id/BoutonStatistiques"
    android:layout_width="wrap_content"
    android:layout_height="0dp"
    android:layout_gravity="center"
    android:layout_marginTop="@dimen/MargeVerticaleBoutonsInterfaceJeux"
    android:layout_weight="1"
    android:background="@drawable/bouton_jouer"
    android:text="@string/BoutonStatistiques"
    android:textColor="@color/CouleurTexteBoutons"
    android:textSize="25sp"
    android:typeface="serif"/>

<vd63.jeux.Jeu.BoutonInterface
    android:id="@+id/BoutonQuitter"
    android:layout_width="wrap_content"
    android:layout_height="0dp"
    android:layout_gravity="center"
    android:layout_marginBottom="@dimen/MargeVerticaleBoutonsInterfaceJeux"
    android:layout_marginTop="@dimen/MargeVerticaleBoutonsInterfaceJeux"
    android:layout_weight="1"
    android:background="@drawable/bouton_quitter"
    android:text="@string/BoutonQuitter"
    android:textColor="@color/CouleurTexteBoutons"
    android:textSize="25sp"
    android:typeface="serif"/>


The problem is that despite my frame and the Scene's container are defined with width and height set to match_parent, the resulting display doesn't always fit the entire screen. On my tablet, only half the screen is used...
Does anyone knows where the problem could come from?

A: You need to define separate layout folders to support different devices like below ...
res/layout/main_activity.xml
res/layout-sw600dp/main_activity.xml   # For 7" tablets
res/layout-sw720dp/main_activity.xml   # For 10" tablets


A: The problem was coming from the line myView=inflater.inflate(R.layout.my_fragment_layout,null,false). Once replaced by myView=inflater.inflate(R.layout.my_fragment_layout,container,false), where container is the Container passed to the onCreateView function as parameter, everything went normal.
