Skip to content

Commit

Permalink
Merge pull request #36 from Thermometer/issue35
Browse files Browse the repository at this point in the history
Tried to reproduce issue #35
  • Loading branch information
castorflex committed May 19, 2014
2 parents 2d93cd0 + 5d98a23 commit efacf0c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public void onStart() {
mPocketBar.setVisibility(View.VISIBLE);
}
});
mPocketBar.progressiveStart();

findViewById(R.id.start).setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.widget.TextView;

import fr.castorflex.android.smoothprogressbar.SmoothProgressBar;
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable;

/**
* Created by castorflex on 12/1/13.
Expand All @@ -44,13 +45,31 @@ public class MakeCustomActivity extends Activity {
private int mSeparatorLength;
private int mSectionsCount;

// Temp testing vars
// ProgressBar starts visible and active
Boolean mProgressBarIsActive = true;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_custom);

mProgressBar = (SmoothProgressBar) findViewById(R.id.progressbar);
// Add CallbackListener for onStart & onStop
mProgressBar.setSmoothProgressDrawableCallbacks(new SmoothProgressDrawable.Callbacks() {
@Override
public void onStop() {
mProgressBar.setVisibility(View.GONE);
}

@Override
public void onStart() {
mProgressBar.setVisibility(View.VISIBLE);
}
});
mProgressBar.progressiveStart();

mCheckBoxMirror = (CheckBox) findViewById(R.id.checkbox_mirror);
mCheckBoxReversed = (CheckBox) findViewById(R.id.checkbox_reversed);
mCheckBoxGradients = (CheckBox) findViewById(R.id.checkbox_gradients);
Expand Down Expand Up @@ -148,7 +167,14 @@ public void onStopTrackingTouch(SeekBar seekBar) {
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setValues();
//setValues();
// Temp override onClick to stop/start the progressBar
if (mProgressBarIsActive)
mProgressBar.progressiveStop();
else
mProgressBar.progressiveStart();

mProgressBarIsActive = !mProgressBarIsActive;
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_custom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
android:indeterminateOnly="false"
android:indeterminate="true"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"/>

android:layout_marginBottom="8dp"
android:visibility="gone"/>

<LinearLayout
android:layout_width="match_parent"
Expand Down
3 changes: 2 additions & 1 deletion sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/PocketProgressBar"
android:indeterminate="true"/>
android:indeterminate="true"
android:visibility="gone"/>

<LinearLayout
android:layout_width="match_parent"
Expand Down

0 comments on commit efacf0c

Please sign in to comment.