تابع نمایش لودینگ   در اندروید استودیو


برای این کار از تابع زیر استفاده نمایید برای نمایش مقدار تابع رو true تنظیم کنید


@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
private void showProgress(final boolean show) {
   
// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
    // for very easy animations. If available, use these APIs to fade-in
    // the progress spinner.
   
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
       
int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);

       
mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
       
mLoginFormView.animate().setDuration(shortAnimTime).alpha(
                show ?
0 : 1).setListener(new AnimatorListenerAdapter() {
           
@Override
           
public void onAnimationEnd(Animator animation) {
               
mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
            }
        });

       
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
       
mProgressView.animate().setDuration(shortAnimTime).alpha(
                show ?
1 : 0).setListener(new AnimatorListenerAdapter() {
           
@Override
           
public void onAnimationEnd(Animator animation) {
               
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
            }
        });
    }
else {
       
// The ViewPropertyAnimator APIs are not available, so simply show
        // and hide the relevant UI components.
       
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
       
mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
    }
}

تابع نمایش لودینگ در اندروید استودیو

view ,        ,show ,{ ,} ,visible ,view visible ,setvisibility show ,show view ,view gone ,build version ,@override             public ,void onanimationend animator ,onanimationend animator animation ,        mprogressview setvisibility

مشخصات

آخرین ارسال ها

آخرین جستجو ها


سایت تخخصی اپل آیدی آنتیک کالا mahyargamer هر چی که بخوای hashem21 یادداشت های روزانه یک برنامه نویس مطالب اینترنتی مطالب اینترنتی کارآفر اینجا حیدرآباد است...