Skip to content

Commit

Permalink
Merge pull request #68 from punchdrunker/bump-version
Browse files Browse the repository at this point in the history
Bump version
  • Loading branch information
punchdrunker authored Jun 20, 2024
2 parents 25a8ca8 + a99546a commit 9681eed
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 43 deletions.
22 changes: 11 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ android {
minSdkVersion 24 // <- サポートする最小のandroidバージョン
targetSdkVersion 34
// <- buildに利用するツール郡の設定(Android plugin for Gradle 3.0.0以降なら設定しない場合プラグインに合わせたバージョンが自動で選択される)
versionCode 9
versionCode 10
// <- アプリのバージョンコード 内部的に使われるもので基本的にユーザーの目にするものではない アプリのインストール時やGoogle Play Consoleでのリリースで使われる
versionName "1.4.0" // <- ユーザーが目にするバージョン名
versionName "1.4.1" // <- ユーザーが目にするバージョン名
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// <- androidTestに使われるRunner
}
Expand All @@ -39,7 +39,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion "1.5.3"
kotlinCompilerExtensionVersion "1.5.14"
}

// app bundleを有効にする
Expand All @@ -66,12 +66,12 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// <- app/libs の下にある*.jar ファイルを利用する設定(デフォルトで記述されるが大抵の場合不要)
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$versions.kotlin"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.activity:activity-ktx:1.7.2"
implementation 'androidx.browser:browser:1.6.0'
implementation "androidx.activity:activity-ktx:1.9.0"
implementation 'androidx.browser:browser:1.8.0'
// <- Kotlinでプラグインによる自動生成処理を行うための設定(kotlinを使わない場合はannotationProcessor)

implementation 'com.google.android.play:core:1.10.3' // <- Dynamic Featureのロードに必要
Expand All @@ -94,15 +94,15 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' // <- 利用するライブラリを設定する

// coroutine
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0'
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'

// compose
implementation 'androidx.activity:activity-compose:1.7.2'
implementation "androidx.compose.material3:material3:1.1.1"
implementation 'androidx.activity:activity-compose:1.9.0'
implementation "androidx.compose.material3:material3:1.2.1"
implementation "androidx.compose.animation:animation:$versions.compose"
implementation "androidx.compose.ui:ui-tooling:$versions.compose"
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.8.2'
implementation "com.google.android.material:compose-theme-adapter:1.2.1"

// utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ package tokyo.punchdrunker.hocho.transition
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.KeyEvent
import android.view.View
import android.widget.ImageView
import androidx.activity.OnBackPressedCallback
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.SharedElementCallback
import androidx.databinding.DataBindingUtil
import androidx.viewpager.widget.ViewPager
import tokyo.punchdrunker.hocho.R
import tokyo.punchdrunker.hocho.databinding.ActivityPagerBinding


class PagerActivity : AppCompatActivity() {
private var initialPosition = 0
private var useTransition = true
Expand All @@ -31,33 +30,43 @@ class PagerActivity : AppCompatActivity() {
binding.viewPager.also {
it.adapter = adapter
it.currentItem = initialPosition
it.addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() {
override fun onPageSelected(position: Int) {
PhotoStore.setCurrentPosition(this@PagerActivity, position)
}
})
it.addOnPageChangeListener(
object : ViewPager.SimpleOnPageChangeListener() {
override fun onPageSelected(position: Int) {
PhotoStore.setCurrentPosition(this@PagerActivity, position)
}
},
)
}
prepareEnterTransition()
}

override fun dispatchKeyEvent(event: KeyEvent?): Boolean {
// Backボタン検知する
if (!useTransition && event?.keyCode == KeyEvent.KEYCODE_BACK) {
finishViewer()
return false
}
return super.dispatchKeyEvent(event)
val callback: OnBackPressedCallback =
object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
// Backボタン検知する
if (!useTransition) {
finishViewer()
}
}
}
onBackPressedDispatcher.addCallback(callback)
prepareEnterTransition()
}

private fun prepareEnterTransition() {
setEnterSharedElementCallback(object : SharedElementCallback() {
override fun onMapSharedElements(names: List<String>, sharedElements: MutableMap<String, View>) {
val detailImageView = adapter.getCurrentFragment().view?.findViewById<ImageView>(R.id.photo)
if (detailImageView != null) {
sharedElements[names[0]] = detailImageView
setEnterSharedElementCallback(
object : SharedElementCallback() {
override fun onMapSharedElements(
names: List<String>,
sharedElements: MutableMap<String, View>,
) {
val detailImageView =
adapter.getCurrentFragment().view?.findViewById<ImageView>(R.id.photo)
if (detailImageView != null) {
sharedElements[names[0]] = detailImageView
}
}
}
})
},
)
}

private fun finishViewer() {
Expand All @@ -69,12 +78,15 @@ class PagerActivity : AppCompatActivity() {
}

companion object {
fun createIntent(context: Context, position: Int, useTransition: Boolean = true): Intent {
return Intent(context, PagerActivity::class.java).also {
fun createIntent(
context: Context,
position: Int,
useTransition: Boolean = true,
): Intent =
Intent(context, PagerActivity::class.java).also {
it.putExtra(KEY_POSITION, position)
it.putExtra(KEY_USE_TRANSITION, useTransition)
}
}

private const val KEY_POSITION = "KEY_POSITION"
private const val KEY_USE_TRANSITION = "KEY_USE_TRANSITION"
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ apply plugin: 'com.github.ben-manes.versions'
buildscript {
ext.versions = [
'glide': '4.14.0',
'kotlin': '1.9.10',
'retrofit': '2.9.0',
'okhttp': '4.11.0',
'leakcanary': '2.12',
'kotlin': '1.9.24',
'retrofit': '2.11.0',
'okhttp': '4.12.0',
'leakcanary': '2.14',
'compose': '1.6.0-alpha04',
]
repositories {
Expand All @@ -16,7 +16,7 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.1'
classpath 'com.android.tools.build:gradle:8.1.4'
// <- buildに使うandroid用のpluginの設定
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
// <- kotlin用のpluginの設定
Expand Down
2 changes: 1 addition & 1 deletion gallery/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
implementation project(':app')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$versions.kotlin"
// 暫定的な対応...
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'


Expand Down

0 comments on commit 9681eed

Please sign in to comment.