From daba6506567ffc5f88c3a2a3cf8c009b2a9a7a6d Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Wed, 5 Sep 2018 20:17:14 -0500 Subject: Remodel the Model - The configuration and crypto model is now entirely independent of Android classes other than Nullable and TextUtils. - Model classes are immutable and use builders that enforce the appropriate optional/required attributes. - The Android config proxies (for Parcelable and databinding) are moved to the Android side of the codebase, and are designed to be safe for two-way databinding. This allows proper observability in TunnelDetailFragment. - Various robustness fixes and documentation updates to helper classes. --- app/src/main/res/layout/tunnel_detail_fragment.xml | 6 ++--- app/src/main/res/layout/tunnel_detail_peer.xml | 6 ++--- app/src/main/res/layout/tunnel_editor_fragment.xml | 28 ++++++++++++---------- app/src/main/res/layout/tunnel_editor_peer.xml | 13 +++++----- app/src/main/res/layout/tunnel_list_fragment.xml | 3 +-- app/src/main/res/values/strings.xml | 5 +--- 6 files changed, 29 insertions(+), 32 deletions(-) (limited to 'app/src/main/res') diff --git a/app/src/main/res/layout/tunnel_detail_fragment.xml b/app/src/main/res/layout/tunnel_detail_fragment.xml index 11cfafae..9b06ddd4 100644 --- a/app/src/main/res/layout/tunnel_detail_fragment.xml +++ b/app/src/main/res/layout/tunnel_detail_fragment.xml @@ -19,7 +19,7 @@ + type="com.wireguard.config.Config" /> + android:text="@{config.interface.keyPair.publicKey.toBase64}" /> + android:text="@{config.interface.addresses}" /> diff --git a/app/src/main/res/layout/tunnel_detail_peer.xml b/app/src/main/res/layout/tunnel_detail_peer.xml index 91be0011..767e0383 100644 --- a/app/src/main/res/layout/tunnel_detail_peer.xml +++ b/app/src/main/res/layout/tunnel_detail_peer.xml @@ -8,7 +8,7 @@ + type="com.wireguard.config.Peer" /> + android:text="@{item.publicKey.toBase64}" /> + android:text="@{item.allowedIps}" /> - - + type="com.wireguard.android.viewmodel.ConfigProxy" /> + +