Renamed classes: IntentFragmentAdapter -> FragmentAdapter, IntentFragment -> IntentListFragment
This commit is contained in:
parent
6d9ff2d539
commit
09b0fc7297
@ -7,16 +7,16 @@ import android.support.v4.app.FragmentPagerAdapter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class IntentFragmentAdapter extends FragmentPagerAdapter {
|
||||
private final List<IntentFragment> mTabs;
|
||||
public class FragmentAdapter extends FragmentPagerAdapter {
|
||||
private final List<IntentListFragment> mTabs;
|
||||
|
||||
public IntentFragmentAdapter(FragmentManager fm) {
|
||||
public FragmentAdapter(final FragmentManager fm) {
|
||||
super(fm);
|
||||
|
||||
mTabs = new ArrayList<IntentFragment>();
|
||||
mTabs = new ArrayList<IntentListFragment>();
|
||||
}
|
||||
|
||||
public void add(IntentFragment fragment) {
|
||||
public void add(final IntentListFragment fragment) {
|
||||
mTabs.add(fragment);
|
||||
}
|
||||
|
||||
@ -26,12 +26,12 @@ public class IntentFragmentAdapter extends FragmentPagerAdapter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
public Fragment getItem(final int position) {
|
||||
return mTabs.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
public CharSequence getPageTitle(final int position) {
|
||||
return mTabs.get(position).getTitle();
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ import android.widget.ListView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class IntentFragment extends Fragment implements OnScrollListener, OnItemClickListener {
|
||||
public class IntentListFragment extends Fragment implements OnScrollListener, OnItemClickListener {
|
||||
private ArrayList<Intent> mIntents;
|
||||
private IntentAdapter mAdapter;
|
||||
private int mScrollIndex, mScrollTop;
|
@ -17,7 +17,7 @@ import java.util.ArrayList;
|
||||
|
||||
public class ShareActivity extends FragmentActivity implements ActionBar.TabListener {
|
||||
private IntentComparator mComparator;
|
||||
private IntentFragmentAdapter mFragmentAdapter;
|
||||
private FragmentAdapter mFragmentAdapter;
|
||||
private IntentGenerator mGenerator;
|
||||
private boolean mIsPortal;
|
||||
private String mLl;
|
||||
@ -27,7 +27,7 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
private int mZoom;
|
||||
|
||||
private void addTab(final ArrayList<Intent> intents, final int label, final int icon) {
|
||||
final IntentFragment fragment = new IntentFragment();
|
||||
final IntentListFragment fragment = new IntentListFragment();
|
||||
final Bundle args = new Bundle();
|
||||
args.putParcelableArrayList("intents", intents);
|
||||
args.putString("title", getString(label));
|
||||
@ -62,7 +62,7 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
mComparator = new IntentComparator(this);
|
||||
mGenerator = new IntentGenerator(this);
|
||||
|
||||
mFragmentAdapter = new IntentFragmentAdapter(getSupportFragmentManager());
|
||||
mFragmentAdapter = new FragmentAdapter(getSupportFragmentManager());
|
||||
|
||||
final ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
@ -107,7 +107,7 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
});
|
||||
|
||||
for (int i = 0; i < mFragmentAdapter.getCount(); i++) {
|
||||
final IntentFragment fragment = (IntentFragment) mFragmentAdapter.getItem(i);
|
||||
final IntentListFragment fragment = (IntentListFragment) mFragmentAdapter.getItem(i);
|
||||
|
||||
actionBar.addTab(actionBar
|
||||
.newTab()
|
||||
|
Loading…
x
Reference in New Issue
Block a user