Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
9e3f65bf
Commit
9e3f65bf
authored
Mar 19, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add AppGlideModule;
set cache directory for glide content (images by design) as cache/files/photos
parent
8f4943c3
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
3 deletions
+57
-3
build.gradle
app/build.gradle
+1
-0
RoomParkGlideModule.kt
.../biganto/visual/roompark/di/dagger/RoomParkGlideModule.kt
+41
-0
AlbumHeaderAdapter.kt
...ark/presentation/screen/albums/util/AlbumHeaderAdapter.kt
+2
-0
AlbumListAdapter.kt
...mpark/presentation/screen/albums/util/AlbumListAdapter.kt
+2
-0
ScreenController.kt
.../roompark/presentation/screen/article/ScreenController.kt
+3
-0
textAdapter.kt
.../roompark/presentation/screen/article/util/textAdapter.kt
+2
-0
ScreenController.kt
...ual/roompark/presentation/screen/deal/ScreenController.kt
+2
-0
Adapter.kt
...visual/roompark/presentation/screen/deals/util/Adapter.kt
+2
-3
Adapter.kt
...al/roompark/presentation/screen/feed_list/util/Adapter.kt
+2
-0
No files found.
app/build.gradle
View file @
9e3f65bf
...
...
@@ -125,6 +125,7 @@ dependencies {
implementation
'com.squareup.retrofit2:converter-gson:2.3.0'
implementation
'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation
'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation
'com.squareup.okhttp3:okhttp:3.14.0'
implementation
'com.squareup.okhttp3:logging-interceptor:3.12.2'
implementation
'com.squareup.okhttp3:okhttp-urlconnection:3.14.0'
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/RoomParkGlideModule.kt
0 → 100644
View file @
9e3f65bf
package
com.biganto.visual.roompark.di.dagger
import
android.content.Context
import
com.bumptech.glide.GlideBuilder
import
com.bumptech.glide.annotation.GlideModule
import
com.bumptech.glide.load.engine.cache.InternalCacheDiskCacheFactory
import
com.bumptech.glide.module.AppGlideModule
/**
* Created by Vladislav Bogdashkin on 19.03.2020.
*/
@GlideModule
class
RoomParkGlideModule
:
AppGlideModule
()
{
// fun applyOptions(@NonNull context: Context?, @NonNull builder: GlideBuilder) {
// super.applyOptions(context, builder)
// builder.setDefaultRequestOptions(RequestOptions().format(DecodeFormat.PREFER_ARGB_8888))
// }
override
fun
applyOptions
(
context
:
Context
,
builder
:
GlideBuilder
)
{
val
filderName
=
"../files/photos"
builder
.
setDiskCache
(
InternalCacheDiskCacheFactory
(
context
,
filderName
,
1024L
*
1024L
*
256L
)
)
}
//
// fun registerComponents(
// @NonNull context: Context?, @NonNull glide: Glide?, @NonNull registry: Registry
// ) {
// registry.append(Photo::class.java, InputStream::class.java, Factory())
// }
// Disable manifest parsing to avoid adding similar modules twice.
override
fun
isManifestParsingEnabled
():
Boolean
{
return
false
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/util/AlbumHeaderAdapter.kt
View file @
9e3f65bf
...
...
@@ -9,6 +9,7 @@ import com.biganto.visual.roompark.domain.model.AlbumPreviewModel
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
/**
...
...
@@ -40,6 +41,7 @@ class AlbumsHeaderViewHolder(itemView: View) : CommonViewHolder<AlbumPreviewMode
.
load
(
model
.
previewUrl
)
.
centerCrop
()
.
fitCenter
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
preview
)
}
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/util/AlbumListAdapter.kt
View file @
9e3f65bf
...
...
@@ -13,6 +13,7 @@ import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyc
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.google.android.material.textview.MaterialTextView
import
com.jakewharton.rxbinding3.view.detaches
import
com.jakewharton.rxrelay2.BehaviorRelay
...
...
@@ -90,6 +91,7 @@ class PhotosViewHolder(itemView: View) : CommonViewHolder<PhotoModel>(itemView)
.
load
(
it
.
url
)
.
centerCrop
()
.
fitCenter
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
photoPreview
)
}}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/ScreenController.kt
View file @
9e3f65bf
...
...
@@ -17,6 +17,7 @@ import com.biganto.visual.roompark.presentation.screen.article.util.HtmlPageAdap
import
com.biganto.visual.roompark.presentation.screen.article.util.HtmlTag
import
com.biganto.visual.roompark.util.extensions.formatToSimple
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.google.android.material.textview.MaterialTextView
import
jp.wasabeef.glide.transformations.BlurTransformation
import
timber.log.Timber
...
...
@@ -123,10 +124,12 @@ class ArticleScreenController :
Glide
.
with
(
blurPreview
)
.
load
(
viewState
.
item
.
previewUrl
)
.
transform
(
BlurTransformation
(
40
,
4
))
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
blurPreview
)
Glide
.
with
(
articlePreview
)
.
load
(
viewState
.
item
.
previewUrl
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
articlePreview
)
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/util/textAdapter.kt
View file @
9e3f65bf
...
...
@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
import
butterknife.ButterKnife
import
com.biganto.visual.roompark.R
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.google.android.material.textview.MaterialTextView
/**
...
...
@@ -94,6 +95,7 @@ class HtmlImageViewHolder(itemView: View) :HtmlTagViewHolder<HtmlTag.ImageSource
Glide
.
with
(
itemView
)
.
load
(
url
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
itemView
as
ImageView
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenController.kt
View file @
9e3f65bf
...
...
@@ -23,6 +23,7 @@ import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusPr
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bluelinelabs.conductor.changehandler.FadeChangeHandler
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.google.android.material.textview.MaterialTextView
import
com.jakewharton.rxbinding3.view.clicks
import
com.jakewharton.rxbinding3.view.scrollChangeEvents
...
...
@@ -212,6 +213,7 @@ class DealScreenController :
viewState
.
estate
.
estate
.
multitourPreview
?.
let
{
Glide
.
with
(
tourScreen
)
.
load
(
it
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
tourScreen
)
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/util/Adapter.kt
View file @
9e3f65bf
...
...
@@ -19,6 +19,7 @@ import com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressAnimationState
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.google.android.material.textview.MaterialTextView
import
com.jakewharton.rxbinding3.view.clicks
import
io.reactivex.Observable
...
...
@@ -98,12 +99,10 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
statusLayout
.
addView
(
currentStatusText
,
0
)
statusLayout
.
invalidate
()
model
.
tourPreview
?.
let
{
Glide
.
with
(
tourScreen
)
.
load
(
it
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
tourScreen
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feed_list/util/Adapter.kt
View file @
9e3f65bf
...
...
@@ -10,6 +10,7 @@ import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyc
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.biganto.visual.roompark.util.extensions.setGone
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
timber.log.Timber
import
java.text.SimpleDateFormat
import
java.util.*
...
...
@@ -46,6 +47,7 @@ class ArticleViewHolder(itemView: View) : CommonViewHolder<ArticlePreviewModel>(
Glide
.
with
(
preview
)
.
load
(
model
.
previewUrl
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
(
preview
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment