-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mvvm/login #3
Open
iamsannyrai
wants to merge
11
commits into
master
Choose a base branch
from
mvvm/login
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Mvvm/login #3
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
32ca3c0
dependencies added
iamsannyrai 04ec926
login
iamsannyrai 9415a90
login layout changed
iamsannyrai 7316b85
update gitignore
iamsannyrai bddd18f
changes made
iamsannyrai b32ea49
generic data to wrap all response added
iamsannyrai c328dfe
add support for java 8
khadkarajesh e79a078
update gitignore
khadkarajesh a1e6f96
coroutine
iamsannyrai 6d3c141
koin DI
iamsannyrai 36f60e1
No internet exception handled
iamsannyrai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,86 @@ | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
*.aab | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
release/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# IntelliJ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.idea/workspace.xml | ||
.idea/tasks.xml | ||
.idea/gradle.xml | ||
.idea/assetWizardSettings.xml | ||
.idea/dictionaries | ||
.idea/libraries | ||
# Android Studio 3 in .gitignore file. | ||
.idea/caches | ||
.idea/modules.xml | ||
# Comment next line if keeping position of elements in Navigation Editor is relevant for you | ||
.idea/navEditor.xml | ||
.idea/misc.xml | ||
.idea/encodings.xml | ||
.idea/codeStyles/Project.xml | ||
|
||
|
||
# Keystore files | ||
# Uncomment the following lines if you do not want to check your keystore files in. | ||
#*.jks | ||
#*.keystore | ||
|
||
# External native build folder generated in Android Studio 2.2 and later | ||
.externalNativeBuild | ||
|
||
# Google Services (e.g. APIs or Firebase) | ||
# google-services.json | ||
|
||
# Freeline | ||
freeline.py | ||
freeline/ | ||
freeline_project_description.json | ||
|
||
# fastlane | ||
fastlane/report.xml | ||
fastlane/Preview.html | ||
fastlane/screenshots | ||
fastlane/test_output | ||
fastlane/readme.md | ||
|
||
# Version control | ||
vcs.xml | ||
|
||
# lint | ||
lint/intermediates/ | ||
lint/generated/ | ||
lint/outputs/ | ||
lint/tmp/ | ||
# lint/reports/ |
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 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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.incwelltechnology.lms | ||
|
||
import android.app.Application | ||
import com.incwelltechnology.lms.module.lmsModule | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.android.ext.koin.androidLogger | ||
import org.koin.core.context.startKoin | ||
|
||
class App:Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
startKoin { | ||
androidLogger() | ||
androidContext(this@App) | ||
modules(lmsModule) | ||
} | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
app/src/main/java/com/incwelltechnology/lms/MainActivity.kt
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/incwelltechnology/lms/data/model/BaseResponse.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,8 @@ | ||
package com.incwelltechnology.lms.data.model | ||
|
||
class BaseResponse<T> { | ||
var status: Boolean = false | ||
var data: T? = null | ||
var error: String = "" | ||
var token: String = "" | ||
} |
3 changes: 3 additions & 0 deletions
3
app/src/main/java/com/incwelltechnology/lms/data/model/LoginRequest.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,3 @@ | ||
package com.incwelltechnology.lms.data.model | ||
|
||
data class LoginRequest(val username:String, val password:String) |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/incwelltechnology/lms/data/model/User.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,16 @@ | ||
package com.incwelltechnology.lms.data.model | ||
|
||
data class User( | ||
val full_name : String = "", | ||
val phone_number: String = "", | ||
var email: String= "", | ||
val department: String = "", | ||
var leave_issuer: String ="", | ||
var image: String = "", | ||
var sick_leaves: Int, | ||
var annual_leaves:Int, | ||
var compensation_leaves: Int, | ||
val date_of_birth:String = "", | ||
val joined_date:String = "", | ||
var id:Int=0 | ||
) |
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/incwelltechnology/lms/data/network/LmsApi.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,33 @@ | ||
package com.incwelltechnology.lms.data.network | ||
|
||
import com.incwelltechnology.lms.data.model.BaseResponse | ||
import com.incwelltechnology.lms.data.model.LoginRequest | ||
import com.incwelltechnology.lms.data.model.User | ||
import okhttp3.OkHttpClient | ||
import retrofit2.Response | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
import retrofit2.http.Body | ||
import retrofit2.http.POST | ||
|
||
interface LmsApi { | ||
@POST("login") | ||
suspend fun userLogin( | ||
@Body login: LoginRequest | ||
): Response<BaseResponse<User>> | ||
|
||
companion object { | ||
operator fun invoke(networkConnectionInterceptor: NetworkConnectionInterceptor): LmsApi { | ||
val okHttpClient=OkHttpClient.Builder() | ||
.addInterceptor(networkConnectionInterceptor) | ||
.build() | ||
|
||
return Retrofit.Builder() | ||
.client(okHttpClient) | ||
.baseUrl("http://192.168.1.100:8000/v1/api/") | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.build() | ||
.create(LmsApi::class.java) | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamsannyrai we have decided to create network module isn't it?