package info.z_pw.ebook.Activitys;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.viewpager.widget.ViewPager;
import info.z_pw.ebook.Adapters.MainViewPageAdapter;
import info.z_pw.ebook.Base.BaseActivity;
import info.z_pw.ebook.Events.MainPageChangeListener;
import info.z_pw.ebook.R;
import info.z_pw.ebook.Views.ETabWidget;
import android.os.Bundle;
import android.widget.ImageView;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends BaseActivity {
private ViewPager mainWindow;
private ETabWidget findBtn;
private ETabWidget bookBtn;
private ETabWidget meBtn;
private List btnList = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}
private void initView()
{
findBtn = findViewById(R.id.tab_find);
bookBtn = findViewById(R.id.tab_book);
meBtn = findViewById(R.id.tab_me);
mainWindow = findViewById(R.id.main_window);
btnList.add(findBtn);
btnList.add(bookBtn);
btnList.add(meBtn);
initViewPager();
}
private void initViewPager()
{
mainWindow.setAdapter(new MainViewPageAdapter());
mainWindow.addOnPageChangeListener(new MainPageChangeListener(btnList));
}
}
new MainViewPageAdapter()需要androidx.fragment.app.FragmentManager,activity怎么获取