Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin implemtentation of minicap #12

Merged
merged 3 commits into from
Apr 16, 2021
Merged

Kotlin implemtentation of minicap #12

merged 3 commits into from
Apr 16, 2021

Conversation

pcrepieux
Copy link

This is an attempt to write a minicap version in kotlin and
use higher level api that should hopefully make it easier
to support many os version (and the future ones).
It also is likely to prevent the reccurent "Vector<> have
different types" errors.
The implementation is not complete and a few changes will have
to be done on stf.

This is an attempt to write a minicap version in kotlin and
use higher level api that should hopefully make it easier
to support many os version (and the future ones).
It also is likely to prevent the reccurent "Vector<> have
different types" errors.
The implementation is not complete and a few changes will have
to be done on stf.

Signed-off-by: Crepieux Pierre <[email protected]>
implementation 'com.google.android.material:material:1.3.0'
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'com.github.tony19:logback-android:2.0.0'
testImplementation 'junit:junit:4.+'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove test dependencies if we have no tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

putInt(screenSize.height)//Height
putInt(targetSize.width)//resized Width
putInt(targetSize.height)//resized height
put(0.toByte()) //orientation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe extract a constant for this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe should I simply have those sizes as parameters of sendBanner. They actually aren't used anywhere else at the moment.

@SuppressLint("PrivateApi")
object DisplayManagerGlobal {
private var displayManager: Any?
private var CLASS: Class<*>?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's rather named like clazz

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

ext.kotlin_version = "1.4.31"
repositories {
google()
jcenter()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jcenter will become read only in May and completely disabled next year. I would not include it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

- remove currently unused test deps and code
- remove Jcenter repository
- reduce scope of target and device size in MinicapClientOutput
- rename CLASS to clazz

Signed-off-by: Crepieux Pierre <[email protected]>
@pcrepieux pcrepieux merged commit e5e6153 into master Apr 16, 2021
@pcrepieux pcrepieux deleted the minicap-kotlin branch April 16, 2021 06:59
@varundtsfi
Copy link
Collaborator

I am not aware about the kotlin but I will use this approach.:+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants