-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from Aspsine/dev
Demo use FragmentNavigator
- Loading branch information
Showing
4 changed files
with
96 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
app/src/main/java/com/aspsine/swipetoloadlayout/demo/MainFragmentAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.aspsine.swipetoloadlayout.demo; | ||
|
||
import android.support.v4.app.Fragment; | ||
|
||
import com.aspsine.fragmentnavigator.FragmentNavigatorAdapter; | ||
import com.aspsine.swipetoloadlayout.demo.fragment.NavGoogleFragment; | ||
import com.aspsine.swipetoloadlayout.demo.fragment.NavJDFragment; | ||
import com.aspsine.swipetoloadlayout.demo.fragment.NavJavaCodeFragment; | ||
import com.aspsine.swipetoloadlayout.demo.fragment.NavTwitterFragment; | ||
import com.aspsine.swipetoloadlayout.demo.fragment.NavYalantisFragment; | ||
|
||
/** | ||
* Created by aspsine on 16/4/28. | ||
*/ | ||
public class MainFragmentAdapter implements FragmentNavigatorAdapter { | ||
|
||
@Override | ||
public Fragment onCreateFragment(int position) { | ||
switch (position) { | ||
case 0: | ||
return NavTwitterFragment.newInstance(); | ||
|
||
case 1: | ||
return NavGoogleFragment.newInstance(); | ||
|
||
case 2: | ||
return NavYalantisFragment.newInstance(); | ||
|
||
case 3: | ||
return NavJDFragment.newInstance(); | ||
|
||
case 4: | ||
return NavJavaCodeFragment.newInstance(); | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getTag(int position) { | ||
return String.valueOf(position); | ||
} | ||
|
||
@Override | ||
public int getCount() { | ||
return 5; | ||
} | ||
} |
Binary file not shown.