Example #1
0
    protected void onPostExecute(HNFeed result) {
      if (progress != null && progress.isShowing()) progress.dismiss();

      if (result != null
          && result.getUserAcquiredFor() != null
          && result.getUserAcquiredFor().equals(Settings.getUserName(App.getInstance())))
        showFeed(result);
    }
Example #2
0
  @Override
  protected void onResume() {
    super.onResume();

    boolean registeredUserChanged =
        mFeed.getUserAcquiredFor() != null
            && (!mFeed.getUserAcquiredFor().equals(Settings.getUserName(this)));

    // We want to reload the feed if a new user logged in
    if (HNCredentials.isInvalidated() || registeredUserChanged) {
      showFeed(new HNFeed(new ArrayList<HNPost>(), null, ""));
      startFeedLoading();
    }

    // refresh if font size changed
    if (refreshFontSizes()) mPostsListAdapter.notifyDataSetChanged();

    // Ramesh kumar coding part for change background color using radio button
    if (refreshBackgroundColor()) mPostsListAdapter.notifyDataSetChanged();

    // ------------- kevin's codes. refresh the setup when changing the setting -----------------
    if (refreshHTMLContent()) {

      if (mCurrentHTMLContent.equals("display")) {

        new Thread(getURLContent_Thread).start();
      } else {
        List<HNPost> mPosts = mFeed.getPosts();
        for (int i = 0; i < mPosts.size(); i++) {

          mPosts.get(i).setContent("");
        }
        showFeed(mFeed);
      }
    }
    // restore vertical scrolling position if applicable
    if (mListState != null) mPostsList.onRestoreInstanceState(mListState);

    mListState = null;
  }