Skip to content

Commit

Permalink
Merge pull request #16 from BorgRancher/15-transition-animations
Browse files Browse the repository at this point in the history
Fragment transitions & icon
  • Loading branch information
BorgRancher authored Jun 5, 2022
2 parents 20aa77c + c3168eb commit d3dba76
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 87 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
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.

155 changes: 80 additions & 75 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 d3dba76

Please sign in to comment.