Skip to content

Commit 1a536ee

Browse files
committedFeb 17, 2021
Project Setup
1 parent 5c3e95b commit 1a536ee

28 files changed

+437
-64
lines changed
 

‎.github/workflows/Build.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build_apk:
6+
name: Generate APK
7+
runs-on: ubuntu-18.04
8+
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Set up JDK 12
12+
uses: actions/setup-java@v1
13+
with:
14+
java-version: 12
15+
16+
# Cache gradle
17+
- name: Cache Gradle and wrapper
18+
uses: actions/cache@v2
19+
with:
20+
path: |
21+
~/.gradle/caches
22+
~/.gradle/wrapper
23+
key: cache-${{ runner.os }}-${{ matrix.jdk }}-gradle-${{ hashFiles('**/*.gradle*') }}
24+
restore-keys: |
25+
${{ runner.os }}-gradle-
26+
- name: Grant Permission to Execute
27+
run: chmod +x gradlew
28+
29+
- name: Build debug APK
30+
run: bash ./gradlew assembleDebug --stacktrace
31+
- name: Upload APK
32+
uses: actions/upload-artifact@v1
33+
with:
34+
name: app
35+
path: app/build/outputs/apk/debug/app-debug.apk

‎.github/workflows/Lint.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Lint Check
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Code
12+
uses: actions/checkout@v2
13+
14+
- name: Lint Code Base
15+
uses: docker://github/super-linter:v2.2.0
16+
env:
17+
VALIDATE_ALL_CODEBASE: true
18+
VALIDATE_MD: false
19+
VALIDATE_XML: true
20+
VALIDATE_KOTLIN: true

‎.idea/codeStyles/Project.xml

+139
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/codeStyles/codeStyleConfig.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/discord.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/build.gradle

+53-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
plugins {
22
id 'com.android.application'
33
id 'kotlin-android'
4+
id 'kotlin-android-extensions'
5+
id 'kotlin-kapt'
6+
id 'dagger.hilt.android.plugin'
47
}
58

