Day/Night テーマ切替時に Vector Drawables アイコンの色を自動変更させたい

Vector Drawableの各パスの色は、XML形式の一部として


android:fillColor="..."

という形式で定義されています。

これは、


android:fillColor="@color/colorPrimary"

などのカラーリソース や、


android:fillColor="?attr/colorControlNormal"

などのテーマ属性 に対応しています。


<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportHeight="24.0"
    android:viewportWidth="24.0">
    <path
        android:fillColor="?attr/colorControlNormal"
        android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
    <path
        android:fillColor="?attr/colorControlNormal"
        android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>

colorControlNormal 属性は Day/Night テーマのデフォルトです。

👉 Combining Vector Drawables with Day/Night Theme | by Tim Mutton | Medium 

 

まとめ

以下のように、Day/Night テーマ変更時にアイコンの色を変化させるには、

Day/Night theme Vector Drawables

Vector Drawable 内


<path
    android:fillColor="?attr/colorControlNormal"
    ...

とするとよい。


手袋外さずにスマホ操作したいのだが

わざわざ、そんな手袋を買うのもなんだかな。



ランニンググローブ アウトドアグローブ 防寒手袋 ***タッチパネル対応*** 登山 ジョギング サイクリング ハイキング クライミング 通勤通学 秋冬用

タッチペンを100均で買いました!

タッチペン 100均

へんな鈴と合わせて200円でした!

使ってみました。

こんなかんじです。



使い勝手は、

ペン操作に慣れてないせいか

まあまあですが

寒くないので良いですよ!

👉 顔文字/絵文字辞書 単語リスト - Google Play のアプリ 


Rx の Hot が扱うのは State か Event か

RxのHotとColdについて
👉 RxのHotとColdについて - Qiita 

 

なかなか理屈ではくっきり区別しづらくなってきたような気がしています。

kotlin や swift でいうところの

Rx の Hot。

検索キーワードとして

ざっくりと2つに分ける。

 

State


ConflatedBroatcastChannel (Kotlin - Channel)

  ↓

StateFlow (Kotlin - Flow)


BehaviorSubject (RxSwift/RxJava)

  ↓

BehaviorRelay (RxRelay/RxCoCoa)

  ↓

Driver (RxCocoa)

 

Event


BroadcastChannel (Kotlin - Channel)

  ↓

SharedFlow (Kotlin - Flow)


PublishSubject (RxSwift/RxJava)

  ↓

PublishRelay (RxRelay/RxCoCoa)

  ↓

Signal (RxCocoa)

 

まとめ

最近では日本語だけの検索では情報が足りません。

iOS ↔ Android 間の意味合いを考えながら、

まずは、

扱うのが State か Event か、を区別すると理解しやすいと思います。

 

👉 com.jakewharton.rxrelay2 (RxRelay 2.0.0 API) 
👉 ReactiveX/RxSwift: Reactive Programming in Swift 
👉 【RxSwift】BehaviorRelayとPublishRelayについてまとめてみた 
👉 RxSwiftのSubjectとRelayについて理解する - Qiita 
👉 関数型プログラマのための Rx 入門(前編) - Okapies' Archive 
👉 RxSwift/RxRelay at main · ReactiveX/RxSwift 
👉 RxSwift(RxCocoa) における Subject・Relay を理解する - iOSエンジニアのつぶやき 
👉 「Rx」の検索結果 - Qiita 

👉 [B!] Rx の Hot が扱うのは State か Event か 


ルーターの設定画面が開けないのだが

ルータの設定を変更しようと思い、

OSネットワークの設定で、

ルーターのIPアドレスを見て、

ネットワーク 設定 デフォルトゲートウェイ

ブラウザのURLバーに入力して、

設定画面にアクセス!

設定画面にアクセスできない

なんでや。

Buffalo の Wi-Fiルーターなんだが、

なんでや。

 

スマホアプリで確認

スマホアプリを入れたら、 IPアドレスが分かります。

StationRadar


192.168.150.33

👉 StationRadar - Google Play のアプリ 

