本文整理汇总了Java中fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable类的典型用法代码示例。如果您正苦于以下问题:Java SmoothProgressDrawable类的具体用法?Java SmoothProgressDrawable怎么用?Java SmoothProgressDrawable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SmoothProgressDrawable类属于fr.castorflex.android.smoothprogressbar包,在下文中一共展示了SmoothProgressDrawable类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
private void initView() {
mView = (CoordinatorLayout) findViewById(R.id.coordinator_layout);
mPocketBar = (SmoothProgressBar) findViewById(R.id.pocketProgressBar);
mPocketBar.setSmoothProgressDrawableCallbacks(new SmoothProgressDrawable.Callbacks() {
@Override
public void onStop() {
mPocketBar.setVisibility(View.INVISIBLE);
}
@Override
public void onStart() {
mPocketBar.setVisibility(View.VISIBLE);
}
});
fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(this);
mSnackbar = Snackbar.make(mView, getString(R.string.fetch_token_msg), Snackbar.LENGTH_INDEFINITE);
}
示例2: onCreate
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_story);
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
width = size.x;
db = new DatabaseHandler(this);
funcs = new NetworkFunctions();
pref = new SharedPref(this);
layout = (RelativeLayout)findViewById(R.id.view_story_progress_layout);
progressBar = (SmoothProgressBar)findViewById(R.id.pocket_view_story);
progressBar.setSmoothProgressDrawableBackgroundDrawable(SmoothProgressBarUtils.generateDrawableWithColors(getResources().getIntArray(R.array.pocket_background_colors), ((SmoothProgressDrawable) progressBar.getIndeterminateDrawable()).getStrokeWidth()));
dwn_txt = (TextView)findViewById(R.id.dwn_txt_view_story);
storyBody = (TextView)findViewById(R.id.news_body);
storyImage = (ImageView)findViewById(R.id.story_image);
headline = (TextView)findViewById(R.id.news_headline);
new GetArticleInfo().execute(pref.getSelectedNews());
}
示例3: applyProgressBarSettings
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
private void applyProgressBarSettings() {
if (mHeaderProgressBar != null) {
final int strokeWidth = mHeaderProgressBar.getResources()
.getDimensionPixelSize(R.dimen.ptr_progress_bar_stroke_width);
mHeaderProgressBar.setIndeterminateDrawable(
new SmoothProgressDrawable.Builder(mHeaderProgressBar.getContext())
.color(mProgressDrawableColor)
.strokeWidth(strokeWidth)
.build());
ShapeDrawable shape = new ShapeDrawable();
shape.setShape(new RectShape());
shape.getPaint().setColor(mProgressDrawableColor);
ClipDrawable clipDrawable = new ClipDrawable(shape, Gravity.CENTER, ClipDrawable.HORIZONTAL);
mHeaderProgressBar.setProgressDrawable(clipDrawable);
}
}
示例4: applyProgressBarSettings
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
private void applyProgressBarSettings() {
if (mHeaderProgressBar != null) {
final int strokeWidth = mHeaderProgressBar.getResources()
.getDimensionPixelSize(R.dimen.ptr_progress_bar_stroke_width);
mHeaderProgressBar.setIndeterminateDrawable(
new SmoothProgressDrawable.Builder(mHeaderProgressBar.getContext())
.color(mProgressDrawableColor)
.width(strokeWidth)
.build());
ShapeDrawable shape = new ShapeDrawable();
shape.setShape(new RectShape());
shape.getPaint().setColor(mProgressDrawableColor);
ClipDrawable clipDrawable = new ClipDrawable(shape, Gravity.CENTER, ClipDrawable.HORIZONTAL);
mHeaderProgressBar.setProgressDrawable(clipDrawable);
}
}
示例5: applyProgressBarSettings
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
private void applyProgressBarSettings() {
if (mHeaderProgressBar != null) {
final int strokeWidth = mHeaderProgressBar.getResources()
.getDimensionPixelSize(R.dimen.ptr_progress_bar_stroke_width);
mHeaderProgressBar.setIndeterminateDrawable(
new SmoothProgressDrawable.Builder(mHeaderProgressBar.getContext())
.color(mProgressDrawableColor)
.build());
ShapeDrawable shape = new ShapeDrawable();
shape.setShape(new RectShape());
shape.getPaint().setColor(mProgressDrawableColor);
ClipDrawable clipDrawable = new ClipDrawable(shape, Gravity.CENTER, ClipDrawable.HORIZONTAL);
mHeaderProgressBar.setProgressDrawable(clipDrawable);
}
}
示例6: ServerRequest
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
/**
* Server request - Params in this order: params[0] = Title, params[1] = Message
*
* @param activity
* @param params
*/
public ServerRequest(Activity activity, String... params) {
Activity currentActivity = activity;
this.progressDialog = new ProgressDialog(currentActivity);
this.progressDialog.setIndeterminateDrawable(new SmoothProgressDrawable.Builder(activity.getApplicationContext())
.color(Color.BLUE)
.interpolator(new DecelerateInterpolator())
.sectionsCount(4)
.separatorLength(8) //You should use Resources#getDimensionPixelSize
.strokeWidth(8f) //You should use Resources#getDimension
.speed(2f) //2 times faster
.progressiveStartSpeed(2)
.progressiveStopSpeed(3.4f)
.reversed(false)
.mirrorMode(false)
.progressiveStart(true)
.build());
this.progressDialog.setIndeterminate(true);
// For recording part
if (params.length > 0) {
String title = params[0];
String message = params[1];
this.progressDialog.setTitle(title);
this.progressDialog.setMessage(message);
} else {
this.progressDialog.setTitle("Processing");
this.progressDialog.setMessage("Please wait...");
}
this.progressDialog.setCancelable(false);
this.progressDialog.setCanceledOnTouchOutside(false);
}
示例7: onViewCreated
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
@Override
public void onViewCreated(Activity activity, View headerView) {
int[] ptrColorArray = getResources().getIntArray(SomeTheme.getThemeResource(getActivity(), R.attr.progressBarColorArray, R.array.sbp_colors_light));
nextPageColor = SomeTheme.getThemeColor(getActivity(), R.attr.progressBarColor, Color.rgb(20,146,204));
refreshColor = SomeTheme.getThemeColor(getActivity(), R.attr.progressBarColorRefresh, Color.rgb(190, 190, 190));
final int strokeWidth = getResources().getDimensionPixelSize(R.dimen.pull_to_refresh_stroke);
if(ptrColorArray != null){
pfbProgressbar.setIndeterminateDrawable(
new SmoothProgressDrawable.Builder(getActivity())
.colors(ptrColorArray)
.sectionsCount(6)
.separatorLength(0)
.strokeWidth(strokeWidth)
.build()
);
}else{
pfbProgressbar.setIndeterminateDrawable(
new SmoothProgressDrawable.Builder(getActivity())
.color(nextPageColor)
.sectionsCount(6)
.separatorLength(0)
.strokeWidth(strokeWidth)
.build());
}
updateHeaderState();
}
示例8: onCreate
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
db = new DatabaseHandler(this);
mPocketBar = (SmoothProgressBar) findViewById(R.id.pocket);
mPocketBar.setSmoothProgressDrawableBackgroundDrawable(SmoothProgressBarUtils.generateDrawableWithColors(getResources().getIntArray(R.array.pocket_background_colors), ((SmoothProgressDrawable) mPocketBar.getIndeterminateDrawable()).getStrokeWidth()));
dwntext = (TextView)findViewById(R.id.dwn_txt);
fadeIn = AnimationUtils.loadAnimation(this, R.anim.abc_fade_in);
fadeOut = AnimationUtils.loadAnimation(this, R.anim.abc_fade_out);
pushLeftIn = AnimationUtils.loadAnimation(this, R.anim.push_left_in);
pushLeftOut = AnimationUtils.loadAnimation(this, R.anim.push_left_out);
pushRightIn = AnimationUtils.loadAnimation(this, R.anim.push_right_in);
pushRightOut = AnimationUtils.loadAnimation(this, R.anim.push_right_out);
if(isNetworkAvailable()){
db.clearTempTables();
new LoadInitialData().execute();
} else {
//Proceed to offline reading activity
if(db.offlineAvailable()){
startActivity(new Intent(this, ViewOfflineActivity.class));
overridePendingTransition(R.anim.push_left_in, R.anim.fadeout);
finish();
} else {
Toast.makeText(SplashScreen.this, "Please turn on mobile data or WiFi", Toast.LENGTH_SHORT).show();
monitorNetwork();
}
}
}
示例9: ExampleView
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
public ExampleView(TiViewProxy proxy) {
super(proxy);
String packageName = proxy.getActivity().getPackageName();
Resources resources = proxy.getActivity().getResources();
View progressBarWrapper;
int resId_progressBarHolder = -1;
int resId_progressBar = -1;
resId_progressBarHolder = resources.getIdentifier(
"progressbar_layout", "layout", packageName);
resId_progressBar = resources.getIdentifier("progressbar_default",
"id", packageName);
LayoutInflater inflater = LayoutInflater.from(getActivity());
progressBarWrapper = inflater
.inflate(resId_progressBarHolder, null);
progressBar = (ProgressBar) progressBarWrapper
.findViewById(resId_progressBar);
TiApplication appContext = TiApplication.getInstance();
progressBar
.setIndeterminateDrawable(new SmoothProgressDrawable.Builder(
appContext).sectionsCount(sectionsCount)
.separatorLength(separatorLength).speed(speed)
.mirrorMode(mirrorMode).reversed(reversed)
.color(color).strokeWidth(strokeWidth)
.interpolator(interpolator).build());
setNativeView(progressBarWrapper);
}
示例10: Builder
import fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable; //导入依赖的package包/类
public Builder(final Context context) {
indeterminateDrawableBuilder = new SmoothProgressDrawable.Builder(context);
final Resources res = context.getResources();
progressColor(res.getColor(R.color.spb_default_color));
progressStrokeWidth(res.getDimensionPixelSize(R.dimen.spb_default_stroke_width));
}