Commit e9b6c14d7e97097f87d459c3bbfb58ae28047247
1 parent
4ef24041
Passage au supportv13 avec les fragments natifs
Showing
8 changed files
with
12 additions
and
13 deletions
Show diff stats
PremiereActivite/app/build.gradle
PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java
1 | 1 | package com.example.app_10p5; |
2 | 2 | |
3 | +import android.app.Activity; | |
3 | 4 | import android.content.Intent; |
4 | -import android.opengl.ETC1; | |
5 | 5 | import android.os.Bundle; |
6 | 6 | import android.support.design.widget.TabLayout; |
7 | -import android.support.v4.app.FragmentActivity; | |
8 | 7 | import android.support.v4.view.ViewPager; |
9 | -import android.text.InputFilter; | |
10 | 8 | import android.view.View; |
11 | 9 | import android.widget.EditText; |
12 | 10 | import android.widget.Toast; |
... | ... | @@ -20,7 +18,7 @@ import java.util.HashMap; |
20 | 18 | /** |
21 | 19 | * Created by beaus on 24/04/2016. |
22 | 20 | */ |
23 | -public class MainActivite extends FragmentActivity implements ASyncResponse { | |
21 | +public class MainActivite extends Activity implements ASyncResponse { | |
24 | 22 | |
25 | 23 | public static final int STATE_RIEN = 0; |
26 | 24 | public static final int STATE_COMMANDE = 3; |
... | ... | @@ -55,7 +53,7 @@ public class MainActivite extends FragmentActivity implements ASyncResponse { |
55 | 53 | tabLayout.setTabGravity(TabLayout.GRAVITY_FILL); |
56 | 54 | |
57 | 55 | final ViewPager viewPager = (ViewPager) findViewById(R.id.pager); |
58 | - final PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount()); | |
56 | + final PagerAdapter adapter = new PagerAdapter(getFragmentManager(), tabLayout.getTabCount()); | |
59 | 57 | viewPager.setAdapter(adapter); |
60 | 58 | viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); |
61 | 59 | tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { | ... | ... |
PremiereActivite/app/src/main/java/com/example/app_10p5/PagerAdapter.java
... | ... | @@ -3,9 +3,9 @@ package com.example.app_10p5; |
3 | 3 | /** |
4 | 4 | * Created by beaus on 24/04/2016. |
5 | 5 | */ |
6 | -import android.support.v4.app.Fragment; | |
7 | -import android.support.v4.app.FragmentManager; | |
8 | -import android.support.v4.app.FragmentStatePagerAdapter; | |
6 | +import android.app.Fragment; | |
7 | +import android.app.FragmentManager; | |
8 | +import android.support.v13.app.FragmentStatePagerAdapter;; | |
9 | 9 | |
10 | 10 | public class PagerAdapter extends FragmentStatePagerAdapter { |
11 | 11 | int mNumOfTabs; | ... | ... |
PremiereActivite/app/src/main/java/com/example/app_10p5/TabFragment1.java
PremiereActivite/app/src/main/java/com/example/app_10p5/TabFragment2.java
PremiereActivite/app/src/main/java/com/example/app_10p5/TabFragment3.java
PremiereActivite/app/src/main/java/com/example/app_10p5/TabFragment4.java
PremiereActivite/app/src/main/java/com/example/app_10p5/TabFragment5.java