-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/refact/selfQA' into feat/api/friend
# Conflicts: # app/build.gradle
- Loading branch information
Showing
87 changed files
with
2,104 additions
and
798 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
plugins { | ||
id("com.android.application") | ||
id("org.jetbrains.kotlin.android") | ||
id("kotlin-parcelize") | ||
id("androidx.navigation.safeargs.kotlin") | ||
id("dagger.hilt.android.plugin") | ||
id("kotlin-kapt") | ||
} | ||
|
||
android { | ||
compileSdk = 33 | ||
|
||
defaultConfig { | ||
applicationId = "com.teampome.pome" | ||
minSdk = 23 | ||
targetSdk = 33 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
multiDexEnabled = true | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
debug { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
buildConfigField("String", "BASE_URL", "\"http://13.125.237.136:8085/\"") | ||
buildConfigField("String", "IMAGE_BASE_URL", "\"http://image-main-server.ap-northeast-2.elasticbeanstalk.com/\"") | ||
} | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
buildConfigField("String", "BASE_URL", "\"http://52.79.89.129/\"") | ||
buildConfigField("String", "IMAGE_BASE_URL", "\"http://image-main-server.ap-northeast-2.elasticbeanstalk.com/\"") | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
dataBinding { | ||
enable = true | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation("androidx.core:core-ktx:1.9.0") | ||
implementation("androidx.appcompat:appcompat:1.5.1") | ||
implementation("com.google.android.material:material:1.7.0") | ||
implementation("androidx.constraintlayout:constraintlayout:2.1.4") | ||
testImplementation("junit:junit:4.13.2") | ||
androidTestImplementation("androidx.test.ext:junit:1.1.3") | ||
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") | ||
|
||
// Fragment ViewModel | ||
val fragmentKtxVersion = "1.5.3" | ||
implementation("androidx.fragment:fragment-ktx:$fragmentKtxVersion") | ||
|
||
// Retrofit | ||
val retrofitVersion = "2.9.0" | ||
implementation("com.squareup.retrofit2:retrofit:$retrofitVersion") | ||
implementation("com.google.code.gson:gson:$retrofitVersion") | ||
implementation("com.squareup.retrofit2:converter-gson:$retrofitVersion") | ||
|
||
val okhttp_version = "4.10.0" | ||
implementation("com.squareup.okhttp3:okhttp:$okhttp_version") | ||
implementation("com.squareup.okhttp3:logging-interceptor:$okhttp_version") | ||
|
||
// Glide | ||
val glide_version = "4.13.2" | ||
implementation("com.github.bumptech.glide:glide:$glide_version") | ||
kapt("com.github.bumptech.glide:compiler:$glide_version") | ||
implementation("com.github.bumptech.glide:okhttp3-integration:$glide_version"){ | ||
exclude(group = "glide-parent") | ||
} | ||
implementation("com.github.bumptech.glide:annotations:$glide_version") | ||
annotationProcessor("com.github.bumptech.glide:compiler:$glide_version") | ||
implementation("com.caverock:androidsvg-aar:1.4") | ||
|
||
// Glide Tranform | ||
implementation("jp.wasabeef:glide-transformations:4.3.0") | ||
|
||
// Navigation | ||
val navVersion = "2.5.2" | ||
implementation("androidx.navigation:navigation-fragment-ktx:$navVersion") | ||
implementation("androidx.navigation:navigation-ui-ktx:$navVersion") | ||
|
||
// Hilt | ||
val hiltVersion = "2.44" | ||
implementation("com.google.dagger:hilt-android:$hiltVersion") | ||
kapt("com.google.dagger:hilt-android-compiler:$hiltVersion") | ||
|
||
val kotlinxMetadataJvmVersion = "0.5.0" | ||
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:$kotlinxMetadataJvmVersion") | ||
|
||
// Calendar | ||
implementation("com.github.prolificinteractive:material-calendarview:2.0.1") | ||
implementation("com.jakewharton.threetenabp:threetenabp:1.1.1") | ||
|
||
// DataStore | ||
implementation("androidx.datastore:datastore-preferences:1.0.0") | ||
|
||
// Paging | ||
val pagingVersion = "3.1.1" | ||
implementation("androidx.paging:paging-runtime:$pagingVersion") | ||
} |
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
8 changes: 8 additions & 0 deletions
8
app/src/debug/res/drawable/pome_seekbar_custom_over_thumb.xml
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle" | ||
android:useLevel="false"> | ||
<solid android:color="@color/red_over"/> | ||
<size android:width="35dp" android:height="20dp"/> | ||
<corners android:radius="10dp"/> | ||
</shape> |
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,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:id="@+id/background_red"> | ||
<shape android:shape="rectangle"> | ||
<stroke android:color="@color/red_over"/> | ||
<solid android:color="@color/red_over"/> | ||
<corners android:radius="4dp"/> | ||
</shape> | ||
</item> | ||
|
||
<item android:id="@+id/progress_horizontal"> | ||
<clip> | ||
<shape android:shape="rectangle"> | ||
<stroke android:color="@color/red_over"/> | ||
<solid android:color="@color/red_over"/> | ||
<corners android:radius="4dp"/> | ||
</shape> | ||
</clip> | ||
</item> | ||
</layer-list> |
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
56 changes: 56 additions & 0 deletions
56
app/src/main/java/com/teampome/pome/PomeConnectivityReceiver.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,56 @@ | ||
package com.teampome.pome | ||
|
||
import android.app.Dialog | ||
import android.content.BroadcastReceiver | ||
import android.content.Context | ||
import android.content.Intent | ||
import android.net.ConnectivityManager | ||
import android.net.NetworkInfo | ||
import android.widget.Toast | ||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
import com.teampome.pome.databinding.PomeRemoveDialogBinding | ||
|
||
class PomeConnectivityReceiver: BroadcastReceiver() { | ||
override fun onReceive(context: Context?, intent: Intent?) { | ||
context?.let { | ||
ConnectivityUtils.notifyNetworkStatus(it) | ||
} | ||
} | ||
|
||
enum class NetworkState(val isConnected: Boolean) { | ||
CONNECTED(true), | ||
DISCONNECTED(false) | ||
} | ||
|
||
object ConnectivityUtils { | ||
private val liveConnectivityState = MutableLiveData<NetworkState>() | ||
|
||
fun notifyNetworkStatus(context: Context) { | ||
val newState = getLatestConnectivityStatusWithContext(context) | ||
|
||
liveConnectivityState.value = newState | ||
} | ||
|
||
private fun getLatestConnectivityStatusWithContext(context: Context): NetworkState { | ||
val isConnect = isConnected(context) | ||
|
||
return if(isConnect) { | ||
NetworkState.CONNECTED | ||
} else { | ||
NetworkState.DISCONNECTED | ||
} | ||
} | ||
|
||
fun getLiveConnectivityState() : LiveData<NetworkState> { | ||
return liveConnectivityState | ||
} | ||
|
||
private fun isConnected(context: Context): Boolean { | ||
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | ||
val networkInfo: NetworkInfo? = connectivityManager.activeNetworkInfo | ||
|
||
return networkInfo != null && networkInfo.isConnected | ||
} | ||
} | ||
} |
Oops, something went wrong.