Пример #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recommend);
    SwipeBackHelper.getCurrentPage(this).setSwipeBackEnable(false);
    ButterKnife.bind(this);
    back.setOnClickListener(v -> finish());
    viewpager.setAdapter(pagerAdapter = new SeedFragmentListAdapter(getSupportFragmentManager()));
    tabs.setupWithViewPager(viewpager);
    viewpager.setCurrentItem(getIntent().getIntExtra("type", 0));
    tabs.setTabTextColors(
        getResources().getColor(R.color.gray), getResources().getColor(R.color.orange));
    tabs.setOnTabSelectedListener(
        new TabLayout.OnTabSelectedListener() {
          @Override
          public void onTabSelected(TabLayout.Tab tab) {
            title.setText(tab.getText());
          }

          @Override
          public void onTabUnselected(TabLayout.Tab tab) {}

          @Override
          public void onTabReselected(TabLayout.Tab tab) {}
        });
  }
Пример #2
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.user_activity_login);
   ButterKnife.inject(this);
   register.setOnClickListener(v -> startActivity(new Intent(this, RegisterActivity.class)));
   login.setOnClickListener(v -> checkInput());
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_password_edit);
   ButterKnife.bind(this);
   back.setOnClickListener(v -> finish());
   edit.setOnClickListener(v -> check());
 }