Skip to content

Commit

Permalink
Create circular progress
Browse files Browse the repository at this point in the history
  • Loading branch information
rejasupotaro committed Nov 9, 2014
1 parent bfd2543 commit 9e59c8a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
1 change: 1 addition & 0 deletions Rebuild/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
compile 'com.joanzapata.android:android-iconify:1.0.6'
compile "com.mixpanel.android:mixpanel-android:4.2.1@aar"
compile 'uk.me.lewisdeane.ldialogs:ldialogs:1.0@aar'
compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.1'

androidTestCompile fileTree(dir: 'src/androidTest/libs', include: '*.jar')
androidTestCompile 'com.squareup:fest-android:1.0.7'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@
import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;
import rejasupotaro.rebuild.R;
import rejasupotaro.rebuild.data.models.Tweet;
import rejasupotaro.rebuild.utils.PicassoHelper;

public class TweetListAdapter extends BindableAdapter<Tweet> {
private static class ViewHolder {
public static class ViewHolder {
@InjectView(R.id.user_profile_image)
ImageView userProfileImageView;
@InjectView(R.id.created_at_text)
TextView createdAtTextView;
@InjectView(R.id.user_name_text)
TextView userNameTextView;
@InjectView(R.id.tweet_text)
TextView tweetTextView;
@InjectView(R.id.retweet_count_text)
TextView retweetCountTextView;
@InjectView(R.id.favorite_count_text)
TextView favoriteCountTextView;

public ViewHolder(View view) {
userProfileImageView = (ImageView) view.findViewById(R.id.user_profile_image);
createdAtTextView = (TextView) view.findViewById(R.id.created_at_text);
userNameTextView = (TextView) view.findViewById(R.id.user_name_text);
tweetTextView = (TextView) view.findViewById(R.id.tweet_text);
retweetCountTextView = (TextView) view.findViewById(R.id.retweet_count_text);
favoriteCountTextView = (TextView) view.findViewById(R.id.favorite_count_text);
ButterKnife.inject(this, view);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public abstract class MoreLoadListener implements AbsListView.OnScrollListener {
private boolean isFinish = false;

public MoreLoadListener(Context context, ListView listView) {
this(context, listView, View.inflate(context, R.layout.list_item_progress, null));
this(context, listView, View.inflate(context, R.layout.list_footer_progress, null));
}

public MoreLoadListener(Context context, ListView listView, View footerView) {
Expand Down
27 changes: 27 additions & 0 deletions Rebuild/src/main/res/layout/list_footer_progress.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/spacing_large">

<fr.castorflex.android.circularprogressbar.CircularProgressBar xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/progress"
android:layout_width="40dp"
android:layout_height="40dp"
android:indeterminate="true"
app:cpb_color="@color/light_gray"
app:cpb_max_sweep_angle="300"
app:cpb_min_sweep_angle="10"
app:cpb_rotation_speed="1.0"
app:cpb_stroke_width="4dp"
app:cpb_sweep_speed="1.0" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_toRightOf="@+id/progress"
android:text="@string/loading" />
</LinearLayout>
1 change: 1 addition & 0 deletions Rebuild/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<string name="activity_recent_changes">Recent Changes</string>
<string name="activity_licenses">OSS Licenses</string>

<string name="loading">Loading...</string>
<string name="rebuild_description">A Podcast by Tatsuhiko Miyagawa. Talking about Tech, Software Development and Gadgets.</string>
<string name="app_description">The best podcast player to listen to Rebuild.fm.</string>
<string name="copyright">Rebuild.fm for Android, Version %1$s. Copyright © 2013 by rejasupotaro</string>
Expand Down

0 comments on commit 9e59c8a

Please sign in to comment.