Page viewer sous android
-
Upload
zakaria-bouazza -
Category
Education
-
view
349 -
download
1
description
Transcript of Page viewer sous android
Page Viewer
CONTACT
/PREEMPTIF
@ElZakaria
http://www.javailable.com
Concept
Concept
Projet
Extends FragmentActivity
Les fragments
import android.support.v4.app.Fragment;
Layouts
Layout_fragment1.xml Layout_fragment2.xml Layout_fragment3.xml
Main.xml (MyActivity.java)
<?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="match_parent" android:layout_height="match_parent" />
Utilisé dans MyActivity.java
Un adapteur• Selon la doc Android :
- Doc android -
Class FragmentPagerAdap
ter
On lui passe le fragmentmanager de l’activité(extend FragmentActivity)
MyActivity.java
Voir détails méthodesaprès
Activer la navigation
Mise en place du ViewPager
Inner Class
Gérer le click sur les tabs
Résultat