Application Profiles. Settings menu.

This commit is contained in:
madwasp79 2019-03-26 14:05:58 +02:00
parent 25656e83a8
commit 306b304b95
14 changed files with 1519 additions and 954 deletions

View file

@ -1,13 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto" package="net.osmand.plus"
package="net.osmand.plus"> android:installLocation="auto">
<uses-sdk
android:targetSdkVersion="26"
tools:overrideLibrary="com.getkeepsafe.taptargetview, studio.carbonylgroup.textfieldboxes, android.support.customtabs"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.STORAGE"/> <uses-permission android:name="android.permission.STORAGE"/>
@ -18,83 +21,155 @@
<uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="com.android.vending.BILLING"/> <uses-permission android:name="com.android.vending.BILLING"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> <!-- The next 2 seem necessary only for Android < v4.2 (to initialize BT SCO) -->
<uses-permission
android:maxSdkVersion="18"
android:name="android.permission.BROADCAST_STICKY"/>
<uses-permission
android:maxSdkVersion="18"
android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-feature
<!-- The next 2 seem necessary only for Android < v4.2 (to initialize BT SCO) --> android:name="android.hardware.camera"
<uses-permission android:name="android.permission.BROADCAST_STICKY" android:maxSdkVersion="18" /> android:required="false"/>
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="18" /> <uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false"/>
<uses-feature
android:name="android.hardware.microphone"
android:required="false"/>
<uses-feature
android:name="android.hardware.wifi"
android:required="false"/>
<uses-feature
android:name="android.hardware.location"
android:required="false"/>
<uses-feature
android:name="android.hardware.location.network"
android:required="false"/>
<uses-feature
android:name="android.hardware.location.gps"
android:required="false"/>
<uses-feature
android:name="android.hardware.sensor.light"
android:required="false"/>
<uses-feature
android:name="android.hardware.sensor.compass"
android:required="false"/>
<uses-feature
android:name="android.hardware.sensor.accelerometer"
android:required="false"/>
<uses-feature
android:name="android.hardware.sensor.gyroscope"
android:required="false"/>
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false"/>
<uses-feature
android:name="android.hardware.bluetooth"
android:required="false"/>
<uses-feature
android:name="com.sec.feature.spen_usp"
android:required="false"/>
<uses-feature android:name="android.hardware.camera" android:required="false" /> <supports-screens
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> android:anyDensity="true"
<uses-feature android:name="android.hardware.microphone" android:required="false" /> android:largeScreens="true"
<uses-feature android:name="android.hardware.wifi" android:required="false" /> android:normalScreens="true"
<uses-feature android:name="android.hardware.location" android:required="false" /> android:resizeable="true"
<uses-feature android:name="android.hardware.location.network" android:required="false" /> android:smallScreens="true"
<uses-feature android:name="android.hardware.location.gps" android:required="false" /> android:xlargeScreens="true"/>
<uses-feature android:name="android.hardware.sensor.light" android:required="false" />
<uses-feature android:name="android.hardware.sensor.compass" android:required="false" />
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" />
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
<uses-feature android:name="com.sec.feature.spen_usp" android:required="false"/>
<uses-sdk android:targetSdkVersion="26" <application
tools:overrideLibrary="com.getkeepsafe.taptargetview, studio.carbonylgroup.textfieldboxes, android.support.customtabs"/> android:allowBackup="true"
android:backupAgent=".OsmandBackupAgent"
android:configChanges="locale"
android:icon="@mipmap/icon"
android:label="@string/app_name"
android:largeHeap="true"
android:name=".OsmandApplication"
android:restoreAnyVersion="true"
android:theme="@style/OsmandDarkTheme">
<supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" <meta-data
android:xlargeScreens="true" android:anyDensity="true" /> android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAIqF3tNGT66etVBn_vgzpfAY1wmIzKV1Ss6Ku-2A"/>
<meta-data
android:name="com.sec.android.support.multiwindow"
android:value="true"/>
<meta-data
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W"
android:resource="@dimen/app_defaultsize_w"
android:value=""/>
<meta-data
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H"
android:resource="@dimen/app_defaultsize_h"
android:value=""/>
<meta-data
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W"
android:resource="@dimen/app_minimumsize_w"
android:value=""/>
<meta-data
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H"
android:resource="@dimen/app_minimumsize_h"
android:value=""/>
<meta-data
android:name="com.sec.minimode.icon.portrait.normal"
android:resource="@mipmap/icon"
android:value=""/>
<meta-data
android:name="com.sec.minimode.icon.landscape.normal"
android:resource="@mipmap/icon"
android:value=""/>
<activity android:name=".activities.HelpActivity"/>
<!-- android:theme="@style/OsmandLightDarkActionBarTheme" --> <activity android:name=".activities.ExitActivity"/>
<application android:allowBackup="true" android:backupAgent="net.osmand.plus.OsmandBackupAgent"
android:icon="@mipmap/icon" android:label="@string/app_name"
android:name="net.osmand.plus.OsmandApplication" android:configChanges="locale"
android:theme="@style/OsmandDarkTheme" android:restoreAnyVersion="true" android:largeHeap="true">
<meta-data android:name="com.google.android.backup.api_key" android:value="AEdPqrEAAAAIqF3tNGT66etVBn_vgzpfAY1wmIzKV1Ss6Ku-2A" />
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:resource="@dimen/app_defaultsize_w" android:value="" />
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:resource="@dimen/app_defaultsize_h" android:value="" />
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:resource="@dimen/app_minimumsize_w" android:value="" />
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:resource="@dimen/app_minimumsize_h" android:value="" />
<meta-data android:name="com.sec.minimode.icon.portrait.normal" android:resource="@mipmap/icon" android:value="" />
<meta-data android:name="com.sec.minimode.icon.landscape.normal" android:resource="@mipmap/icon" android:value="" />
<activity android:name="net.osmand.plus.activities.HelpActivity" />
<activity android:name="net.osmand.plus.activities.ExitActivity" />
<provider <provider
android:name="android.support.v4.content.FileProvider"
android:authorities="net.osmand.plus.fileprovider" android:authorities="net.osmand.plus.fileprovider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true" > android:grantUriPermissions="true"
android:name="android.support.v4.content.FileProvider">
<meta-data <meta-data
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/paths"/> android:resource="@xml/paths"/>
</provider> </provider>
<activity android:name="net.osmand.plus.activities.MapActivity" android:label="@string/app_name" android:theme="@style/FirstSplashScreenPlus" <activity
android:screenOrientation="unspecified" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize"> android:label="@string/app_name"
android:launchMode="singleTask"
android:name=".activities.MapActivity"
android:screenOrientation="unspecified"
android:theme="@style/FirstSplashScreenPlus"
android:windowSoftInputMode="adjustResize">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.SEND"/> <action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" android:host="*" android:mimeType="binary/octet-stream" />
<data android:scheme="content" android:host="*" android:mimeType="application/octet-stream" />
</intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<data
android:host="*"
android:mimeType="binary/octet-stream"
android:scheme="content"/>
<data
android:host="*"
android:mimeType="application/octet-stream"
android:scheme="content"/>
</intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/> <category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<data android:scheme="http"/> <data android:scheme="http"/>
<data android:host="osmand.net"/> <data android:host="osmand.net"/>
<data android:pathPrefix="/go"/> <data android:pathPrefix="/go"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.APP_MAPS"/> <category android:name="android.intent.category.APP_MAPS"/>
@ -102,12 +177,13 @@
<category android:name="android.intent.category.CAR_DOCK"/> <category android:name="android.intent.category.CAR_DOCK"/>
<category android:name="android.intent.category.DESK_DOCK"/> <category android:name="android.intent.category.DESK_DOCK"/>
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<data android:scheme="https"/> <data android:scheme="https"/>
<data android:host="osmand.net"/> <data android:host="osmand.net"/>
<data android:pathPrefix="/go"/> <data android:pathPrefix="/go"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.APP_MAPS"/> <category android:name="android.intent.category.APP_MAPS"/>
@ -116,20 +192,23 @@
<category android:name="android.intent.category.DESK_DOCK"/> <category android:name="android.intent.category.DESK_DOCK"/>
</intent-filter> </intent-filter>
<!-- android matches non-greedy : http://stackoverflow.com/questions/3400072/pathpattern-to-match-file-extension-does-not-work-if-a-period-exists-elsewhere-i --> <!-- android matches non-greedy : http://stackoverflow.com/questions/3400072/pathpattern-to-match-file-extension-does-not-work-if-a-period-exists-elsewhere-i -->
<!-- mimeType&host are both needed or you will either have unwanted matching or no match when needed --> <!-- mimeType&host are both needed or you will either have unwanted matching or no match when needed -->
<!-- Capture file open requests (pathPattern is honoured) where no MIME type is provided in the Intent. An Intent with a null <!--
Capture file open requests (pathPattern is honoured) where no MIME type is provided in the Intent. An Intent with a null
MIME type will never be matched by a filter with a set MIME type, so we need a second intent-filter if we wish to also MIME type will never be matched by a filter with a set MIME type, so we need a second intent-filter if we wish to also
match files with this extension and a non-null MIME type (even if it is non-null but zero length). match files with this extension and a non-null MIME type (even if it is non-null but zero length).
https://stackoverflow.com/a/31028507/4654078 --> https://stackoverflow.com/a/31028507/4654078
-->
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:scheme="content"/> <data android:scheme="content"/>
<data android:host="*"/> <data android:host="*"/>
@ -139,13 +218,14 @@
<data android:pathPattern=".*\\..*\\..*\\..*\\.gpx"/> <data android:pathPattern=".*\\..*\\..*\\..*\\.gpx"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.gpx"/> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.gpx"/>
</intent-filter> </intent-filter>
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:scheme="content"/> <data android:scheme="content"/>
<data android:host="*"/> <data android:host="*"/>
@ -156,13 +236,14 @@
<data android:pathPattern=".*\\..*\\..*\\..*\\.gpx"/> <data android:pathPattern=".*\\..*\\..*\\..*\\.gpx"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.gpx"/> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.gpx"/>
</intent-filter> </intent-filter>
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="content"/> <data android:scheme="content"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:scheme="data"/> <data android:scheme="data"/>
@ -175,13 +256,14 @@
<data android:pathPattern=".*\\..*\\..*\\..*\\.kml"/> <data android:pathPattern=".*\\..*\\..*\\..*\\.kml"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kml"/> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kml"/>
</intent-filter> </intent-filter>
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="content"/> <data android:scheme="content"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:scheme="data"/> <data android:scheme="data"/>
@ -193,13 +275,14 @@
<data android:pathPattern=".*\\..*\\..*\\..*\\.kmz"/> <data android:pathPattern=".*\\..*\\..*\\..*\\.kmz"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kmz"/> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kmz"/>
</intent-filter> </intent-filter>
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:host="*"/> <data android:host="*"/>
<data android:mimeType="*/*"/> <data android:mimeType="*/*"/>
@ -209,13 +292,14 @@
<data android:pathPattern=".*\\..*\\..*\\..*\\.kmz"/> <data android:pathPattern=".*\\..*\\..*\\..*\\.kmz"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kmz"/> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kmz"/>
</intent-filter> </intent-filter>
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:host="*"/> <data android:host="*"/>
<data android:pathPattern=".*\\.obf"/> <data android:pathPattern=".*\\.obf"/>
@ -224,13 +308,14 @@
<data android:pathPattern=".*\\..*\\..*\\..*\\.obf"/> <data android:pathPattern=".*\\..*\\..*\\..*\\.obf"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.obf"/> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.obf"/>
</intent-filter> </intent-filter>
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:host="*"/> <data android:host="*"/>
<data android:mimeType="*/*"/> <data android:mimeType="*/*"/>
@ -240,13 +325,14 @@
<data android:pathPattern=".*\\..*\\..*\\..*\\.obf"/> <data android:pathPattern=".*\\..*\\..*\\..*\\.obf"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.obf"/> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.obf"/>
</intent-filter> </intent-filter>
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:host="*"/> <data android:host="*"/>
<data android:pathPattern=".*\\.sqlitedb"/> <data android:pathPattern=".*\\.sqlitedb"/>
@ -255,13 +341,14 @@
<data android:pathPattern=".*\\..*\\..*\\..*\\.sqlitedb"/> <data android:pathPattern=".*\\..*\\..*\\..*\\.sqlitedb"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.sqlitedb"/> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.sqlitedb"/>
</intent-filter> </intent-filter>
<intent-filter <intent-filter
android:label="@string/app_name" android:label="@string/app_name"
android:priority="50"> android:priority="50">
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="content"/> <data android:scheme="content"/>
<data android:scheme="file"/> <data android:scheme="file"/>
<data android:scheme="data"/> <data android:scheme="data"/>
@ -278,14 +365,18 @@
<!-- trying to handle emails --> <!-- trying to handle emails -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/gpx+xml"/> <data android:mimeType="application/gpx+xml"/>
</intent-filter> </intent-filter>
<!-- google navigation intent --> <!-- google navigation intent -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="google.navigation"/> <data android:scheme="google.navigation"/>
<data android:scheme="osmand.navigation"/> <data android:scheme="osmand.navigation"/>
</intent-filter> </intent-filter>
@ -293,69 +384,111 @@
<!-- osmand api --> <!-- osmand api -->
<intent-filter> <intent-filter>
<data android:scheme="osmand.api"/> <data android:scheme="osmand.api"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
</intent-filter> </intent-filter>
</activity> </activity>
<receiver android:name="net.osmand.plus.audionotes.MediaRemoteControlReceiver"> <receiver android:name=".audionotes.MediaRemoteControlReceiver">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.CAMERA_BUTTON"/> <action android:name="android.intent.action.CAMERA_BUTTON"/>
<!-- <action android:name="android.intent.action.MEDIA_BUTTON" /> --> <!-- <action android:name="android.intent.action.MEDIA_BUTTON" /> -->
</intent-filter> </intent-filter>
</receiver> </receiver>
<activity android:name="net.osmand.plus.activities.SettingsActivity" android:label="@string/shared_string_settings" android:configChanges="keyboardHidden|orientation" /> <activity
<activity android:name="net.osmand.plus.activities.SettingsGeneralActivity" android:configChanges="keyboardHidden|orientation" /> android:configChanges="keyboardHidden|orientation"
<activity android:name="net.osmand.plus.activities.SettingsNavigationActivity" android:configChanges="keyboardHidden|orientation" /> android:label="@string/shared_string_settings"
<activity android:name="net.osmand.plus.monitoring.SettingsMonitoringActivity" android:configChanges="keyboardHidden|orientation" /> android:name=".activities.SettingsActivity"/>
<activity android:name="net.osmand.plus.rastermaps.SettingsRasterMapsActivity" android:configChanges="keyboardHidden|orientation" /> <activity
android:configChanges="keyboardHidden|orientation"
<activity android:name="net.osmand.plus.osmedit.SettingsOsmEditingActivity" android:configChanges="keyboardHidden|orientation" /> android:name=".activities.SettingsGeneralActivity"/>
<activity android:name="net.osmand.plus.development.SettingsDevelopmentActivity" android:configChanges="keyboardHidden|orientation" /> <activity
<activity android:name="net.osmand.plus.audionotes.SettingsAudioVideoActivity" android:configChanges="keyboardHidden|orientation" /> android:configChanges="keyboardHidden|orientation"
<activity android:name="net.osmand.access.SettingsAccessibilityActivity" android:configChanges="keyboardHidden|orientation" /> android:name=".activities.SettingsNavigationActivity"/>
<activity
<activity android:name="net.osmand.plus.activities.search.SearchActivity" android:label="@string/search_activity" /> android:configChanges="keyboardHidden|orientation"
<activity android:name="net.osmand.plus.activities.FavoritesListActivity" android:label="@string/favourites_list_activity" /> android:name=".monitoring.SettingsMonitoringActivity"/>
<activity android:name=".myplaces.FavoritesActivity" android:windowSoftInputMode="adjustPan" /> <activity
<activity android:name="net.osmand.plus.activities.TrackActivity"/> android:configChanges="keyboardHidden|orientation"
<activity android:name="net.osmand.plus.activities.PluginsActivity" /> android:name=".rastermaps.SettingsRasterMapsActivity"/>
<activity android:name="net.osmand.plus.activities.PluginActivity" /> <activity
<activity android:name="net.osmand.plus.activities.ContributionVersionActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/contribution_activity" /> android:configChanges="keyboardHidden|orientation"
android:name=".osmedit.SettingsOsmEditingActivity"/>
<activity
<activity android:name="net.osmand.plus.osmo.SettingsOsMoActivity" android:configChanges="keyboardHidden|orientation" /> android:configChanges="keyboardHidden|orientation"
<activity android:name="net.osmand.plus.osmo.OsMoGroupsActivity"> android:name=".development.SettingsDevelopmentActivity"/>
<activity
android:configChanges="keyboardHidden|orientation"
android:name=".audionotes.SettingsAudioVideoActivity"/>
<activity
android:configChanges="keyboardHidden|orientation"
android:name="net.osmand.access.SettingsAccessibilityActivity"/>
<activity
android:label="@string/search_activity"
android:name=".activities.search.SearchActivity"/>
<activity
android:label="@string/favourites_list_activity"
android:name=".activities.FavoritesListActivity"/>
<activity
android:name=".myplaces.FavoritesActivity"
android:windowSoftInputMode="adjustPan"/>
<activity android:name=".activities.TrackActivity"/>
<activity android:name=".activities.PluginsActivity"/>
<activity android:name=".activities.PluginActivity"/>
<activity
android:configChanges="keyboardHidden|orientation"
android:label="@string/contribution_activity"
android:name=".activities.ContributionVersionActivity"/>
<activity
android:configChanges="keyboardHidden|orientation"
android:name=".osmo.SettingsOsMoActivity"/>
<activity android:name=".osmo.OsMoGroupsActivity">
<intent-filter> <intent-filter>
<data android:scheme="http" android:host="z.osmo.mobi" /> <data
android:host="z.osmo.mobi"
android:scheme="http"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter> </intent-filter>
</activity> </activity>
<activity
<activity android:name="net.osmand.plus.activities.search.SearchPOIActivity" android:label="@string/searchpoi_activity" /> android:label="@string/searchpoi_activity"
<activity android:name="net.osmand.plus.activities.search.SearchAddressActivity" android:label="@string/select_address_activity" /> android:name=".activities.search.SearchPOIActivity"/>
<activity android:name="net.osmand.plus.activities.search.SearchCityByNameActivity" /> <activity
<activity android:name="net.osmand.plus.activities.search.SearchRegionByNameActivity" /> android:label="@string/select_address_activity"
<activity android:name="net.osmand.plus.activities.search.SearchStreetByNameActivity" /> android:name=".activities.search.SearchAddressActivity"/>
<activity android:name="net.osmand.plus.activities.search.SearchStreet2ByNameActivity" /> <activity android:name=".activities.search.SearchCityByNameActivity"/>
<activity android:name="net.osmand.plus.activities.search.SearchBuildingByNameActivity" /> <activity android:name=".activities.search.SearchRegionByNameActivity"/>
<activity android:name="net.osmand.plus.sherpafy.TourViewActivity" android:exported="true" <activity android:name=".activities.search.SearchStreetByNameActivity"/>
android:launchMode= "singleInstance" android:label="Sherpafy" /> <activity android:name=".activities.search.SearchStreet2ByNameActivity"/>
<activity android:name="net.osmand.plus.activities.EditPOIFilterActivity" /> <activity android:name=".activities.search.SearchBuildingByNameActivity"/>
<activity
<activity android:name="net.osmand.plus.activities.search.GeoIntentActivity" android:label="@string/app_name"> android:exported="true"
android:label="Sherpafy"
android:launchMode="singleInstance"
android:name=".sherpafy.TourViewActivity"/>
<activity android:name=".activities.EditPOIFilterActivity"/>
<activity
android:label="@string/app_name"
android:name=".activities.search.GeoIntentActivity">
<intent-filter> <intent-filter>
<data android:scheme="osmand.geo"/> <data android:scheme="osmand.geo"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<data android:scheme="geo"/> <data android:scheme="geo"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter> </intent-filter>
@ -364,14 +497,30 @@
<data android:scheme="https"/> <data android:scheme="https"/>
<data android:host="maps.yandex.ru"/> <data android:host="maps.yandex.ru"/>
<data android:host="maps.yandex.com"/> <data android:host="maps.yandex.com"/>
<data android:host="www.openstreetmap.org" android:path="/"/> <!-- catches /#map=... --> <data
<data android:host="www.openstreetmap.org" android:pathPrefix="/query"/> android:host="www.openstreetmap.org"
<data android:host="www.openstreetmap.org" android:pathPrefix="/go"/> android:path="/"/> <!-- catches /#map=... -->
<data android:host="www.openstreetmap.org" android:pathPrefix="/search"/> <data
<data android:host="openstreetmap.org" android:path="/"/> <!-- catches /#map=... --> android:host="www.openstreetmap.org"
<data android:host="openstreetmap.org" android:pathPrefix="/query"/> android:pathPrefix="/query"/>
<data android:host="openstreetmap.org" android:pathPrefix="/go"/> <data
<data android:host="openstreetmap.org" android:pathPrefix="/search"/> android:host="www.openstreetmap.org"
android:pathPrefix="/go"/>
<data
android:host="www.openstreetmap.org"
android:pathPrefix="/search"/>
<data
android:host="openstreetmap.org"
android:path="/"/> <!-- catches /#map=... -->
<data
android:host="openstreetmap.org"
android:pathPrefix="/query"/>
<data
android:host="openstreetmap.org"
android:pathPrefix="/go"/>
<data
android:host="openstreetmap.org"
android:pathPrefix="/search"/>
<data android:host="osm.org"/> <data android:host="osm.org"/>
<data android:host="map.baidu.cn"/> <data android:host="map.baidu.cn"/>
<data android:host="map.baidu.com"/> <data android:host="map.baidu.com"/>
@ -383,21 +532,39 @@
<data android:host="map.wap.qq.com"/> <data android:host="map.wap.qq.com"/>
<data android:host="map.qq.com"/> <data android:host="map.qq.com"/>
<data android:host="maps.apple.com"/> <data android:host="maps.apple.com"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<data android:scheme="http" android:host="openstreetmap.de" android:pathPrefix="/karte" /> <data
<data android:scheme="https" android:host="openstreetmap.de" android:pathPrefix="/karte" /> android:host="openstreetmap.de"
android:pathPrefix="/karte"
android:scheme="http"/>
<data
android:host="openstreetmap.de"
android:pathPrefix="/karte"
android:scheme="https"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<data android:scheme="http" android:host="download.osmand.net" android:pathPrefix="/go" /> <data
<data android:scheme="http" android:host="download.osmand.net" android:pathPrefix="go" /> android:host="download.osmand.net"
android:pathPrefix="/go"
android:scheme="http"/>
<data
android:host="download.osmand.net"
android:pathPrefix="go"
android:scheme="http"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.APP_MAPS"/> <category android:name="android.intent.category.APP_MAPS"/>
@ -636,9 +803,7 @@
<data android:scheme="http"/> <data android:scheme="http"/>
<data android:scheme="https"/> <data android:scheme="https"/>
<data android:pathPrefix="/maps"/> <data android:pathPrefix="/maps"/>
<data android:host="www.google.ac"/> <data android:host="www.google.ac"/>
<data android:host="www.google.ad"/> <data android:host="www.google.ad"/>
<data android:host="www.google.ae"/> <data android:host="www.google.ae"/>
@ -844,42 +1009,45 @@
<data android:host="www.google.ws"/> <data android:host="www.google.ws"/>
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".development.TestVoiceActivity"/>
<activity android:name="net.osmand.plus.development.TestVoiceActivity" /> <activity
<activity android:name="net.osmand.plus.download.DownloadActivity" android:label="" /> android:label=""
android:name=".download.DownloadActivity"/> <!-- keep android:process on a separate line !! -->
<!-- keep android:process on a separate line !! -->
<service <service
android:process="net.osmand.plus"
android:label="@string/process_navigation_service" android:label="@string/process_navigation_service"
android:name="net.osmand.plus.NavigationService" android:name=".NavigationService"
android:process="net.osmand.plus"
android:stopWithTask="false"> android:stopWithTask="false">
<intent-filter> <intent-filter>
<action android:name="net.osmand.plus.NavigationService"/> <action android:name="net.osmand.plus.NavigationService"/>
</intent-filter> </intent-filter>
</service> </service>
<service
<service android:name="net.osmand.aidl.OsmandAidlService" android:exported="true" > android:exported="true"
android:name="net.osmand.aidl.OsmandAidlService">
<intent-filter> <intent-filter>
<action android:name="net.osmand.aidl.OsmandAidlService"/> <action android:name="net.osmand.aidl.OsmandAidlService"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
</intent-filter> </intent-filter>
</service> </service>
<receiver android:name="net.osmand.plus.OnNavigationServiceAlarmReceiver" /> <receiver android:name=".OnNavigationServiceAlarmReceiver"/>
<receiver android:name="net.osmand.plus.notifications.NotificationDismissReceiver" /> <receiver android:name=".notifications.NotificationDismissReceiver"/>
<activity android:name="net.osmand.plus.activities.PrintDialogActivity" /> <activity android:name=".activities.PrintDialogActivity"/>
<activity android:name=".liveupdates.OsmLiveActivity" <activity
android:label="@string/osm_live"/> android:label="@string/osm_live"
android:name=".liveupdates.OsmLiveActivity"/>
<activity android:name=".wikivoyage.explore.WikivoyageExploreActivity"> <activity android:name=".wikivoyage.explore.WikivoyageExploreActivity">
<intent-filter> <intent-filter>
<data android:scheme="http"/> <data android:scheme="http"/>
<data android:scheme="https"/> <data android:scheme="https"/>
<data android:host="osmand.net"/> <data android:host="osmand.net"/>
<data android:pathPrefix="/travel"/> <data android:pathPrefix="/travel"/>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.APP_MAPS"/> <category android:name="android.intent.category.APP_MAPS"/>
@ -887,9 +1055,17 @@
<category android:name="android.intent.category.CAR_DOCK"/> <category android:name="android.intent.category.CAR_DOCK"/>
<category android:name="android.intent.category.DESK_DOCK"/> <category android:name="android.intent.category.DESK_DOCK"/>
</intent-filter> </intent-filter>
</activity>
<receiver android:name=".liveupdates.LiveUpdatesAlarmReceiver"/>
<activity
android:label="Application profiles"
android:name=".profiles.SettingsProfileActivity"
android:configChanges="keyboardHidden|orientation">
</activity> </activity>
<receiver android:name="net.osmand.plus.liveupdates.LiveUpdatesAlarmReceiver"/>
</application> </application>
</manifest> </manifest>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="24dp" />
<solid android:color="@color/map_widget_blue"/>
</shape>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="24dp" />
<solid android:color="@color/map_widget_blue_pressed"/>
</shape>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/fab_extended_blue_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/fab_extended_blue_idle"/>
</selector>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>

