novum-d / SearchSummarizer

0 stars 0 forks source link

Browser機能 #7

Open novum-d opened 2 years ago

novum-d commented 2 years ago

Overview

Web検索の実装

App内でWeb検索をする

Todo

Option

novum-d commented 2 years ago

OptIn annotationを使用すると以下のGralde警告が発生

This class can only be used with the compiler argument '-opt-in=kotlin.RequiresOptIn'

GradleのOpt-in requirementsの警告を抑制するためのcompiler optionを追加することで解決:bulb: https://github.com/HamadaTomoki/SearchSummarizer/blob/0bd2b979d2b177584d9cad2df7c37670002bae90/app/build.gradle#L53-L55

novum-d commented 2 years ago

faviconを提供するGoogle Favicon SnatcherAPIから画像を取得するためにCoilを使用する

Coilは、Kotlin CoroutineがSupportするAndroid用の画像読み込みLibrary

novum-d commented 2 years ago

recomposeによりWebviewが再構成され続けるbugを修正

recomposeのたびにWebViewが構成されるため、navigationのback stackが一向に溜まらない問題が起きた(back stackがたまらないので後ろへnavigateできない)。WebViewのinstanceをViewModelで保持すること解決:bulb:

novum-d commented 2 years ago

Android 9.0以上は暗号化されていない接続を「Clear Text 接続」はdefaultで無効になる。iOSの ATS (App Transport Security) と同じような考え方。

以下を参考

novum-d commented 2 years ago

https://stackoverflow.com/questions/46283981/android-viewmodel-additional-arguments https://mahendranv.github.io/posts/viewmodel-store/ Caused by: java.lang.NoSuchMethodException: com.searchSummarizer.app.SearchSummarizerViewModel. [class android.app.Application]

Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option
novum-d commented 2 years ago

WebViewは単純にweb pageを表示するだけのcomponentでbrowser機能を提供するには独自の実装が必要