Skip to content

Commit

Permalink
Merge pull request #17 from BorgRancher/dev
Browse files Browse the repository at this point in the history
Transitions and Aesthetics
  • Loading branch information
ZASHMCD authored Jun 5, 2022
2 parents 2368a51 + d3dba76 commit e14dbff
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 90 deletions.
2 changes: 2 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

157 changes: 81 additions & 76 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
minSdk 23
targetSdk 32
versionCode 1
versionName "1.0.4"
versionName "1.0.5"
buildConfigField("String","BASE_URL","\"https://graphql-pokeapi.graphcdn.app\"")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -26,7 +26,7 @@ android {
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
arguments += ["dagger.hilt.disableModulesHaveInstallInCheck" : "true"]
arguments += ["dagger.hilt.disableModulesHaveInstallInCheck": "true"]
}
}
}
Expand All @@ -50,6 +50,7 @@ android {
}

debug {
minifyEnabled false
debuggable true
}
}
Expand All @@ -70,106 +71,110 @@ android {
includeInApk true
includeInBundle true
}
}

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'

// Kotlin extensions for activity and fragment
implementation 'androidx.activity:activity-ktx:1.4.0'
implementation 'androidx.fragment:fragment-ktx:1.4.1'
// Kotlin extensions for activity and fragment
implementation 'androidx.activity:activity-ktx:1.4.0'
implementation 'androidx.fragment:fragment-ktx:1.4.1'

implementation 'com.google.android.material:material:1.6.0'
implementation 'com.google.android.material:material:1.6.0'

implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

// Apollo GraphQL
implementation 'com.apollographql.apollo3:apollo-runtime:3.3.0'
// Apollo GraphQL
implementation 'com.apollographql.apollo3:apollo-runtime:3.3.0'

// Kotlin Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.2'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.2'
// Kotlin Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.2'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.2'

// Room for local storage
def room_version = "2.4.2"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
// Room for local storage
def room_version = "2.4.2"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"

// optional - Room test helpers
testImplementation "androidx.room:room-testing:$room_version"
// optional - Room test helpers
testImplementation "androidx.room:room-testing:$room_version"

// hilt for dependency injection
def hilt_version = '2.42'
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
kaptAndroidTest "com.google.dagger:hilt-compiler:$hilt_version"
// hilt for dependency injection
def hilt_version = '2.42'
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
kaptAndroidTest "com.google.dagger:hilt-compiler:$hilt_version"

// For instrumentation tests
androidTestAnnotationProcessor "com.google.dagger:hilt-compiler:$hilt_version"
// For instrumentation tests
androidTestAnnotationProcessor "com.google.dagger:hilt-compiler:$hilt_version"

// For local unit tests
testImplementation 'com.google.dagger:hilt-android-testing:2.42'
testAnnotationProcessor 'com.google.dagger:hilt-compiler:2.42'
// For local unit tests
testImplementation 'com.google.dagger:hilt-android-testing:2.42'
testAnnotationProcessor 'com.google.dagger:hilt-compiler:2.42'

// Groupie for recycler views
def groupie_version = '2.10.1'
implementation "com.github.lisawray.groupie:groupie:$groupie_version"
implementation "com.github.lisawray.groupie:groupie-viewbinding:$groupie_version"
// Groupie for recycler views
def groupie_version = '2.10.1'
implementation "com.github.lisawray.groupie:groupie:$groupie_version"
implementation "com.github.lisawray.groupie:groupie-viewbinding:$groupie_version"

// optional - Paging 3 Integration
implementation "androidx.paging:paging-runtime:3.1.1"
// optional - Paging 3 Integration
implementation "androidx.paging:paging-runtime:3.1.1"

// Timber for better logging
implementation 'com.jakewharton.timber:timber:5.0.1'
// Timber for better logging
implementation 'com.jakewharton.timber:timber:5.0.1'

// Navigation - Kotlin
def nav_version = '2.4.2'
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
// Navigation - Kotlin
def nav_version = '2.4.2'
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"


// Stetho for debugging
def stetho_version = '1.6.0'
implementation "com.facebook.stetho:stetho:$stetho_version"
implementation "com.facebook.stetho:stetho-okhttp3:$stetho_version"
// Stetho for debugging
def stetho_version = '1.6.0'
implementation "com.facebook.stetho:stetho:$stetho_version"
implementation "com.facebook.stetho:stetho-okhttp3:$stetho_version"

// Glide for image wrangling
def glide_version = '4.13.2'
def glide_palette_version = '2.1.2'
implementation "com.github.bumptech.glide:glide:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"
implementation "com.github.florent37:glidepalette:$glide_palette_version"
// Glide for image wrangling
def glide_version = '4.13.2'
def glide_palette_version = '2.1.2'
implementation "com.github.bumptech.glide:glide:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"
implementation "com.github.florent37:glidepalette:$glide_palette_version"