このIPアドレスでアクセスするといける。

ブリッジモード

どうやら「ブリッジモード」のようです。

設定で自動に

「ルーター」でなく「ブリッジ」に

なっていたようです。

 

パソコンだけで確認できないのか。

いちいちアプリを入れるのだるいです。

mac で MAC を調べます。


~ % get-oui -v
Renaming ieee-oui.txt to ieee-oui.txt.bak
Fetching OUI data from http://standards-oui.ieee.org/oui/oui.txt
Fetched 5029216 bytes
Opening output file ieee-oui.txt
31329 OUI entries written to file ieee-oui.txt

~ % sudo arp-scan -l
Password:
Interface: en1, type: EN10MB, MAC: f8:ff:c1:3a:12:ee, IPv4: 192.168.150.30
Starting arp-scan 1.9.7 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.150.1	98:2c:ba:40:78:c2	Fibergate Inc.
192.168.150.5	ec:12:80:22:1b:c0	D-Link International
192.168.150.33	84:1f:ec:9c:26:08	BUFFALO.INC
192.168.150.34	14:12:a3:91:2e:e0	Motorola Mobility LLC, a Lenovo Company
192.168.150.42	d0:17:82:f3:68:2a	AzureWave Technology Inc.
192.168.150.220	01:d0:41:d6:1f:51	AMIGO TECHNOLOGY CO., LTD.
192.168.150.52	8c:45:30:14:80:21	Murata Manufacturing Co., Ltd.

BUFFALO は、


192.168.150.33

 

🧑🏻‍💻 参考

👉 【macOS】ルーターの注意喚起が出たら arp-scan がいいよ hatena-bookmark

👉 端末IPアドレス取得 

👉 ブリッジ設定にする必要はありますか/どのような場合にルーター機能を停止させますか | バッファロー 

👉 【謎?】QRコードによるデバイスのペア設定 - Android11 


プライバシーに関する警告 このネットワークは暗号化されたDNSのトラフィックをブロックしています。

こんなの出てます。

Privacy Warning This network is blocking encrypted DNS traffic.

プライバシーに関する警告
このネットワークは暗号化されたDNSのトラフィックをブロックしています。
デバイスがこのネットワーク上でアクセスWebサイトやほかのサーバの名前は、このネットワーク上のほかのデバイスによって監視および記録される場合があります。

Privacy Warning
This network is blocking encrypted DNS traffic.
The names of websites and other servers your device accesses on this network may be monitored and recorded by other devices on this network.

なんすかこれ。

少し前に記事になってました。

👉 一部の通信事業者がiPhoneのiCloudプライベートリレーをブロックしている - GIGAZINE 

👉 「iPhoneのiCloudプライベートリレーをブロックしている」と報じられた通信事業者が「iOSのバグが原因」と反論 - GIGAZINE 

Apple vs 通信キャリア ですか。

 

警告を消す方法を探す

Apple サポートにチャットしてみましたが、結局これを案内するだけ。

👉 Wi-Fi ルーターと Wi-Fi アクセスポイントの推奨設定 - Apple サポート (日本) 

警告メッセージ下のリンク先と同じものを紹介されます。

一応、ルーターの設定は確認しましたが消えません。

 

結局、

1. Go to the Wi-Fi Settings of your iOS devices, forget/delete the network, then reconnect to it again. Check and confirm if the privacy warning will disappear.

2. If that doesn't help, try changing the DNS servers on the router to 8.8.8.8 and 1.1.1 (Under Advanced > Network > Internet).1 manually, then go to the Wi-Fi Settings of your iOS devices, forget/delete the network, then reconnect to it again.

👉 Network is blocking encrypted DNS Traffic - Home Network Community 

警告メッセージの出ている「ネットワーク設定を削除」から再度パスワード入力することで消えました。

このネットワークは暗号化されたDNSのトラフィックをブロックしています。

この状態で少し様子を見ることにします。

警告が復活するかもしれません。

そのときは、

また、追記していきたいと思います。

(つづく...)