IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Android Discussion :

Intégration de viewflow


Sujet :

Android

  1. #1
    Membre habitué Avatar de Willy55
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 188
    Points : 131
    Points
    131
    Par défaut Intégration de viewflow
    Bonjour,

    Je voudrais intégrer le projet viewflow de github (https://github.com/pakerfeldt/android-viewflow)

    Je colle les éléments dans mon layout comme ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    	xmlns:app="http://schemas.android.com/apk/res/navibc.tablette"
    	android:orientation="vertical" android:layout_width="fill_parent"
    	android:layout_height="fill_parent">
    	<LinearLayout android:layout_width="fill_parent"
    		android:gravity="center_horizontal" android:id="@+id/header_layout"
    		android:orientation="vertical" android:layout_height="wrap_content">
    		<org.taptwo.android.widget.TitleFlowIndicator
    			android:id="@+id/viewflowindic" android:layout_height="wrap_content"
    			android:layout_width="fill_parent"
    			app:footerLineHeight="2dp"
    			app:customTypeface="fonts/Antic.ttf"
    			app:footerTriangleHeight="10dp" 
    			app:textColor="#FFFFFFFF" 
    			app:selectedColor="#FFFFC445" 
    			app:footerColor="#FFFFC445" 
    			app:titlePadding="10dp" 
    			app:textSize="11dp" 
    			app:selectedSize="12dp" 
    			android:layout_marginTop="10dip" 
    			app:clipPadding="5dp">
    		</org.taptwo.android.widget.TitleFlowIndicator>
    	</LinearLayout>
    	<org.taptwo.android.widget.ViewFlow
    		android:duplicateParentState="true" android:id="@+id/viewflow"
    		android:layout_width="fill_parent" android:layout_height="fill_parent"></org.taptwo.android.widget.ViewFlow>
    </LinearLayout>
    Au début c'est "xmlns:app="http://schemas.android.com/apk/res/org.taptwo.android.widget.viewflow.example" ce qui me génère 2 erreurs xml mais je remplace par mon package et les erreurs disparaissent.

    Pourtant lorsque je veux lancer mon application j'ai sans arrêt cette erreur : " Enable to start activity : android.view.inflate.exception Binary XML file line#9 : Error inflating class org.taptwo.android.widget.TitleFlowIndicator"

    C'est la ligne ou j'intègre l'objet : <org.taptwo.android.widget.TitleFlowIndicator

    J'ai deja essayer d'ajouter le jar et le projet entier en Build Path. Ou de copier toute les sources dans mon projet a chaque fois j'ai la même erreur.

    ça n'a marcher qu'une seule fois c'est quand j'ai copié mes sources dans le projet viewflow-example... pourtant viewflow-example fait appel au projet viewflow comme je voudrais faire aussi et il n'intègre pas les sources... je ne comprend pas ce qui me manque.

  2. #2
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Donne le stacktrace complet de l'erreur s'il te plaît (et pas en image, un copié/collé)
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  3. #3
    Membre habitué Avatar de Willy55
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 188
    Points : 131
    Points
    131
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    05-29 10:59:18.687: E/AndroidRuntime(26014): FATAL EXCEPTION: main
    05-29 10:59:18.687: E/AndroidRuntime(26014): java.lang.RuntimeException: Unable to start activity ComponentInfo{navibc.tablette/navibc.tablette.TitleViewFlowExample}: android.view.InflateException: Binary XML file line #9: Error inflating class org.taptwo.android.widget.TitleFlowIndicator
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.os.Looper.loop(Looper.java:130)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.app.ActivityThread.main(ActivityThread.java:3691)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at java.lang.reflect.Method.invokeNative(Native Method)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at java.lang.reflect.Method.invoke(Method.java:507)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at dalvik.system.NativeStart.main(Native Method)
    05-29 10:59:18.687: E/AndroidRuntime(26014): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class org.taptwo.android.widget.TitleFlowIndicator
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:234)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.app.Activity.setContentView(Activity.java:1679)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at navibc.tablette.TitleViewFlowExample.onCreate(TitleViewFlowExample.java:34)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	... 11 more
    05-29 10:59:18.687: E/AndroidRuntime(26014): Caused by: java.lang.ClassNotFoundException: org.taptwo.android.widget.TitleFlowIndicator in loader dalvik.system.PathClassLoader[/data/app/navibc.tablette-2.apk]
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.view.LayoutInflater.createView(LayoutInflater.java:471)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
    05-29 10:59:18.687: E/AndroidRuntime(26014): 	... 21 more

  4. #4
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    L'erreur à résoudre, c'est celle-ci :
    Caused by: java.lang.ClassNotFoundException: org.taptwo.android.widget.TitleFlowIndicator in loader dalvik.system.PathClassLoader[/data/app/navibc.tablette-2.apk
    Vérifie le path de ton application, tu dois ajouter trop de chose.

    Ps : au vu des screenshots, j'ai l'impression que c'est un simple clone du composant officiel "ViewPager", avec quelques petits ajouts.
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  5. #5
    Membre habitué Avatar de Willy55
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 188
    Points : 131
    Points
    131
    Par défaut
    J'ai tout enlevé du path, cela m'a généré des erreurs sur les fichiers contenant le viewflow, j'ai cliqué sur Fix project properties, puis j'ai ajouter le jar au build path ce qui a enlevé toute les erreurs et maintenant j'ai :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    05-29 11:28:37.502: E/AndroidRuntime(27203): FATAL EXCEPTION: main
    05-29 11:28:37.502: E/AndroidRuntime(27203): java.lang.RuntimeException: Unable to start activity ComponentInfo{navibc.tablette/navibc.tablette.TitleViewFlowExample}: android.view.InflateException: Binary XML file line #9: Error inflating class org.taptwo.android.widget.TitleFlowIndicator
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.os.Looper.loop(Looper.java:130)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.app.ActivityThread.main(ActivityThread.java:3691)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at java.lang.reflect.Method.invokeNative(Native Method)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at java.lang.reflect.Method.invoke(Method.java:507)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at dalvik.system.NativeStart.main(Native Method)
    05-29 11:28:37.502: E/AndroidRuntime(27203): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class org.taptwo.android.widget.TitleFlowIndicator
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.view.LayoutInflater.createView(LayoutInflater.java:518)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:234)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.app.Activity.setContentView(Activity.java:1679)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at navibc.tablette.TitleViewFlowExample.onCreate(TitleViewFlowExample.java:34)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	... 11 more
    05-29 11:28:37.502: E/AndroidRuntime(27203): Caused by: java.lang.reflect.InvocationTargetException
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at java.lang.reflect.Constructor.constructNative(Native Method)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at android.view.LayoutInflater.createView(LayoutInflater.java:505)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	... 22 more
    05-29 11:28:37.502: E/AndroidRuntime(27203): Caused by: java.lang.NoClassDefFoundError: org.taptwo.android.widget.viewflow.R$styleable
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	at org.taptwo.android.widget.TitleFlowIndicator.<init>(TitleFlowIndicator.java:95)
    05-29 11:28:37.502: E/AndroidRuntime(27203): 	... 25 more

  6. #6
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Tu es sûr d'avoir ajouter le fichier XML représentant le composant ?
    Selon l'erreur, il n'a pas été généré dans le R.
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  7. #7
    Membre habitué Avatar de Willy55
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 188
    Points : 131
    Points
    131
    Par défaut
    J'ai copié le fichier XML contenant l'objet dans mon projet...

    Si on suit le "how to use" sur le site il disent ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
     
    Usage
    In your layout
     
    <org.taptwo.android.widget.ViewFlow
        android:id="@+id/viewflow"
        app:sidebuffer="5"
        />
     
    The use of app:sidebuffer is optional. It defines the number of Views to buffer on each side of the currently shown View. The default sidebuffer is 3, making up a grand total of 7 (3 * 2 + 1) Views loaded at a time (at max). To be able to use the more convenient app:sidebuffer attribute, the application namespace must be included in the same manner as the android namespace is. Please refer to the layout main.xml in the example project for a full example. Again, note that it's the application namespace and not the viewflow namespace that must be referred like xmlns:app="http://schemas.android.com/apk/res/your.application.package.here".
    In your activity
     
    ViewFlow viewFlow = (ViewFlow) findViewById(R.id.viewflow);
    viewFlow.setAdapter(myAdapter);
     
    Setting a different initial position (0 being default) is as easy as:
     
    viewFlow.setAdapter(myAdapter, 8);
    J'ai la même erreur...

  8. #8
    Membre habitué Avatar de Willy55
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2012
    Messages
    188
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 188
    Points : 131
    Points
    131
    Par défaut
    Le projet viewflow est bien dans ma bibliothèque, il disent bien qu'il ne faut pas importer les sources pourtant j'ai l'impression que ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <org.taptwo.android.widget.ViewFlow
    ne passe jamais...

  9. #9
    Expert éminent

    Avatar de Feanorin
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    4 589
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 4 589
    Points : 9 149
    Points
    9 149
    Par défaut
    Bonjour

    Quand on importe une librairie sous Android , il te suffit juste de déclarer tes activity que tu vas utiliser dans ton Manifest celui de ton application avec le chemin de ta librairie .

    C'est ton manifest qui va faire le lien lors des appels et non celui de ta librairie de même pour les permission il me semble qu'il faut également les redéclarer , enfin ce point je n'en suis pas sûr.
    Responsable Android de Developpez.com (Twitter et Facebook)
    Besoin d"un article/tutoriel/cours sur Android, consulter la page cours
    N'hésitez pas à consulter la FAQ Android et à poser vos questions sur les forums d'entraide mobile d'Android.

Discussions similaires

  1. Intégration de code c++
    Par Raoul le perdu dans le forum MFC
    Réponses: 2
    Dernier message: 24/02/2004, 08h54
  2. intégration de sons
    Par pal200 dans le forum OpenGL
    Réponses: 2
    Dernier message: 09/02/2004, 11h17
  3. [MFC][Excel] Intégration excel et MFC!
    Par fadoua dans le forum MFC
    Réponses: 2
    Dernier message: 22/12/2003, 10h51
  4. [NETBEANS] Intégration de Jboss dans NetBeans
    Par Kleb dans le forum NetBeans
    Réponses: 1
    Dernier message: 09/06/2003, 18h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo