-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
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.
Overall, looks great!
@@ -0,0 +1,6 @@ | |||
<vector android:height="20dp" android:viewportHeight="20" |
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.
nit- license
|
||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<solid android:color="@color/photonGrey30" /> |
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.
at some point we should probably update all of these to have an attr color but doesn't have to be now
@@ -21,7 +21,16 @@ fun String.replace(pairs: Map<String, String>): String { | |||
fun String?.urlToHost(): String { | |||
return try { | |||
val url = URL(this) | |||
url.host | |||
val firstIndex = url.host.indexOfFirst { it == '.' } + 1 | |||
val lastIndex = url.host.indexOfLast { it == '.' } |
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.
@ekager this is the updated way I'm generating the "host" string because just want the name of the website (e.g. mozilla
instead of www.mozilla.org
like we previously had.)
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 cleaned this up quite a bit so it looks nicer and has a comment to explain the logic. Do you think it's okay to have this change here?
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 this the only place this extension is used? You may want to create another function just to not break someone else's code using this
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.
Good point. I moved it to a separate function :)
221824d
to
f3494a2
Compare
This PR is almost complete, but I want to do a round of clean up on it before review!