-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9ac2b9
commit f2e2166
Showing
13 changed files
with
129 additions
and
88 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
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
27 changes: 25 additions & 2 deletions
27
helium-core/src/androidMain/kotlin/com/joaquimverges/helium/core/HeliumViewModel.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 |
---|---|---|
@@ -1,13 +1,36 @@ | ||
package com.joaquimverges.helium.core | ||
|
||
import androidx.lifecycle.LifecycleObserver | ||
import androidx.lifecycle.DefaultLifecycleObserver | ||
import androidx.lifecycle.LifecycleOwner | ||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.viewModelScope | ||
import kotlinx.coroutines.CoroutineScope | ||
|
||
/** | ||
* Android ViewModel implementation | ||
*/ | ||
actual abstract class HeliumViewModel : ViewModel(), LifecycleObserver { | ||
actual abstract class HeliumViewModel : ViewModel(), DefaultLifecycleObserver { | ||
actual val coroutineScope: CoroutineScope = viewModelScope | ||
|
||
override fun onResume(owner: LifecycleOwner) { | ||
onResume() | ||
} | ||
|
||
override fun onPause(owner: LifecycleOwner) { | ||
onPause() | ||
} | ||
|
||
override fun onCleared() { | ||
super.onCleared() | ||
this.onClear() | ||
} | ||
|
||
actual open fun onResume() { | ||
} | ||
|
||
actual open fun onPause() { | ||
} | ||
|
||
actual open fun onClear() { | ||
} | ||
} |
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
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
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
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
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 |
---|---|---|
@@ -1,29 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.joaquimverges.demoapp"> | ||
package="com.joaquimverges.demoapp"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name="com.joaquimverges.demoapp.MainActivity"> | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name="com.joaquimverges.demoapp.MainActivity" | ||
android:exported="true"> | ||
<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" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity android:name="com.joaquimverges.demoapp.SimpleListActivity"/> | ||
<activity android:name="com.joaquimverges.demoapp.ViewPagerActivity"/> | ||
<activity android:name="com.joaquimverges.demoapp.SimpleListActivityRetained"/> | ||
<activity android:name="com.joaquimverges.demoapp.SimpleListFragmentActivityRetained"/> | ||
<activity android:name="com.joaquimverges.demoapp.AdvancedListActivity"/> | ||
<activity android:name="com.joaquimverges.demoapp.CardListActivity"/> | ||
<activity android:name="com.joaquimverges.demoapp.BottomNavActivity"/> | ||
<activity android:name="com.joaquimverges.demoapp.SimpleListActivity" /> | ||
<activity android:name="com.joaquimverges.demoapp.ViewPagerActivity" /> | ||
<activity android:name="com.joaquimverges.demoapp.SimpleListActivityRetained" /> | ||
<activity android:name="com.joaquimverges.demoapp.SimpleListFragmentActivityRetained" /> | ||
<activity android:name="com.joaquimverges.demoapp.AdvancedListActivity" /> | ||
<activity android:name="com.joaquimverges.demoapp.CardListActivity" /> | ||
<activity android:name="com.joaquimverges.demoapp.BottomNavActivity" /> | ||
</application> | ||
|
||
</manifest> |
24 changes: 13 additions & 11 deletions
24
samples/multiplatform_app/android/src/main/AndroidManifest.xml
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
Binary file modified
BIN
-203 Bytes
(99%)
...ios/Helium News.xcworkspace/xcuserdata/joaquim.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
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
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
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