コード例 #1
0
 @Override
 protected void onChartSelected(int page, int column) {
   super.onChartSelected(page, column);
   if (page != currentChartSet.ordinal()) {
     currentChartSet = ChartSet.values()[page];
     updateTabbarButtons();
   }
 }
コード例 #2
0
  @Override
  protected void onResume() {
    super.onResume();

    dataUpdateRequested = shouldRemoteUpdateStats();

    executeLoadDataDefault();
  }
コード例 #3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    smoothEnabled = Preferences.getChartSmooth(this);
    super.onCreate(savedInstanceState);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    setCurrentChartSet(ChartSet.RATINGS);

    Bundle b = getIntent().getExtras();
    if (b != null) {
      String chartSet = b.getString(DetailsActivity.EXTRA_CHART_SET);
      if (chartSet != null) {
        currentChartSet = ChartSet.valueOf(chartSet);
      }
    }

    if (currentChartSet == null) {
      currentChartSet = ChartSet.DOWNLOADS;
    }

    if (ChartSet.RATINGS.equals(currentChartSet)) {
      getSupportActionBar().setTitle(R.string.ratings);
    } else {
      getSupportActionBar().setTitle(R.string.downloads);
    }

    // chartFrame = (ViewSwitcher) ;

    oneEntryHint = (View) findViewById(R.id.base_chart_one_entry_hint);

    historyList = (ListView) findViewById(R.id.base_chart_list);
    View inflate = getLayoutInflater().inflate(R.layout.chart_list_footer, null);
    historyListFooter = (TextView) inflate.findViewById(R.id.chart_footer_text);
    historyList.addFooterView(inflate, null, false);

    // XXX this whole package is going away, make it compile for now
    historyListAdapter = null; // new ChartListAdapter(this);
    setAdapter(historyListAdapter);

    historyListAdapter.setCurrentChart(currentChartSet.ordinal(), 1);
    setAllowChangePageSliding(false);

    if (getLastCustomNonConfigurationInstance() != null) {
      loadChartData = (LoadChartData) getLastCustomNonConfigurationInstance();
      loadChartData.attach(this);
      if (loadChartData.statsForApp != null) {
        updateView(loadChartData.statsForApp);
        dataUpdateRequested = false;
      }
    }
    // first load is handled in onResume()
  }
コード例 #4
0
  @Override
  protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    setIntent(intent);
    Bundle b = intent.getExtras();
    if (b != null) {
      String chartSet = b.getString(DetailsActivity.EXTRA_CHART_SET);
      if (chartSet != null) {
        currentChartSet = ChartSet.valueOf(chartSet);
      }
    }

    if (currentChartSet == null) {
      currentChartSet = ChartSet.DOWNLOADS;
    }
    setCurrentChart(currentChartSet.ordinal(), 1);
  }