View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/setting_profile_item_height"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/profile_icon"
android:layout_width="wrap_content"
android:layout_height="@dimen/standard_icon_size"
android:layout_marginLeft="@dimen/setting_profile_image_margin"
android:layout_marginRight="@dimen/setting_profile_image_margin"
android:src="@drawable/ic_action_bicycle_dark"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/divider"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="4">
<TextView
android:id="@+id/profile_title"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/main_font_dark"
android:textSize="@dimen/default_list_text_size"
tools:text="Bicycle"/>
<TextView
android:id="@+id/profile_descr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/default_desc_text_size"
tools:text="Type: Bicycle"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="horizontal">
<ImageView
android:id="@+id/profile_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_additional_option"
android:tint="?attr/primary_icon_color"
android:layout_gravity="center_vertical"
android:padding="@dimen/setting_profile_item_switch_margin"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/profile_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:background="@null"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/ctx_menu_info_view_bg"
android:orientation="vertical">
<LinearLayout
android:id="@+id/top_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/appbar"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="4dp"/>
<include layout="@layout/card_top_divider"/>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/profiles_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/top_divider"
android:clipToPadding="false"/>
<android.support.v7.widget.AppCompatButton
android:id="@+id/add_profile_btn"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_gravity="bottom|center_horizontal"
android:background="@drawable/fab_extended_drawable"
android:drawableLeft="@drawable/ic_action_plus"
android:drawableStart="@drawable/ic_action_plus"
android:text="@string/shared_string_add"
android:layout_margin="16dp"
android:textColor="@color/color_white"/>
</RelativeLayout>

