<style name="TopSheet_DialogAnimation">
<item name="android:windowEnterAnimation">@anim/slide_out_from_top</item>
<item name="android:windowExitAnimation">@anim/slide_back_to_top</item>
</style>
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
import kotlin.properties.ReadOnlyProperty | |
import kotlin.reflect.KClass | |
import kotlin.reflect.KProperty | |
/* | |
* Using the Injection framework: | |
* | |
* Create bindings somewhere in the application before the injections would occur. | |
* | |
* factory<MyInterface>(named = "specialName") { SomeImplementation() } |
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
<com.ingerul93.navigation.navigation.NavigationHostView | |
android:id="@+id/main_navigation_host" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent" /> |
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
override fun onSupportNavigateUp(): Boolean = navController.navigateUp() | |
override fun onBackPressed() { | |
if (!navController.popBackStack()) { | |
super.onBackPressed() | |
} | |
} |
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
private lateinit var navController: NavController | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
navController = Navigation.findNavController(mainNavigationHost) | |
Navigation.setViewNavController(mainNavigationHost, navController) | |
} |
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
@NavDestination.ClassType(ViewGroup::class) | |
class ViewDestination(navigator: Navigator<out NavDestination>) : NavDestination(navigator) { | |
@LayoutRes var layoutId: Int = 0 | |
override fun onInflate(context: Context, attrs: AttributeSet) { | |
//Some implementation here | |
} | |
} |
NewerOlder