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


Java DefaultRetryPolicy.DEFAULT_BACKOFF_MULT属性代码示例

本文整理汇总了Java中com.android.volley.DefaultRetryPolicy.DEFAULT_BACKOFF_MULT属性的典型用法代码示例。如果您正苦于以下问题:Java DefaultRetryPolicy.DEFAULT_BACKOFF_MULT属性的具体用法?Java DefaultRetryPolicy.DEFAULT_BACKOFF_MULT怎么用?Java DefaultRetryPolicy.DEFAULT_BACKOFF_MULT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.android.volley.DefaultRetryPolicy的用法示例。


在下文中一共展示了DefaultRetryPolicy.DEFAULT_BACKOFF_MULT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInterpolation

public float getInterpolation(float t) {
    if (t == 0.0f) {
        return 0.0f;
    }
    if (t >= DefaultRetryPolicy.DEFAULT_BACKOFF_MULT) {
        return DefaultRetryPolicy.DEFAULT_BACKOFF_MULT;
    }
    float s;
    if (this._period == 0.0f) {
        this._period = 0.3f;
    }
    if (this._amplitude == 0.0f || this._amplitude < DefaultRetryPolicy.DEFAULT_BACKOFF_MULT) {
        this._amplitude = DefaultRetryPolicy.DEFAULT_BACKOFF_MULT;
        s = this._period / 4.0f;
    } else {
        s = (float) (Math.asin((double) (DefaultRetryPolicy.DEFAULT_BACKOFF_MULT / this._amplitude)) * (((double) this._period) / 6.283185307179586d));
    }
    return (float) (((((double) this._amplitude) * Math.pow(2.0d, (double) (-10.0f * t))) * Math.sin((((double) (t - s)) * 6.283185307179586d) / ((double) this._period))) + 1.0d);
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:19,代码来源:ElasticOutInterpolator.java

示例2: getInterpolation

public float getInterpolation(float t) {
    if (t == 0.0f) {
        return 0.0f;
    }
    if (t >= DefaultRetryPolicy.DEFAULT_BACKOFF_MULT) {
        return DefaultRetryPolicy.DEFAULT_BACKOFF_MULT;
    }
    float s;
    if (this._period == 0.0f) {
        this._period = 0.3f;
    }
    if (this._amplitude == 0.0f || this._amplitude < DefaultRetryPolicy.DEFAULT_BACKOFF_MULT) {
        this._amplitude = DefaultRetryPolicy.DEFAULT_BACKOFF_MULT;
        s = this._period / 4.0f;
    } else {
        s = (float) ((((double) this._period) / 6.283185307179586d) * Math.asin((double) (DefaultRetryPolicy.DEFAULT_BACKOFF_MULT / this._amplitude)));
    }
    t -= DefaultRetryPolicy.DEFAULT_BACKOFF_MULT;
    return (float) (-((Math.pow(2.0d, (double) (10.0f * t)) * ((double) this._amplitude)) * Math.sin((((double) (t - s)) * 6.283185307179586d) / ((double) this._period))));
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:20,代码来源:ElasticInInterpolator.java

示例3: runPullShadeAnimation

AnimationSequence runPullShadeAnimation(final View view) {
    view.setVisibility(View.VISIBLE);
    view.setAlpha(DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
    view.setTranslationY(0.0f);
    AnimationSequence sequence = new AnimationSequence();
    sequence.setView(view);
    sequence.setRepeat(true);
    AlphaAnimation fadeIn = new AlphaAnimation(0.0f, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
    fadeIn.setDuration(300);
    sequence.addAnimation(fadeIn);
    TranslateAnimation swipe = new TranslateAnimation(0.0f, 0.0f, 0.0f, 100.0f);
    swipe.setDuration(500);
    sequence.addAnimation(swipe);
    Animation fadeOut = new AlphaAnimation(DefaultRetryPolicy.DEFAULT_BACKOFF_MULT, 0.0f);
    fadeOut.setDuration(300);
    sequence.addAnimation(new Runnable() {
        public void run() {
            view.setTranslationY(100.0f);
        }
    }, fadeOut);
    Animation pause = new AlphaAnimation(0.0f, 0.0f);
    pause.setDuration(4000);
    sequence.addAnimation(pause, new Runnable() {
        public void run() {
            view.setTranslationY(0.0f);
        }
    });
    sequence.start();
    return sequence;
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:30,代码来源:OOBTutorialActivity.java

示例4: findIntersection

static PointF findIntersection(PointF p1, PointF p2, PointF p3, PointF p4) {
    float xD1 = p2.x - p1.x;
    float xD2 = p4.x - p3.x;
    float yD1 = p2.y - p1.y;
    float yD2 = p4.y - p3.y;
    float xD3 = p1.x - p3.x;
    float yD3 = p1.y - p3.y;
    float len1 = (float) Math.sqrt((double) ((xD1 * xD1) + (yD1 * yD1)));
    float len2 = (float) Math.sqrt((double) ((xD2 * xD2) + (yD2 * yD2)));
    if (Math.abs(((xD1 * xD2) + (yD1 * yD2)) / (len1 * len2)) == DefaultRetryPolicy.DEFAULT_BACKOFF_MULT) {
        return null;
    }
    PointF pt = new PointF(0.0f, 0.0f);
    float div = (yD2 * xD1) - (xD2 * yD1);
    float ua = ((xD2 * yD3) - (yD2 * xD3)) / div;
    float ub = ((xD1 * yD3) - (yD1 * xD3)) / div;
    pt.x = p1.x + (ua * xD1);
    pt.y = p1.y + (ua * yD1);
    xD1 = pt.x - p1.x;
    xD2 = pt.x - p2.x;
    yD1 = pt.y - p1.y;
    yD2 = pt.y - p2.y;
    float segmentLen1 = (float) (Math.sqrt((double) ((xD1 * xD1) + (yD1 * yD1))) + Math.sqrt((double) ((xD2 * xD2) + (yD2 * yD2))));
    xD1 = pt.x - p3.x;
    xD2 = pt.x - p4.x;
    yD1 = pt.y - p3.y;
    yD2 = pt.y - p4.y;
    float segmentLen2 = (float) (Math.sqrt((double) ((xD1 * xD1) + (yD1 * yD1))) + Math.sqrt((double) ((xD2 * xD2) + (yD2 * yD2))));
    if (((double) Math.abs(len1 - segmentLen1)) > 0.01d || ((double) Math.abs(len2 - segmentLen2)) > 0.01d) {
        return null;
    }
    return pt;
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:33,代码来源:GeometryUtils.java

示例5: setRequestTimeout

private void setRequestTimeout(int ms) {
    int timeout = (ms == 0) ? DefaultRetryPolicy.DEFAULT_TIMEOUT_MS : ms;

    mRetryPolicy = new DefaultRetryPolicy(timeout,
            DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
}
 
开发者ID:socoolby,项目名称:CoolClock,代码行数:7,代码来源:NetworkService.java

示例6: IrailApi

public IrailApi(Context context, IrailParser parser, IrailStationProvider stationProvider) {
    this.context = context;
    this.parser = parser;
    this.stationProvider = stationProvider;
    this.requestQueue = Volley.newRequestQueue(context);
    this.requestPolicy = new DefaultRetryPolicy(10000,
            3,
            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:9,代码来源:IrailApi.java

示例7: generateRetryPolicy

/**
 * Generate a default retry policy (30 seconds for the timeout, 1 retry maximum, 1 backoff multiplier)
 * @return a default retry policy, not null
 */
@NonNull
private static RetryPolicy generateRetryPolicy() {
    return new DefaultRetryPolicy(requestTimeout,
            DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
}
 
开发者ID:neopixl,项目名称:Spitfire,代码行数:10,代码来源:SpitfireManager.java

示例8: makeRequest

/**
 * 如果传入的tag有效,则可以通过该tag取消请求的发送
 *
 * @param request    req
 * @param requestTag tag
 */
private void makeRequest(VolleyRequest request, String requestTag) {
    if (!TextUtils.isEmpty(requestTag)) {
        request.setTag(requestTag);
    }
    // step4:放入请求队列
    RequestQueue requestQueue = VolleyManager.getInstance(mContext).getRequestQueue();
    int socketTimeout = 5000;//30 seconds - change to what you want
    RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
    request.setRetryPolicy(policy);
    requestQueue.add(request);
}
 
开发者ID:jessie345,项目名称:RealArchitecture,代码行数:17,代码来源:VolleyClient.java

示例9: callAPI

public void callAPI(View view) {
    Log.d("Action Log", "button clicked");

    RequestQueue queue = Volley.newRequestQueue(this);
    String baseURL = "http://azureml-recommend-sample-android.azurewebsites.net";//ご自身の展開した Azure Web Apps のURL を記入してください。
    String url = baseURL +  "/api/values/11";//Web application 側の API を呼び出します。この例では ID 11 の人を呼び出すことになります。


    //https://developer.android.com/intl/ja/training/volley/simple.html を参考に実装
    StringRequest apiRequest = new StringRequest(Request.Method.GET, url,
            new Response.Listener<String>() {
                @Override
                public void onResponse(String response) {
                    //成功時の出力
                    Log.d("response", response);
                }
            },
            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    //失敗時のエラー出力。
                    Log.d("response", error.toString());
                }
            });

    int custome_timeout_ms = 60000;//timeoutを60000sec(1min)に設定する為の変数
    DefaultRetryPolicy policy = new DefaultRetryPolicy(custome_timeout_ms,DefaultRetryPolicy.DEFAULT_MAX_RETRIES,DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
    apiRequest.setRetryPolicy(policy);//リトライのポリシーを設定。ここで、タイムアウトの時間を変更。

    //API 呼び出し
    queue.add(apiRequest);
}
 
开发者ID:NT-D,项目名称:AzureML_Recommend_Android,代码行数:32,代码来源:MainActivity.java

示例10: onCreate

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

    this.mContext = this;
    this.mApplicationContext = getApplicationContext();
    this.mActivity = this;

    this.volleyQueue = Volley.newRequestQueue(mContext);

    this.policy = new DefaultRetryPolicy(Constant.TimeInApplication.NET_TIMEOUT, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);

    ActivityManager.addActivity(this);
}
 
开发者ID:ChinaSunHZ,项目名称:ProjectUtils,代码行数:14,代码来源:BaseActivity.java

示例11: onAttach

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    mContext = activity.getBaseContext();
    mApplicationContext = mContext.getApplicationContext();
    mActivity = activity;

    this.volleyQueue = Volley.newRequestQueue(mContext);
    this.policy = new DefaultRetryPolicy(Constant.TimeInApplication.NET_TIMEOUT, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
}
 
开发者ID:ChinaSunHZ,项目名称:ProjectUtils,代码行数:11,代码来源:BaseFragment.java

示例12: ResetCameraAndGetImageReq

public ResetCameraAndGetImageReq(RequestQueue queue, OnGetImgListener listener)
{
    RetryPolicy retryPolicy = new DefaultRetryPolicy(
            15000,
            1,
            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
    mImageReq = new GetImage(queue, this, UrlRequestType.RESET_AND_GET_IMAGE, retryPolicy);
    mListener = listener;
}
 
开发者ID:ludwigandersson,项目名称:thermospy,代码行数:9,代码来源:ResetCameraAndGetImageReq.java

示例13: SetImgBoundsReq

public SetImgBoundsReq(RequestQueue queue, OnSetImgBoundsListener listener, Boundary bounds)
{
    mBounds = bounds;
    mListener = listener;
    mGetJsonObjectReq = new PutJsonObject(queue, this, UrlRequestType.IMG_BOUNDS, getJsonObject(), new DefaultRetryPolicy(10000, 1, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));

}
 
开发者ID:ludwigandersson,项目名称:thermospy,代码行数:7,代码来源:SetImgBoundsReq.java

示例14: CameraControlReq

public CameraControlReq(RequestQueue queue, OnCameraControlListener listener, Action cameraControlAction)
{
    mCameraControlAction = cameraControlAction;
    RetryPolicy retryPolicy = new DefaultRetryPolicy(
            15000,
            DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
            DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
    mGetJsonObjectReq = new PutJsonObject(queue, this, UrlRequestType.CAMERA_CONTROL, getJsonObject(), retryPolicy);
    mListener = listener;
}
 
开发者ID:ludwigandersson,项目名称:thermospy,代码行数:10,代码来源:CameraControlReq.java

示例15: init

protected void init() {
		initErrorListener();
		if(method==Method.POST&&params!=null&&params.size()>0&&isJsonPost){
			initListener2();
			initJson();
			return;
		}
		initListener();
		Logger.info("Request", url);
		jsonObjectRequest = new com.android.volley.toolbox.StringRequest(method, url, listener,errorListener
		){
			@Override
			protected Map<String, String> getParams() throws AuthFailureError {
				if(params!=null&&params.entrySet().size()>0){
					Logger.info("params", params.toString());
					return validFormat(params);
				}
				return super.getParams();
			}
			@Override
			public Map<String, String> getHeaders() throws AuthFailureError {
				Map<String, String> rt = NetConfig.getHeaders(isNormalPost);
				addCustomHeader(rt);
				Logger.info("headers", rt.toString());
				return rt;
			}
//			@Override
			public RetryPolicy getRetryPolicy() {
				RetryPolicy retryPolicy = new DefaultRetryPolicy(NetConfig.getConnectionTimeout(), 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
				return retryPolicy;
			}
		};
	}
 
开发者ID:simplelifetian,项目名称:GomeOnline,代码行数:33,代码来源:JsonRequest.java


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