View file

@ -327,4 +327,9 @@
<dimen name="text_button_letter_spacing" format="float">0.01</dimen> <dimen name="text_button_letter_spacing" format="float">0.01</dimen>
<dimen name="text_button_line_spacing_multiplier" format="float">1.2</dimen> <dimen name="text_button_line_spacing_multiplier" format="float">1.2</dimen>
<dimen name="setting_profile_item_height">64dp</dimen>
<dimen name="setting_profile_image_margin">20dp</dimen>
<dimen name="setting_profile_item_switch_margin">18dp</dimen>
</resources> </resources>

View file

@ -11,6 +11,8 @@
Thx - Hardy Thx - Hardy
--> -->
<string name="application_profiles_descr">Select the profiles to be visible in the app.</string>
<string name="application_profiles">Application profiles</string>
<string name="shared_string_degrees">Degrees</string> <string name="shared_string_degrees">Degrees</string>
<string name="shared_string_milliradians">Milliradians</string> <string name="shared_string_milliradians">Milliradians</string>
<string name="angular_measeurement">Angular measurement units</string> <string name="angular_measeurement">Angular measurement units</string>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<Preference android:key="general_settings" android:title="@string/general_settings_2" android:summary="@string/general_settings_descr"/> <Preference android:key="general_settings" android:title="@string/general_settings_2" android:summary="@string/general_settings_descr"/>
<Preference android:key="application_profiles" android:title="@string/application_profiles" android:summary="@string/application_profiles_descr"/>
<Preference android:key="routing_settings" android:title="@string/routing_settings_2" android:summary="@string/routing_settings_descr"/> <Preference android:key="routing_settings" android:title="@string/routing_settings_2" android:summary="@string/routing_settings_descr"/>
<Preference android:key="subscription_settings" android:title="@string/osm_live_subscription" android:summary="@string/osm_live_subscription_desc"/> <Preference android:key="subscription_settings" android:title="@string/osm_live_subscription" android:summary="@string/osm_live_subscription_desc"/>
<PreferenceCategory android:key="plugin_settings" android:title="@string/plugin_settings" /> <PreferenceCategory android:key="plugin_settings" android:title="@string/plugin_settings" />

