Skip to content

A mini elegant webview for fast easy access. Its a no frame fully customisable toolbox for complex transactions.

License

Notifications You must be signed in to change notification settings

101medialab/android-ezwebview

 
 

Repository files navigation

Advanced Webview GitHub Actions BadgeAndroid Arsenal Download

Lastest Version v1.6.4

Highlights

  • New self-explanatory API
  • Encapsulated WebContent implementation

Demo example code

Remote Repo

    repositories {
        maven { url "http://dl.bintray.com/jjhesk/maven" }
    }

Dependency

   implementation 'com.hkm.ezwebview:ezwebviewv:1.3.6'

Step 1.

please locate in the xml for the video display

                <RelativeLayout
                    android:id="@+id/framevideoplayer"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/item_height_video"
                    android:background="@color/main_background"
                    android:padding="1dp"
                    android:visibility="gone">

                    <com.hkm.ezwebview.webviewleakfix.NonLeakingWebView
                        android:id="@+id/videoplayer"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_centerInParent="true"
                        android:background="@color/main_background"
                        android:visibility="gone" />

                    <com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar               xmlns:fab="http://schemas.android.com/apk/res-auto"
                        android:id="@+id/progressloadingbarpx"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerInParent="true"
                        fab:mlpb_enable_circle_background="true"
                        fab:mlpb_inner_radius="18dp"
                        fab:mlpb_progress_color="@color/second_grey_bg"
                        fab:mlpb_show_arrow="false" />
                </RelativeLayout>

if you need to start a content display for html please also specify the xml as below:

   <RelativeLayout
                    android:id="@+id/content_article_frame"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:visibility="gone">

                    <com.hkm.ezwebview.webviewleakfix.NonLeakingWebView
                        android:id="@+id/content_block"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:visibility="gone"
                        tool:ignore="WebViewLayout" />
                </RelativeLayout>

HTML content display area

======= This is the fast simple implementation without any callbacks:

  @Override
    public void onViewCreated(View v, Bundle b) {
        initBinding(v);
        final String contentc = fromFileRaw(getActivity(), R.raw.sample_html);
        try {
            Fx9C.setup_content_block_wb(this, content_article_frame, block, contentc);
        } catch (Exception e) {
            e.printStackTrace();
        }
        // if (bloadlistenr != null)
        //   bloadlistenr.onLoad();
    }

This is the advanced implementation:

  @Override
    public void onViewCreated(View v, Bundle b) {
        initBinding(v);
        final String contentc = fromFileRaw(getActivity(), R.raw.sample_html);
        try {
            Fx9C.setup_content_block_wb(this, content_article_frame, block, contentc, new HClient.Callback() {

                @Override
                public void retrieveCookie(String cookie_string) {

                }
            }, new Runnable() {
                @Override
                public void run() {
                    ViewCompat.animate(mprogressbar).alpha(0f).withEndAction(new Runnable() {
                        @Override
                        public void run() {
                            mprogressbar.setVisibility(View.GONE);
                        }
                    });
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
        // if (bloadlistenr != null)
        //   bloadlistenr.onLoad();
    }

After enhancement

=======

Video embeded content display area

=======

 try {
            CircleProgressBar bprogressbar = (CircleProgressBar)this.findViewById(R.id.progressloadingbarpx);
            Fx9C.setup_web_video(
                    this,
                    video_frame,
                    mVideo,
                    bprogressbar,
                    video_embed_code_webvoew,
                    new HClient.Callback() {
                        @Override
                        public void startNewActivity(String s, String s1, String s2, Context context) {

                        }

                        @Override
                        public void startFeedList(String s, Context context) {

                        }

                        @Override
                        public void openUri(String s, Context context) {

                        }

                        @Override
                        public void retrieveCookie(String s) {

                        }
                    }, null);
        } catch (Exception e) {
            e.printStackTrace();
        }

License

Copyright 2015 jjHESK, HKM UNITED

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A mini elegant webview for fast easy access. Its a no frame fully customisable toolbox for complex transactions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 98.9%
  • HTML 1.1%