Skip to content

Commit d288a81

Browse files
committed
Add initial project
0 parents  commit d288a81

File tree

71 files changed

+2444
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2444
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
namespace 'com.utsman.osmapp'
8+
compileSdk 33
9+
10+
defaultConfig {
11+
applicationId "com.utsman.osmapp"
12+
minSdk 24
13+
targetSdk 33
14+
versionCode 1
15+
versionName "1.0"
16+
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18+
vectorDrawables {
19+
useSupportLibrary true
20+
}
21+
}
22+
23+
buildTypes {
24+
release {
25+
minifyEnabled false
26+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
27+
}
28+
}
29+
compileOptions {
30+
sourceCompatibility JavaVersion.VERSION_1_8
31+
targetCompatibility JavaVersion.VERSION_1_8
32+
}
33+
kotlinOptions {
34+
jvmTarget = '1.8'
35+
}
36+
buildFeatures {
37+
compose true
38+
}
39+
composeOptions {
40+
kotlinCompilerExtensionVersion '1.2.0'
41+
}
42+
packagingOptions {
43+
resources {
44+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
45+
}
46+
}
47+
}
48+
49+
dependencies {
50+
51+
implementation 'androidx.core:core-ktx:1.7.0'
52+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
53+
implementation 'androidx.activity:activity-compose:1.3.1'
54+
implementation "androidx.compose.ui:ui:$compose_ui_version"
55+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
56+
implementation 'androidx.compose.material:material:1.2.0'
57+
testImplementation 'junit:junit:4.13.2'
58+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
59+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
60+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
61+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
62+
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
63+
64+
implementation project(":osm-compose")
65+
implementation 'org.osmdroid:osmdroid-android:6.1.16'
66+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.utsman.osmapp
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.utsman.osmapp", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
6+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
7+
<uses-permission android:name="android.permission.INTERNET" />
8+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
9+
10+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
11+
tools:ignore="ScopedStorage" />
12+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
13+
tools:ignore="ScopedStorage" />
14+
15+
<application
16+
android:allowBackup="true"
17+
android:dataExtractionRules="@xml/data_extraction_rules"
18+
android:fullBackupContent="@xml/backup_rules"
19+
android:icon="@mipmap/ic_launcher"
20+
android:label="@string/app_name"
21+
android:supportsRtl="true"
22+
android:theme="@style/Theme.OsmAndroidCompose"
23+
tools:targetApi="31">
24+
<activity
25+
android:name=".MainActivity"
26+
android:exported="true"
27+
android:label="@string/app_name"
28+
android:theme="@style/Theme.OsmAndroidCompose">
29+
<intent-filter>
30+
<action android:name="android.intent.action.MAIN" />
31+
32+
<category android:name="android.intent.category.LAUNCHER" />
33+
</intent-filter>
34+
</activity>
35+
</application>
36+
37+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.utsman.osmapp
2+
3+
import org.osmdroid.util.GeoPoint
4+
5+
object Coordinates {
6+
7+
private val depokJakartaRoutesPolyline = "BGvjumMyq93rGkCO8L4DwMjSwMjSkIrO4D7GoLoG0KkI4IkI0F0FkNwMwM4NkNsOgKgK8GwHsEsE4IkIgPsO8LsJwC8BsJ0F0F4DkN8G8LoG8QsJ0FkDgFwC4IsEsEwCgKgFoG4DwH4DoGkD0FwCwWoLsE8B4D8BwH4DwHsE0FkDsEwC4csO4SsJ0KsEgK4DgFwCoG4DgFwC0FwC8GkDgFwC4I4D0PkI0U8LoL0F0K8GgU4NsEkDwbkX0UsTwHwHkSsOsOoL8L0KwH8G0KkIwM4IwM8G0K0FgKsE8L0FgU8G0PoGsO0FouBwRgoBoQsO0FsiBkN0F8BsJ4D8gD8kB0P0F0FwC0K4D8LsEsnBgP4IkDkIkD4hB4N0UkIgKkDkN4DoLkDgKwCgZoGgKwCoG8B8G8BwWgFgK8B8GoBoLwCoGoBgFoBoV4DoL8BwHoBwHoBkwBsJsO4D0PsE0PgF0P0F4IwCwgBsJkI8BsJ8B8QkD0ZoG4NkD8L4DwlB4NsYwHkIkDge4I0Z8GsiBsJoLwC8GoB8GUsJAsOA0yBjD4wBvCssB3DwMnB4mB_EkXjDgKTgKnBwHTgFTwMnB8VvC0jBrEwlB3DkNnBoGT8GTkSvC4InB0KvCkI7BgF7BsTzFsJvCsOrE4N3DoG7BgKjDgUnGgPrEwR_EwRrE0UrE0FnB0FAgKT0KTkIUkI8BoGwCokB0UwM8G4DwC0Fw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VzKsJrEsJ_E8Q3I4IrEsY7L8GjDsOnGsiBvRwH_EwH_EoGrEsEvC8Q7GsJ3DsEnB0FTsJwCsEUgFAkI7B4DTsETgFUsEoBs1E8zB4rBkSgzDgtB8QoGkDoBkNvC0F7BgFjDgKjIwMriBkNrsBgtB_mEkSjwB8G7VgF_O8G_T0FrTwWr7B0FrOoG4DkD8BgFkD0FoBsEoBsEAkNwC0FAkDT4NjDsd3IgoBjNwRzFwHvC4I7B4c7Gk6BnLwvBnLoa7GwH7B8anGsd7GoLvC89BrJ8arE4uC3NwWjD0F_YwH7f4DzP8GrnBwHrnB0K36B4DvWoBzFwCAgFA0FU0jBAkNA8B3DwCvCsEvCgFTsEU4D8BkDkD0F8B8GoBwHoBoVAwvBAk_BUoQAonCUgyBUoLA4D7GwC_EniCzmC7BU7BTnBnBT7BU7BoBnB8BT8BU"
8+
9+
val depokJakartaRoutes: List<GeoPoint>
10+
get() {
11+
val routes = PolylineEncoderDecoder.decode(depokJakartaRoutesPolyline)
12+
return routes.map { GeoPoint(it.lat, it.lng) }
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.utsman.osmapp
2+
3+
import android.util.Log
4+
import androidx.compose.runtime.Composable
5+
import androidx.compose.runtime.SideEffect
6+
import androidx.compose.runtime.remember
7+
8+
class Ref(var value: Int)
9+
// Note the inline function below which ensures that this function is essentially
10+
// copied at the call site to ensure that its logging only recompositions from the
11+
// original call site.
12+
@Composable
13+
inline fun LogCompositions(tag: String, msg: String) {
14+
if (BuildConfig.DEBUG) {
15+
val ref = remember { Ref(0) }
16+
SideEffect { ref.value++ }
17+
Log.d(tag, "Compositions: $msg ${ref.value}")
18+
}
19+
}

0 commit comments

Comments
 (0)