Skip to content

Commit

Permalink
refactor: removed ViewPager1 since it's deprecated and discouraged to…
Browse files Browse the repository at this point in the history
… be used
  • Loading branch information
FunkyMuse committed May 26, 2021
1 parent 81e3852 commit 2e123c0
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 154 deletions.
19 changes: 11 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {
implementation project(path: ':common')


testImplementation 'junit:junit:4.13.2'
testImplementation "junit:junit:$junitVersion"

//language features
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
Expand All @@ -68,7 +68,8 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-process:$lifecycle"

//joda time
implementation 'net.danlew:android.joda:2.10.9.1'
implementation "net.danlew:android.joda:$joda"


//moshi
implementation "com.squareup.moshi:moshi-kotlin:$moshi"
Expand All @@ -94,18 +95,20 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines"

//auth
implementation 'androidx.biometric:biometric:1.2.0-alpha03'
implementation "androidx.biometric:biometric:$biometrics"

//util
implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation "androidx.exifinterface:exifinterface:$exifinterface"

//core
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.core:core-ktx:1.6.0-beta01'
implementation "androidx.preference:preference:$preference"
implementation "androidx.palette:palette-ktx:$palette"

implementation "androidx.core:core-ktx:$coreKTX"


//android apis
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation "androidx.viewpager2:viewpager2:$viewPager"
implementation "com.google.android.material:material:$material"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$swipeRefresh"
implementation "androidx.appcompat:appcompat:$appCompat"
Expand Down
2 changes: 1 addition & 1 deletion biometrics/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
api 'androidx.biometric:biometric:1.2.0-alpha03'
api "androidx.biometric:biometric:$biometrics"
}
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ buildscript {
annotationVersion = '1.2.0'
documentFile = '1.0.1'
swipeRefresh = '1.1.0'
viewPager = '1.0.0'
biometrics = '1.2.0-alpha03'
joda = '2.10.9.1'
exifinterface= '1.3.2'
palette = '1.0.0'
preference = '1.1.1'


//app only
Expand Down
2 changes: 1 addition & 1 deletion jodaDateTime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ android {

dependencies {
//joda time
implementation 'net.danlew:android.joda:2.10.9.1'
implementation "net.danlew:android.joda:$joda"
}

This file was deleted.

1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ include ':resources'
include ':networking'
include ':http'
include ':view'
include ':viewpager2'
1 change: 1 addition & 0 deletions viewpager2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
11 changes: 11 additions & 0 deletions viewpager2/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
Empty file added viewpager2/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions viewpager2/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.crazylegend.viewpager2

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.crazylegend.viewpager2.test", appContext.packageName)
}
}
5 changes: 5 additions & 0 deletions viewpager2/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.crazylegend.viewpager2">

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.crazylegend.viewpager2

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

0 comments on commit 2e123c0

Please sign in to comment.