Skip to content

Commit 6ec6d4f

Browse files
committed
prefix resource strings
1 parent 287f7ce commit 6ec6d4f

8 files changed

Lines changed: 18 additions & 13 deletions

File tree

VERSIONS.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def ROBOLECTRIC_VERSION = "3.0"
1313
def JUNIT_VERSION = "4.12"
1414
def FEST_ASSERT_CORE_VERSION = "2.0M10"
1515
def SUPPORT_TEST_VERSION = "0.5"
16+
def RESOURCE_PREFIX = "mauron85_bgloc_"
1617

1718
ext {
1819
hasRootProject = { ->
@@ -112,6 +113,10 @@ ext {
112113
return false
113114
}
114115

116+
getResourcePrefix = { ->
117+
return RESOURCE_PREFIX
118+
}
119+
115120
androidLibs = [
116121
supportAnnotations: [group: 'com.android.support', name: 'support-annotations', version: '23.1.1'],
117122
supportCompat: [group: 'com.android.support', name: 'support-compat', version: getSupportLibVersion()],

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ apply plugin: 'com.android.library'
22

33
apply from: './VERSIONS.gradle'
44
def applicationId = getApplicationId()
5-
def playServicesVersion = getPlayServicesVersion()
6-
def supportLibVersion = getSupportLibVersion()
75
def hasGradle3Support = getGradle3Support()
6+
def resourcePrefix = getResourcePrefix()
87

98
// https://hackernoon.com/android-how-to-add-gradle-dependencies-using-foreach-c4cbcc070458
109
def oreoDependencies = [
@@ -66,8 +65,9 @@ android {
6665
publishNonDefault true
6766

6867
defaultConfig {
69-
resValue "string", "content_authority", applicationId + '.provider'
70-
resValue "string", "account_type", applicationId
68+
resValue "string", resourcePrefix + "account_name", 'Locations'
69+
resValue "string", resourcePrefix + "account_type", applicationId + '.mauron85.bgloc.account'
70+
resValue "string", resourcePrefix + "content_authority", applicationId + '.mauron85.bgloc.provider'
7171
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
7272
minSdkVersion project.ext.getMinSdkVersion()
7373
versionCode 1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.marianhello.backgroundgeolocation;
22

33
abstract public class TestConstants {
4-
public static final String Authority = "com.marianhello.app.provider";
4+
public static final String Authority = "com.marianhello.app.mauron85.bgloc.provider";
55
}

src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</service>
4242
<provider
4343
android:name="com.marianhello.bgloc.data.provider.LocationContentProvider"
44-
android:authorities="@string/content_authority"
44+
android:authorities="@string/mauron85_bgloc_content_authority"
4545
android:exported="false"
4646
android:syncable="true"/>
4747
<service android:enabled="true" android:exported="false" android:name="com.marianhello.bgloc.LocationService" />

src/main/java/com/marianhello/bgloc/ResourceResolver.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
*/
88
public class ResourceResolver {
99

10-
private static final String ACCOUNT_NAME_RESOURCE = "account_name";
11-
private static final String ACCOUNT_TYPE_RESOURCE = "account_type";
12-
private static final String AUTHORITY_TYPE_RESOURCE = "content_authority";
10+
private static final String RESOURCE_PREFIX = "mauron85_bgloc_";
11+
private static final String ACCOUNT_NAME_RESOURCE = RESOURCE_PREFIX + "account_name";
12+
private static final String ACCOUNT_TYPE_RESOURCE = RESOURCE_PREFIX + "account_type";
13+
private static final String AUTHORITY_TYPE_RESOURCE = RESOURCE_PREFIX + "content_authority";
1314

1415
private Context mContext;
1516

src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<string name="app_name">app_name</string>
4-
<string name="account_name">Locations</string>
54
</resources>

src/main/res/xml/authenticator.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<account-authenticator
33
xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:accountType="@string/account_type"
4+
android:accountType="@string/mauron85_bgloc_account_type"
55
android:icon="@mipmap/ic_launcher"
66
android:smallIcon="@mipmap/ic_launcher"
77
android:label="@string/app_name"/>

src/main/res/xml/syncadapter.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<sync-adapter
33
xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:contentAuthority="@string/content_authority"
5-
android:accountType="@string/account_type"
4+
android:contentAuthority="@string/mauron85_bgloc_content_authority"
5+
android:accountType="@string/mauron85_bgloc_account_type"
66
android:userVisible="false"
77
android:supportsUploading="true"
88
android:allowParallelSyncs="false"

0 commit comments

Comments
 (0)