Search in sources :

Example 1 with ObservableWebView

use of com.github.ksoichiro.android.observablescrollview.ObservableWebView in project Android-ObservableScrollView by ksoichiro.

the class WebViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_webview);
    ObservableWebView scrollable = (ObservableWebView) findViewById(R.id.scrollable);
    scrollable.setScrollViewCallbacks(this);
    scrollable.loadUrl("file:///android_asset/lipsum.html");
}
Also used : ObservableWebView(com.github.ksoichiro.android.observablescrollview.ObservableWebView)

Example 2 with ObservableWebView

use of com.github.ksoichiro.android.observablescrollview.ObservableWebView in project Android-ObservableScrollView by ksoichiro.

the class SlidingUpWebViewActivity method createScrollable.

@Override
protected ObservableWebView createScrollable() {
    ObservableWebView webView = (ObservableWebView) findViewById(R.id.scroll);
    webView.setScrollViewCallbacks(this);
    webView.loadUrl("file:///android_asset/lipsum.html");
    return webView;
}
Also used : ObservableWebView(com.github.ksoichiro.android.observablescrollview.ObservableWebView)

Example 3 with ObservableWebView

use of com.github.ksoichiro.android.observablescrollview.ObservableWebView in project Android-ObservableScrollView by ksoichiro.

the class StickyHeaderWebViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_stickyheaderwebview);
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
    mHeaderView = findViewById(R.id.header);
    ViewCompat.setElevation(mHeaderView, getResources().getDimension(R.dimen.toolbar_elevation));
    mToolbarView = findViewById(R.id.toolbar);
    mScrollView = (ObservableScrollView) findViewById(R.id.scroll);
    mScrollView.setScrollViewCallbacks(mScrollViewScrollCallbacks);
    ObservableWebView mWebView = (ObservableWebView) findViewById(R.id.web);
    mWebView.setScrollViewCallbacks(mWebViewScrollCallbacks);
    mWebView.loadUrl("file:///android_asset/lipsum.html");
}
Also used : ObservableWebView(com.github.ksoichiro.android.observablescrollview.ObservableWebView)

Example 4 with ObservableWebView

use of com.github.ksoichiro.android.observablescrollview.ObservableWebView in project Android-ObservableScrollView by ksoichiro.

the class ToolbarControlWebViewActivity method createScrollable.

@Override
protected ObservableWebView createScrollable() {
    ObservableWebView webView = (ObservableWebView) findViewById(R.id.scrollable);
    webView.loadUrl("file:///android_asset/lipsum.html");
    return webView;
}
Also used : ObservableWebView(com.github.ksoichiro.android.observablescrollview.ObservableWebView)

Example 5 with ObservableWebView

use of com.github.ksoichiro.android.observablescrollview.ObservableWebView in project Android-ObservableScrollView by ksoichiro.

the class ViewPagerTabFragmentWebViewFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_webview, container, false);
    final ObservableWebView webView = (ObservableWebView) view.findViewById(R.id.scroll);
    webView.loadUrl("file:///android_asset/lipsum.html");
    Fragment parentFragment = getParentFragment();
    ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
    if (viewGroup != null) {
        webView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
        if (parentFragment instanceof ObservableScrollViewCallbacks) {
            webView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
        }
    }
    return view;
}
Also used : ViewGroup(android.view.ViewGroup) ObservableWebView(com.github.ksoichiro.android.observablescrollview.ObservableWebView) ObservableScrollViewCallbacks(com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks) View(android.view.View) ObservableWebView(com.github.ksoichiro.android.observablescrollview.ObservableWebView) Fragment(android.support.v4.app.Fragment)

Aggregations

ObservableWebView (com.github.ksoichiro.android.observablescrollview.ObservableWebView)11 View (android.view.View)3 ObservableScrollViewCallbacks (com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks)3 Activity (android.app.Activity)2 Fragment (android.support.v4.app.Fragment)1 ViewGroup (android.view.ViewGroup)1