diff options
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable/ic_info_black_24dp.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_notifications_black_24dp.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_sync_black_24dp.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/layout/app_bar_main.xml | 18 | ||||
-rw-r--r-- | app/src/main/res/layout/content_main.xml | 21 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_atlas.xml | 14 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_observations.xml | 45 | ||||
-rw-r--r-- | app/src/main/res/menu/main.xml | 7 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 78 | ||||
-rw-r--r-- | app/src/main/res/xml/pref_data_sync.xml | 21 | ||||
-rw-r--r-- | app/src/main/res/xml/pref_general.xml | 33 | ||||
-rw-r--r-- | app/src/main/res/xml/pref_headers.xml | 20 | ||||
-rw-r--r-- | app/src/main/res/xml/pref_notification.xml | 27 |
13 files changed, 276 insertions, 35 deletions
diff --git a/app/src/main/res/drawable/ic_info_black_24dp.xml b/app/src/main/res/drawable/ic_info_black_24dp.xml new file mode 100644 index 0000000..34b8202 --- /dev/null +++ b/app/src/main/res/drawable/ic_info_black_24dp.xml @@ -0,0 +1,9 @@ +<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="#FF000000" + android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm1,15h-2v-6h2v6zm0,-8h-2V7h2v2z" /> +</vector> diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml new file mode 100644 index 0000000..e3400cf --- /dev/null +++ b/app/src/main/res/drawable/ic_notifications_black_24dp.xml @@ -0,0 +1,9 @@ +<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="#FF000000" + android:pathData="M11.5,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.9,2 2,2zm6.5,-6v-5.5c0,-3.07 -2.13,-5.64 -5,-6.32V3.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,2.67 10,3.5v0.68c-2.87,0.68 -5,3.25 -5,6.32V16l-2,2v1h17v-1l-2,-2z" /> +</vector> diff --git a/app/src/main/res/drawable/ic_sync_black_24dp.xml b/app/src/main/res/drawable/ic_sync_black_24dp.xml new file mode 100644 index 0000000..2aef437 --- /dev/null +++ b/app/src/main/res/drawable/ic_sync_black_24dp.xml @@ -0,0 +1,9 @@ +<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="#FF000000" + android:pathData="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01,-0.25 1.97,-0.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0,-4.42,-3.58,-8,-8,-8zm0 14c-3.31 0,-6,-2.69,-6,-6 0,-1.01 0.25,-1.97 0.7,-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4,-4,-4,-4v3z" /> +</vector>
\ No newline at end of file diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml index 2addb9d..cb2a28a 100644 --- a/app/src/main/res/layout/app_bar_main.xml +++ b/app/src/main/res/layout/app_bar_main.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.design.widget.CoordinatorLayout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" @@ -20,14 +21,11 @@ </android.support.design.widget.AppBarLayout> - <include layout="@layout/content_main" /> - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fab" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom|end" - android:layout_margin="@dimen/fab_margin" - app:srcCompat="@android:drawable/ic_menu_add" /> + <!--<include layout="@layout/content_main" />--> + <FrameLayout + android:id="@+id/flContent" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="?attr/actionBarSize" /> </android.support.design.widget.CoordinatorLayout> diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml deleted file mode 100644 index 30f3787..0000000 --- a/app/src/main/res/layout/content_main.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:layout_behavior="@string/appbar_scrolling_view_behavior" - tools:context="org.marcinzelent.liberavem.MainActivity" - tools:showIn="@layout/app_bar_main"> - - <TextView - android:id="@+id/textView2" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/about" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - android:layout_marginLeft="8dp" /> -</android.support.constraint.ConstraintLayout> diff --git a/app/src/main/res/layout/fragment_atlas.xml b/app/src/main/res/layout/fragment_atlas.xml new file mode 100644 index 0000000..0c5c59b --- /dev/null +++ b/app/src/main/res/layout/fragment_atlas.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".AtlasFragment"> + + <!-- TODO: Update blank fragment layout --> + <TextView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:text="@string/atlas" /> + +</FrameLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_observations.xml b/app/src/main/res/layout/fragment_observations.xml new file mode 100644 index 0000000..791c16c --- /dev/null +++ b/app/src/main/res/layout/fragment_observations.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".ObservationsFragment"> + + <android.support.v4.view.ViewPager + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" + tools:context="org.marcinzelent.liberavem.MainActivity" + tools:showIn="@layout/app_bar_main"> + + <android.support.design.widget.TabLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <android.support.design.widget.TabItem + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="My observations" /> + + <android.support.design.widget.TabItem + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="All observations" /> + + </android.support.design.widget.TabLayout> + </android.support.v4.view.ViewPager> + + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|end" + android:layout_margin="@dimen/fab_margin" + app:srcCompat="@android:drawable/ic_menu_add" /> + +</FrameLayout>
\ No newline at end of file diff --git a/app/src/main/res/menu/main.xml b/app/src/main/res/menu/main.xml index a2411e3..02c191b 100644 --- a/app/src/main/res/menu/main.xml +++ b/app/src/main/res/menu/main.xml @@ -2,8 +2,9 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item - android:id="@+id/action_settings" + android:id="@+id/action_search" + android:icon="@android:drawable/ic_menu_search" android:orderInCategory="100" - android:title="@string/action_settings" - app:showAsAction="never" /> + android:title="@string/action_search" + app:showAsAction="always" /> </menu> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 82dcbff..d6ef134 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -5,9 +5,85 @@ <string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string> - <string name="action_settings">Settings</string> + <string name="action_search">Search</string> <string name="observations">Observations</string> <string name="atlas">Atlas</string> <string name="settings">Settings</string> <string name="about">About</string> + <string name="title_activity_settings">Settings</string> + + <!-- Strings related to Settings --> + + <!-- Example General settings --> + <string name="pref_header_general">General</string> + + <string name="pref_title_social_recommendations">Enable social recommendations</string> + <string name="pref_description_social_recommendations">Recommendations for people to contact + based on your message history + </string> + + <string name="pref_title_display_name">Display name</string> + <string name="pref_default_display_name">John Smith</string> + + <string name="pref_title_add_friends_to_messages">Add friends to messages</string> + <string-array name="pref_example_list_titles"> + <item>Always</item> + <item>When possible</item> + <item>Never</item> + </string-array> + <string-array name="pref_example_list_values"> + <item>1</item> + <item>0</item> + <item>-1</item> + </string-array> + + <!-- Example settings for Data & Sync --> + <string name="pref_header_data_sync">Data & sync</string> + + <string name="pref_title_sync_frequency">Sync frequency</string> + <string-array name="pref_sync_frequency_titles"> + <item>15 minutes</item> + <item>30 minutes</item> + <item>1 hour</item> + <item>3 hours</item> + <item>6 hours</item> + <item>Never</item> + </string-array> + <string-array name="pref_sync_frequency_values"> + <item>15</item> + <item>30</item> + <item>60</item> + <item>180</item> + <item>360</item> + <item>-1</item> + </string-array> + + <string-array name="list_preference_entries"> + <item>Entry 1</item> + <item>Entry 2</item> + <item>Entry 3</item> + </string-array> + + <string-array name="list_preference_entry_values"> + <item>1</item> + <item>2</item> + <item>3</item> + </string-array> + + <string-array name="multi_select_list_preference_default_value" /> + + <string name="pref_title_system_sync_settings">System sync settings</string> + + <!-- Example settings for Notifications --> + <string name="pref_header_notifications">Notifications</string> + + <string name="pref_title_new_message_notifications">New message notifications</string> + + <string name="pref_title_ringtone">Ringtone</string> + <string name="pref_ringtone_silent">Silent</string> + + <string name="pref_title_vibrate">Vibrate</string> + + <!-- TODO: Remove or change this placeholder text --> + <string name="hello_blank_fragment">Hello blank fragment</string> </resources> diff --git a/app/src/main/res/xml/pref_data_sync.xml b/app/src/main/res/xml/pref_data_sync.xml new file mode 100644 index 0000000..6bd9192 --- /dev/null +++ b/app/src/main/res/xml/pref_data_sync.xml @@ -0,0 +1,21 @@ +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> + + <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to + dismiss it. --> + <!-- NOTE: ListPreference's summary should be set to its value by the activity code. --> + <ListPreference + android:defaultValue="180" + android:entries="@array/pref_sync_frequency_titles" + android:entryValues="@array/pref_sync_frequency_values" + android:key="sync_frequency" + android:negativeButtonText="@null" + android:positiveButtonText="@null" + android:title="@string/pref_title_sync_frequency" /> + + <!-- This preference simply launches an intent when selected. Use this UI sparingly, per + design guidelines. --> + <Preference android:title="@string/pref_title_system_sync_settings"> + <intent android:action="android.settings.SYNC_SETTINGS" /> + </Preference> + +</PreferenceScreen> diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml new file mode 100644 index 0000000..36569d6 --- /dev/null +++ b/app/src/main/res/xml/pref_general.xml @@ -0,0 +1,33 @@ +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> + + <SwitchPreference + android:defaultValue="true" + android:key="example_switch" + android:summary="@string/pref_description_social_recommendations" + android:title="@string/pref_title_social_recommendations" /> + + <!-- NOTE: EditTextPreference accepts EditText attributes. --> + <!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. --> + <EditTextPreference + android:capitalize="words" + android:defaultValue="@string/pref_default_display_name" + android:inputType="textCapWords" + android:key="example_text" + android:maxLines="1" + android:selectAllOnFocus="true" + android:singleLine="true" + android:title="@string/pref_title_display_name" /> + + <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to + dismiss it. --> + <!-- NOTE: ListPreference's summary should be set to its value by the activity code. --> + <ListPreference + android:defaultValue="-1" + android:entries="@array/pref_example_list_titles" + android:entryValues="@array/pref_example_list_values" + android:key="example_list" + android:negativeButtonText="@null" + android:positiveButtonText="@null" + android:title="@string/pref_title_add_friends_to_messages" /> + +</PreferenceScreen> diff --git a/app/src/main/res/xml/pref_headers.xml b/app/src/main/res/xml/pref_headers.xml new file mode 100644 index 0000000..0112e90 --- /dev/null +++ b/app/src/main/res/xml/pref_headers.xml @@ -0,0 +1,20 @@ +<preference-headers xmlns:android="http://schemas.android.com/apk/res/android"> + + <!-- These settings headers are only used on tablets. --> + + <header + android:fragment="org.marcinzelent.liberavem.SettingsActivity$GeneralPreferenceFragment" + android:icon="@drawable/ic_info_black_24dp" + android:title="@string/pref_header_general" /> + + <header + android:fragment="org.marcinzelent.liberavem.SettingsActivity$NotificationPreferenceFragment" + android:icon="@drawable/ic_notifications_black_24dp" + android:title="@string/pref_header_notifications" /> + + <header + android:fragment="org.marcinzelent.liberavem.SettingsActivity$DataSyncPreferenceFragment" + android:icon="@drawable/ic_sync_black_24dp" + android:title="@string/pref_header_data_sync" /> + +</preference-headers> diff --git a/app/src/main/res/xml/pref_notification.xml b/app/src/main/res/xml/pref_notification.xml new file mode 100644 index 0000000..e5a319e --- /dev/null +++ b/app/src/main/res/xml/pref_notification.xml @@ -0,0 +1,27 @@ +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> + + <!-- A 'parent' preference, which enables/disables child preferences (below) + when checked/unchecked. --> + <SwitchPreference + android:defaultValue="true" + android:key="notifications_new_message" + android:title="@string/pref_title_new_message_notifications" /> + + <!-- Allows the user to choose a ringtone in the 'notification' category. --> + <!-- NOTE: This preference will be enabled only when the checkbox above is checked. --> + <!-- NOTE: RingtonePreference's summary should be set to its value by the activity code. --> + <RingtonePreference + android:defaultValue="content://settings/system/notification_sound" + android:dependency="notifications_new_message" + android:key="notifications_new_message_ringtone" + android:ringtoneType="notification" + android:title="@string/pref_title_ringtone" /> + + <!-- NOTE: This preference will be enabled only when the checkbox above is checked. --> + <SwitchPreference + android:defaultValue="true" + android:dependency="notifications_new_message" + android:key="notifications_new_message_vibrate" + android:title="@string/pref_title_vibrate" /> + +</PreferenceScreen> |