项目作者: jamesgathu

项目描述 :
A sample project for creating wizards in Android
高级语言: Java
项目地址: git://github.com/jamesgathu/AndroidWizard.git
创建时间: 2017-10-16T08:23:00Z
项目社区:https://github.com/jamesgathu/AndroidWizard

开源协议:

下载


Image

Android Wizard

Take it as a plugin for wizards to track the change in pages
The dependency is available on jcenter() and mavenCentral()
Image

Integration

Add the following to your build.gradle(App)

  1. dependencies {
  2. //other dependencies
  3. compile 'com.jswiftdev.wizard:wizardindicator:0.1.2'
  4. }

Wizard tracker

To use the Wizard Indicator
In your layout add the following view

  1. <com.jswiftdev.wizard.LineIndicator
  2. android:id="@+id/indicator"
  3. android:layout_width="match_parent"
  4. android:layout_height="100dp"
  5. app:activeCircleColor="@color/apple_orange"
  6. app:activePage="3"
  7. app:circleColor="@color/deep_silver"
  8. app:circleRadius="50"
  9. app:lineColor="@color/deep_silver"
  10. app:lineWidth="3"
  11. app:numberOfPages="5"
  12. app:textSize="30" ></com.jswiftdev.wizard.LineIndicator>

to manipulate the changes from page to page, you can use

  1. import com.jswiftdev.wizard.Indicator;
  2. @Override
  3. protected void onCreate(Bundle savedInstanceState) {
  4. WizardIndicator indicator = (WizardIndicator)findViewById(R.id.indicator);
  5. //to change from one active page to another
  6. indicator.setActivePage(1);
  7. //set the number of pages
  8. indicator.setNumberOfPages(5);
  9. }

while using it with viewpager add indicator.setActivePage(position); in onTabSelected(…) method
as shown below

1. Bubble Indicator

To use the slide selector add the following in your layout file

  1. <com.jswiftdev.wizard.SlideSelector
  2. android:clickable="false"
  3. android:id="@+id/slider_selector"
  4. android:layout_width="match_parent"
  5. android:layout_height="wrap_content"
  6. android:layout_below="@+id/indicator"
  7. app:activeTextColor="@color/white"
  8. app:choicesArrayId="@array/options"
  9. app:drawableId="@drawable/another_back"
  10. app:inActiveTextColor="@color/black"
  11. app:tColor="@color/black"
  12. app:textPadding="20" ></com.jswiftdev.wizard.SlideSelector>

from your Activity or fragment use

  1. ...
  2. SlideSelector slideSelector = findViewById(R.id.slider_selector);
  3. slideSelector.setSelectionChanges(new SlideSelector.SelectionChanges() {
  4. @Override
  5. public void onSelectedIndexChanged(String selectedItem) {
  6. //get the selected item from the provided array @array/options
  7. }
  8. });
  9. //choose different selection as default
  10. slideSelector.setSelectedIndex(4);
  11. ...

2. Inverted Tab Indicator

Tab indicator with its indicator on the upperside

  1. <com.jswiftdev.wizard.SlideSelector
  2. android:layout_width="match_parent"
  3. android:layout_height="wrap_content"
  4. android:layout_marginTop="10dp"
  5. app:activeTextColor="@color/apple_pink"
  6. app:choicesArrayId="@array/options"
  7. app:drawableId="@drawable/rect_back"
  8. app:inActiveTextColor="@color/black"
  9. app:mode="TAB_INVERSE"
  10. app:tColor="@color/black"
  11. app:textPadding="30" ></com.jswiftdev.wizard.SlideSelector>

3. Simple Tab Indicator

Simple tab indicator. An imitation of the tab indicator

  1. <com.jswiftdev.wizard.SlideSelector
  2. android:layout_width="match_parent"
  3. android:layout_height="wrap_content"
  4. android:layout_marginTop="8dp"
  5. app:activeTextColor="@color/apple_pink"
  6. app:choicesArrayId="@array/options"
  7. app:drawableId="@drawable/rect_back"
  8. app:inActiveTextColor="@color/black"
  9. app:mode="TAB"
  10. app:tColor="@color/black"
  11. app:textPadding="30" ></com.jswiftdev.wizard.SlideSelector>

License

Copyright 2017 Jswiftdev.

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.