View file

@ -14,6 +14,7 @@ import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.Version; import net.osmand.plus.Version;
import net.osmand.plus.liveupdates.OsmLiveActivity; import net.osmand.plus.liveupdates.OsmLiveActivity;
import net.osmand.plus.profiles.SettingsProfileActivity;
public class SettingsActivity extends SettingsBaseActivity { public class SettingsActivity extends SettingsBaseActivity {
@ -28,6 +29,7 @@ public class SettingsActivity extends SettingsBaseActivity {
private Preference general; private Preference general;
private Preference routing; private Preference routing;
private Preference subscription; private Preference subscription;
private Preference profiles;
@Override @Override
@ -40,6 +42,8 @@ public class SettingsActivity extends SettingsBaseActivity {
general.setOnPreferenceClickListener(this); general.setOnPreferenceClickListener(this);
routing = (Preference) screen.findPreference("routing_settings"); routing = (Preference) screen.findPreference("routing_settings");
routing.setOnPreferenceClickListener(this); routing.setOnPreferenceClickListener(this);
profiles = (Preference) screen.findPreference("application_profiles");
profiles.setOnPreferenceClickListener(this);
subscription = (Preference) screen.findPreference("subscription_settings"); subscription = (Preference) screen.findPreference("subscription_settings");
subscription.setOnPreferenceClickListener(this); subscription.setOnPreferenceClickListener(this);
@ -88,6 +92,9 @@ public class SettingsActivity extends SettingsBaseActivity {
if (preference == general) { if (preference == general) {
startActivity(new Intent(this, SettingsGeneralActivity.class)); startActivity(new Intent(this, SettingsGeneralActivity.class));
return true; return true;
} else if (preference == profiles){
startActivity(new Intent(this, SettingsProfileActivity.class));
return true;
} else if (preference == routing) { } else if (preference == routing) {
startActivity(new Intent(this, SettingsNavigationActivity.class)); startActivity(new Intent(this, SettingsNavigationActivity.class));
return true; return true;

View file

@ -0,0 +1,87 @@
package net.osmand.plus.profiles;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SwitchCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.profiles.ProfileMenuAdapter.ProfileViewHolder;
import net.osmand.plus.profiles.SettingsProfileActivity.ProfileItem;
public class ProfileMenuAdapter extends RecyclerView.Adapter<ProfileViewHolder> {
private List<ProfileItem> items;
OsmandApplication app;
public ProfileMenuAdapter(List<ProfileItem> items, OsmandApplication app) {
this.items = items;
this.app = app;
}
public List<ProfileItem> getItems() {
return items;
}
public void addItem(ProfileItem profileItem) {
items.add(profileItem);
notifyDataSetChanged();
}
@NonNull
@Override
public ProfileViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.profile_list_item, parent, false);
return new ProfileViewHolder(itemView);
}
@Override
public void onBindViewHolder(@NonNull ProfileViewHolder holder, int position) {
ProfileItem item = items.get(position);
holder.title.setText(item.getTitle());
holder.descr.setText(item.getDescr());
Drawable drawable = app.getUIUtilities().getThemedIcon(item.getIconRes());
holder.icon.setImageDrawable(drawable);
holder.aSwitch.setChecked(item.getState());
holder.aSwitch.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//todo change profile state;
}
});
holder.profileOptions.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//todo open profile settings;
}
});
}
@Override
public int getItemCount() {
return items.size();
}
class ProfileViewHolder extends RecyclerView.ViewHolder {
TextView title, descr;
SwitchCompat aSwitch;
ImageView icon, profileOptions;
ProfileViewHolder(View itemView) {
super(itemView);
title = itemView.findViewById(R.id.profile_title);
descr = itemView.findViewById(R.id.profile_descr);
aSwitch = itemView.findViewById(R.id.profile_switch);
icon = itemView.findViewById(R.id.profile_icon);
profileOptions = itemView.findViewById(R.id.profile_settings);
}
}
}

