pockethub / PocketHub

PocketHub Android App
Apache License 2.0
9.39k stars 3.47k forks source link

Inline Intent helper methods #1274

Closed veyndan closed 4 years ago

veyndan commented 4 years ago

Inline Intent.get___Extra(String) methods as:

Meisolsson commented 4 years ago

Why do we use activity?.intent? in app/src/main/java/com/github/pockethub/android/ui/gist/GistFileFragment.kt but activity.intent in app/src/main/java/com/github/pockethub/android/ui/commit/CommitCompareListFragment.kt?

veyndan commented 4 years ago

In the original app/src/main/java/com/github/pockethub/android/ui/gist/GistFileFragment.kt we don't assert that the activity should be non-nullable, so I have kept the logic the same by using activity?. In the original app/src/main/java/com/github/pockethub/android/ui/commit/CommitCompareListFragment.kt we assert that activity should never be null, so in the later lines activity is never null. I haven't changed the nullability contract in this PR.

Meisolsson commented 4 years ago

Alright, that makes sense. I'll check this in a bit.