//package cn.flightfeather.thirdapp.dataanalysis.rank;
//
//import android.content.Intent;
//import android.graphics.Color;
//import android.os.Build;
//import android.os.Bundle;
//import android.support.annotation.RequiresApi;
//import android.support.design.widget.TabLayout;
//import android.support.v4.app.Fragment;
//import android.support.v4.app.FragmentManager;
//import android.support.v4.app.FragmentPagerAdapter;
//import android.support.v4.content.ContextCompat;
//import android.support.v4.view.ViewCompat;
//import android.support.v4.view.ViewPager;
//import android.support.v7.app.AppCompatActivity;
//import android.view.Gravity;
//import android.view.View;
//import android.widget.TextView;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import butterknife.BindView;
//import butterknife.ButterKnife;
//import butterknife.OnClick;
//import butterknife.Unbinder;
//import cn.flightfeather.thirdapp.R;
//import cn.flightfeather.thirdapp.bean.vo.RankVo;
//
//public class AnalysisRankActivity_B extends AppCompatActivity {
//
// //
// public static final String ARG_PARAM1 = "RankVo";
// public static final String ARG_PARAM2 = "topTask";
// public static final String ARG_PARAM3 = "sceneTypeName";
// public static final String ARG_PARAM4 = "rankType";//首次展示的排名类型,场景综合排名 或 街道综合排名
//
// private final String TITLE = "排名";
//
// private RankVo rankVo;
// private String topTask;
// private String sceneTypeName;
// private int rankType;
//
// private Unbinder unbinder;
// //
//
// //
// @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_analysis_rank);
// unbinder = ButterKnife.bind(this);
// Intent intent = getIntent();
// this.rankVo = (RankVo) intent.getSerializableExtra(ARG_PARAM1);
// this.topTask = intent.getStringExtra(ARG_PARAM2);
// this.sceneTypeName = intent.getStringExtra(ARG_PARAM3);
// this.rankType = intent.getIntExtra(ARG_PARAM4, 0);
//
// initToolBar();
// initTitle();
// initTab();
// initViewPager();
// }
//
//
//
// @Override
// protected void onDestroy() {
// super.onDestroy();
// if (unbinder != null) {
// unbinder.unbind();
// }
// }
//
// //
//
// //
// @BindView(R.id.action_bar_rank) View action_bar;
//
// @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
// private void initToolBar() {
// action_bar.setElevation(0);
// action_bar.setBackgroundColor(Color.alpha(0));
// action_bar.findViewById(R.id.spinner_topclass_task).setVisibility(View.GONE);
//// action_bar.findViewById(R.id.img_left).setVisibility(View.GONE);
// action_bar.findViewById(R.id.img_right).setVisibility(View.INVISIBLE);
// action_bar.findViewById(R.id.ll_menu_text).setVisibility(View.VISIBLE);
// TextView title = action_bar.findViewById(R.id.actionbar_title);
// title.setText(TITLE);
// }
//
// @OnClick(R.id.img_left)
// void onClickBack() {
// this.finish();
// }
// //
//
// //
// @BindView(R.id.text_topTask) TextView text_topTask;
// @BindView(R.id.text_scene) TextView text_scene;
//
// private void initTitle() {
// text_topTask.setText(topTask);
// text_scene.setText(sceneTypeName);
// }
// //
//
// //
// @BindView(R.id.tabLayout) TabLayout tabLayout;
// @BindView(R.id.viewPager) ViewPager viewPager;
// private List tabIndicators;//tab标题
// private List tabFragments;//内容
// private ContentPagerAdapter contentAdapter;//viewPager内容页面适配器
//
// private void initTab(){
// tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
// tabLayout.setTabGravity(Gravity.CENTER_HORIZONTAL);
// tabLayout.setTabTextColors(ContextCompat.getColor(this, R.color.black), ContextCompat.getColor(this, R.color.orange));
// tabLayout.setSelectedTabIndicatorColor(ContextCompat.getColor(this, R.color.orange));
// ViewCompat.setElevation(tabLayout, 2);
// tabLayout.setupWithViewPager(viewPager);//将tab和viewPager绑定
//
// }
//
// private void initViewPager(){
// tabIndicators = new ArrayList<>();
// tabIndicators.add("场景综合排名");
// tabIndicators.add("街道综合排名");
//
// tabFragments = new ArrayList<>();
// tabFragments.add(SceneRankContentFragment.newInstance(rankVo.getSceneRanks()));
// tabFragments.add(TownRankContentFragment.newInstance(rankVo.getTownRanks()));
//
// contentAdapter = new ContentPagerAdapter(getSupportFragmentManager());
// viewPager.setAdapter(contentAdapter);
// try {
// viewPager.setCurrentItem(rankType);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
// /**
// * viewPager适配器
// */
// class ContentPagerAdapter extends FragmentPagerAdapter {
//
// public ContentPagerAdapter(FragmentManager fm) {
// super(fm);
// }
//
// @Override
// public Fragment getItem(int position) {
// return tabFragments.get(position);
// }
//
// @Override
// public int getCount() {
// return tabIndicators.size();
// }
//
// @Override
// public CharSequence getPageTitle(int position) {
// return tabIndicators.get(position);
// }
// }
// //
//}