| 23410 |
tejbeer |
1 |
/*
|
|
|
2 |
* Copyright (C) 2011 Patrik Akerfeldt
|
|
|
3 |
* Copyright (C) 2011 Jake Wharton
|
|
|
4 |
*
|
|
|
5 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
6 |
* you may not use this file except in compliance with the License.
|
|
|
7 |
* You may obtain a copy of the License at
|
|
|
8 |
*
|
|
|
9 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
10 |
*
|
|
|
11 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
12 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
13 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
14 |
* See the License for the specific language governing permissions and
|
|
|
15 |
* limitations under the License.
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
package com.viewpagerindicator;
|
|
|
19 |
|
|
|
20 |
import android.support.v4.view.ViewPager;
|
|
|
21 |
|
|
|
22 |
/**
|
|
|
23 |
* A PageIndicator is responsible to show an visual indicator on the total views
|
|
|
24 |
* number and the current visible view.
|
|
|
25 |
*/
|
|
|
26 |
public interface PageIndicator extends ViewPager.OnPageChangeListener {
|
|
|
27 |
/**
|
|
|
28 |
* Bind the indicator to a ViewPager.
|
|
|
29 |
*
|
|
|
30 |
* @param view
|
|
|
31 |
*/
|
|
|
32 |
void setViewPager(ViewPager view);
|
|
|
33 |
|
|
|
34 |
/**
|
|
|
35 |
* Bind the indicator to a ViewPager.
|
|
|
36 |
*
|
|
|
37 |
* @param view
|
|
|
38 |
* @param initialPosition
|
|
|
39 |
*/
|
|
|
40 |
void setViewPager(ViewPager view, int initialPosition);
|
|
|
41 |
|
|
|
42 |
/**
|
|
|
43 |
* <p>Set the current page of both the ViewPager and indicator.</p>
|
|
|
44 |
*
|
|
|
45 |
* <p>This <strong>must</strong> be used if you need to set the page before
|
|
|
46 |
* the views are drawn on screen (e.g., default start page).</p>
|
|
|
47 |
*
|
|
|
48 |
* @param item
|
|
|
49 |
*/
|
|
|
50 |
void setCurrentItem(int item);
|
|
|
51 |
|
|
|
52 |
/**
|
|
|
53 |
* Set a page change listener which will receive forwarded events.
|
|
|
54 |
*
|
|
|
55 |
* @param listener
|
|
|
56 |
*/
|
|
|
57 |
void setOnPageChangeListener(ViewPager.OnPageChangeListener listener);
|
|
|
58 |
|
|
|
59 |
/**
|
|
|
60 |
* Notify the indicator that the fragment list has changed.
|
|
|
61 |
*/
|
|
|
62 |
void notifyDataSetChanged();
|
|
|
63 |
}
|