Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"binding" issues #1

@mpa-rochester

Description

@mpa-rochester

New to github; not sure if this is the right way to ask a question...

I've copied the source code for scroll2d-tut and am trying to build the app (in my own library). I have several questions...
I proceeding iteratively as in the video. When I nest a vertical ScrollView inside a horizontal ScrollView, the app behaves as expected (horizontal or vertical scrolling, but no "diagonal" scrolling).

When I try to introduce the OuterHorizontalScrollView I have problems.

  1. I tried using OuterHorizontalScrollView without the "binding" statements in my main activity. The "bigpic" appears, but, the app crashes when I touch the screen with a
    "NullPointerException: Attempt to invoke virtual method 'boolean android.widget.ScrollView.onInterceptTouchEvent(android.view.MotionEvent)' on a null object reference" (the scrollView.onInterceptTouchEvent statement)

  2. Thinking that was surely due to the missing "binding" statements in the main activity, I added then, but I can't compile the app due to "cannot resolve symbol" errors on "import android.databinding.DataBindingUtil" and "ActivityScrollBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
    binding.horizontal.scrollView = binding.vertical;"
    I have no idea what to do, as I can't find any reference when I google "android studio activityscrollbinding", so I don't know where to go next for information. Have you any suggestions?

  3. Final question... After updating the methods in the OuterHorizontalScrollView, you said "now I just have to hook up this reference", referring to the "public ScrollView scrollview" statement, and it sounded like you pressed a couple keys, but I don't know what you actually did. Can you tell me?

Thank you!

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions