Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
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
726b46dd
Commit
726b46dd
authored
Dec 02, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust pictures sizes
parent
6dbbbb66
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
raw2entity.kt
...anto/visual/roompark/data/repository/mapper/raw2entity.kt
+1
-1
ScreenController.kt
.../roompark/presentation/screen/article/ScreenController.kt
+3
-4
PicassoImageGetter.kt
...isual/roompark/util/view_utils/html/PicassoImageGetter.kt
+6
-3
feed_read_header.xml
app/src/main/res/layout/feed_read_header.xml
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/data/repository/mapper/raw2entity.kt
View file @
726b46dd
...
...
@@ -50,7 +50,7 @@ fun fromRaw(raw:ArticleRaw) : ArticleEntity {
fun
fromRaw
(
raw
:
NewsArticleRaw
,
feedId
:
Int
):
ArticleEntity
{
val
entity
=
ArticleEntity
()
entity
.
setId
(
raw
.
id
)
entity
.
setPreview
(
"https://room-park.ru${raw.preview}"
)
entity
.
setPreview
(
raw
.
preview
)
entity
.
setAnnounce
(
raw
.
announce
)
entity
.
setPublished
(
raw
.
published
)
entity
.
setTitle
(
raw
.
title
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/ScreenController.kt
View file @
726b46dd
...
...
@@ -14,7 +14,6 @@ import com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.util.view_utils.html.HtmlTagHandler
import
com.google.android.material.floatingactionbutton.FloatingActionButton
import
com.google.android.material.textview.MaterialTextView
import
com.squareup.picasso.Picasso
...
...
@@ -123,7 +122,7 @@ class ArticleScreenController :
val
imageGetter
=
PicassoImageGetter
(
contentView
)
val
parsedHtml
=
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
Html
.
fromHtml
(
viewState
.
item
.
htmlBody
,
HtmlCompat
.
FROM_HTML_MODE_
LEGACY
HtmlCompat
.
FROM_HTML_MODE_
COMPACT
,
imageGetter
// Html.ImageGetter { url ->
...
...
@@ -135,7 +134,7 @@ class ArticleScreenController :
// .toDrawable(resources!!)
//// .current
// }
,
HtmlTagHandler
()
)
,
null
)
else
Html
.
fromHtml
(
viewState
.
item
.
htmlBody
,
imageGetter
...
...
@@ -148,7 +147,7 @@ class ArticleScreenController :
// .toDrawable(resources!!)
//// .current
// }
,
HtmlTagHandler
()
)
,
null
)
contentView
.
text
=
parsedHtml
...
...
app/src/main/java/com/biganto/visual/roompark/util/view_utils/html/PicassoImageGetter.kt
View file @
726b46dd
...
...
@@ -42,9 +42,12 @@ class PicassoImageGetter(private val target: MaterialTextView) : Html.ImageGette
var
width
=
drawable
.
intrinsicWidth
var
height
=
drawable
.
intrinsicHeight
target
.
let
{
val
aspect
=
it
.
measuredWidthAndState
.
toFloat
()/
width
.
toFloat
()
height
=
(
height
*
min
(
aspect
,
1.0f
)).
toInt
()
width
=
min
(
width
,
it
.
measuredWidthAndState
)
val
aspect
=
it
.
width
.
toFloat
()/
width
.
toFloat
()
height
=
if
(
width
>
it
.
width
)
(
height
*
min
(
aspect
,
1.0f
)).
toInt
()
else
(
height
.
toFloat
()*
aspect
).
toInt
()
width
=
if
(
width
>
it
.
width
)
width
else
it
.
width
drawable
.
setBounds
(
0
,
0
,
width
,
height
)
setBounds
(
0
,
0
,
width
,
height
)
...
...
app/src/main/res/layout/feed_read_header.xml
View file @
726b46dd
...
...
@@ -29,7 +29,7 @@
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/ic_favorites"
/>
<TextView
<
com.google.android.material.textview.Material
TextView
android:id=
"@+id/articleDate"
style=
"@style/Feed.Notice"
android:layout_width=
"0dp"
...
...
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