Skip to content

Commit

Permalink
Add circle indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
Raduh committed Jul 21, 2014
1 parent f908f05 commit 38b95d9
Show file tree
Hide file tree
Showing 15 changed files with 791 additions and 8 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------------------

*The Navigation indicator is licensed by Patrik Akerfeldt and Jake Wharton
under Apache License, Version 2.0. A copy of the Apache license, version 2.0
can be found at:

http://www.apache.org/licenses/LICENSE-2.0

--------------------------------------------------------------------------------
*All graphic assets are licensed by TobyRich GmbH under the
Creative Commons Attribution-NonCommercial 4.0 International License. This
specifies the following:
Expand Down
1 change: 1 addition & 0 deletions SmartPlane/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ android {

dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile project(':indicator-library')
compile files('libs/dd-plist.jar')
compile files('libs/LibSmartlink.jar')
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
import com.tobyrich.app.SmartPlane.util.Const;
import com.tobyrich.app.SmartPlane.util.MeteoTask;
import com.tobyrich.app.SmartPlane.util.Util;
import com.viewpagerindicator.CirclePageIndicator;

import lib.smartlink.BluetoothDisabledException;

Expand Down Expand Up @@ -108,11 +109,14 @@ protected void onCreate(Bundle savedInstanceState) {

// Instantiate a ViewPager and a PagerAdapter
ViewPager screenPager = (ViewPager) findViewById(R.id.screenPager);
PagerAdapter pageAdapter = new ScreenSlideAdapter();
screenPager.setAdapter(pageAdapter);
screenPager.setAdapter(new ScreenSlideAdapter());

CirclePageIndicator screenIndicator =
(CirclePageIndicator) findViewById(R.id.screenIndicator);
screenIndicator.setViewPager(screenPager);

screenPager.setCurrentItem(1); // horizon screen
screenPager.setOffscreenPageLimit(2);

}

@Override
Expand Down
21 changes: 18 additions & 3 deletions SmartPlane/src/main/res/layout/activity_fullscreen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,30 @@
android:layout_height="fill_parent"
android:layout_above="@id/controlPanel">

<android.support.v4.view.ViewPager
android:id="@+id/screenPager"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v4.view.ViewPager
android:id="@+id/screenPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<com.viewpagerindicator.CirclePageIndicator
android:id="@+id/screenIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp"
android:padding="10dip" />
</RelativeLayout>

<ImageView
android:id="@+id/imgHorizonCover"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="right|center_vertical"
android:contentDescription="@string/desc_horizonBorder"
android:scaleType="fitXY"
android:src="@drawable/cover" />
Expand Down
2 changes: 1 addition & 1 deletion SmartPlane/src/main/res/layout/plane_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="3dp"
android:layout_marginBottom="12dp"
android:background="@color/dark_green"
android:padding="5dp">

Expand Down
22 changes: 22 additions & 0 deletions indicator-library/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apply plugin: 'android-library'

android {
compileSdkVersion 18
buildToolsVersion "19.1.0"

defaultConfig {
applicationId "com.viewpagerindicator"
minSdkVersion 18
}

buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

dependencies {
compile 'com.android.support:support-v4:19.1.0'
}
9 changes: 9 additions & 0 deletions indicator-library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.viewpagerindicator"
android:versionCode="65"
android:versionName="2.4.1">

<uses-sdk android:minSdkVersion="4" />
</manifest>
Loading

0 comments on commit 38b95d9

Please sign in to comment.