Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

affichage de deux vues XML

Featured Replies

Posté(e)

Bonjour, je débute avec android et je ne sais pas trop comment afficher ces deux ficher XML en meme temp pour avoir un ViewPager et aussi le menu DrawerLayout sur la droite

 

 

merci


 

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/pager"
    android:layout_width="wrap_content"
    android:layout_height="0dp"
    android:layout_weight="0.19">

</android.support.v4.view.ViewPager>

 
 

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- As the main content view, the view below consumes the entire
         space available using match_parent in both dimensions. -->

	<FrameLayout 
		android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    	<LinearLayout 
		android:id="@+id/content_linear"
        android:layout_width="350dp"
        android:layout_height="match_parent"
        android:layout_gravity="right"
        android:orientation="vertical">   
         <LinearLayout
		    android:layout_width="wrap_content"
		    android:layout_height="wrap_content"
		    android:orientation="horizontal" >

            <TextView
                android:id="@+id/name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance ="@style/text_ihm"
                android:text="@string/name" />
            <TextView
                android:id="@+id/name_edit"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance ="@style/text_ihm"
                android:text="" />	         
         </LinearLayout>
         <LinearLayout 
		    android:layout_width="wrap_content"
		    android:layout_height="wrap_content"
		    android:orientation="horizontal" >
            <TextView
                android:id="@+id/nb_tab"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance ="@style/text_ihm"
                android:text="@string/nb_tab" />
            <TextView
                android:id="@+id/nb_tab_edit"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance ="@style/text_ihm"
                android:text="0" />
    
         </LinearLayout> 
	 
	    
	    <!-- android:layout_gravity="start" tells DrawerLayout to treat
	         this as a sliding drawer on the left side for left-to-right
	         languages and on the right side for right-to-left languages.
	         The drawer is given a fixed width in dp and extends the full height of
	         the container. A solid background is used for contrast
	         with the content view. -->
	    <ListView
	        android:id="@+id/right_drawer"
	        android:layout_width="match_parent"
	        android:layout_height="match_parent"
	        android:choiceMode="singleChoice"
	        android:divider="@android:color/transparent"
	        android:dividerHeight="0dp"
	        android:background="#111"/>

     </LinearLayout>
     
</android.support.v4.widget.DrawerLayout>

Modifié par tlarour

Posté(e)
  • Auteur

personne?

 

tuto, lien, explication, je prends tout

Posté(e)

Bonjour,

 

Tu peux déjà te baser sur la doc developer Android, tu y trouveras notamment un tutorial (avec exemple complet) pour le drawer. De même pour le ViewPager. Même si associer ces deux éléments risque de créer des interférences (les 2 se basant sur des swipes) ...

Posté(e)
  • Auteur

Merci,

J'ai effectivement des soucis pour gérer les deux éléments mais j'ai trouvé un début de solition avec l'utilisation d'un ViewPagerIndicator plutot que de l'afficher dans l'actionBar

http://viewpagerindicator.com/

Rejoignez la conversation

Vous pouvez poster maintenant et vous enregistrez plus tard. Si vous avez un compte, connectez-vous maintenant pour poster.

Invité
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Répondre à ce sujet…

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.