@Override
 protected void startRefresh() {
   super.startRefresh();
   page = 1;
   switch (type) {
     case ORGANIZATION_TYPE_USER:
       getOrganizations();
       break;
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    orgs = (Organization) intent.getParcelableExtra(ORGS);
    setContentView(R.layout.activity_organization_detail);
    main = (LinearLayout) findViewById(R.id.main);
    main.setVisibility(View.GONE);

    swithBt = (Switch) findViewById(R.id.switch_bt);
    swithBt.setVisibility(View.GONE);
  }
Esempio n. 3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    type = intent.getStringExtra(REPOS_TYPE);
    page = 1;
    switch (type) {
      case REPOS_TYPE_USER:
        user = (User) intent.getParcelableExtra(HotUserFragment.USER);
        break;
      case REPOS_TYPE_SHOWCASE:
        showCase = (ShowCase) intent.getParcelableExtra(ShowCaseFragment.SHOWCASE);
        break;
      case REPOS_TYPE_ORGS:
        orgs = (Organization) intent.getParcelableExtra(OrganizationDetailActivity.ORGS);
        break;
    }
    this.setContentView(R.layout.activity_list_layout);

    adapter = new ReposListAdapter(this);
    adapter.setOnItemClickListener(
        new ReposListAdapter.OnItemClickListener() {
          @Override
          public void onItemClick(View view, int position) {
            Intent intent = new Intent(ReposListActivity.this, ReposDetailActivity.class);
            Bundle bundle = new Bundle();
            bundle.putParcelable(HotReposFragment.REPOS, adapter.getItem(position));
            intent.putExtras(bundle);
            startActivity(intent);
          }
        });
    adapter.setOnLoadMoreClickListener(
        new ReposListAdapter.OnItemClickListener() {

          @Override
          public void onItemClick(View view, int position) {
            if (isLoadingMore) {
              Log.d(TAG, "ignore manually update!");
            } else {
              page++;
              isLoadingMore = true;
              getRefreshHandler().sendEmptyMessage(START_UPDATE);
            }
          }
        });

    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    // recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this).build());
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(adapter);
  }
Esempio n. 4
0
 @Override
 protected void startRefresh() {
   super.startRefresh();
   switch (type) {
     case REPOS_TYPE_USER:
       userReposList();
       break;
     case REPOS_TYPE_SHOWCASE:
       showCaseReposList();
       break;
     case REPOS_TYPE_ORGS:
       orgsReposList();
       break;
   }
 }
 @Override
 protected void endError() {
   super.endError();
 }
 @Override
 protected void endRefresh() {
   super.endRefresh();
   main.setVisibility(View.VISIBLE);
   setOrganization();
 }
 @Override
 protected void startRefresh() {
   super.startRefresh();
   getOrganizationInfo();
 }
 @Override
 protected void endError() {
   super.endError();
   isLoadingMore = false;
 }
 @Override
 protected void endRefresh() {
   super.endRefresh();
   isLoadingMore = false;
 }