Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
ihsanbal authored and ihsanbal committed Jan 23, 2017
1 parent 69eb301 commit 181589f
Show file tree
Hide file tree
Showing 14 changed files with 136 additions and 132 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
/build
/captures
.externalNativeBuild
/.idea/
/gradlew
/gradlew.bat
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SlidingIntoView

[![API](https://img.shields.io/badge/API-11%2B-brightgreen.svg?style=flat-square)](https://android-arsenal.com/api?level=9) [![License](https://img.shields.io/npm/l/express.svg?style=flat-square)](https://opensource.org/licenses/MIT) [![Jitpack](https://jitpack.io/v/ihsanbal/SlidingIntoView.svg?style=flat-square)](https://jitpack.io/#ihsanbal/SlidingIntoView) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SlidingIntoView-green.svg?style=flat-square)](https://android-arsenal.com/details/1/4534)
<a href="http://www.methodscount.com/?lib=com.github.ihsanbal%3ASlidingIntoView%3A1.0.0"><img src="https://img.shields.io/badge/Methods and size-core: 91 | deps: 16517 | 25 KB-e91e63.svg"/></a>
<a href="http://www.methodscount.com/?lib=com.github.ihsanbal%3ASlidingIntoView%3A1.0.1"><img src="https://img.shields.io/badge/Methods and size-core: 91 | deps: 16517 | 25 KB-e91e63.svg"/></a>
================

Simple Sliding Intro View
Expand All @@ -22,7 +22,7 @@ repositories {
}
dependencies {
compile 'com.github.ihsanbal:SlidingIntoView:1.0.0'
compile 'com.github.ihsanbal:SlidingIntoView:1.0.1'
}
```
or Maven:
Expand All @@ -35,7 +35,7 @@ or Maven:
<dependency>
<groupId>com.github.ihsanbal</groupId>
<artifactId>SlidingIntoView</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
```

Expand Down Expand Up @@ -104,7 +104,7 @@ You can control these parameters via XML:
Changelog
---------

* 1.0.0 - initial release
* 1.0.1 - initial release


License
Expand Down
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.ihsanbal.io"
minSdkVersion 11
targetSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -28,14 +28,14 @@ repositories {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'me.relex:circleindicator:1.1.8@aar'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.jakewharton:butterknife:8.4.0'

apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.android.support:appcompat-v7:24.2.1'
compile project(':library')
// compile 'com.github.ihsanbal:SlidingIntoView:1.0.0'
testCompile 'junit:junit:4.12'
}
7 changes: 5 additions & 2 deletions app/src/main/java/com/ihsanbal/io/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
mIntroView.setOffscreenPageLimit(2);
mIntroView.setOffscreenPageLimit(3);
mIntroView.init(getSupportFragmentManager(),
getResources().getStringArray(R.array.titles),
getResources().getStringArray(R.array.texts),
R.drawable.istanbul_wp, R.drawable.rize_wp, R.drawable.diyarbekir_wp, R.drawable.izmir_wp, R.drawable.izmir_wp, R.drawable.izmir_wp, R.drawable.izmir_wp);
R.drawable.istanbul_wp,
R.drawable.rize_wp,
R.drawable.diyarbekir_wp,
R.drawable.izmir_wp);
mCircleIndicator.setViewPager(mIntroView);
}
}
3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
app:scaleType="center"
app:scrollDelay="5000"
app:scrollDuration="5"
app:textColor="#fc2f2f"
app:textSize="7sp"
app:titleTextColor="#ffffff"
app:titleTextColor="@color/colorAccent"
app:titleTextSize="13sp" />

<me.relex.circleindicator.CircleIndicator
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorPrimary">#ff3333</color>
<color name="colorPrimaryDark">#d92323</color>
<color name="colorAccent">#ffff40</color>
</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.3.0-beta2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Mon Jan 23 08:35:49 EET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
13 changes: 6 additions & 7 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
compileSdkVersion 25
buildToolsVersion '25.0.2'

