Skip to content

Commit

Permalink
Merge pull request #47 from wching/dependencies_update
Browse files Browse the repository at this point in the history
Update dependencies version
  • Loading branch information
wching authored Mar 4, 2022
2 parents c836dad + 8e49a94 commit c123546
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 270 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.4.21'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.android.tools.build:gradle:7.3.0-alpha05'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.4.1"
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.1.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -20,7 +20,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 13 additions & 11 deletions indefinitepagerindicator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "org.jlleitschuh.gradle.ktlint"

group = 'com.ryanjeffreybrooks.IndefinitePagerIndicator'

android {
compileSdkVersion 30
compileSdkVersion 32
buildToolsVersion '30.0.3'

defaultConfig {
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 32
versionCode 1
versionName "1.0"
}

buildFeatures {
viewBinding true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_11
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,16 @@ class IndefinitePagerIndicator @JvmOverloads constructor(
}

private fun setIntermediateSelectedItemPosition(mostVisibleChild: View) {
recyclerView?.findContainingViewHolder(mostVisibleChild)?.adapterPosition?.let { position ->
intermediateSelectedItemPosition = if (isRtl() && !verticalSupport) {
getRTLPosition(
position = position
)
} else {
position
recyclerView?.findContainingViewHolder(mostVisibleChild)?.bindingAdapterPosition
?.let { position ->
intermediateSelectedItemPosition = if (isRtl() && !verticalSupport) {
getRTLPosition(
position = position
)
} else {
position
}
}
}
}
}

Expand Down
18 changes: 8 additions & 10 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 30
compileSdkVersion 32
buildToolsVersion '30.0.3'

defaultConfig {
applicationId "com.rbrooks.infinitepageindicator"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 32
versionCode 1
versionName "1.0"
}
Expand All @@ -29,24 +28,23 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_11
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

// Support libs
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.duolingo.open:rtl-viewpager:2.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'

// Library dependency
implementation project(':indefinitepagerindicator')
Expand Down
1 change: 1 addition & 0 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<activity
android:name="com.rbrooks.indefinitepagerindicatorsample.MainActivity"
android:exported="true"
android:theme="@style/NoActionBarActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.google.android.material.tabs.TabLayout
import com.rbrooks.indefinitepagerindicatorsample.databinding.ActivityMainBinding
import com.rbrooks.indefinitepagerindicatorsample.recyclerViewSample.RecyclerViewSampleFragment
import com.rbrooks.indefinitepagerindicatorsample.rtlViewPagerSample.RTLViewPagerSampleFragment
import com.rbrooks.indefinitepagerindicatorsample.util.OnPagerNumberChangeListener
import com.rbrooks.indefinitepagerindicatorsample.util.PagerNumberPickerDialogPreference
import com.rbrooks.indefinitepagerindicatorsample.viewPager2Sample.ViewPager2SampleFragment
import com.rbrooks.indefinitepagerindicatorsample.viewPagerSample.ViewPagerSampleFragment
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity(), TabLayout.OnTabSelectedListener,
OnPagerNumberChangeListener {
Expand All @@ -31,18 +30,18 @@ class MainActivity : AppCompatActivity(), TabLayout.OnTabSelectedListener,
private lateinit var viewPagerSampleFragment: ViewPagerSampleFragment
private lateinit var viewPager2SampleFragment: ViewPager2SampleFragment
private lateinit var recyclerViewSampleFragment: RecyclerViewSampleFragment
private lateinit var rtlViewPagerSampleFragment: RTLViewPagerSampleFragment
private lateinit var sharedPreferences: SharedPreferences

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

sharedPreferences = getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE)

setSupportActionBar(toolbar)
toolbar?.title = getString(R.string.main_activity_title)
toolbar?.setTitleTextColor(ContextCompat.getColor(this, R.color.white))
ActivityMainBinding.inflate(layoutInflater).run {
setSupportActionBar(toolbar)
toolbar.title = getString(R.string.main_activity_title)
toolbar.setTitleTextColor(ContextCompat.getColor(this@MainActivity, R.color.white))
}

bindViews()
setupFragments()
Expand Down Expand Up @@ -91,7 +90,6 @@ class MainActivity : AppCompatActivity(), TabLayout.OnTabSelectedListener,
0 -> setFragment(viewPagerSampleFragment)
1 -> setFragment(viewPager2SampleFragment)
2 -> setFragment(recyclerViewSampleFragment)
3 -> setFragment(rtlViewPagerSampleFragment)
}
}

Expand All @@ -103,7 +101,6 @@ class MainActivity : AppCompatActivity(), TabLayout.OnTabSelectedListener,
(viewPagerSampleFragment as OnPagerNumberChangeListener).onPagerNumberChanged()
(viewPager2SampleFragment as OnPagerNumberChangeListener).onPagerNumberChanged()
(recyclerViewSampleFragment as OnPagerNumberChangeListener).onPagerNumberChanged()
(rtlViewPagerSampleFragment as OnPagerNumberChangeListener).onPagerNumberChanged()
}

// Private Api
Expand All @@ -122,11 +119,9 @@ class MainActivity : AppCompatActivity(), TabLayout.OnTabSelectedListener,
viewPagerSampleFragment = ViewPagerSampleFragment()
viewPager2SampleFragment = ViewPager2SampleFragment()
recyclerViewSampleFragment = RecyclerViewSampleFragment()
rtlViewPagerSampleFragment = RTLViewPagerSampleFragment()
}

private fun setFragment(fragment: Fragment) {
// TODO: Set custom animations depending on which one
supportFragmentManager.beginTransaction()
.replace(R.id.main_activity_fragment_holder, fragment).commit()
}
Expand Down

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
android:layout_height="wrap_content"
android:text="@string/recyclerview" />

<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rtl_view_pager" />


</com.google.android.material.tabs.TabLayout>

<FrameLayout
Expand Down
Loading

0 comments on commit c123546

Please sign in to comment.