Skip to content

Commit

Permalink
Fixed SmoothProgressBar bug. Updated Firstpost fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
sahildave committed Oct 4, 2014
1 parent 5390be6 commit 5ff3e03
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.*;
import fr.castorflex.android.smoothprogressbar.SmoothProgressBar;
import in.sahildave.gazetti.R;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
Expand All @@ -34,7 +35,7 @@ public class WebsiteDetailActivity extends ActionBarActivity implements WebsiteD
View headerStub;

// Header
ProgressBar detailViewProgress;
SmoothProgressBar detailViewProgress;
TextView mTitleTextView;
ImageView mMainImageView;
String mImageURL;
Expand Down Expand Up @@ -130,8 +131,9 @@ public void onPreExecute(View rootView) {
mScrollToReadLayout = (LinearLayout) rootView.findViewById(R.id.scrollToReadLayout);

// Progress Bar
detailViewProgress = (ProgressBar) rootView.findViewById(R.id.detailViewProgressBar);
detailViewProgress = (SmoothProgressBar) rootView.findViewById(R.id.detailViewProgressBar);
detailViewProgress.setVisibility(View.VISIBLE);
detailViewProgress.progressiveStart();
}

@Override
Expand All @@ -158,6 +160,7 @@ public void onPostExecute(String[] result) {

mTitleTextView = (TextView) headerStub.findViewById(R.id.article_title);
mTitleTextView.setText(titleText);
detailViewProgress.progressiveStop();
detailViewProgress.setVisibility(View.GONE);
} else {
Log.d(TAG, "Loading Image...");
Expand Down Expand Up @@ -246,6 +249,7 @@ public void onGlobalLayout() {

});

detailViewProgress.progressiveStop();
detailViewProgress.setVisibility(View.GONE);

}
Expand Down
16 changes: 11 additions & 5 deletions src/in/sahildave/gazetti/news_activities/fetch/firstPost.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ public String[] getFirstPostArticle() {
articleText = articleText + temp + "\n\n";
}
}

result[0] = titleText;
result[1] = mImageURL;
result[2] = articleText;
result[3] = mArticlePubDate;

} catch (IOException e) {
e.printStackTrace();
} catch (NullPointerException npe) {
npe.printStackTrace();
articleText = null;
} catch (Exception e) {
e.printStackTrace();
}
result[0] = titleText;
result[1] = mImageURL;
result[2] = articleText;
result[3] = mArticlePubDate;

return result;

}
Expand Down
2 changes: 2 additions & 0 deletions src/in/sahildave/gazetti/util/ConfigService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ public ConfigService() {
setTheHinduElementsFromConfig(config);
setTOIElementsFromConfig(config);
setIndianExpressElementsFromConfig(config);
setFirstPostElementsFromConfig(config);
} else {
setTheHinduElementsFromConstants();
setTOIElementsFromConstants();
setIndianExpressElementsFromConstants();
setFirstPostElementsFromConstants();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
expListAdapter.setExpList(expListView);
expListView.setAdapter(expListAdapter);

System.out.println("expListAdapter - " + (null == expListAdapter));
System.out.println("expListView - " + (null == expListView));
System.out.println("listDataHeader - " + (listDataHeader.size()));
System.out.println("listDataChild - " + (listDataHeader.size()));

Button done_button = (Button) rootView.findViewById(R.id.welcome_feed_select_explist_done_button);
done_button.setOnClickListener(new OnClickListener() {
public void onClick(View next) {
Expand Down

0 comments on commit 5ff3e03

Please sign in to comment.