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
61a1f848
Commit
61a1f848
authored
Nov 01, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update converters
parent
690c8b44
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
37 deletions
+64
-37
build.gradle
app/build.gradle
+4
-0
AuthRepository.kt
...anto/visual/roompark/data/data_provider/AuthRepository.kt
+1
-1
SupportTypes.kt
...isual/roompark/data/repository/db/requrey/SupportTypes.kt
+4
-34
Article.kt
...sual/roompark/data/repository/db/requrey/model/Article.kt
+2
-2
TitledPhotoListConverter.java
...repository/db/requrey/utils/TitledPhotoListConverter.java
+52
-0
build.gradle
build.gradle
+1
-0
No files found.
app/build.gradle
View file @
61a1f848
...
@@ -8,6 +8,8 @@ apply plugin: 'kotlin-android-extensions'
...
@@ -8,6 +8,8 @@ apply plugin: 'kotlin-android-extensions'
apply
from:
'../dependencies.gradle'
apply
from:
'../dependencies.gradle'
apply
plugin:
'kotlinx-serialization'
//apply plugin: 'io.fabric'
//apply plugin: 'io.fabric'
android
{
android
{
...
@@ -66,6 +68,8 @@ dependencies {
...
@@ -66,6 +68,8 @@ dependencies {
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation
'androidx.core:core-ktx:1.1.0'
implementation
'androidx.core:core-ktx:1.1.0'
implementation
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation
"org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.13.0"
// JVM dependency
//Material
//Material
implementation
"com.google.android.material:material:$materialVersion"
implementation
"com.google.android.material:material:$materialVersion"
...
...
app/src/main/java/com/biganto/visual/roompark/data/data_provider/AuthRepository.kt
View file @
61a1f848
...
@@ -17,7 +17,7 @@ class AuthRepository @Inject constructor(
...
@@ -17,7 +17,7 @@ class AuthRepository @Inject constructor(
override
fun
signIn
(
email
:
String
,
password
:
String
):
Observable
<
AuthInfoModel
>
=
override
fun
signIn
(
email
:
String
,
password
:
String
):
Observable
<
AuthInfoModel
>
=
roomparkApi
.
authenticate
(
email
,
password
)
roomparkApi
.
authenticate
(
email
,
password
)
.
map
{
}
.
map
{
AuthInfoModel
(
""
,
2
,
""
,
""
)
}
override
fun
signOut
():
Completable
{
override
fun
signOut
():
Completable
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/SupportTypes.kt
View file @
61a1f848
package
com.biganto.visual.roompark.data.repository.db.requrey
package
com.biganto.visual.roompark.data.repository.db.requrey
import
android.os.Parcel
import
kotlinx.serialization.Serializable
import
android.os.Parcelable
/**
/**
* Created by Vladislav Bogdashkin on 15.06.2018.
* Created by Vladislav Bogdashkin on 15.06.2018.
...
@@ -29,7 +28,7 @@ class RevisionString(private val value:String, private val revision:String?){
...
@@ -29,7 +28,7 @@ class RevisionString(private val value:String, private val revision:String?){
@Serializable
class
TitledPhoto
(
val
title
:
String
,
val
url
:
String
){
class
TitledPhoto
(
val
title
:
String
,
val
url
:
String
){
companion
object
{
companion
object
{
...
@@ -43,39 +42,10 @@ class TitledPhoto(val title:String, val url:String){
...
@@ -43,39 +42,10 @@ class TitledPhoto(val title:String, val url:String){
}
}
//
@Serializable
@Serializable
data class
ResolutionRaw
(
data class
ResolutionRaw
(
val
res_name
:
String
,
val
res_name
:
String
,
val
url
:
String
,
val
url
:
String
,
val
width
:
Int
,
val
width
:
Int
,
val
height
:
Int
val
height
:
Int
)
:
Parcelable
{
)
constructor
(
parcel
:
Parcel
)
:
this
(
parcel
.
readString
(),
parcel
.
readString
(),
parcel
.
readInt
(),
parcel
.
readInt
()
)
{
}
override
fun
writeToParcel
(
parcel
:
Parcel
,
flags
:
Int
)
{
parcel
.
writeString
(
res_name
)
parcel
.
writeString
(
url
)
parcel
.
writeInt
(
width
)
parcel
.
writeInt
(
height
)
}
override
fun
describeContents
():
Int
{
return
0
}
companion
object
CREATOR
:
Parcelable
.
Creator
<
ResolutionRaw
>
{
override
fun
createFromParcel
(
parcel
:
Parcel
):
ResolutionRaw
{
return
ResolutionRaw
(
parcel
)
}
override
fun
newArray
(
size
:
Int
):
Array
<
ResolutionRaw
?
>
{
return
arrayOfNulls
(
size
)
}
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/Article.kt
View file @
61a1f848
package
com.biganto.visual.roompark.data.repository.db.requrey.model
package
com.biganto.visual.roompark.data.repository.db.requrey.model
import
com.biganto.visual.roompark.data.repository.db.requrey.TitledPhoto
import
com.biganto.visual.roompark.data.repository.db.requrey.TitledPhoto
import
com.biganto.visual.roompark.data.repository.db.requrey.utils.TitledPhotoConverter
import
com.biganto.visual.roompark.data.repository.db.requrey.utils.TitledPhoto
List
Converter
import
io.requery.*
import
io.requery.*
import
java.util.*
import
java.util.*
...
@@ -25,6 +25,6 @@ interface Article : Persistable {
...
@@ -25,6 +25,6 @@ interface Article : Persistable {
@get
:
ForeignKey
(
references
=
Feed
::
class
,
referencedColumn
=
"alias"
)
@get
:
ForeignKey
(
references
=
Feed
::
class
,
referencedColumn
=
"alias"
)
@get
:
ManyToOne
@get
:
ManyToOne
val
feed_alias
:
Feed
val
feed_alias
:
Feed
@get
:
Convert
(
TitledPhotoConverter
::
class
)
@get
:
Convert
(
TitledPhoto
List
Converter
::
class
)
val
photo
:
List
<
TitledPhoto
>?
val
photo
:
List
<
TitledPhoto
>?
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/utils/TitledPhotoConverter.java
→
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/utils/TitledPhoto
List
Converter.java
View file @
61a1f848
...
@@ -2,8 +2,8 @@ package com.biganto.visual.roompark.data.repository.db.requrey.utils;
...
@@ -2,8 +2,8 @@ package com.biganto.visual.roompark.data.repository.db.requrey.utils;
import
com.biganto.visual.roompark.data.repository.db.requrey.TitledPhoto
;
import
com.biganto.visual.roompark.data.repository.db.requrey.TitledPhoto
;
import
java.
text.SimpleDateForma
t
;
import
java.
util.ArrayLis
t
;
import
java.util.L
ocale
;
import
java.util.L
ist
;
import
io.requery.Converter
;
import
io.requery.Converter
;
import
timber.log.Timber
;
import
timber.log.Timber
;
...
@@ -13,15 +13,12 @@ import timber.log.Timber;
...
@@ -13,15 +13,12 @@ import timber.log.Timber;
*/
*/
public
class
TitledPhotoConverter
implements
Converter
<
TitledPhoto
,
String
>
{
public
class
TitledPhotoListConverter
implements
Converter
<
List
<
TitledPhoto
>,
String
>
{
private
SimpleDateFormat
apiFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSS+hh:mm"
,
Locale
.
ROOT
);
//SimpleDateFormat dbFormat =new SimpleDateFormat("YYYYMMDDThhmmss", Locale.ROOT);
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
@Override
@Override
public
Class
<
TitledPhoto
>
getMappedType
()
{
public
Class
<
List
<
TitledPhoto
>
>
getMappedType
()
{
return
TitledPhoto
.
class
;
return
(
Class
)
List
.
class
;
}
}
@Override
@Override
...
@@ -35,20 +32,20 @@ public class TitledPhotoConverter implements Converter<TitledPhoto, String> {
...
@@ -35,20 +32,20 @@ public class TitledPhotoConverter implements Converter<TitledPhoto, String> {
}
}
@Override
@Override
public
String
convertToPersisted
(
TitledPhoto
value
)
{
public
String
convertToPersisted
(
List
<
TitledPhoto
>
value
)
{
return
value
==
null
?
null
:
apiFormat
.
format
(
value
);
return
value
==
null
?
null
:
null
;
//Json.Companion.stringify(TitledPhoto(),value)
}
}
@Override
@Override
public
TitledPhoto
convertToMapped
(
Class
<?
extends
TitledPhoto
>
type
,
public
List
<
TitledPhoto
>
convertToMapped
(
Class
<?
extends
List
<
TitledPhoto
>
>
type
,
String
value
)
{
String
value
)
{
try
{
try
{
return
value
==
null
?
null
:
new
TitledPhoto
(
value
);
return
value
==
null
?
null
:
n
ull
;
//n
ew TitledPhoto(value);
}
}
catch
(
Exception
e
){
catch
(
Exception
e
){
Timber
.
e
(
"Wrong stored data format! {%s}"
,
value
);
Timber
.
e
(
"Wrong stored data format! {%s}"
,
value
);
return
new
TitledPhoto
(
""
,
""
);
return
new
ArrayList
<
TitledPhoto
>(
1
);
//TitledPhoto("","")
);
}
}
}
}
...
...
build.gradle
View file @
61a1f848
...
@@ -13,6 +13,7 @@ buildscript {
...
@@ -13,6 +13,7 @@ buildscript {
dependencies
{
dependencies
{
classpath
"com.android.tools.build:gradle:3.5.0"
classpath
"com.android.tools.build:gradle:3.5.0"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath
"org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// in the individual module build.gradle files
}
}
...
...
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