Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Ver 1.4.0 (#242)
Browse files Browse the repository at this point in the history
* 스플래시 화면 로티 추가

* 내가 작성한 제품 아이템 태그 디자인 변경

* 리뷰 등록/수정 chip 디자인 수정

* 리뷰 필터 디자인 변경

* Small Chip 추가, Factory 패턴 수정

* 제품 기호도 선택 이미지 교체

* 신규 제품 기록하기 기호도 로직 변경

* 리뷰 수정하기 기호도 로직 변경

* 리뷰 작성 내용 디자인 변경

* 이미 기록한 제품 팻말 표시

* 이미 기록한 제품은 내가 작성한 리뷰 화면으로 이동

* 이미지 조정 및 로직 수정

* Version Up

* 검색 로딩 다이얼로그 추가

* 검색창 힌트 문구 변경

* Version Up

* gradle update

* delete gradle
  • Loading branch information
kangmin1012 committed Mar 22, 2022
1 parent 7214f34 commit bb4ff5a
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 149 deletions.
138 changes: 0 additions & 138 deletions app/build.gradle

This file was deleted.

24 changes: 24 additions & 0 deletions app/src/main/java/com/teamounce/ounce/base/BindingActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,26 @@ import androidx.databinding.ViewDataBinding
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import com.teamounce.ounce.component.LoadingDialog

abstract class BindingActivity<T : ViewDataBinding>(@LayoutRes private val layoutResId: Int) :
AppCompatActivity() {
protected lateinit var binding: T

private val loadingDialog by lazy {
LoadingDialog(this)
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, layoutResId)
}

override fun onDestroy() {
dismissLoadingDialog()
super.onDestroy()
}

protected inner class LifeCycleEventLogger(private val className: String) : LifecycleObserver {
fun registerLogger(lifecycle: Lifecycle) {
lifecycle.addObserver(this)
Expand All @@ -29,4 +39,18 @@ abstract class BindingActivity<T : ViewDataBinding>(@LayoutRes private val layou
Log.d("${className}LifeCycleEvent", "${lifecycle.currentState}")
}
}

fun showLoadingDialog() {
try {
if (!loadingDialog.isShowing)
loadingDialog.show()
} catch (e: Exception) {}
}

fun dismissLoadingDialog() {
try {
if (loadingDialog.isShowing)
loadingDialog.dismiss()
} catch (e: Exception) {}
}
}
32 changes: 32 additions & 0 deletions app/src/main/java/com/teamounce/ounce/component/LoadingDialog.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.teamounce.ounce.component

import android.annotation.SuppressLint
import android.app.Dialog
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.LayoutInflater
import android.view.Window
import android.view.WindowManager
import com.teamounce.ounce.R

@SuppressLint("InflateParams")
class LoadingDialog(context: Context, isCancelable: Boolean = false) : Dialog(context) {

init {
requestWindowFeature(Window.FEATURE_NO_TITLE)

// make dialog background transparent
this.window!!.run {
setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
}

// make dialog background un-selectable
setCanceledOnTouchOutside(isCancelable)
setCancelable(isCancelable)

setContentView(R.layout.dialog_loading)

}
}
17 changes: 11 additions & 6 deletions app/src/main/java/com/teamounce/ounce/review/ui/SearchActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class SearchActivity : BindingActivity<ActivitySearchBinding>(R.layout.activity_
private fun setObserver() {

searchViewModel.resultList.observe(this) {
dismissLoadingDialog()
if (it.isEmpty()) {
binding.clayoutNoResult.visibility = View.VISIBLE
binding.clayoutSearch.visibility = View.GONE
Expand All @@ -104,19 +105,15 @@ class SearchActivity : BindingActivity<ActivitySearchBinding>(R.layout.activity_
}
binding.etReviewSearch.setOnKeyListener { _, keyCode, keyEvent ->
if (keyEvent.action == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) {
searchViewModel.search()
mImm.hideSoftInputFromWindow(currentFocus?.windowToken, 0)
binding.etReviewSearch.clearFocus()
searchFood()
true
} else {
false
}
}

binding.imgReviewSearch.setOnClickListener {
searchViewModel.search()
mImm.hideSoftInputFromWindow(currentFocus?.windowToken, 0)
binding.etReviewSearch.clearFocus()
searchFood()
}

/** 건의하기 버튼 클릭 시 구글 폼 이동 */
Expand All @@ -127,6 +124,14 @@ class SearchActivity : BindingActivity<ActivitySearchBinding>(R.layout.activity_
}
}


private fun searchFood() {
showLoadingDialog()
searchViewModel.search()
mImm.hideSoftInputFromWindow(currentFocus?.windowToken, 0)
binding.etReviewSearch.clearFocus()
}

private fun focusSearchEdt() {
binding.etReviewSearch.requestFocus()

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:hint="제조사, 상품명 입력"
android:hint="제조사 또는 상품명 입력"
android:imeOptions="actionSearch"
android:inputType="text"
android:paddingStart="12dp"
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/res/layout/dialog_loading.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">

<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:lottie_loop="true"
app:lottie_autoPlay="true"
app:lottie_rawRes="@raw/loading"
app:lottie_enableMergePathsForKitKatAndAbove="true"/>

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/raw/loading.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"v":"5.7.1","fr":60,"ip":0,"op":121,"w":375,"h":667,"nm":"iPhone 8 2","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Ellipse 4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[167,324,0],"to":[6.667,0,0],"ti":[-6.667,0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"t":30,"s":[207,324,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":45,"s":[207,324,0],"to":[0,6.667,0],"ti":[0,-6.667,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"t":60,"s":[207,364,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":75,"s":[207,364,0],"to":[-6.667,0,0],"ti":[6.667,0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"t":90,"s":[167,364,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":105,"s":[167,364,0],"to":[0,-6.667,0],"ti":[0,6.667,0]},{"t":120,"s":[167,324,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[20,20],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 4","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Ellipse 6","sr":1,"ks":{"o":{"a":0,"k":60,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":15,"s":[207,324,0],"to":[0,6.667,0],"ti":[0,-6.667,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":30,"s":[207,364,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":45,"s":[207,364,0],"to":[-6.667,0,0],"ti":[6.667,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":60,"s":[167,364,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":75,"s":[167,364,0],"to":[0,-6.667,0],"ti":[0,6.667,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":90,"s":[167,324,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":105,"s":[167,324,0],"to":[6.667,0,0],"ti":[-6.667,0,0]},{"t":120,"s":[207,324,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[20,20],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 6","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Ellipse 6","sr":1,"ks":{"o":{"a":0,"k":40,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":15,"s":[207,364,0],"to":[-6.667,0,0],"ti":[6.667,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":30,"s":[167,364,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":45,"s":[167,364,0],"to":[0,-6.667,0],"ti":[0,6.667,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":60,"s":[167,324,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":75,"s":[167,324,0],"to":[6.667,0,0],"ti":[-6.667,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":90,"s":[207,324,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":105,"s":[207,324,0],"to":[0,6.667,0],"ti":[0,-6.667,0]},{"t":120,"s":[207,364,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[20,20],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 6","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Ellipse 4","sr":1,"ks":{"o":{"a":0,"k":15,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":15,"s":[167,364,0],"to":[0,-6.667,0],"ti":[0,6.667,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":30,"s":[167,324,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":45,"s":[167,324,0],"to":[6.667,0,0],"ti":[-6.667,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":60,"s":[207,324,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":75,"s":[207,324,0],"to":[0,6.667,0],"ti":[0,-6.667,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":90,"s":[207,364,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":105,"s":[207,364,0],"to":[-6.667,0,0],"ti":[6.667,0,0]},{"t":120,"s":[167,364,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[20,20],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 4","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":300,"st":0,"bm":0}],"markers":[]}
5 changes: 4 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {

extra["kotlin_version"] = Versions.kotlinVersion

repositories {
google()
mavenCentral()
}

dependencies {
classpath("com.android.tools.build:gradle:${Versions.gradleVersion}")
classpath("com.android.tools.build:gradle:7.1.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlinVersion}")
classpath(ClassPathPlugins.hilt)
classpath(ClassPathPlugins.oss)
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ object Constants {
const val compileSdk = 31
const val minSdk = 26
const val targetSdk = 30
const val versionCode = 14
const val versionName = "1.3.0"
const val versionCode = 15
const val versionName = "1.4.0"
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

0 comments on commit bb4ff5a

Please sign in to comment.