diff options
Diffstat (limited to 'java/com/android/dialer/helplines/res')
11 files changed, 520 insertions, 0 deletions
diff --git a/java/com/android/dialer/helplines/res/drawable/ic_help.xml b/java/com/android/dialer/helplines/res/drawable/ic_help.xml new file mode 100644 index 000000000..51a32eccf --- /dev/null +++ b/java/com/android/dialer/helplines/res/drawable/ic_help.xml @@ -0,0 +1,26 @@ +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="?android:attr/colorAccent" + android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52, +2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4, +1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"/> +</vector> diff --git a/java/com/android/dialer/helplines/res/drawable/ic_helpline_call.xml b/java/com/android/dialer/helplines/res/drawable/ic_helpline_call.xml new file mode 100644 index 000000000..5d67f0359 --- /dev/null +++ b/java/com/android/dialer/helplines/res/drawable/ic_helpline_call.xml @@ -0,0 +1,25 @@ +<!-- + Copyright (C) 2017 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/textColorPrimary"> + <path + android:fillColor="?android:attr/textColorPrimary" + android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z"/> +</vector> diff --git a/java/com/android/dialer/helplines/res/layout/activity_helplines.xml b/java/com/android/dialer/helplines/res/layout/activity_helplines.xml new file mode 100644 index 000000000..c4cac0aab --- /dev/null +++ b/java/com/android/dialer/helplines/res/layout/activity_helplines.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/helplines_list" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="gone" /> + + <LinearLayout + android:id="@+id/helplines_loading" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical"> + + <ProgressBar + android:id="@+id/helplines_progress_bar" + style="@android:style/Widget.DeviceDefault.ProgressBar.Horizontal" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:max="100" + android:paddingStart="32dp" + android:paddingEnd="32dp" + android:progress="0" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:text="@string/helplines_loading" + android:textSize="16sp" /> + </LinearLayout> + + <LinearLayout + android:id="@+id/empty_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:orientation="vertical" + android:visibility="gone"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:gravity="center" + android:text="@string/helplines_empty" + android:textSize="16sp" /> + </LinearLayout> +</LinearLayout> diff --git a/java/com/android/dialer/helplines/res/layout/dialog_helpline_details.xml b/java/com/android/dialer/helplines/res/layout/dialog_helpline_details.xml new file mode 100644 index 000000000..4b283b2da --- /dev/null +++ b/java/com/android/dialer/helplines/res/layout/dialog_helpline_details.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:paddingStart="24dp" + android:paddingTop="24dp" + android:paddingEnd="24dp" + android:paddingBottom="24dp"> + + <TextView + android:id="@+id/name_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/helpline_name" + android:textSize="16dp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingBottom="8dp" + android:text="Name here" + android:textSize="16dp" /> + + <TextView + android:id="@+id/categories_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/helpline_categories" + android:textSize="16dp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/categories" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingBottom="8dp" + android:text="Categories here" + android:textSize="16dp" /> + + <TextView + android:id="@+id/number_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/helpline_number" + android:textSize="16dp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/number" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingBottom="8dp" + android:text="Number here" + android:textSize="16dp" /> + + <TextView + android:id="@+id/org_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/helpline_org" + android:textSize="16dp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/org" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingBottom="8dp" + android:text="Org here" + android:textSize="16dp" /> + + <TextView + android:id="@+id/website_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/helpline_website" + android:textSize="16dp" + android:textStyle="bold" /> + + <TextView + android:id="@+id/website" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Website here" + android:textSize="16dp" /> +</LinearLayout> diff --git a/java/com/android/dialer/helplines/res/layout/item_helpline.xml b/java/com/android/dialer/helplines/res/layout/item_helpline.xml new file mode 100644 index 000000000..5160105a4 --- /dev/null +++ b/java/com/android/dialer/helplines/res/layout/item_helpline.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/item" + android:background="?android:attr/selectableItemBackground" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:minHeight="48dp" + android:paddingTop="8dp" + android:paddingBottom="8dp"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_weight="1" + android:orientation="vertical" + android:layout_gravity="center_vertical"> + + <TextView + android:id="@+id/item_helpline_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="top|start" + tools:text="Title" + android:textColor="?android:attr/textColorPrimary" + android:textSize="@dimen/helpline_primary_text_size"/> + + <TextView + android:id="@+id/item_helpline_categories" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:text="Categories" + android:textColor="?android:attr/textColorSecondary" + android:visibility="gone" + tools:visibility="visible" + android:textSize="@dimen/helpline_secondary_text_size"/> + + <TextView + android:id="@+id/item_helpline_languages" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:text="Languages" + android:textColor="?android:attr/textColorSecondary" + android:visibility="gone" + tools:visibility="visible" + android:textSize="@dimen/helpline_secondary_text_size"/> + </LinearLayout> + + <ImageView + android:id="@+id/item_helpline_call_icon" + android:layout_width="32dp" + android:layout_height="32dp" + android:layout_gravity="center|end" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:scaleType="center" + android:background="?android:attr/selectableItemBackgroundBorderless" + android:clickable="true" + android:focusable="true" + android:src="@drawable/ic_helpline_call" + android:visibility="visible"/> +</LinearLayout> diff --git a/java/com/android/dialer/helplines/res/menu/menu_helplines.xml b/java/com/android/dialer/helplines/res/menu/menu_helplines.xml new file mode 100644 index 000000000..c4f99fc61 --- /dev/null +++ b/java/com/android/dialer/helplines/res/menu/menu_helplines.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:id="@+id/menu_helpline_help" + android:icon="@drawable/ic_help" + android:showAsAction="always" + android:title="@string/helplines_help" /> +</menu> diff --git a/java/com/android/dialer/helplines/res/values/dimens.xml b/java/com/android/dialer/helplines/res/values/dimens.xml new file mode 100644 index 000000000..20fec7ede --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/dimens.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <dimen name="helpline_primary_text_size">16sp</dimen> + <dimen name="helpline_secondary_text_size">12sp</dimen> +</resources> diff --git a/java/com/android/dialer/helplines/res/values/helpline_categories.xml b/java/com/android/dialer/helplines/res/values/helpline_categories.xml new file mode 100644 index 000000000..1e885f1f5 --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/helpline_categories.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <string name="helpline_category_abuse">Abuse</string> + <string name="helpline_category_acohol">Alcohol</string> + <string name="helpline_category_addiction">Addiction</string> + <string name="helpline_category_adolescents">Adolescents</string> + <string name="helpline_category_adults">Adults</string> + <string name="helpline_category_aids">AIDS</string> + <string name="helpline_category_birth">Birth</string> + <string name="helpline_category_children">Children</string> + <string name="helpline_category_crime">Crime</string> + <string name="helpline_category_crime_victims">Crime Victims</string> + <string name="helpline_category_corruption">Corruption</string> + <string name="helpline_category_discrimination">Discrimination</string> + <string name="helpline_category_domestic_violence">Domestic Violence</string> + <string name="helpline_category_drugs">Drugs</string> + <string name="helpline_category_emotional_support">Emotional Support</string> + <string name="helpline_category_family">Family</string> + <string name="helpline_category_gambling">Gambling</string> + <string name="helpline_category_gender">Gender</string> + <string name="helpline_category_generic">Generic</string> + <string name="helpline_category_hiv">HIV</string> + <string name="helpline_category_human_rights">Human rights</string> + <string name="helpline_category_human_trafficking">Human Trafficking</string> + <string name="helpline_category_legal_aid">Legal Aid</string> + <string name="helpline_category_lgbtq">LGBTQ+</string> + <string name="helpline_category_men">Men</string> + <string name="helpline_category_mental_health">Mental Health</string> + <string name="helpline_category_missing_children">Missing children</string> + <string name="helpline_category_mothers">Mothers</string> + <string name="helpline_category_muslim">Muslim</string> + <string name="helpline_category_parents">Parents</string> + <string name="helpline_category_pregnancy">Pregnancy</string> + <string name="helpline_category_psychological">Psychological</string> + <string name="helpline_category_religion">Religion</string> + <string name="helpline_category_senior">Seniors</string> + <string name="helpline_category_sexual_abuse">Sexual Abuse</string> + <string name="helpline_category_sexual_assault">Sexual Assault</string> + <string name="helpline_category_sexual_rights">Sexual Rights</string> + <string name="helpline_category_sexuality">Sexuality</string> + <string name="helpline_category_soldiers">Soldiers</string> + <string name="helpline_category_suicide">Suicide Prevention</string> + <string name="helpline_category_trans">Transgender</string> + <string name="helpline_category_veterans">Veterans</string> + <string name="helpline_category_violence">Violence</string> + <string name="helpline_category_war">War</string> + <string name="helpline_category_women">Women</string> + <string name="helpline_category_youth">Youth</string> +</resources> diff --git a/java/com/android/dialer/helplines/res/values/helpline_names.xml b/java/com/android/dialer/helplines/res/values/helpline_names.xml new file mode 100644 index 000000000..5ca02acdd --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/helpline_names.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + +</resources> diff --git a/java/com/android/dialer/helplines/res/values/strings.xml b/java/com/android/dialer/helplines/res/values/strings.xml new file mode 100644 index 000000000..232ac46a8 --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/strings.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="helplines_name">Helplines</string> + <string name="helplines_loading">Loading\u2026</string> + <string name="helplines_empty">No helplines found.\nInsert a sim card and try again</string> + <string name="helplines_help">Help</string> + <string name="helplines_help_title">These are safe to call</string> + <string name="helplines_help_message">None of these numbers appear in your call history.\nYou can click any item for more information</string> + + <string name="helplines_help_more_message">The list of helplines is filled with information that is updated manually by contributors. If you encounter any missing or wrong information, please feel free to contact us at www.lineageos.org</string> + + <string name="helpline_button_more">More</string> + + <string name="unknown_helpline_name">Unknown Organisation</string> + + <string name="helpline_name">Name</string> + <string name="helpline_org">Organization</string> + <string name="helpline_categories">Categories</string> + <string name="helpline_number">Number</string> + <string name="helpline_website">Website</string> + <string name="helpline_browser_history_title">Attention</string> + <string name="helpline_browser_history_message">Don\'t forget to clear the browser history</string> + + <!-- Format for displaying a helpline name with the country - Example will resolve to "Emotional Support Hotline (US)" --> + <string name="helpline_name_format_country"><xliff:g id="helpline_name" example="Emotional Support Helpline">%1$s</xliff:g> (<xliff:g id="helpline_county" example="US">%2$s</xliff:g>)</string> + + <string name="helpline_language_cree">Cree</string> + <string name="helpline_language_english">English</string> + <string name="helpline_language_french">French</string> + <string name="helpline_language_german">German</string> + <string name="helpline_language_inuktitut">Inuktitut</string> + <string name="helpline_language_ojibway">Ojibway</string> + <string name="helpline_language_turkish">Turkish</string> +</resources> diff --git a/java/com/android/dialer/helplines/res/values/styles.xml b/java/com/android/dialer/helplines/res/values/styles.xml new file mode 100755 index 000000000..4df1e1c1d --- /dev/null +++ b/java/com/android/dialer/helplines/res/values/styles.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2019-2021 The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <style name="BaseTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar"> + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:colorBackgroundCacheHint">@null</item> + <item name="android:windowShowWallpaper">true</item> + <item name="android:windowNoTitle">true</item> + <item name="android:colorEdgeEffect">#FF757575</item> + </style> + + <style name="BaseTheme.Dark" parent="@style/BaseTheme"> + <item name="android:textColorPrimary">#FFFFFFFF</item> + <item name="android:textColorSecondary">#FFFFFFFF</item> + <item name="android:textColorTertiary">#CCFFFFFF</item> + <item name="android:textColorHint">#A0FFFFFF</item> + <item name="android:colorControlHighlight">#A0FFFFFF</item> + <item name="android:colorPrimary">#FF212121</item> + </style> + + <!-- A derivative project can extend these themes to customize the application theme without + affecting the base theme --> + <style name="HelplineTheme" parent="@style/BaseTheme" /> + <style name="HelplineTheme.Dark" parent="@style/BaseTheme.Dark" /> +</resources> |