Android Open Source - road-trip Tracking Horizontal Scroll View






From Project

Back to project page road-trip.

License

The source code is released under:

Apache License

If you think the Android project road-trip listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * Copyright 2013 Romain Guy//from  w  w  w .j a  v a2  s  .c o  m
 *
 * 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.
 */

package org.curiouscreature.android.roadtrip;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.HorizontalScrollView;

public class TrackingHorizontalScrollView extends HorizontalScrollView {
    public interface OnScrollChangedListener {
        void onScrollChanged(TrackingHorizontalScrollView source, int l, int t, int oldl, int oldt);
    }

    private OnScrollChangedListener mOnScrollChangedListener;

    public TrackingHorizontalScrollView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public TrackingHorizontalScrollView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public void setOnScrollChangedListener(OnScrollChangedListener listener) {
        mOnScrollChangedListener = listener;
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);

        if (mOnScrollChangedListener != null) {
            mOnScrollChangedListener.onScrollChanged(this, l, t, oldl, oldt);
        }
    }
}




Java Source Code List

org.curiouscreature.android.roadtrip.IntroView.java
org.curiouscreature.android.roadtrip.MainActivity.java
org.curiouscreature.android.roadtrip.StateView.java
org.curiouscreature.android.roadtrip.SvgHelper.java
org.curiouscreature.android.roadtrip.TrackingHorizontalScrollView.java
org.curiouscreature.android.roadtrip.TrackingScrollView.java