-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement basic list of floor plans and simple AR Fragment that can h…
…ost a cloud anchor
- Loading branch information
0 parents
commit 971b865
Showing
61 changed files
with
1,798 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
plugins { | ||
id 'com.android.application' | ||
id 'org.jetbrains.kotlin.android' | ||
id 'kotlinx-serialization' | ||
id 'androidx.navigation.safeargs.kotlin' | ||
id 'com.google.secrets_gradle_plugin' version '0.4' | ||
} | ||
|
||
android { | ||
namespace 'de.morhenn.ar_localization' | ||
compileSdk 33 | ||
|
||
defaultConfig { | ||
applicationId "de.morhenn.ar_localization" | ||
minSdk 24 | ||
targetSdk 33 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
buildFeatures { | ||
viewBinding true | ||
} | ||
aaptOptions { | ||
noCompress 'filamat', 'ktx' | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation 'androidx.core:core-ktx:1.9.0' | ||
implementation 'com.google.android.material:material:1.7.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||
|
||
// Navigation component | ||
implementation "androidx.navigation:navigation-fragment-ktx:2.5.3" | ||
implementation "androidx.navigation:navigation-ui-ktx:2.5.3" | ||
|
||
// Play services | ||
implementation 'com.google.android.gms:play-services-maps:18.1.0' | ||
implementation 'com.google.android.gms:play-services-location:21.0.1' | ||
//OAuth | ||
implementation 'com.google.android.gms:play-services-auth:20.3.0' | ||
|
||
// LiveData | ||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1" | ||
|
||
//JSON serialization | ||
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2' | ||
|
||
// SceneView | ||
implementation 'io.github.sceneview:arsceneview:0.6.1-SNAPSHOT' | ||
|
||
implementation 'com.google.ar:core:1.34.0' //need min 1.33 for new cloud console endpoint | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:dataExtractionRules="@xml/data_extraction_rules" | ||
android:fullBackupContent="@xml/backup_rules" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.Arlocalization" | ||
tools:targetApi="31"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
app/src/main/java/de/morhenn/ar_localization/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package de.morhenn.ar_localization | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/de/morhenn/ar_localization/MyApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.morhenn.ar_localization | ||
|
||
import android.app.Application | ||
import de.morhenn.ar_localization.utils.FileLog | ||
|
||
class MyApplication : Application() { | ||
|
||
companion object { | ||
@JvmField | ||
var initialized = false | ||
const val TAG = "ArLocalizationApp" | ||
} | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
if (!initialized) { | ||
initialized = true | ||
//initialize all static utils | ||
|
||
FileLog.init(applicationContext, true) | ||
Thread.setDefaultUncaughtExceptionHandler { _, e -> FileLog.fatal(e) } | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
app/src/main/java/de/morhenn/ar_localization/adapter/FloorPlanListAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package de.morhenn.ar_localization.adapter | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import de.morhenn.ar_localization.databinding.ItemFloorPlanListBinding | ||
import de.morhenn.ar_localization.model.FloorPlan | ||
|
||
class FloorPlanListAdapter(private val floorPlanList: List<FloorPlan>) : RecyclerView.Adapter<FloorPlanListAdapter.ViewHolder>() { | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
val binding = ItemFloorPlanListBinding.inflate(LayoutInflater.from(parent.context), parent, false) | ||
return ViewHolder(binding) | ||
} | ||
|
||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
holder.bind(floorPlanList[position], position) | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return floorPlanList.size | ||
} | ||
|
||
class ViewHolder(private val binding: ItemFloorPlanListBinding) : RecyclerView.ViewHolder(binding.root) { | ||
|
||
fun bind(floorPlan: FloorPlan, position: Int) { | ||
binding.floorPlanListItemName.text = floorPlan.name | ||
binding.floorPlanListItemInfo.text = floorPlan.info | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.