Skip to content

Commit

Permalink
Added Swipe to delete lesson 3 next item
Browse files Browse the repository at this point in the history
  • Loading branch information
ViratAtAndroid committed Jan 10, 2024
1 parent fd122ab commit 6045fee
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private fun LessonContent() {
val currentPage = rememberSaveable { mutableStateOf(0) }

LogicPager(
pageCount = 9,
pageCount = 10,
currentPage = currentPage
) {
Column(
Expand Down Expand Up @@ -67,6 +67,7 @@ private fun LessonContent() {
6 -> ExpandableAnimatedList(getCountries())
7 -> ShimmerAnimatedList()
8 -> ToggleList()
9 -> SwipeToDeleteScreen()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.jetpack_compose_all_in_one.lessons.lesson_3

import androidx.compose.runtime.Composable

@Composable
fun SwipeToDeleteScreen() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.jetpack_compose_all_in_one.lessons.lesson_3

import androidx.lifecycle.ViewModel

class SwipeToDeleteViewModel : ViewModel() {

}
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<item>Expandable Animated List</item>
<item>Shimmer Animated List</item>
<item>Toggle List</item>
<item>Swipe to delete</item>
</string-array>

<string-array name="lesson_7_header_text">
Expand Down
1 change: 1 addition & 0 deletions dynamicfeature/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
29 changes: 29 additions & 0 deletions dynamicfeature/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
plugins {
id 'com.android.dynamic-feature'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'abhishek.pathak.dynamicfeature'
compileSdk 33

defaultConfig {
minSdk 24
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation project(":app")
implementation 'androidx.core:core-ktx:1.9.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.annotation:annotation:1.6.0'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package abhishek.pathak.dynamicfeature

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("abhishek.pathak.dynamicfeature", appContext.packageName)
}
}
13 changes: 13 additions & 0 deletions dynamicfeature/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution">

<dist:module
dist:instant="false"
dist:title="@string/title_dynamicfeature">
<dist:delivery>
<dist:on-demand />
</dist:delivery>
<dist:fusing dist:include="true" />
</dist:module>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package abhishek.pathak.dynamicfeature

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

0 comments on commit 6045fee

Please sign in to comment.