// WorkManager for background processing
implementation "androidx.work:work-runtime-ktx:2.7.1"
// WorkManager for background processing
implementation "androidx.work:work-runtime-ktx:2.7.1"

// Lottie for animations
def lottie_version = '5.2.0'
implementation "com.airbnb.android:lottie:$lottie_version"
// Lottie for animations
def lottie_version = '5.2.0'
implementation "com.airbnb.android:lottie:$lottie_version"

// Paging 3 for taming pokemon
def paging_version = '3.1.1'
implementation "androidx.paging:paging-runtime:$paging_version"
// Paging 3 for taming pokemon
def paging_version = '3.1.1'
implementation "androidx.paging:paging-runtime:$paging_version"

// alternatively - without Android dependencies for tests
testImplementation "androidx.paging:paging-common:$paging_version"
// alternatively - without Android dependencies for tests
testImplementation "androidx.paging:paging-common:$paging_version"

// Deploygate for distribution
implementation 'com.deploygate:sdk:4.1.0'
// Deploygate for distribution
implementation 'com.deploygate:sdk:4.1.0'

// Animatoo for better transitions
implementation 'com.github.mohammadatif:Animatoo:master'
}
}

apollo {
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="tech.borgranch.pokedex">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_LOGS"
Expand All @@ -19,6 +18,8 @@
android:supportsRtl="true"
android:theme="@style/Theme.Pokedex"
tools:ignore="UnusedAttribute">
<profileable android:shell="true"/>

<activity
android:name=".ui.main.MainActivity"
android:exported="true">
Expand All @@ -29,6 +30,7 @@
</intent-filter>
</activity>
</application>

<queries>
<package android:name="com.deploygate" />
</queries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,19 @@ class DetailFragment : Fragment() {
GlidePalette.with(imageUrl)
.use(BitmapPalette.Profile.MUTED)
.intoCallBack { palette ->
val rgb = palette?.lightMutedSwatch?.rgb
val lightMuted = palette?.lightMutedSwatch?.rgb
val domain = palette?.darkMutedSwatch?.rgb
// val textColor = palette?.darkMutedSwatch?.titleTextColor
if (rgb != null && domain != null) {
if (lightMuted != null && domain != null) {
ui.apply {
val gradientDrawable = verticalGradientDrawable(domain, rgb)
val gradientDrawable = verticalGradientDrawable(domain, lightMuted)
header.background = gradientDrawable
// index.setTextColor(textColor)
// arrow.drawable.setTint(textColor)
}
} else if (domain != null) {
ui.apply {
val gradientDrawable = verticalGradientDrawable(domain, domain)
header.background = gradientDrawable
// index.setTextColor(textColor)
// arrow.drawable.setTint(textColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class PokemonListCard(
if (muted != null && darkMuted != null) {
val gradientDrawable = verticalGradientDrawable(muted, darkMuted)
viewBinding.pokemonHolder.background = gradientDrawable
} else if (darkMuted != null) {
val gradientDrawable = verticalGradientDrawable(darkMuted, darkMuted)
viewBinding.pokemonHolder.background = gradientDrawable
}
}.crossfade(true)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.graphics.drawable.GradientDrawable

// GradientDrawables are used to create a gradient background for a view
fun verticalGradientDrawable(startColor: Int, endColor: Int): GradientDrawable {
val gradientDrawable = GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, intArrayOf(startColor, endColor))
return gradientDrawable
return GradientDrawable(
GradientDrawable.Orientation.TOP_BOTTOM,
intArrayOf(startColor, endColor)
)
}
16 changes: 8 additions & 8 deletions app/src/main/res/navigation/pokedex_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<action
android:id="@+id/action_listFragment_to_detailFragment"
app:destination="@id/detailFragment"
app:enterAnim="@android:anim/fade_in"
app:exitAnim="@android:anim/fade_out"
app:popEnterAnim="@android:anim/slide_in_left"
app:popExitAnim="@android:anim/slide_out_right"
app:enterAnim="@anim/animate_shrink_enter"
app:exitAnim="@anim/animate_slide_up_exit"
app:popEnterAnim="@anim/animate_fade_enter"
app:popExitAnim="@anim/animate_fade_exit"
app:popUpToInclusive="false" />
<argument
android:name="selectedIndex"
Expand All @@ -43,10 +43,10 @@
<action
android:id="@+id/action_detailFragment_to_listFragment"
app:destination="@id/listFragment"
app:enterAnim="@android:anim/slide_in_left"
app:exitAnim="@android:anim/slide_out_right"
app:popEnterAnim="@android:anim/fade_in"
app:popExitAnim="@android:anim/fade_out"
app:enterAnim="@anim/animate_zoom_enter"
app:exitAnim="@anim/animate_shrink_exit"
app:popEnterAnim="@anim/animate_fade_enter"
app:popExitAnim="@anim/animate_fade_exit"
app:popUpTo="@id/listFragment"
app:popUpToInclusive="true" />
</fragment>
Expand Down

0 comments on commit e14dbff

Please sign in to comment.