Beispiel #1
0
  @Override
  protected void onCreate(Bundle savedInstanceBundle) {
    requestWindowFeature(Window.FEATURE_PROGRESS);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceBundle);

    setContentView(R.layout.activity_reading);
    this.overlayLeft = (Button) findViewById(R.id.reading_overlay_left);
    this.overlayRight = (Button) findViewById(R.id.reading_overlay_right);
    this.overlayCount = (TextView) findViewById(R.id.reading_overlay_count);

    fragmentManager = getSupportFragmentManager();

    storiesToMarkAsRead = new HashSet<Story>();
    storiesAlreadySeen = new HashSet<Story>();

    passedPosition = getIntent().getIntExtra(EXTRA_POSITION, 0);
    currentState = getIntent().getIntExtra(ItemsList.EXTRA_STATE, 0);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    contentResolver = getContentResolver();

    this.apiManager = new APIManager(this);

    // this value is expensive to compute but doesn't change during a single runtime
    this.overlayRangeTopPx = (float) UIUtils.convertDPsToPixels(this, OVERLAY_RANGE_TOP_DP);
    this.overlayRangeBotPx = (float) UIUtils.convertDPsToPixels(this, OVERLAY_RANGE_BOT_DP);

    // the unread count overlay defaults to neutral colour.  set it to positive if we are in focus
    // mode
    if (this.currentState == AppConstants.STATE_BEST) {
      ViewUtils.setViewBackground(this.overlayCount, R.drawable.positive_count_rect);
    }
  }
Beispiel #2
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   MenuInflater inflater = getSupportMenuInflater();
   inflater.inflate(R.menu.reading, menu);
   return true;
 }
Beispiel #3
0
 @Override
 protected void onPause() {
   flushStoriesMarkedRead();
   super.onPause();
 }