-
Notifications
You must be signed in to change notification settings - Fork 10
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
Gz/convert to kotlin #100
Gz/convert to kotlin #100
Conversation
70fc2c4
to
85bd7eb
Compare
|
@gigiyy I'll take a look at this tomorrow, my brain has had too much PR for one day 😬 |
seems odd to me that all the source is nested under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the changes of the android target/compile versions, have you tested with different versions in the emulator? The ideal would be to test with the min and max version.
The tests are not passing for me (version 23 in the emulator) for the java version, and for the Kotlin version I am not able to launch anything, it says to select a SDK version:
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_linked_broker_accounts) | ||
val textView = linked_broker_accounts_textview //this.findViewById(R.id.linked_broker_accounts_textview) as TextView? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we delete this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted
/** | ||
* [Testing Fundamentals](http://d.android.com/tools/testing/testing_android.html) | ||
*/ | ||
class ApplicationTest : ApplicationTestCase<Application>(Application::class.java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, can we delete this, as it does nothing special?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted. it seems the left over of the skeleton when application is created.
/** | ||
* To work on unit tests, switch the Test Artifact in the Build Variants view. | ||
*/ | ||
class ExampleUnitTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this, as it does nothing special?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted. this folder was supposed to contain those tests that don't need to use espresso test framework.
implementation 'com.android.support:customtabs:27.1.1' | ||
implementation 'com.android.support:appcompat-v7:27.1.1' | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
implementation "org.jetbrains.anko:anko:$anko_version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this library for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/Kotlin/anko, I'm planning the use this library when further improvement to the app is done. it can be safely removed though if not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, if currently there are nothing using it, can you remove it?
"orderId='" + orderId + '\'' + | ||
", orderDetails=" + orderDetails + | ||
"orderId='" + orderId + "'" + | ||
", ackWarningsList=[]" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are empty arrays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regenerate using the IDE instead.
@@ -34,6 +34,42 @@ | |||
TradeItOrderDetailsParcelable() { | |||
} | |||
|
|||
@Override | |||
public String toString() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a real benefit in term of performance, writing a custom toString()
with StringBuilder
than generating the method by IntelliJ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just didn't realize it can be generated. 😱
@@ -68,8 +68,8 @@ | |||
DELETE_ALL_LINKED_BROKERS("Delete all linked brokers"), | |||
AUTHENTICATE_FIRST_LINKED_BROKER("Authenticate first linked broker"), | |||
AUTHENTICATE_ALL_LINKED_BROKERS("Authenticate all linked brokers"), | |||
AUTHENTICATE_WITH_SECURITY_QUESTION_SIMPLE("Simple security question"), | |||
AUTHENTICATE_WITH_SECURITY_QUESTION_OPTIONS("Security question with options"), | |||
// AUTHENTICATE_WITH_SECURITY_QUESTION_SIMPLE("Simple security question"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
originally it's not implemented, not used at all. in fact, to test security questions, we just need to use same testOAuthFlow
and use dummySecurity
and dummyOption
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, can we remove them if we are not using instead of commenting out?
HI @guillaumedebavelaere, you will need to install chrome browser in your emulator( I tested in api level22, android 5.1) and it works ok. you can download the apk from apkmirror.com inside the emulator itself. the reason is that, current test only works with chrome custom tab, and not working with webview for oAuth pages (will need to use espresso-web instead) |
I installed chrome, but the tests are not passing (API 19). It is blocked when entering the credentials in the oAuth flow.
|
can you try run |
7b268ba
to
d17f84f
Compare
working now 👍 |
Let's wait to review and merge this one before: #102 |
d17f84f
to
e9b75f0
Compare
example App conversion to kotlin