android.support.v7.widget.ViewStubCompat的实例源码

项目:eazycore    文件:BaseMainWithDataFragment.java   
@Nullable
@Override
public View onCreateView(LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState) {
    View view = super.onCreateView(inflater,container,savedInstanceState);

    rootLayout = (LinearLayout) rootView.findViewById(R.id.root_layout);
    replaceLayout = (ViewStubCompat) rootView.findViewById(R.id.replace_layout);
    multiStateView = (MultiStateView) rootView.findViewById(R.id.multiStateView);
    if (inflateExtraView() != -1) {
        replaceLayout.setLayoutResource(inflateExtraView());
        replaceLayout.inflate();
    }
    swipeRefresh = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefresh);
    swipeRefresh.setOnRefreshListener(onRefreshListener());

    multiStateView.setStateListener(onStateListener());
    return view;
}
项目:EazyBaseMVP    文件:BaseMainWithDataFragment.java   
@Nullable
@Override
public View onCreateView(LayoutInflater inflater,savedInstanceState);

    rootLayout = (LinearLayout) rootView.findViewById(R.id.root_layout);
    replaceLayout = (ViewStubCompat) rootView.findViewById(R.id.replace_layout);
    multiStateView = (MultiStateView) rootView.findViewById(R.id.multiStateView);
    if (inflateExtraView() != -1) {
        replaceLayout.setLayoutResource(inflateExtraView());
        replaceLayout.inflate();
    }
    swipeRefresh = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefresh);
    swipeRefresh.setOnRefreshListener(onRefreshListener());

    multiStateView.setStateListener(onStateListener());
    return view;
}
项目:mimi-reader    文件:GalleryImageBase.java   
public void inflateLayout(@LayoutRes int res,ViewStubCompat.OnInflateListener listener) {
    if (viewStub != null) {
        if (listener != null) {
            viewStub.setOnInflateListener(listener);
        }

        viewStub.setLayoutResource(res);
        viewStub.inflate();
    }
}
项目:EasyIntro    文件:EasyIntroCarouselFragment.java   
private void addIndicator() {
    if (mIndicatorRes != -1) {
        ViewStubCompat viewStub = (ViewStubCompat) mIndicatorsContainer.findViewById(R.id.pageIndicator);
        viewStub.setLayoutResource(mIndicatorRes);
        viewStub.setOnInflateListener(new ViewStubCompat.OnInflateListener() {
            @Override
            public void onInflate(ViewStubCompat stub,View inflated) {
                setViewPagerToPageIndicator();
            }
        });
        View view = viewStub.inflate();
        view.setVisibility(mPageIndicatorVisibility ? View.VISIBLE : View.GONE);
    }
}
项目:eazycore    文件:BaseMainWithDataFragment.java   
public ViewStubCompat getReplaceLayout() {
    return replaceLayout;
}
项目:EazyBaseMVP    文件:BaseMainWithDataFragment.java   
public ViewStubCompat getReplaceLayout() {
    return replaceLayout;
}
项目:mimi-reader    文件:GalleryImageBase.java   
@Override
public void onViewCreated(View view,@Nullable Bundle savedInstanceState) {
    super.onViewCreated(view,savedInstanceState);

    if (view == null || !defaultLayout || getArguments() == null) {
        return;
    }

    viewStub = (ViewStubCompat) view.findViewById(R.id.view_stub);
    progressBar = (ProgressBar) view.findViewById(R.id.progress_bar);

    final String protocol = MimiUtil.httpOrHttps(getActivity());
    final String baseUrl = getString(R.string.image_link);
    final String basePath = getString(R.string.full_image_path,boardName,tim,fileExt);
    imageUrl = protocol + baseUrl + basePath;

    downloadTask = new DownloadThread(getImageFileLocation(),imageUrl);
    downloadTask.setProgressListener(new DownloadThread.ProgressListener() {
        @Override
        public void onProgressUpdate(int progress) {
            progressBar.setProgress(progress);
        }

        @Override
        public void onComplete(final String filePath) {
            Log.i(LOG_TAG,"Finished downloading image: location=" + filePath);
            if (!TextUtils.isEmpty(filePath) && getActivity() != null) {

                if (progressBar != null) {
                    progressBar.setVisibility(View.GONE);
                }

                imageFile = new File(filePath);
                displayImage(imageFile,getUserVisibleHint());


            }
        }
    });
    downloadTask.setErrorListener(new DownloadThread.ErrorListener() {
        @Override
        public void onError() {
            Log.e(LOG_TAG,"Error downloading file");
        }
    });

    downloadTask.start();
}
项目:EasyIntro    文件:EasyIntroCarouselFragment.java   
private void inflateIndicatorContainer(final View view) {
    final ViewStubCompat indicatorContainerStub = (ViewStubCompat) view.findViewById(R.id.indicatorContainer);

    // set gravity
    FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) indicatorContainerStub.getLayoutParams();
    params.gravity = mIndicatorContainerGravity;
    indicatorContainerStub.setLayoutParams(params);

    indicatorContainerStub.setLayoutResource(mIndicatorContainer);
    indicatorContainerStub.setOnInflateListener(new ViewStubCompat.OnInflateListener() {
        @Override
        public void onInflate(ViewStubCompat stub,View inflated) {
            // there must be predefined ids
            if (inflated.findViewById(R.id.leftIndicator) == null) {
                throw new RuntimeException(getString(R.string.exception_left_indicator_id));
            } else if (inflated.findViewById(R.id.rightIndicator) == null) {
                throw new RuntimeException(getString(R.string.exception_right_indicator_id));
            } else if (inflated.findViewById(R.id.pageIndicator) == null) {
                throw new RuntimeException(getString(R.string.exception_page_indicator_id));
            }
            // check indicators instanceof
            else if (!(inflated.findViewById(R.id.leftIndicator) instanceof LeftToggleIndicator)) {
                throw new RuntimeException(getString(R.string.exception_previous_indicator_instanceof));
            } else if (!(inflated.findViewById(R.id.rightIndicator) instanceof RightToggleIndicator)) {
                throw new RuntimeException(getString(R.string.exception_next_indicator_instanceof));
            }

            mIndicatorsContainer = inflated;

            // must be initialized after inflating indicator container
            mRightIndicator = (RightToggleIndicator) mIndicatorsContainer.findViewById(R.id.rightIndicator);
            mLeftIndicator = (LeftToggleIndicator) mIndicatorsContainer.findViewById(R.id.leftIndicator);
            mRightIndicator.setListener(EasyIntroCarouselFragment.this);
            mRightIndicator.withDisabled(mRightIndicatorEnabled);
            mLeftIndicator.setListener(EasyIntroCarouselFragment.this);
            mLeftIndicator.withDisabled(mLeftIndicatorEnabled);

            addIndicator();
            updateToggleIndicators();
        }
    });
    indicatorContainerStub.inflate();
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


com.google.gson.internal.bind.ArrayTypeAdapter的实例源码
com.google.gson.JsonSyntaxException的实例源码
com.google.gson.JsonDeserializer的实例源码
com.google.gson.internal.ConstructorConstructor的实例源码
com.google.gson.JsonPrimitive的实例源码
com.google.gson.LongSerializationPolicy的实例源码
com.google.gson.internal.GsonInternalAccess的实例源码
com.google.gson.JsonIOException的实例源码
com.google.gson.internal.StringMap的实例源码
com.google.gson.JsonObject的实例源码
com.google.gson.internal.bind.TimeTypeAdapter的实例源码
com.google.gson.FieldAttributes的实例源码
com.google.gson.internal.bind.TreeTypeAdapter的实例源码
com.google.gson.internal.LinkedHashTreeMap的实例源码
com.google.gson.TypeAdapterFactory的实例源码
com.google.gson.JsonSerializer的实例源码
com.google.gson.FieldNamingPolicy的实例源码
com.google.gson.JsonElement的实例源码
com.google.gson.internal.JsonReaderInternalAccess的实例源码
com.google.gson.TypeAdapter的实例源码