/*
 * Copyright 2016 Philip Cohn-Cort
 *
 * 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 com.fuzz.indicator.text;

import android.support.annotation.NonNull;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.widget.TextView;

import com.fuzz.indicator.IndicatorViewHolder;
import com.fuzz.indicator.OffSetters;

/**
 * Simple indicator implementation for TextViews.
 *
 * @author Philip Cohn-Cort (Fuzz)
 */
public class LayeredTextViewHolder extends IndicatorViewHolder<TextView> {

    public LayeredTextViewHolder(@NonNull TextView child) {
        super(child);
    }

    @Override
    public void offsetContentBy(int orientation, float percentage) {
        CharSequence text = itemView.getText();
        if (text instanceof Spanned) {
            Spannable spannable;
            if (text instanceof Spannable) {
                spannable = (Spannable) text;
            } else {
                // The SpannableString constructor will copy over pre-existing spans,
                // so no need to worry about losing state.
                spannable = new SpannableString(text);
            }
            OffSetters.offsetSpansBy(spannable, orientation, percentage);
            itemView.setText(spannable);
        }
    }
}

@@ -885,16 +885,103 @@
 Setters;
+%0Aimport com.fuzz.indicator.OffsetEvent;%0Aimport com.fuzz.indicator.ViewPagerOffsetEvent;
 %0A%0A/**%0A *
@@ -1894,11 +1894,278 @@
  %7D%0A    %7D
+%0A%0A    @Override%0A    public void offsetContentBy(OffsetEvent event) %7B%0A        if (event instanceof ViewPagerOffsetEvent) %7B%0A            ViewPagerOffsetEvent ev = (ViewPagerOffsetEvent) event;%0A            offsetContentBy(ev.orientation(), ev.fraction());%0A        %7D%0A    %7D
 %0A%7D%0A

Add missing method implementation