content: package my.project.sakuraproject.main.about;
  
  import com.chad.library.adapter.base.BaseQuickAdapter;
  
  import java.util.List;
  
  import androidx.appcompat.widget.Toolbar;
  import androidx.recyclerview.widget.LinearLayoutManager;
  import androidx.recyclerview.widget.RecyclerView;
  import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
  import butterknife.BindView;
  import my.project.sakuraproject.R;
  import my.project.sakuraproject.adapter.SourceAdapter;
  import my.project.sakuraproject.bean.SourceBean;
  import my.project.sakuraproject.config.OpenSourceEnum;
  import my.project.sakuraproject.main.base.BaseActivity;
  import my.project.sakuraproject.main.base.Presenter;
  import my.project.sakuraproject.util.Utils;
  
  public class OpenSourceActivity extends BaseActivity {
      @BindView(R.id.toolbar)
      Toolbar toolbar;
      @BindView(R.id.mSwipe)
      SwipeRefreshLayout mSwipe;
      @BindView(R.id.rv_list)
      RecyclerView recyclerView;
      private SourceAdapter adapter;
      private List<SourceBean> list = OpenSourceEnum.getSourceList();
  
      @Override
      protected Presenter createPresenter() {
          return null;
      }
  
      @Override
      protected void loadData() {
  
      }
  
      @Override
      protected int setLayoutRes() {
          return R.layout.activity_source;
      }
  
      @Override
      protected void init() {
  //        Slidr.attach(this, Utils.defaultInit());
          initToolbar();
          initSwipe();
          initAdapter();
      }
  
      @Override
      protected void initBeforeView() {
  //        SwipeBackLayoutUtil.convertActivityToTranslucent(this);
      }
  
      @Override
      protected void setConfigurationChanged() {
  
      }
  
      public void initToolbar() {
          toolbar.setTitle(Utils.getString(R.string.os_title));
          setSupportActionBar(toolbar);
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
          toolbar.setNavigationOnClickListener(view -> supportFinishAfterTransition());
      }
  
      public void initSwipe() {
          mSwipe.setEnabled(false);
      }
  
      public void initAdapter() {
          recyclerView.setLayoutManager(new LinearLayoutManager(this));
          adapter = new SourceAdapter(list);
          adapter.openLoadAnimation(BaseQuickAdapter.SLIDEIN_BOTTOM);
          adapter.setOnItemClickListener((adapter, view, position) -> {
              if (Utils.isFastClick()) Utils.viewInChrome(this, list.get(position).getUrl());
          });
          if (Utils.checkHasNavigationBar(this)) recyclerView.setPadding(0,0,0, Utils.getNavigationBarHeight(this) + 15);
          recyclerView.setAdapter(adapter);
      }
  }
  