Skip to content

Instantly share code, notes, and snippets.

View seanashmore's full-sized avatar

Sean Ashmore seanashmore

  • Northern Ireland
View GitHub Profile
@seanashmore
seanashmore / WelcomeFragmentSafeArgNavPart2.kt
Created March 6, 2021 16:33
WelcomeFragment-SafeArgNav-Part2
package com.alittlelost.navsample
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
@seanashmore
seanashmore / applevelmodernplugin.gradle
Created March 6, 2021 16:24
app-level-safe-args-plugin-nav-part-2
plugins {
id 'androidx.navigation.safeargs.kotlin'
}
@seanashmore
seanashmore / applevelbuild.gradle
Created March 6, 2021 16:23
Nav-part2-app-level-build-gradle-safe-args-plugin
apply plugin: "androidx.navigation.safeargs.kotlin"
@seanashmore
seanashmore / toplevelbuiid.gradle
Created March 6, 2021 16:22
Nav-Part2-Top-Level-SafeArgs
dependencies {
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.3"
}
@seanashmore
seanashmore / WelcomeFragmentPart2Rev2.kt
Created March 6, 2021 14:21
WelcomeFragment minus auto-generated comments and code
package com.alittlelost.navsample
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
class WelcomeFragment : Fragment() {
@seanashmore
seanashmore / welcome_layout_part2_revision1.xml
Last active March 6, 2021 14:14
Welcome layout Update 1
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".WelcomeFragment">
<Button
android:id="@+id/next_button"
android:layout_width="wrap_content"
@seanashmore
seanashmore / androidJetpackSimpleNavFragContainter.xml
Created November 13, 2020 00:08
Android Jetpack Navigation Fragment Container
<?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">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
@seanashmore
seanashmore / androidJetpackNavSimpleDependencies.gradle
Created November 12, 2020 23:37
Android Jetpack Navigation basic dependencies
def nav_version = "2.3.1"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
@seanashmore
seanashmore / androidXFragmentDependencies.gradle
Last active November 11, 2020 16:47
AndroidX Fragment Dependencies
dependencies {
def fragment_version = "1.3.0-beta01"
// Java language implementation
implementation "androidx.fragment:fragment:$fragment_version"
// Kotlin
implementation "androidx.fragment:fragment-ktx:$fragment_version"
}
@seanashmore
seanashmore / androidXActivityDependencies.gradle
Last active November 11, 2020 16:47
AndroidX Activity Dependencies
dependencies {
def activity_version = "1.2.0-beta01"
// Java language implementation
implementation "androidx.activity:activity:$activity_version"
// Kotlin
implementation "androidx.activity:activity-ktx:$activity_version"
}