Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
r2unit committed Jul 6, 2021
0 parents commit f3aa9f9
Show file tree
Hide file tree
Showing 84 changed files with 1,951 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Tweet App
![Imgur](https://imgur.com/DTNuPpX.jpg)
The Tweet application is a tweet posting application for a single user. It uses Firestore to store and fetch the tweets. The Firestore updates the screen realtime by using the FirestoreRecyclerAdapter

## App use case
- Post new tweets.
- See the tweets in a list sorted by timestamp
- Edit and delete a tweet.
- Login and logout using firebase google authentication

## App Architecture
![Imgur](https://imgur.com/FScZEpj.jpg)
The architecture used for this application is MVVM. The activity uses viewModel functions to save and fetch data to firestore via a repository.
The FirestoreRecyclerAdapter keeps listening to the changes in the database and updates in realtime.

Components used:
Hilt for Dependency injection
Coroutines for pushing data to Firestore
Firebase integration

## Third Party Libraries
The following 3rd party libraries are used:
- SDP intuit: to support multiple screen avoiding the dimens files.
- Glide: To load images
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
110 changes: 110 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.gms.google-services'
id 'kotlin-kapt'
id 'kotlin-android-extensions'
id 'dagger.hilt.android.plugin'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.app.glints"
minSdkVersion 24
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

def sdp_version = "1.0.6"
def hilt_android = "2.28.1-alpha"
def hilt_lifecycle = "1.0.0-alpha01"
def activity_ktx_version = "1.2.3"
def lifecycle_ktx_version = "2.3.1"
def coroutines_version = "1.4.1"
def lifecycle_extension_version = "1.1.1"
def glide_version = "4.12.0"

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-firestore:21.4.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

/**
* Firebase
*/
implementation platform('com.google.firebase:firebase-bom:28.2.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-database'
implementation 'com.firebaseui:firebase-ui-firestore:7.1.1'
implementation 'com.google.firebase:firebase-auth-ktx'


/**
* Coroutines and lifecycle
*/
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_ktx_version"
implementation "android.arch.lifecycle:extensions:$lifecycle_extension_version"


/**
* SDP to support multiple release
*/
implementation "com.intuit.sdp:sdp-android:$sdp_version"
implementation "com.intuit.ssp:ssp-android:$sdp_version"

/**
* HILT
*/
implementation "com.google.dagger:hilt-android:$hilt_android"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:$hilt_lifecycle"
kapt "com.google.dagger:hilt-android-compiler:$hilt_android"
kapt "androidx.hilt:hilt-compiler:$hilt_lifecycle"

/**
* Activity and Lifecycle
*/
implementation "androidx.activity:activity-ktx:$activity_ktx_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_ktx_version"

/**
* Google auth
*/
implementation 'com.google.android.gms:play-services-auth:19.0.0'

/**
* Glide for image
*/
implementation "com.github.bumptech.glide:glide:$glide_version"
annotationProcessor "com.github.bumptech.glide:compiler:$glide_version"
}
48 changes: 48 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "1076515696443",
"firebase_url": "https://glintz-2a420-default-rtdb.firebaseio.com",
"project_id": "glintz-2a420",
"storage_bucket": "glintz-2a420.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1076515696443:android:b0abc8c526583d2df7111e",
"android_client_info": {
"package_name": "com.app.glints"
}
},
"oauth_client": [
{
"client_id": "1076515696443-hgo5i2u0eehut4p6hcg4arp4bijbrlfq.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.app.glints",
"certificate_hash": "bcc85ece0a63073b9590f2eb5089c64891cc165e"
}
},
{
"client_id": "1076515696443-tqke3kul4jb1djahtulbiouebvcj8i8o.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBFUmiDQApoHeVX8amH5kwdgp3mjh9sJdo"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1076515696443-tqke3kul4jb1djahtulbiouebvcj8i8o.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
24 changes: 24 additions & 0 deletions app/src/androidTest/java/com/app/glints/ExampleInstrumentedTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.app.glints

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("com.app.glints", appContext.packageName)
}
}
26 changes: 26 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.glints">

<application
android:name=".GlintsApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Glints">
<activity android:name=".ui.tweet.MainActivity">

</activity>

<activity android:name = ".ui.login.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions app/src/main/java/com/app/glints/GlintsApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.app.glints

import android.app.Application
import dagger.hilt.android.HiltAndroidApp


@HiltAndroidApp
class GlintsApplication: Application() {
override fun onCreate() {
super.onCreate()
}
}
Loading

0 comments on commit f3aa9f9

Please sign in to comment.