当前位置: 首页>>代码示例>>Java>>正文


Java SmoothProgressDrawable类代码示例

本文整理汇总了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);
}
 
开发者ID:ganesh2shiv,项目名称:yt-channel-list-android,代码行数:21,代码来源:HomeActivity.java

示例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());
}
 
开发者ID:mthahzan,项目名称:FootyNews,代码行数:27,代码来源:ViewStoryActivity.java

示例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);
    }
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:20,代码来源:DefaultHeaderTransformer.java

示例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);
    }
}
 
开发者ID:jonathangerbaud,项目名称:Klyph,代码行数:20,代码来源:DefaultHeaderTransformer.java

示例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);
    }
}
 
开发者ID:pranayairan,项目名称:CodeLessDoMore,代码行数:20,代码来源:DefaultHeaderTransformer.java

示例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);
}
 
开发者ID:davideberdin,项目名称:PARLA,代码行数:42,代码来源:ServerRequest.java

示例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();
}
 
开发者ID:2fast2fourier,项目名称:something.apk,代码行数:29,代码来源:ThreadViewFragment.java

示例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();
        }
    }

}
 
开发者ID:mthahzan,项目名称:FootyNews,代码行数:36,代码来源:SplashScreen.java

示例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);

}
 
开发者ID:artanisdesign,项目名称:ti-smoothprogressbar,代码行数:36,代码来源:SmoothProgressBarProxy.java

示例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));
}
 
开发者ID:mariotaku,项目名称:RefreshNow,代码行数:7,代码来源:RefreshNowProgressIndicator.java


注:本文中的fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。