This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.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" | |
tools:context=".MainActivity"> | |
<fragment | |
android:id="@+id/fragment" |
This file contains hidden or 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
sceneform.asset('sampledata/models/model.obj', | |
'default', | |
'sampledata/models/model.sfa', | |
'src/main/res/raw/model') |
This file contains hidden or 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
<!-- Camera permission is required for scene --> | |
<uses-permission android:name="android.permission.CAMERA" /> | |
<!-- This tag indicates that this application requires ARCore. This results in the application | |
only being visible in the Google Play Store on devices that support ARCore. --> | |
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/> |
This file contains hidden or 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
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.15.0' |
This file contains hidden or 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
apply plugin: 'com.google.ar.sceneform.plugin' |
This file contains hidden or 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
classpath 'com.google.ar.sceneform:plugin:1.15.0' |
This file contains hidden or 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
class MainActivity : AppCompatActivity() { | |
private val mainViewModel: MainViewModel by viewModel() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
text_view_demo.text = mainViewModel.getUserName() |
This file contains hidden or 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
class MyApp: Application() { | |
override fun onCreate() { | |
super.onCreate() | |
val moduleList = listOf(mainModule) | |
// start Koin! | |
startKoin { | |
androidLogger() | |
// declare used Android context |
This file contains hidden or 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
val mainModule = module { | |
single { | |
RemoteRepository() | |
} | |
viewModel { | |
MainViewModel(get()) | |
} | |
} |
This file contains hidden or 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
// ViewModel for fetching data from repository. | |
class MainViewModel(private var remoteRepository: RemoteRepository): ViewModel() { | |
fun getUserName(): String { | |
return remoteRepository.getUserName() | |
} | |
} |