defaultConfig {
minSdkVersion 11
targetSdkVersion 24
versionCode 1
versionName "1.0.0"

targetSdkVersion 25
versionCode 2
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
Expand All @@ -26,6 +25,6 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
import android.support.v4.app.FragmentPagerAdapter;

/**
* Created by ihsan on 10/10/16.
* @author ihsan on 10/10/16.
*/

public class AdapterPageSection extends FragmentPagerAdapter {
class AdapterPageSection extends FragmentPagerAdapter {

private final Bundle bundle;
private int[] resourcesId;
private String[] titleResources, textResource;

public AdapterPageSection(FragmentManager fm, Bundle bundle, String[] titleResources, String[] textResources, int[] resourcesId) {
AdapterPageSection(FragmentManager fm, Bundle bundle, String[] titleResources, String[] textResources, int[] resourcesId) {
super(fm);
this.resourcesId = resourcesId;
this.titleResources = titleResources;
Expand Down
73 changes: 43 additions & 30 deletions library/src/main/java/com/ihsanbal/introview/FragmentPage.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.ihsanbal.introview;

import android.annotation.SuppressLint;
import android.content.res.ColorStateList;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
Expand All @@ -9,33 +11,35 @@
import android.widget.TextView;

/**
* Created by ihsan on 10/10/16.
* @author ihsan on 10/10/16.
*/
public class FragmentPage extends Fragment {
@SuppressLint("ValidFragment")
class FragmentPage extends Fragment {

private static final String ARG_SECTION_NUMBER = "section_number";
private static final String ARG_SECTION_TITLE = "section_title";
private static final String ARG_SECTION_TEXT = "section_text";
public static final String TEXT_SIZE = "attr_text_size";
public static final String TITLE_SIZE = "attr_title_size";
public static final String TEXT_COLOR = "attr_text_color";
public static final String TITLE_COLOR = "attr_title_color";
public static final String PADDING_TITLE_TOP = "attr_title_padding_top";
public static final String PADDING_TITLE_BOTTOM = "attr_title_padding_bottom";
public static final String PADDING_TITLE_LEFT = "attr_title_padding_left";
public static final String PADDING_TITLE_RIGHT = "attr_title_padding_right";
public static final String PADDING_TEXT_TOP = "attr_text_padding_top";
public static final String PADDING_TEXT_BOTTOM = "attr_text_padding_bottom";
public static final String PADDING_TEXT_LEFT = "attr_text_padding_left";
public static final String PADDING_TEXT_RIGHT = "attr_text_padding_right";
public static final String SCALE_TYPE = "attr_scale_type";

public static final String ARG_TEXT_SIZE = "attr_text_size";
public static final String ARG_TITLE_SIZE = "attr_title_size";
public static final String ARG_TEXT_COLOR = "attr_text_color";
public static final String ARG_TITLE_COLOR = "attr_title_color";
public static final String ARG_PADDING_TITLE_TOP = "attr_title_padding_top";
public static final String ARG_PADDING_TITLE_BOTTOM = "attr_title_padding_bottom";
public static final String ARG_PADDING_TITLE_LEFT = "attr_title_padding_left";
public static final String ARG_PADDING_TITLE_RIGHT = "attr_title_padding_right";
public static final String ARG_PADDING_TEXT_TOP = "attr_text_padding_top";
public static final String ARG_PADDING_TEXT_BOTTOM = "attr_text_padding_bottom";
public static final String ARG_PADDING_TEXT_LEFT = "attr_text_padding_left";
public static final String ARG_PADDING_TEXT_RIGHT = "attr_text_padding_right";
public static final String ARG_SCALE_TYPE = "attr_scale_type";
private static final String BUNDLE = "args_bundle";

public FragmentPage() {
FragmentPage() {

}

public static FragmentPage newInstance(int sectionNumber, String sectionTitle, String sectionText, Bundle bundle) {
static FragmentPage newInstance(int sectionNumber, String sectionTitle, String sectionText, Bundle bundle) {
FragmentPage fragment = new FragmentPage();
Bundle args = new Bundle();
if (bundle != null) {
Expand All @@ -58,24 +62,33 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

Bundle arr = getArguments();
Bundle bundle = arr.getBundle(BUNDLE);
title.setText(arr.getString(ARG_SECTION_TITLE));
title.setPadding((int) bundle.getFloat(PADDING_TITLE_LEFT), (int) bundle.getFloat(PADDING_TITLE_TOP), (int) bundle.getFloat(PADDING_TITLE_RIGHT), (int) bundle.getFloat(PADDING_TITLE_BOTTOM));
int titleColor = bundle.getInt(TITLE_COLOR);
if (titleColor > 0)
title.setTextColor(titleColor);
title.setTextSize(bundle.getFloat(TITLE_SIZE));

title.setText(arr.getString(ARG_SECTION_TITLE));
text.setText(arr.getString(ARG_SECTION_TEXT));
text.setPadding((int) bundle.getFloat(PADDING_TEXT_LEFT), (int) bundle.getFloat(PADDING_TEXT_TOP), (int) bundle.getFloat(PADDING_TEXT_RIGHT), (int) bundle.getFloat(PADDING_TEXT_BOTTOM));
int textColor = bundle.getInt(TEXT_COLOR);
if (textColor > 0)
text.setTextColor(textColor);
text.setTextSize(bundle.getFloat(TEXT_SIZE));
if (bundle != null) {
title.setPadding((int) bundle.getFloat(ARG_PADDING_TITLE_LEFT), (int) bundle.getFloat(ARG_PADDING_TITLE_TOP),
(int) bundle.getFloat(ARG_PADDING_TITLE_RIGHT), (int) bundle.getFloat(ARG_PADDING_TITLE_BOTTOM));

text.setPadding((int) bundle.getFloat(ARG_PADDING_TEXT_LEFT), (int) bundle.getFloat(ARG_PADDING_TEXT_TOP),
(int) bundle.getFloat(ARG_PADDING_TEXT_RIGHT), (int) bundle.getFloat(ARG_PADDING_TEXT_BOTTOM));


ColorStateList titleColor = bundle.getParcelable(ARG_TITLE_COLOR);
if (titleColor != null) {
title.setTextColor(titleColor);
}
ColorStateList textColor = bundle.getParcelable(ARG_TEXT_COLOR);
if (textColor != null) {
text.setTextColor(textColor);
}

title.setTextSize(bundle.getFloat(ARG_TITLE_SIZE));
text.setTextSize(bundle.getFloat(ARG_TEXT_SIZE));
}

imageView.setImageResource(arr.getInt(ARG_SECTION_NUMBER));
int scaleType = bundle.getInt(SCALE_TYPE);

switch (scaleType) {
switch (bundle != null ? bundle.getInt(ARG_SCALE_TYPE) : 0) {
case 0:
imageView.setScaleType(ImageView.ScaleType.CENTER);
break;
Expand Down
Loading

0 comments on commit 181589f

Please sign in to comment.