View file

@ -0,0 +1,90 @@
package net.osmand.plus.profiles;
import android.os.Bundle;
import android.view.MenuItem;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.OsmandActionBarActivity;
public class SettingsProfileActivity extends OsmandActionBarActivity {
private OsmandApplication app;
@Override
public void onCreate(Bundle savedInstanceState) {
app = getMyApplication();
app.applyTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.single_fragment_layout);
if (savedInstanceState == null) {
SettingsProfileFragment profileFragment = new SettingsProfileFragment();
profileFragment.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction().add(android.R.id.content, profileFragment).commit();
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
switch (itemId) {
case android.R.id.home:
finish();
return true;
}
return false;
}
@Override
protected void onResume() {
super.onResume();
}
public class ProfileItem {
private int iconRes;
private String title;
private String descr;
private boolean state;
public ProfileItem(int iconRes, String title, String descr, boolean state) {
this.iconRes = iconRes;
this.title = title;
this.descr = descr;
this.state = state;
}
public int getIconRes() {
return iconRes;
}
public void setIconRes(int iconRes) {
this.iconRes = iconRes;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescr() {
return descr;
}
public void setDescr(String descr) {
this.descr = descr;
}
public boolean getState() {
return state;
}
public void setState(boolean state) {
this.state = state;
}
}
}

View file

@ -0,0 +1,42 @@
package net.osmand.plus.profiles;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import net.osmand.PlatformUtil;
import net.osmand.plus.R;
import net.osmand.plus.base.BaseOsmAndFragment;
import org.apache.commons.logging.Log;
public class SettingsProfileFragment extends BaseOsmAndFragment {
private static final Log LOG = PlatformUtil.getLog(SettingsProfileFragment.class);
private ProfileMenuAdapter adapter;
private RecyclerView recyclerView;
private AppCompatButton btn;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.profiles_list_fragment, container, false);
recyclerView = view.findViewById(R.id.profiles_list);
btn = view.findViewById(R.id.add_profile_btn);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//todo add new profile;
}
});
return view;
}
}