diff --git a/app/src/main/java/com/mercandalli/android/browser/main/MainActivityPresenter.kt b/app/src/main/java/com/mercandalli/android/browser/main/MainActivityPresenter.kt index 7c424b8..6438fdd 100644 --- a/app/src/main/java/com/mercandalli/android/browser/main/MainActivityPresenter.kt +++ b/app/src/main/java/com/mercandalli/android/browser/main/MainActivityPresenter.kt @@ -6,9 +6,7 @@ internal class MainActivityPresenter( override fun onSearchPerformed(search: String) { screen.showLoader(0) - val url = - if (search.startsWith("https://") || search.startsWith("http://")) search - else "https://www.google.fr/search?q=" + search.replace(" ", "+") + val url = searchToUrl(search) screen.showUrl(url) screen.resetSearchInput() screen.collapseToolbar() @@ -51,4 +49,11 @@ internal class MainActivityPresenter( override fun onToolbarCollapsed(collapsed: Boolean) { screen.setToolbarContentVisible(!collapsed) } + + private fun searchToUrl(search: String) = + if (search.startsWith("https://") || search.startsWith("http://")) { + search + } else { + "https://www.google.fr/search?q=" + search.replace(" ", "+") + } } diff --git a/app/src/main/java/com/mercandalli/android/browser/theme/ThemeModule.kt b/app/src/main/java/com/mercandalli/android/browser/theme/ThemeModule.kt index dbb7ac2..70cbda3 100644 --- a/app/src/main/java/com/mercandalli/android/browser/theme/ThemeModule.kt +++ b/app/src/main/java/com/mercandalli/android/browser/theme/ThemeModule.kt @@ -6,10 +6,10 @@ class ThemeModule( private val context: Context ) { - fun provideThemeManager( - ): ThemeManager { + fun provideThemeManager(): ThemeManager { val sharedPreferences = context.getSharedPreferences( - ThemeManagerImpl.PREFERENCE_NAME, Context.MODE_PRIVATE + ThemeManagerImpl.PREFERENCE_NAME, + Context.MODE_PRIVATE ) return ThemeManagerImpl(sharedPreferences) } diff --git a/build.gradle b/build.gradle index 857f160..095b285 100644 --- a/build.gradle +++ b/build.gradle @@ -38,8 +38,8 @@ task clean(type: Delete) { } ext { - appVersionCode = 1_00_03 - appVersionName = "1.00.03" + appVersionCode = 1_00_04 + appVersionName = "1.00.04" compileSdkVersion = 28 buildToolsVersion = "27.0.3"