提交 50042345 编写于 作者: C chaychan

BottomBarItem新增获取子条目ImageView和TextView的方法

上级 022c7991
...@@ -65,7 +65,7 @@ public class BottomBarLayoutDemoActivity extends FragmentActivity { ...@@ -65,7 +65,7 @@ public class BottomBarLayoutDemoActivity extends FragmentActivity {
private void initListener() { private void initListener() {
vpContent.setAdapter(new MyAdapter(getSupportFragmentManager())); vpContent.setAdapter(new MyAdapter(getSupportFragmentManager()));
bbl.setmViewPager(vpContent); bbl.setViewPager(vpContent);
} }
class MyAdapter extends FragmentStatePagerAdapter{ class MyAdapter extends FragmentStatePagerAdapter{
......
...@@ -97,16 +97,11 @@ public class BottomBarItem extends LinearLayout { ...@@ -97,16 +97,11 @@ public class BottomBarItem extends LinearLayout {
addView(view); addView(view);
} }
private ImageView createImageView() { public ImageView getImageView() {
mImageView = new ImageView(mContext);
mImageView.setImageResource(mIconNormalResourceId);
return mImageView; return mImageView;
} }
private TextView creatTextView() { public TextView getTextView() {
mTextView = new TextView(mContext);
mTextView.setGravity(Gravity.CENTER);
return mTextView; return mTextView;
} }
......
...@@ -50,7 +50,7 @@ public class BottomBarLayout extends LinearLayout implements ViewPager.OnPageCha ...@@ -50,7 +50,7 @@ public class BottomBarLayout extends LinearLayout implements ViewPager.OnPageCha
super.setOrientation(orientation); super.setOrientation(orientation);
} }
public void setmViewPager(ViewPager mViewPager) { public void setViewPager(ViewPager mViewPager) {
this.mViewPager = mViewPager; this.mViewPager = mViewPager;
init(); init();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册