Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit e71fd15b01f4376ff626db54d18170f47c0ec9e7 unknown committed Nov 23, 2011
@@ -0,0 +1,8 @@
+#Android generated
+bin
+gen
+
+#Eclipse
+.project
+.classpath
+.settings
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.astuetz.viewpager.extensions"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk android:minSdkVersion="4" />
+</manifest>
132 README.md
@@ -0,0 +1,132 @@
+ViewPagerExtensions
+===================
+
+Some custom views for indicating the current position
+of a ViewPager from the [Android Support Package][1]
+
+![ViewPagerTabs Screenshots][7]
+
+
+
+Usage
+=====
+
+For an example of how to use this, see [android-viewpagertabs-example][3]
+
+ 1. Including In Your Project
+
+ This is an Android library project, you can include it by referencing it as a library project in
+ Eclipse or ant.
+
+ This project depends on the `ViewPager` class which is available in the Android Support Package.
+ *IMPORTANT* Make sure to use the latest version of the Support Package!
+
+ 2. Include com.astuetz.viewpagertabs.ViewPagerTabs in your view.
+
+ <com.astuetz.viewpagertabs.ViewPagerTabs
+ android:id="@+id/tabs"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="#FF3B3B3B" />
+
+ If you want to add a colored line below the tabs, use something like this:
+
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="2dip"
+ android:background="#FF91A438" />
+
+ And then your ViewPager:
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/pager"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" />
+
+ 3. In your Activity, bind the ViewPager to the ViewPagerTabs in the `onCreate` method.
+
+ // Set the pager with an adapter
+ ViewPager pager = (ViewPager) findViewById(R.id.pager);
+ pager.setAdapter(new ExampleAdapter(this));
+
+ // Bind the ViewPager to ViewPagerTabs
+ ViewPagerTabs tabs = (ViewPagerTabs) findViewById(R.id.tabs);
+ tabs.setViewPager(pager);
+
+ *Note*: The adapter of the ViewPager has to implement `ViewPagerTabProvider`.
+
+
+Styling
+=======
+
+You can customize the tabs either by xml-attributes or by setter-methods:
+
+ 1. Customize by XML-attributes:
+
+ <com.astuetz.viewpagertabs.ViewPagerTabs
+ android:id="@+id/tabs"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ app:backgroundColorPressed="#55333E73"
+ app:textColor="#D8D8D8"
+ app:textColorCenter="#FFFC7F"
+ app:lineColorCenter="#FFFC7F"
+ app:lineHeight="4dip"
+ app:tabPaddingLeft="15dip"
+ app:tabPaddingRight="15dip"
+ app:tabPaddingBottom="2dip"
+ app:tabPaddingTop="5dip"
+ app:textSize="12sp" />
+
+ *Note*: Don't forget to define the namespace: xmlns:app="http://schemas.android.com/apk/res/your.package.name"
+
+ 2. Customize by setter-methods:
+
+ ViewPagerTabs tabs = (ViewPagerTabs) findViewById(R.id.tabs);
+
+ tabs.setBackgroundColor(0x00FFFFFF);
+ tabs.setBackgroundColorPressed(0x33333333);
+ tabs.setTextColor(0x44A80000);
+ tabs.setTextColorCenter(0xFFA80000);
+ tabs.setLineColorCenter(0xFFA80000);
+ tabs.setLineHeight(5);
+ tabs.setTextSize(22);
+ tabs.setTabPadding(5, 1, 5, 10);
+
+
+
+Developed By
+============
+
+ * Andreas St&uuml;tz - <andreas.stuetz@gmail.com>
+
+
+
+License
+=======
+
+ Copyright 2011 Andreas Stuetz <andreas.stuetz@gmail.com>
+
+ 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.
+
+
+
+
+
+
+ [1]: http://developer.android.com/sdk/compatibility-library.html
+ [3]: https://github.com/astuetz/android-viewpagertabs-example
+ [4]: http://developer.android.com/guide/developing/projects/projects-eclipse.html
+ [5]: http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject
+
+ [7]: https://github.com/astuetz/android-viewpagertabs-example/raw/master/tabs.png
Binary file not shown.
@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-4
+android.library=true
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <declare-styleable name="ViewPagerExtensions">
+
+ <attr format="integer" name="fadeOutDelay" />
+ <attr format="integer" name="fadeOutDuration" />
+
+ <attr format="color" name="textColorSelected" />
+
+ <attr format="color" name="lineColor" />
+ <attr format="color" name="lineColorSelected" />
+
+ <attr format="dimension" name="lineHeight" />
+ <attr format="dimension" name="lineHeightSelected" />
+
+ <attr format="color" name="dividerColor" />
+ <attr format="dimension" name="dividerMarginTop" />
+ <attr format="dimension" name="dividerMarginBottom" />
+
+ <attr format="reference" name="dividerDrawable" />
+
+ </declare-styleable>
+
+</resources>
Oops, something went wrong.

0 comments on commit e71fd15

Please sign in to comment.