69
android {
@@ -35,11 +38,55 @@ android {
3538
dependencies {
3639

3740
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
38-
implementation 'androidx.core:core-ktx:1.2.0'
39-
implementation 'androidx.appcompat:appcompat:1.1.0'
40-
implementation 'com.google.android.material:material:1.1.0'
41-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
41+
implementation 'androidx.core:core-ktx:1.3.2'
42+
implementation 'androidx.appcompat:appcompat:1.2.0'
43+
implementation 'com.google.android.material:material:1.3.0'
44+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
4245
testImplementation 'junit:junit:4.+'
43-
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
44-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
46+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
47+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
48+
49+
// Material Design
50+
implementation 'com.google.android.material:material:1.3.0'
51+
52+
// Kotlin
53+
implementation "androidx.fragment:fragment-ktx:1.2.5"
54+
55+
// Architectural Components
56+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0"
57+
58+
// Lifecycle
59+
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
60+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"
61+
implementation "androidx.lifecycle:lifecycle-runtime:2.3.0"
62+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.0"
63+
64+
// Coroutines
65+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
66+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
67+
68+
// Coroutine Lifecycle Scopes
69+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0"
70+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.0"
71+
72+
// Navigation Component
73+
implementation "androidx.navigation:navigation-fragment-ktx:2.3.3"
74+
implementation "androidx.navigation:navigation-ui-ktx:2.3.3"
75+
76+
// Glide
77+
implementation 'com.github.bumptech.glide:glide:4.11.0'
78+
kapt 'com.github.bumptech.glide:compiler:4.11.0'
79+
80+
// Activity KTX for viewModels()
81+
implementation "androidx.activity:activity-ktx:1.2.0"
82+
83+
//Dagger - Hilt
84+
implementation "com.google.dagger:hilt-android:2.28-alpha"
85+
kapt "com.google.dagger:hilt-android-compiler:2.28-alpha"
86+
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha02"
87+
kapt "androidx.hilt:hilt-compiler:1.0.0-alpha02"
88+
89+
// Timber
90+
implementation 'com.jakewharton.timber:timber:4.7.1'
91+
4592
}

‎app/proguard-rules.pro

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
22+
23+
-keepnames class androidx.navigation.fragment.NavHostFragment

‎app/src/androidTest/java/com/sagar/assigmenthub/ExampleInstrumentedTest.kt

-24
This file was deleted.

‎app/src/main/AndroidManifest.xml

+3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.sagar.assigmenthub">
44

5+
<uses-permission android:name="android.permission.INTERNET" />
6+
57
<application
68
android:allowBackup="true"
9+
android:name=".AssigmentHubyApplication"
710
android:icon="@mipmap/ic_launcher"
811
android:label="@string/app_name"
912
android:roundIcon="@mipmap/ic_launcher_round"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.sagar.assigmenthub
2+
3+
import android.app.Application
4+
import dagger.hilt.android.HiltAndroidApp
5+
6+
@HiltAndroidApp
7+
class AssigmentHubyApplication : Application()

‎app/src/main/java/com/sagar/assigmenthub/MainActivity.kt

+2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package com.sagar.assigmenthub
22

33
import androidx.appcompat.app.AppCompatActivity
44
import android.os.Bundle
5+
import dagger.hilt.android.AndroidEntryPoint
56

7+
@AndroidEntryPoint
68
class MainActivity : AppCompatActivity() {
79
override fun onCreate(savedInstanceState: Bundle?) {
810
super.onCreate(savedInstanceState)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.sagar.assigmenthub.di
2+
3+
import dagger.Module
4+
5+
import dagger.hilt.InstallIn
6+
import dagger.hilt.android.components.ApplicationComponent
7+
8+
@Module
9+
@InstallIn(ApplicationComponent::class)
10+
object AppModule
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.sagar.assigmenthub.other
2+
3+
object Constants
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.sagar.assigmenthub.other
2+
3+
open class Event<out T>(private val data: T) {
4+
5+
var hasBeenHandled = false
6+
private set
7+
8+
fun getContentIfNotHandled(): T? {
9+
return if(hasBeenHandled) {
10+
null
11+
} else {
12+
hasBeenHandled = true
13+
data
14+
}
15+
}
16+
17+
fun peekContent() = data
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.sagar.assigmenthub.other
2+
3+
data class Resource<out T>(val status: Status, val data: T?, val message: String?) {
4+
5+
companion object {
6+
fun <T> success(data: T?) = Resource(Status.SUCCESS, data, null)
7+
8+
fun <T> error(message: String, data: T?) = Resource(Status.ERROR, data, message)
9+
10+
fun <T> loading(data: T?) = Resource(Status.LOADING, data, null)
11+
}
12+
}
13+
14+
enum class Status {
15+
SUCCESS,
16+
ERROR,
17+
LOADING
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.sagar.assigmenthub.ui.fragments
2+
3+
import androidx.fragment.app.Fragment
4+
import com.sagar.assigmenthub.R
5+
import dagger.hilt.android.AndroidEntryPoint
6+
7+
@AndroidEntryPoint
8+
class HomeFragment : Fragment(R.layout.fragment_home) {
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.sagar.assigmenthub.ui.fragments
2+
3+
import androidx.fragment.app.Fragment
4+
import com.sagar.assigmenthub.R
5+
import dagger.hilt.android.AndroidEntryPoint
6+
7+
@AndroidEntryPoint
8+
class LoginFragment : Fragment(R.layout.fragment_login) {
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.sagar.assigmenthub.ui.fragments
2+
3+
import androidx.fragment.app.Fragment
4+
import com.sagar.assigmenthub.R
5+
import dagger.hilt.android.AndroidEntryPoint
6+
7+
@AndroidEntryPoint
8+
class RegisterFragment : Fragment(R.layout.fragment_register) {
9+
}

‎app/src/main/res/layout/activity_main.xml

+21-8
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,28 @@
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7+
android:background="@color/white"
78
tools:context=".MainActivity">
89

9-
<TextView
10-
android:layout_width="wrap_content"
11-
android:layout_height="wrap_content"
12-
android:text="Hello World!"
13-
app:layout_constraintBottom_toBottomOf="parent"
14-
app:layout_constraintLeft_toLeftOf="parent"
15-
app:layout_constraintRight_toRightOf="parent"
16-
app:layout_constraintTop_toTopOf="parent" />
10+
<FrameLayout
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent"
13+
app:layout_constraintBottom_toTopOf="parent"
14+
app:layout_constraintEnd_toEndOf="parent"
15+
app:layout_constraintHorizontal_bias="0.5"
16+
app:layout_constraintStart_toStartOf="parent"
17+
app:layout_constraintTop_toTopOf="parent">
18+
19+
<fragment
20+
android:id="@+id/navHostFragment"
21+
android:name="androidx.navigation.fragment.NavHostFragment"
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent"
24+
app:defaultNavHost="true"
25+
app:navGraph="@navigation/nav_graph" />
26+
27+
28+
</FrameLayout>
29+
1730

1831
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
6+
</androidx.constraintlayout.widget.ConstraintLayout>
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:background="@android:color/white">
8+
9+
<TextView
10+
android:id="@+id/textView"
11+
android:layout_width="wrap_content"
12+
android:layout_height="wrap_content"
13+
android:text="Hello World!"
14+
android:textColor="@color/black"
15+
app:layout_constraintBottom_toBottomOf="parent"
16+
app:layout_constraintEnd_toEndOf="parent"
17+
app:layout_constraintStart_toStartOf="parent"
18+
app:layout_constraintTop_toTopOf="parent" />
19+
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
6+
</androidx.constraintlayout.widget.ConstraintLayout>
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:id="@+id/nav_graph"
6+
app:startDestination="@id/loginFragment">
7+
8+
<fragment
9+
android:id="@+id/loginFragment"
10+
tools:layout="@layout/fragment_login"
11+
android:name="com.sagar.assigmenthub.ui.fragments.LoginFragment"
12+
android:label="LoginFragment" />
13+
14+
<fragment
15+
android:id="@+id/registerFragment"
16+
tools:layout="@layout/fragment_register"
17+
android:name="com.sagar.assigmenthub.ui.fragments.RegisterFragment"
18+
android:label="RegisterFragment" />
19+
20+
<fragment
21+
android:id="@+id/homeFragment"
22+
tools:layout="@layout/fragment_home"
23+
android:name="com.sagar.assigmenthub.ui.fragments.HomeFragment"
24+
android:label="HomeFragment" />
25+
26+
27+
</navigation>

‎app/src/main/res/values-night/themes.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22
<!-- Base application theme. -->
3-
<style name="Theme.AssigmentHub" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
3+
<style name="Theme.AssigmentHub" parent="Theme.MaterialComponents.NoActionBar">
44
<!-- Primary brand color. -->
5-
<item name="colorPrimary">@color/purple_200</item>
5+
<item name="colorPrimary">@color/purple_500</item>
66
<item name="colorPrimaryVariant">@color/purple_700</item>
7-
<item name="colorOnPrimary">@color/black</item>
7+
<item name="colorOnPrimary">@color/white</item>
88
<!-- Secondary brand color. -->
99
<item name="colorSecondary">@color/teal_200</item>
10-
<item name="colorSecondaryVariant">@color/teal_200</item>
10+
<item name="colorSecondaryVariant">@color/teal_700</item>
1111
<item name="colorOnSecondary">@color/black</item>
1212
<!-- Status bar color. -->
1313
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>

‎app/src/main/res/values/themes.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22
<!-- Base application theme. -->
3-
<style name="Theme.AssigmentHub" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
3+
<style name="Theme.AssigmentHub" parent="Theme.MaterialComponents.NoActionBar">
44
<!-- Primary brand color. -->
55
<item name="colorPrimary">@color/purple_500</item>
66
<item name="colorPrimaryVariant">@color/purple_700</item>

‎app/src/test/java/com/sagar/assigmenthub/ExampleUnitTest.kt

-17
This file was deleted.

‎build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ buildscript {
88
dependencies {
99
classpath "com.android.tools.build:gradle:4.1.2"
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
11+
classpath "com.google.dagger:hilt-android-gradle-plugin:2.28.3-alpha"
12+
classpath 'com.google.gms:google-services:4.3.5'
1213
// NOTE: Do not place your application dependencies here; they belong
1314
// in the individual module build.gradle files
1415
}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Feb 16 03:22:57 IST 2021
1+
#Tue Feb 16 04:29:53 IST 2021
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

0 commit comments

Comments
 (0)
Please sign in to comment.