mirror of
https://github.com/tateisu/SubwayTooter
synced 2025-01-27 09:11:23 +01:00
依存関係のアップデート
This commit is contained in:
parent
a3db7a263c
commit
7c7fc90a2e
@ -5,14 +5,20 @@ apply plugin: 'kotlin-android'
|
||||
// apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
android {
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
compileSdkVersion target_sdk_version
|
||||
|
||||
defaultConfig {
|
||||
targetSdkVersion target_sdk_version
|
||||
minSdkVersion min_sdk_version
|
||||
|
||||
versionCode 290
|
||||
versionName "2.9.0"
|
||||
versionCode 291
|
||||
versionName "2.9.1"
|
||||
applicationId "jp.juggler.subwaytooter"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@ -99,10 +105,11 @@ dependencies {
|
||||
|
||||
testImplementation 'junit:junit:4.12' // しばらくはkotlin-testとjunitを併用
|
||||
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
||||
testImplementation 'com.squareup.okhttp3:mockwebserver:3.10.0'
|
||||
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.10.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
|
||||
testImplementation 'com.squareup.okhttp3:mockwebserver:3.11.0'
|
||||
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.11.0'
|
||||
|
||||
// glide 4.8.0 は CustomTarget がないので保留
|
||||
implementation 'com.github.bumptech.glide:glide:4.7.1'
|
||||
implementation 'com.github.bumptech.glide:okhttp3-integration:4.7.1'
|
||||
implementation 'com.github.bumptech.glide:annotations:4.7.1'
|
||||
@ -122,11 +129,12 @@ dependencies {
|
||||
|
||||
implementation 'org.hjson:hjson:3.0.0'
|
||||
|
||||
implementation 'com.google.android:flexbox:0.3.2'
|
||||
implementation 'com.google.android:flexbox:1.0.0' // 1.1.0 から AndroidX 依存
|
||||
|
||||
implementation 'com.astuetz:pagerslidingtabstrip:1.0.1'
|
||||
|
||||
implementation 'com.google.android.exoplayer:exoplayer:2.7.3'
|
||||
// exoplayer 2.9.0 は Java 8 compiler support を要求する
|
||||
implementation 'com.google.android.exoplayer:exoplayer:2.8.4'
|
||||
|
||||
// implementation 'com.simplecityapps:recyclerview-fastscroll:1.0.16'
|
||||
|
||||
|
@ -22,21 +22,17 @@ import android.view.View
|
||||
import android.view.Window
|
||||
import android.widget.TextView
|
||||
import com.google.android.exoplayer2.*
|
||||
|
||||
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory
|
||||
import com.google.android.exoplayer2.source.ExtractorMediaSource
|
||||
import com.google.android.exoplayer2.source.MediaSource
|
||||
import com.google.android.exoplayer2.source.MediaSourceEventListener
|
||||
import com.google.android.exoplayer2.source.TrackGroupArray
|
||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
|
||||
import com.google.android.exoplayer2.trackselection.TrackSelectionArray
|
||||
import com.google.android.exoplayer2.ui.PlayerView
|
||||
import com.google.android.exoplayer2.upstream.DataSpec
|
||||
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
|
||||
import com.google.android.exoplayer2.util.Util
|
||||
|
||||
import java.util.LinkedList
|
||||
|
||||
import jp.juggler.subwaytooter.api.TootApiClient
|
||||
import jp.juggler.subwaytooter.api.TootApiResult
|
||||
import jp.juggler.subwaytooter.api.TootTask
|
||||
@ -47,6 +43,7 @@ import jp.juggler.subwaytooter.util.*
|
||||
import jp.juggler.subwaytooter.view.PinchBitmapView
|
||||
import okhttp3.Request
|
||||
import java.io.IOException
|
||||
import java.util.*
|
||||
|
||||
class ActMediaViewer : AppCompatActivity(), View.OnClickListener {
|
||||
|
||||
@ -327,11 +324,9 @@ class ActMediaViewer : AppCompatActivity(), View.OnClickListener {
|
||||
|
||||
val mediaSource = ExtractorMediaSource.Factory(dataSourceFactory)
|
||||
.setExtractorsFactory(extractorsFactory)
|
||||
.createMediaSource(
|
||||
Uri.parse(url),
|
||||
App1.getAppState(this).handler,
|
||||
mediaSourceEventListener
|
||||
)
|
||||
.createMediaSource(Uri.parse(url))
|
||||
|
||||
mediaSource.addEventListener(App1.getAppState(this).handler,mediaSourceEventListener)
|
||||
|
||||
exoPlayer.prepare(mediaSource)
|
||||
exoPlayer.playWhenReady = true
|
||||
@ -345,81 +340,53 @@ class ActMediaViewer : AppCompatActivity(), View.OnClickListener {
|
||||
|
||||
private val mediaSourceEventListener = object : MediaSourceEventListener {
|
||||
override fun onLoadStarted(
|
||||
dataSpec : DataSpec?,
|
||||
dataType : Int,
|
||||
trackType : Int,
|
||||
trackFormat : Format?,
|
||||
trackSelectionReason : Int,
|
||||
trackSelectionData : Any?,
|
||||
mediaStartTimeMs : Long,
|
||||
mediaEndTimeMs : Long,
|
||||
elapsedRealtimeMs : Long
|
||||
) {
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?,
|
||||
loadEventInfo : MediaSourceEventListener.LoadEventInfo?,
|
||||
mediaLoadData : MediaSourceEventListener.MediaLoadData?
|
||||
) {
|
||||
log.d("onLoadStarted")
|
||||
}
|
||||
|
||||
override fun onDownstreamFormatChanged(
|
||||
trackType : Int,
|
||||
trackFormat : Format?,
|
||||
trackSelectionReason : Int,
|
||||
trackSelectionData : Any?,
|
||||
mediaTimeMs : Long
|
||||
) {
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?,
|
||||
mediaLoadData : MediaSourceEventListener.MediaLoadData?
|
||||
) {
|
||||
log.d("onDownstreamFormatChanged")
|
||||
}
|
||||
|
||||
override fun onUpstreamDiscarded(
|
||||
trackType : Int,
|
||||
mediaStartTimeMs : Long,
|
||||
mediaEndTimeMs : Long
|
||||
) {
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?,
|
||||
mediaLoadData : MediaSourceEventListener.MediaLoadData?
|
||||
){
|
||||
log.d("onUpstreamDiscarded")
|
||||
}
|
||||
|
||||
override fun onLoadCompleted(
|
||||
dataSpec : DataSpec?,
|
||||
dataType : Int,
|
||||
trackType : Int,
|
||||
trackFormat : Format?,
|
||||
trackSelectionReason : Int,
|
||||
trackSelectionData : Any?,
|
||||
mediaStartTimeMs : Long,
|
||||
mediaEndTimeMs : Long,
|
||||
elapsedRealtimeMs : Long,
|
||||
loadDurationMs : Long,
|
||||
bytesLoaded : Long
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?,
|
||||
loadEventInfo : MediaSourceEventListener.LoadEventInfo?,
|
||||
mediaLoadData : MediaSourceEventListener.MediaLoadData?
|
||||
) {
|
||||
log.d("onLoadCompleted")
|
||||
}
|
||||
|
||||
override fun onLoadCanceled(
|
||||
dataSpec : DataSpec?,
|
||||
dataType : Int,
|
||||
trackType : Int,
|
||||
trackFormat : Format?,
|
||||
trackSelectionReason : Int,
|
||||
trackSelectionData : Any?,
|
||||
mediaStartTimeMs : Long,
|
||||
mediaEndTimeMs : Long,
|
||||
elapsedRealtimeMs : Long,
|
||||
loadDurationMs : Long,
|
||||
bytesLoaded : Long
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?,
|
||||
loadEventInfo : MediaSourceEventListener.LoadEventInfo?,
|
||||
mediaLoadData : MediaSourceEventListener.MediaLoadData?
|
||||
) {
|
||||
log.d("onLoadCanceled")
|
||||
}
|
||||
|
||||
override fun onLoadError(
|
||||
dataSpec : DataSpec?,
|
||||
dataType : Int,
|
||||
trackType : Int,
|
||||
trackFormat : Format?,
|
||||
trackSelectionReason : Int,
|
||||
trackSelectionData : Any?,
|
||||
mediaStartTimeMs : Long,
|
||||
mediaEndTimeMs : Long,
|
||||
elapsedRealtimeMs : Long,
|
||||
loadDurationMs : Long,
|
||||
bytesLoaded : Long,
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?,
|
||||
loadEventInfo : MediaSourceEventListener.LoadEventInfo?,
|
||||
mediaLoadData : MediaSourceEventListener.MediaLoadData?,
|
||||
error : IOException?,
|
||||
wasCanceled : Boolean
|
||||
) {
|
||||
@ -428,6 +395,27 @@ class ActMediaViewer : AppCompatActivity(), View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMediaPeriodCreated(
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?
|
||||
) {
|
||||
log.d("onMediaPeriodCreated")
|
||||
}
|
||||
|
||||
override fun onMediaPeriodReleased(
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?
|
||||
) {
|
||||
log.d("onMediaPeriodReleased")
|
||||
}
|
||||
|
||||
override fun onReadingStarted(
|
||||
windowIndex : Int,
|
||||
mediaPeriodId : MediaSource.MediaPeriodId?
|
||||
) {
|
||||
log.d("onReadingStarted")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
@ -23,7 +23,6 @@ import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.load.model.LazyHeaders
|
||||
import com.bumptech.glide.load.resource.gif.GifDrawable
|
||||
import com.bumptech.glide.load.resource.gif.MyGifDrawable
|
||||
import com.bumptech.glide.request.target.BaseTarget
|
||||
import com.bumptech.glide.request.target.ImageViewTarget
|
||||
import com.bumptech.glide.request.target.SimpleTarget
|
||||
import com.bumptech.glide.request.target.Target
|
||||
@ -40,27 +39,27 @@ class MyNetworkImageView : AppCompatImageView {
|
||||
}
|
||||
|
||||
// ロード中などに表示するDrawableのリソースID
|
||||
private var mDefaultImageId : Int = 0
|
||||
private var mDefaultImageId = 0
|
||||
|
||||
// エラー時に表示するDrawableのリソースID
|
||||
private var mErrorImageId : Int = 0
|
||||
private var mErrorImageId = 0
|
||||
|
||||
// 角丸の半径。元画像の短辺に対する割合を指定するらしい
|
||||
internal var mCornerRadius : Float = 0.toFloat()
|
||||
internal var mCornerRadius = 0f
|
||||
|
||||
// 表示したい画像のURL
|
||||
private var mUrl : String? = null
|
||||
private var mMayGif : Boolean = false
|
||||
|
||||
// 非同期処理のキャンセル
|
||||
private var mTarget : BaseTarget<*>? = null
|
||||
private var mTarget : Target<*>? = null
|
||||
|
||||
private val proc_load_image : Runnable = Runnable { loadImageIfNecessary() }
|
||||
private val proc_focus_point : Runnable = Runnable { updateFocusPoint() }
|
||||
|
||||
private var media_type_drawable : Drawable? = null
|
||||
private var media_type_bottom : Int = 0
|
||||
private var media_type_left : Int = 0
|
||||
private var media_type_bottom = 0
|
||||
private var media_type_left = 0
|
||||
|
||||
constructor(context : Context)
|
||||
: super(context)
|
||||
|
Loading…
x
Reference in New Issue
Block a user