Add privacy policy (#1075)

* Add privacy policy to settings.

* Add privacy policy to onboarding.

* Add privacy info to permission explanation

* Make privacy link more link like.
This commit is contained in:
Justin Bassett 2020-10-19 10:26:21 -04:00 committed by GitHub
parent 4490ddec88
commit e4fea1d727
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 9 deletions

View file

@ -161,10 +161,7 @@ class SettingsFragment : PreferenceFragmentCompat(), SettingsView {
"https://github.com/home-assistant/android/releases"
else "https://github.com/home-assistant/android/releases/tag/${BuildConfig.VERSION_NAME.replace("-full", "").replace("-minimal", "")}"
it.summary = link
val intent = Intent()
intent.action = "android.intent.action.VIEW"
intent.data = Uri.parse(link)
it.intent = intent
it.intent = Intent(Intent.ACTION_VIEW, Uri.parse(link))
}
findPreference<Preference>("version")?.let {
@ -172,6 +169,11 @@ class SettingsFragment : PreferenceFragmentCompat(), SettingsView {
it.summary = BuildConfig.VERSION_NAME
}
findPreference<Preference>("privacy")?.let {
it.summary = "https://www.home-assistant.io/privacy/"
it.intent = Intent(Intent.ACTION_VIEW, Uri.parse(it.summary.toString()))
}
presenter.onCreate()
}

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/colorAccent"
android:pathData="M17.06 13C15.2 13 13.64 14.33 13.24 16.1C12.29 15.69 11.42 15.8 10.76 16.09C10.35 14.31 8.79 13 6.94 13C4.77 13 3 14.79 3 17C3 19.21 4.77 21 6.94 21C9 21 10.68 19.38 10.84 17.32C11.18 17.08 12.07 16.63 13.16 17.34C13.34 19.39 15 21 17.06 21C19.23 21 21 19.21 21 17C21 14.79 19.23 13 17.06 13M6.94 19.86C5.38 19.86 4.13 18.58 4.13 17S5.39 14.14 6.94 14.14C8.5 14.14 9.75 15.42 9.75 17S8.5 19.86 6.94 19.86M17.06 19.86C15.5 19.86 14.25 18.58 14.25 17S15.5 14.14 17.06 14.14C18.62 14.14 19.88 15.42 19.88 17S18.61 19.86 17.06 19.86M22 10.5H2V12H22V10.5M15.53 2.63C15.31 2.14 14.75 1.88 14.22 2.05L12 2.79L9.77 2.05L9.72 2.04C9.19 1.89 8.63 2.17 8.43 2.68L6 9H18L15.56 2.68L15.53 2.63Z" />
</vector>

View file

@ -50,20 +50,29 @@
android:layout_marginEnd="50dp"
android:text="@string/enable_location_tracking_description" />
<LinearLayout
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/privacy"
android:layout_marginTop="@dimen/activity_margin"
android:autoLink="web"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/privacy_url" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="@dimen/activity_margin"
android:gravity="end|bottom">
android:layout_marginTop="@dimen/activity_margin" >
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/finish"
style="@style/Widget.HomeAssistant.Button.Outlined"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:text="@string/finish" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>

View file

@ -90,7 +90,7 @@ to your home internet.</string>
<string name="enable_all_sensors">Enable All Sensors</string>
<string name="enable_all_sensors_summary">All required permissions will be requested upon enabling</string>
<string name="enable_location_tracking">Enable Location Tracking</string>
<string name="enable_location_tracking_description">Enabling this sensor will allow the Home Assistant application to track you location and report it back to your instance of Home Assistant. Ensure that you enable background access to location, otherwise we cannot enable location tracking.</string>
<string name="enable_location_tracking_description">Enabling this sensor will allow the Home Assistant application to track you location and report it back to your instance of Home Assistant. Ensure that you enable background access to location, otherwise we cannot enable location tracking. Your location data is sent directly to your Home Assistant instance and is never sent to a 3rd party.</string>
<string name="enable_remaining_sensors">Enable %1$d Sensors</string>
<string name="enabled_summary">When enabled values will be sent to Home Assistant</string>
<string name="enabled_title">Enabled</string>
@ -375,4 +375,6 @@ like to connect to:</string>
<string name="widget_text_hint_service_service">Service</string>
<string name="widget_text_size_default">30</string>
<string name="widget_text_size_label">Widget text size:</string>
<string name="privacy_policy">Privacy Policy</string>
<string name="privacy_url">https://www.home-assistant.io/privacy</string>
</resources>

View file

@ -116,6 +116,11 @@
android:icon="@drawable/app_icon"
android:title="@string/application_version"
android:summary="1.0.0 (1)"/>
<Preference
android:key="privacy"
android:icon="@drawable/ic_incognito"
android:title="@string/privacy_policy"
android:summary="@string/privacy_url" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>