Skip to content

Commit

Permalink
Merge pull request #811 from TeamHavit/release
Browse files Browse the repository at this point in the history
[RELEASE] v1.0.0
  • Loading branch information
KxxHyoRim authored Dec 2, 2022
2 parents 0ef47ac + a53b72d commit 3c478e8
Show file tree
Hide file tree
Showing 62 changed files with 192 additions and 203 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ captures/
*.keystore

# Google Services (e.g. APIs or Firebase)
# google-services.json
google-services.json

# Android Patch
gen-external-apklibs
Expand Down Expand Up @@ -164,7 +164,7 @@ crashlytics-build.properties
fabric.properties

# Uncomment the following line in case you need and you don't have the release build type files in your app
release/
release/

### AndroidStudio Patch ###

Expand Down
30 changes: 27 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,41 @@ plugins {
id 'kotlin-android-extensions'
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def kakao_native_app_key = properties.get('KAKAO_NATIVE_APP_KEY_NO_QUEOTS')

android {
compileSdk 31

defaultConfig {
applicationId "org.sopt.havit"
minSdk 23
targetSdk 31
versionCode 100
versionCode 101
versionName "1.0.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "HAVIT_BASE_URL_DEV", properties["HAVIT_BASE_URL_DEV"])
buildConfigField("String", "HAVIT_BASE_URL_PROD", properties["HAVIT_BASE_URL_PROD"])
buildConfigField("String", "KAKAO_NATIVE_APP_KEY", properties['KAKAO_NATIVE_APP_KEY'])
manifestPlaceholders = [KAKAO_NATIVE_APP_KEY: kakao_native_app_key]
}

flavorDimensions "server"
productFlavors {
prod {
dimension "server"
manifestPlaceholders = [appLabel: "HAVIT"]
buildConfigField 'boolean', 'IS_PROD', "true"
buildConfigField 'boolean', 'IS_DEV', "false"
}
dev {
dimension "server"
applicationIdSuffix ".dev"
manifestPlaceholders = [appLabel: "(Dev)HAVIT"]
buildConfigField 'boolean', 'IS_PROD', "false"
buildConfigField 'boolean', 'IS_DEV', "true"
}
}

buildTypes {
Expand Down Expand Up @@ -47,7 +71,7 @@ android {
dataBinding true
}

androidExtensions{
androidExtensions {
experimental = true
}
}
Expand Down
39 changes: 0 additions & 39 deletions app/google-services.json

This file was deleted.

20 changes: 0 additions & 20 deletions app/release/output-metadata.json

This file was deleted.

Binary file added app/src/dev/ic_launcher_havit-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/src/dev/res/mipmap-anydpi-v26/ic_launcher_havit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_havit_background" />
<foreground android:drawable="@mipmap/ic_launcher_havit_foreground" />
</adaptive-icon>
5 changes: 5 additions & 0 deletions app/src/dev/res/mipmap-anydpi-v26/ic_launcher_havit_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_havit_background" />
<foreground android:drawable="@mipmap/ic_launcher_havit_foreground" />
</adaptive-icon>
Binary file added app/src/dev/res/mipmap-hdpi/ic_launcher_havit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/dev/res/mipmap-mdpi/ic_launcher_havit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:name=".MainApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher_havit"
android:label="@string/app_name"
android:label="${appLabel}"
android:roundIcon="@mipmap/ic_launcher_havit_round"
android:supportsRtl="true"
android:theme="@style/Theme.Havit"
Expand Down Expand Up @@ -164,7 +164,7 @@
<!-- Redirect URI: "kakao{NATIVE_APP_KEY}://oauth“ -->
<data
android:host="oauth"
android:scheme="kakao6069fb41c205cbbf8f213b32eec7f2c8" />
android:scheme="kakao${KAKAO_NATIVE_APP_KEY}" />
</intent-filter>
</activity>
<activity
Expand Down
21 changes: 14 additions & 7 deletions app/src/main/java/org/sopt/havit/HavitFirebaseMessagingService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ class HavitFirebaseMessagingService : FirebaseMessagingService() {
val description = dataFromServer["body"]
val image = dataFromServer["image"]
val url = dataFromServer["url"]
val isSeen = dataFromServer["isSeen"].toBoolean()
val contentId = dataFromServer["contentId"]?.toInt()

if (image == DUMMY_IMAGE_URL)
generateNotification(title, description, url = url)
generateNotification(title, description, isSeen, contentId, url = url)
else useBitmapImg(this, image) { bitmapImage ->
generateNotification(title, description, bitmapImage, url)
generateNotification(title, description, isSeen, contentId, bitmapImage, url)
}
}

Expand All @@ -64,19 +66,24 @@ class HavitFirebaseMessagingService : FirebaseMessagingService() {
private fun generateNotification(
title: String?,
message: String?,
isSeen: Boolean? = null,
contentId: Int? = null,
image: Bitmap? = null,
url: String? = null
) {
Log.d("MyFirebaseMessagingService", "$title, $message")
val requestCode = System.currentTimeMillis().toInt()

val intent = Intent(this, WebActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra("url", url)
val pendingIntent =
PendingIntent.getActivity(
this, requestCode, intent, PendingIntent.FLAG_IMMUTABLE
)
intent.apply {
putExtra("url", url)
putExtra("isSeen", isSeen)
putExtra("contentsId", contentId)
}
val pendingIntent = PendingIntent.getActivity(
this, requestCode, intent, PendingIntent.FLAG_IMMUTABLE
)

val builder = NotificationCompat.Builder(this, channelID)
.setPriority(NotificationCompat.PRIORITY_HIGH)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/sopt/havit/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class MainApplication : Application() {

override fun onCreate() {
super.onCreate()
KakaoSdk.init(this, getString(R.string.kakao_app_key))
KakaoSdk.init(this, BuildConfig.KAKAO_NATIVE_APP_KEY)
}
}
5 changes: 2 additions & 3 deletions app/src/main/java/org/sopt/havit/data/RetrofitObject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ package org.sopt.havit.data
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import org.sopt.havit.BuildConfig.*
import org.sopt.havit.data.api.HavitApi
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit

object RetrofitObject {

private const val baseUrl = "https://asia-northeast3-havit-wesopt29.cloudfunctions.net/api/"

private fun getRetrofitBuild(jwt: String) = Retrofit.Builder()
.baseUrl(baseUrl)
.baseUrl(if (IS_DEV) HAVIT_BASE_URL_DEV else HAVIT_BASE_URL_PROD)
.client(getOkhttpClient(jwt))
.addConverterFactory(GsonConverterFactory.create())
.build()
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/org/sopt/havit/data/api/HavitApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import retrofit2.http.*

interface HavitApi {

@GET("content/search/?keyword=")
@GET("content/search?")
suspend fun getSearchContents(
@Query("keyword") keyword: String
): ContentsSearchResponse

@GET("content/search?categoryId=&keyword=")
@GET("content/search?")
suspend fun getSearchCategory(
@Query("categoryId") categoryId: String,
@Query("keyword") keyword: String
Expand Down Expand Up @@ -46,7 +46,7 @@ interface HavitApi {
@Body body: CreateContentsRequest
): CreateContentsResponse

@GET("category/{categoryId}?option=&filter=")
@GET("category/{categoryId}?")
suspend fun getCategoryContents(
@Path("categoryId") categoryId: Int,
@Query("option") option: String,
Expand Down Expand Up @@ -78,7 +78,7 @@ interface HavitApi {
@Body body: UpdateCategoryInfoRequest
): BasicResponse

@GET("content?option=&filter=")
@GET("content?")
suspend fun getAllContents(
@Query("option") option: String,
@Query("filter") filter: String
Expand Down Expand Up @@ -113,7 +113,7 @@ interface HavitApi {
@Body body: SignUpRequest
): SignUpResponse

@GET("content/notification?option=")
@GET("content/notification?")
suspend fun getNotification(
@Query("option") option: String,
): NotificationResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data class ContentsSimpleResponse(
val success: Boolean
) {
data class ContentsSimpleData(
var createdAt: String,
val createdAt: String,
var description: String?,
val id: Int,
val image: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ data class NotificationResponse(
val image: String,
val url: String,
var isSeen: Boolean,
var createdAt: String
val createdAt: String
)
}
5 changes: 2 additions & 3 deletions app/src/main/java/org/sopt/havit/di/RetrofitModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import dagger.hilt.components.SingletonComponent
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import org.sopt.havit.BuildConfig.*
import org.sopt.havit.data.source.local.AuthLocalDataSourceImpl
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
Expand Down Expand Up @@ -58,10 +59,8 @@ object RetrofitModule {
client: OkHttpClient,
gson: Gson
): Retrofit = Retrofit.Builder()
.baseUrl(baseUrl)
.baseUrl(if (IS_DEV) HAVIT_BASE_URL_DEV else HAVIT_BASE_URL_PROD)
.client(client)
.addConverterFactory(GsonConverterFactory.create(gson))
.build()

private const val baseUrl = "https://asia-northeast3-havit-wesopt29.cloudfunctions.net/api/"
}
2 changes: 1 addition & 1 deletion app/src/main/java/org/sopt/havit/domain/entity/Contents.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.sopt.havit.domain.entity

data class Contents(
var createdAt: String,
val createdAt: String,
val description: String,
val id: Int,
val image: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.sopt.havit.data.RetrofitObject
Expand All @@ -13,6 +14,7 @@ import org.sopt.havit.domain.entity.NetworkState
import org.sopt.havit.util.HavitSharedPreference
import javax.inject.Inject

@HiltViewModel
class ContentsSimpleViewModel @Inject constructor(
preference: HavitSharedPreference
) : ViewModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ class HomeCategoryVpAdapter : RecyclerView.Adapter<HomeCategoryVpAdapter.HomeCat
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
val oldItem = oldData[oldItemPosition]
val newItem = newData[newItemPosition]

return oldItem == newItem
return oldItem.size == newItem.size
}

override fun getOldListSize(): Int = oldData.size
Expand Down
Loading

0 comments on commit 3c478e8

Please sign in to comment.