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
a70ac3cc
Commit
a70ac3cc
authored
Mar 11, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dialog
parent
781aa274
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
125 additions
and
17 deletions
+125
-17
AlertDialogController.kt
...isual/roompark/conductor/dialogs/AlertDialogController.kt
+6
-4
ChooseResolutionDialogController.kt
...ark/conductor/dialogs/ChooseResolutionDialogController.kt
+78
-0
ExceptionAlertDialogController.kt
...mpark/conductor/dialogs/ExceptionAlertDialogController.kt
+0
-1
UpdateAppAlertDialogController.kt
...mpark/conductor/dialogs/UpdateAppAlertDialogController.kt
+0
-1
albums.kt
...n/java/com/biganto/visual/roompark/domain/model/albums.kt
+32
-4
choose_size_modal_screen.xml
app/src/main/res/layout/choose_size_modal_screen.xml
+3
-3
choose_size_viewholder.xml
app/src/main/res/layout/choose_size_viewholder.xml
+6
-4
No files found.
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/AlertDialogController.kt
View file @
a70ac3cc
package
com.biganto.visual.
androidplayer
.conductor.dialogs
package
com.biganto.visual.
roompark
.conductor.dialogs
import
android.os.Bundle
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.LayoutInflater
...
@@ -15,9 +15,9 @@ import com.bluelinelabs.conductor.Controller
...
@@ -15,9 +15,9 @@ import com.bluelinelabs.conductor.Controller
* Created by Vladislav Bogdashkin on 09.04.2019.
* Created by Vladislav Bogdashkin on 09.04.2019.
*/
*/
const
val
ALERT_DIALOG_MESSAGE_KEY
=
"BIGANTO_ALERT_MESSAGE"
internal
const
val
ALERT_DIALOG_MESSAGE_KEY
=
"BIGANTO_ALERT_MESSAGE"
const
val
ALERT_DIALOG_BUTTON_TEXT_KEY
=
"BIGANTO_ALERT_OK_BUTTON_TEXT"
internal
const
val
ALERT_DIALOG_BUTTON_TEXT_KEY
=
"BIGANTO_ALERT_OK_BUTTON_TEXT"
const
val
ALERT_DIALOG_BUTTON_CANCEL_TEXT_KEY
=
"BIGANTO_ALERT_CANCEL_BUTTON_TEXT"
internal
const
val
ALERT_DIALOG_BUTTON_CANCEL_TEXT_KEY
=
"BIGANTO_ALERT_CANCEL_BUTTON_TEXT"
fun
formBundle
(
message
:
String
):
Bundle
{
fun
formBundle
(
message
:
String
):
Bundle
{
val
b
=
Bundle
()
val
b
=
Bundle
()
...
@@ -40,6 +40,8 @@ fun formBundle(message:String,buttonText:String,cancelButtonText:String): Bundle
...
@@ -40,6 +40,8 @@ fun formBundle(message:String,buttonText:String,cancelButtonText:String): Bundle
return
b
return
b
}
}
open
class
AlertDialogController
:
Controller
{
open
class
AlertDialogController
:
Controller
{
constructor
():
super
()
constructor
():
super
()
...
...
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/ChooseResolutionDialogController.kt
0 → 100644
View file @
a70ac3cc
package
com.biganto.visual.roompark.conductor.dialogs
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.annotation.LayoutRes
import
androidx.recyclerview.widget.RecyclerView
import
butterknife.BindView
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.PhotoResolutionModel
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.bluelinelabs.conductor.Controller
import
com.google.android.material.textview.MaterialTextView
/**
* Created by Vladislav Bogdashkin on 09.04.2019.
*/
internal
const
val
PHOTOS_KEY
=
"CHHOSE_PHOTO_LIST_KEY"
private
fun
formBundle
(
photos
:
ArrayList
<
PhotoResolutionModel
>):
Bundle
{
val
b
=
Bundle
()
b
.
putParcelableArrayList
(
PHOTOS_KEY
,
photos
)
return
b
}
class
ChooseResolutionDialogController
:
Controller
{
constructor
(
args
:
Bundle
)
:
super
(
args
)
constructor
(
photos
:
ArrayList
<
PhotoResolutionModel
>)
:
super
(
formBundle
(
photos
))
lateinit
var
recyclerView
:
RecyclerView
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
val
view
=
inflater
.
inflate
(
getLayoutId
(),
container
,
false
)
recyclerView
=
view
.
findViewById
(
R
.
id
.
photoSizesRecyclerView
)
recyclerView
.
adapter
=
PhotoSizeAdapter
()
args
.
getParcelableArrayList
<
PhotoResolutionModel
>(
PHOTOS_KEY
)
?.
let
{
(
recyclerView
.
adapter
as
PhotoSizeAdapter
).
setItems
(
it
)
}
return
view
}
@LayoutRes
fun
getLayoutId
()
=
R
.
layout
.
choose_size_modal_screen
var
dismissActionDelegate
=
{
router
.
popCurrentController
()
Unit
// args.putParcelableArrayList("sdsd", arrayListOf<PhotoModel>())
}
}
private
class
PhotoSizeAdapter
:
CommonRecyclerAdapter
<
PhotoSizeViewHolder
,
PhotoResolutionModel
>(){
override
val
vhKlazz
=
PhotoSizeViewHolder
::
class
override
fun
getVhLayout
():
Int
=
R
.
layout
.
choose_size_viewholder
}
private
class
PhotoSizeViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
PhotoResolutionModel
>(
itemView
){
@BindView
(
R
.
id
.
size_text
)
lateinit
var
textView
:
MaterialTextView
override
fun
onViewBound
(
model
:
PhotoResolutionModel
)
{
textView
.
text
=
model
.
resName
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/ExceptionAlertDialogController.kt
View file @
a70ac3cc
package
com.biganto.visual.roompark.conductor.dialogs
package
com.biganto.visual.roompark.conductor.dialogs
import
android.os.Bundle
import
android.os.Bundle
import
com.biganto.visual.androidplayer.conductor.dialogs.AlertDialogController
/**
/**
* Created by Vladislav Bogdashkin on 09.04.2019.
* Created by Vladislav Bogdashkin on 09.04.2019.
...
...
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/UpdateAppAlertDialogController.kt
View file @
a70ac3cc
...
@@ -3,7 +3,6 @@ package com.biganto.visual.roompark.conductor.dialogs
...
@@ -3,7 +3,6 @@ package com.biganto.visual.roompark.conductor.dialogs
import
android.content.Intent
import
android.content.Intent
import
android.net.Uri
import
android.net.Uri
import
android.os.Bundle
import
android.os.Bundle
import
com.biganto.visual.androidplayer.conductor.dialogs.AlertDialogController
import
timber.log.Timber
import
timber.log.Timber
...
...
app/src/main/java/com/biganto/visual/roompark/domain/model/albums.kt
View file @
a70ac3cc
package
com.biganto.visual.roompark.domain.model
package
com.biganto.visual.roompark.domain.model
import
android.os.Parcel
import
android.os.Parcelable
import
com.biganto.visual.roompark.data.repository.db.requrey.model.GalleryPhotoEntity
import
com.biganto.visual.roompark.data.repository.db.requrey.model.GalleryPhotoEntity
import
com.biganto.visual.roompark.data.repository.db.requrey.model.ImageAlbumEntity
import
com.biganto.visual.roompark.data.repository.db.requrey.model.ImageAlbumEntity
import
timber.log.Timber
import
timber.log.Timber
...
@@ -44,9 +46,8 @@ data class PhotoModel(
...
@@ -44,9 +46,8 @@ data class PhotoModel(
val
description
:
String
?,
val
description
:
String
?,
val
sort
:
Int
,
val
sort
:
Int
,
val
resolutionList
:
List
<
PhotoResolutionModel
>
val
resolutionList
:
List
<
PhotoResolutionModel
>
){
){
fun
optimalResolution
(
width
:
Int
,
height
:
Int
)
=
fun
optimalResolution
(
width
:
Int
,
height
:
Int
)
=
resolutionList
resolutionList
.
asSequence
()
.
asSequence
()
.
filter
{
it
.
resWidth
>=
width
||
it
.
resWidth
>=
height
}
.
filter
{
it
.
resWidth
>=
width
||
it
.
resWidth
>=
height
}
...
@@ -54,7 +55,6 @@ data class PhotoModel(
...
@@ -54,7 +55,6 @@ data class PhotoModel(
.
onEach
{
Timber
.
d
(
"res filtered: ${it.resWidth} / ${it.resHeight}"
)
}
.
onEach
{
Timber
.
d
(
"res filtered: ${it.resWidth} / ${it.resHeight}"
)
}
.
minBy
{
it
.
resHeight
*
it
.
resWidth
}
.
minBy
{
it
.
resHeight
*
it
.
resWidth
}
?:
resolutionList
.
maxBy
{
it
.
resHeight
*
it
.
resWidth
}
!!
?:
resolutionList
.
maxBy
{
it
.
resHeight
*
it
.
resWidth
}
!!
}
}
data class
PhotoResolutionModel
(
data class
PhotoResolutionModel
(
...
@@ -62,7 +62,35 @@ data class PhotoResolutionModel(
...
@@ -62,7 +62,35 @@ data class PhotoResolutionModel(
val
url
:
String
,
val
url
:
String
,
val
resWidth
:
Int
,
val
resWidth
:
Int
,
val
resHeight
:
Int
val
resHeight
:
Int
)
)
:
Parcelable
{
constructor
(
parcel
:
Parcel
)
:
this
(
parcel
.
readString
(),
parcel
.
readString
(),
parcel
.
readInt
(),
parcel
.
readInt
()
)
override
fun
writeToParcel
(
parcel
:
Parcel
,
flags
:
Int
)
{
parcel
.
writeString
(
resName
)
parcel
.
writeString
(
url
)
parcel
.
writeInt
(
resWidth
)
parcel
.
writeInt
(
resHeight
)
}
override
fun
describeContents
():
Int
{
return
0
}
companion
object
CREATOR
:
Parcelable
.
Creator
<
PhotoResolutionModel
>
{
override
fun
createFromParcel
(
parcel
:
Parcel
):
PhotoResolutionModel
{
return
PhotoResolutionModel
(
parcel
)
}
override
fun
newArray
(
size
:
Int
):
Array
<
PhotoResolutionModel
?
>
{
return
arrayOfNulls
(
size
)
}
}
}
fun
fromEntity
(
entity
:
ImageAlbumEntity
):
AlbumPreviewModel
=
fun
fromEntity
(
entity
:
ImageAlbumEntity
):
AlbumPreviewModel
=
...
...
app/src/main/res/layout/choose_size_modal_screen.xml
View file @
a70ac3cc
...
@@ -35,13 +35,13 @@
...
@@ -35,13 +35,13 @@
android:id=
"@+id/include4"
android:id=
"@+id/include4"
layout=
"@layout/horizontal_divider"
layout=
"@layout/horizontal_divider"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
1dp
"
app:layout_constraintBottom_toTopOf=
"@+id/
r
ecyclerView"
app:layout_constraintBottom_toTopOf=
"@+id/
photoSizesR
ecyclerView"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
app:layout_constraintStart_toStartOf=
"parent"
/>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/
r
ecyclerView"
android:id=
"@+id/
photoSizesR
ecyclerView"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toTopOf=
"@+id/materialTextView"
app:layout_constraintBottom_toTopOf=
"@+id/materialTextView"
...
...
app/src/main/res/layout/choose_size_viewholder.xml
View file @
a70ac3cc
...
@@ -7,14 +7,15 @@
...
@@ -7,14 +7,15 @@
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/
textView12
"
android:id=
"@+id/
size_text
"
style=
"@style/Default_TextView.Accent_Text"
style=
"@style/Default_TextView.Accent_Text"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"20dp"
android:layout_marginTop=
"20dp"
android:layout_marginTop=
"20dp"
android:layout_marginBottom=
"20dp"
android:includeFontPadding=
"false"
android:includeFontPadding=
"false"
android:text=
"1080x1920"
android:text=
"1080x1920"
android:textAlignment=
"viewStart"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/imageView6"
app:layout_constraintEnd_toStartOf=
"@+id/imageView6"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
@@ -24,8 +25,9 @@
...
@@ -24,8 +25,9 @@
android:id=
"@+id/imageView6"
android:id=
"@+id/imageView6"
android:layout_width=
"16dp"
android:layout_width=
"16dp"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
app:layout_constraintBottom_toBottomOf=
"@+id/textView12"
android:layout_marginEnd=
"8dp"
app:layout_constraintBottom_toBottomOf=
"@+id/size_text"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/
textView12
"
app:layout_constraintTop_toTopOf=
"@+id/
size_text
"
app:srcCompat=
"@drawable/ic_favorites"
/>
app:srcCompat=
"@drawable/ic_favorites"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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