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


Java LoadingView类代码示例

本文整理汇总了Java中io.saeid.fabloading.LoadingView的典型用法代码示例。如果您正苦于以下问题:Java LoadingView类的具体用法?Java LoadingView怎么用?Java LoadingView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onCreateView

import io.saeid.fabloading.LoadingView; //导入依赖的package包/类
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.fragment_main, container, false);
        gridview = (GridView) rootView.findViewById(R.id.gridview);
        gridview.setNumColumns(5);
        counter = 0;
        dialog = new Dialog(getContext(), android.R.style.Animation_Dialog);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        boolean isLollipop = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
        int marvel_1 = isLollipop ? R.drawable.marvel_1_lollipop : R.drawable.marvel_1;
        int marvel_2 = isLollipop ? R.drawable.marvel_2_lollipop : R.drawable.marvel_2;
        int marvel_3 = isLollipop ? R.drawable.marvel_3_lollipop : R.drawable.marvel_3;
        int marvel_4 = isLollipop ? R.drawable.marvel_4_lollipop : R.drawable.marvel_4;
        dialog.setContentView(R.layout.loading);
        mLoadingView = (LoadingView) rootView.findViewById(R.id.loading_view);
        mLoadingView.addAnimation(Color.parseColor("#FFD200"), marvel_1,
                LoadingView.FROM_LEFT);
        mLoadingView.addAnimation(Color.parseColor("#2F5DA9"), marvel_2,
                LoadingView.FROM_TOP);
        mLoadingView.addAnimation(Color.parseColor("#FF4218"), marvel_3,
                LoadingView.FROM_RIGHT);
        mLoadingView.addAnimation(Color.parseColor("#C7E7FB"), marvel_4,
                LoadingView.FROM_BOTTOM);
        dialog.setCancelable(false);
        Window window = getActivity().getWindow();

// clear FLAG_TRANSLUCENT_STATUS flag:
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

// add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

// finally change the coandroid.os.Build.ndroid.os.Build.VERandroid.os.Build.ndroid.os.Build.VERSION_CODES.LOLLIPOP) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            window.setStatusBarColor(getActivity().getResources().getColor(R.color.colorPrimaryDark));
        }


        gridview.setBackgroundColor(getResources().getColor(R.color.colorAccent));
        mRequestingLocationUpdates = false;
        mLastUpdateTime = "";

        // Update values using data stored in the Bundle.
        updateValuesFromBundle(savedInstanceState);

        // Kick off the process of building the GoogleApiClient, LocationRequest, and
        // LocationSettingsRequest objects.

        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }

        metrics = MyApplication.getInstance().getMetrics();

        urls = new String[40];
        latis = new double[40];
        longis = new double[40];
        bitmap = new Bitmap[40];
        titles = new String[40];
        // Inflate the layout for this fragment
        buildGoogleApiClient();
        createLocationRequest();
        buildLocationSettingsRequest();


        return rootView;
    }
 
开发者ID:hemant3370,项目名称:Picoroid,代码行数:71,代码来源:MainFragment.java


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