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
3d3e623a
Commit
3d3e623a
authored
Dec 27, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format date formatting
parent
501b0ea3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
ScreenController.kt
.../roompark/presentation/screen/article/ScreenController.kt
+2
-1
ArticlesPreviewAdapter.kt
...presentation/screen/feeds/utils/ArticlesPreviewAdapter.kt
+2
-5
ext.kt
...n/java/com/biganto/visual/roompark/util/extensions/ext.kt
+7
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/ScreenController.kt
View file @
3d3e623a
...
...
@@ -15,6 +15,7 @@ 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.extensions.formatToSimple
import
com.google.android.material.floatingactionbutton.FloatingActionButton
import
com.google.android.material.textview.MaterialTextView
import
com.squareup.picasso.Picasso
...
...
@@ -151,7 +152,7 @@ class ArticleScreenController :
contentView
.
text
=
parsedHtml
articleDate
.
text
=
viewState
.
item
.
published
.
toString
()
articleDate
.
text
=
viewState
.
item
.
published
.
formatToSimple
Picasso
.
get
()
.
load
(
viewState
.
item
.
previewUrl
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/utils/ArticlesPreviewAdapter.kt
View file @
3d3e623a
...
...
@@ -8,10 +8,9 @@ import com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.ArticlePreviewModel
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.biganto.visual.roompark.util.extensions.formatToSimple
import
com.biganto.visual.roompark.util.extensions.setGone
import
com.squareup.picasso.Picasso
import
java.text.SimpleDateFormat
import
java.util.*
/**
...
...
@@ -28,15 +27,13 @@ class ArticlesPreviewAdapter : CommonRecyclerAdapter<ArticlePreviewViewHolder,Ar
class
ArticlePreviewViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
ArticlePreviewModel
>(
itemView
)
{
private
val
dateFormatter
=
SimpleDateFormat
(
"dd / MM / yyyy"
,
Locale
.
getDefault
())
@BindView
(
R
.
id
.
imageHolder
)
lateinit
var
preview
:
ImageView
@BindView
(
R
.
id
.
feed_date_text_view
)
lateinit
var
articleDate
:
TextView
@BindView
(
R
.
id
.
feed_title_info_text_view
)
lateinit
var
articleTitle
:
TextView
@BindView
(
R
.
id
.
feed_read
)
lateinit
var
articleIsRead
:
View
override
fun
onViewBound
(
model
:
ArticlePreviewModel
)
{
articleDate
.
text
=
dateFormatter
.
format
(
model
.
published
)
articleDate
.
text
=
model
.
published
.
formatToSimple
articleTitle
.
text
=
model
.
title
articleIsRead
.
setGone
(
model
.
isRead
)
...
...
app/src/main/java/com/biganto/visual/roompark/util/extensions/ext.kt
View file @
3d3e623a
...
...
@@ -6,13 +6,19 @@ import android.graphics.RectF
import
android.view.View
import
timber.log.Timber
import
java.text.DecimalFormat
import
java.text.SimpleDateFormat
import
java.util.*
/**
* Created by Vladislav Bogdashkin on 23.10.2019.
*/
private
val
dateFormatter
=
SimpleDateFormat
(
"dd / MM / yyyy"
,
Locale
.
getDefault
())
val
Date
.
formatToSimple
:
String
get
()
=
dateFormatter
.
format
(
this
)
val
Boolean
?.
asInt
get
()
=
if
(
this
!=
null
&&
this
)
1
else
0
...
...
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