-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the file name from Notes to Taaveez
- Loading branch information
1 parent
c911a1e
commit c5c855d
Showing
39 changed files
with
664 additions
and
603 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.itssuryansh.taaveez | ||
|
||
import android.app.Application | ||
import com.itssuryansh.taaveez.database.TaaveezDatabase | ||
|
||
class TaaveezApp:Application() { | ||
val db by lazy { | ||
TaaveezDatabase.getInstance(this) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.itssuryansh.taaveez | ||
|
||
import androidx.room.* | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
@Dao | ||
interface TaaveezDao { | ||
|
||
@Insert | ||
suspend fun insert(TaaveezEntity : TaaveezEntity) | ||
|
||
@Update | ||
suspend fun update(TaaveezEntity : TaaveezEntity) | ||
|
||
@Delete | ||
suspend fun delete(TaaveezEntity : TaaveezEntity) | ||
|
||
@Query("select * from `Taaveez-table`") | ||
fun fetchAllContents(): Flow<List<TaaveezEntity>> | ||
|
||
@Query("select * from `Taaveez-table` where id=:id") | ||
fun fetchContentsById(id:Int):Flow<TaaveezEntity> | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/itssuryansh/taaveez/TaaveezEntity.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.itssuryansh.taaveez | ||
|
||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
|
||
@Entity(tableName = "Taaveez-table") | ||
data class TaaveezEntity( | ||
@PrimaryKey(autoGenerate = true) | ||
val id: Int =0, | ||
val Topic: String="", | ||
val Content: String="", | ||
val Date:String="", | ||
val CreatedDate:String="", | ||
val favorite:Boolean=false, | ||
val SmallDes : String?=null, | ||
val image : String?=null | ||
|
||
) |
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
Oops, something went wrong.