Skip to content

Commit

Permalink
[MERGE/#46] merge develop into ocr-feat-text-recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed Jan 13, 2023
2 parents a7f7017 + 45fc0e3 commit 80ae4c0
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 111 deletions.
12 changes: 11 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
xmlns:tools="http://schemas.android.com/tools">
<!-- Add uses-permissions -->
<uses-permission android:name="android.permission.INTERNET" />

<uses-feature android:name="android.hardware.camera.any" />

<uses-permission android:name="android.permission.CAMERA" />

<application
Expand All @@ -19,14 +21,21 @@
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name="com.keyneez.presentation.onboarding.OnboardingActivity"
android:name="com.keyneez.presentation.splash.SplashActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

</activity>
<activity
android:name="com.keyneez.presentation.onboarding.OnboardingActivity"
android:exported="true"
android:screenOrientation="portrait">

</activity>
<activity
android:name="com.keyneez.presentation.login.LoginActivity"
Expand Down Expand Up @@ -61,4 +70,5 @@
android:exported="false"
android:screenOrientation="portrait" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
val viewPager = binding.vpHome
val tabLayout = binding.tabHome

binding.vpHome.isUserInputEnabled = false // disable swipe

val homeTabTitles = listOf(
getString(R.string.home_recommend),
getString(R.string.home_popular),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,15 @@ package com.keyneez.presentation.main.home.popular

import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import com.keyneez.data.entity.HomeData
import com.keyneez.util.binding.BindingFragment
import com.lab.keyneez.R
import com.lab.keyneez.databinding.FragmentHomePopularBinding

class PopularFragment :
BindingFragment<FragmentHomePopularBinding>(R.layout.fragment_home_popular) {
private val viewModel: PopularViewModel by viewModels()
val data = mutableListOf<HomeData>()
private lateinit var PopularAdapter: PopularAdapter

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

setupHomeData()
initPopularAdapter()
}

private fun setupHomeData() {
viewModel.itemList.observe(viewLifecycleOwner) {
PopularAdapter.data = it
PopularAdapter.notifyDataSetChanged()
}
}

private fun initPopularAdapter() {
PopularAdapter = PopularAdapter()
binding.rvPopular.adapter = PopularAdapter
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,5 @@
package com.keyneez.presentation.main.home.popular

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.keyneez.data.entity.HomeData
import com.lab.keyneez.R

class PopularViewModel : ViewModel() {
private val _itemList = MutableLiveData<List<HomeData>>()
val itemList: LiveData<List<HomeData>>
get() = _itemList

init {
getItemList()
}

private fun getItemList() {
val mainList = listOf(
HomeData(
background = R.drawable.img_home_item_background,
title = "์ฒญ์†Œ๋…„ ๋ฏธ์ˆ ๊ด€ ํ• ์ธ"
),
HomeData(
background = R.drawable.img_home_item_background,
title = "์ฒญ์†Œ๋…„ ๋ฏธ์ˆ ๊ด€ ํ• ์ธ"
),
HomeData(
background = R.drawable.img_home_item_background,
title = "์ฒญ์†Œ๋…„ ๋ฏธ์ˆ ๊ด€ ํ• ์ธ"
),
HomeData(
background = R.drawable.img_home_item_background,
title = "์ฒญ์†Œ๋…„ ๋ฏธ์ˆ ๊ด€ ํ• ์ธ"
)
)
_itemList.value = mainList
}
}
class PopularViewModel : ViewModel()
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,14 @@ package com.keyneez.presentation.main.home.recent

import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import com.keyneez.data.entity.HomeData
import com.keyneez.util.binding.BindingFragment
import com.lab.keyneez.R
import com.lab.keyneez.databinding.FragmentHomeNewBinding

class NewFragment : BindingFragment<FragmentHomeNewBinding>(R.layout.fragment_home_new) {
private val viewModel: NewViewModel by viewModels()
val data = mutableListOf<HomeData>()
private lateinit var NewAdapter: NewAdapter

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setupHomeData()
initNewAdapter()
}

private fun setupHomeData() {
viewModel.itemList.observe(viewLifecycleOwner) {
NewAdapter.data = it
NewAdapter.notifyDataSetChanged()
}
}

private fun initNewAdapter() {
NewAdapter = NewAdapter()
binding.rvNew.adapter = NewAdapter
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,5 @@
package com.keyneez.presentation.main.home.recent

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.keyneez.data.entity.HomeData
import com.lab.keyneez.R

class NewViewModel : ViewModel() {
private val _itemList = MutableLiveData<List<HomeData>>()
val itemList: LiveData<List<HomeData>>
get() = _itemList

init {
getItemList()
}

private fun getItemList() {
val mainList = listOf(
HomeData(
background = R.drawable.img_home_item_background,
title = "์ฒญ์†Œ๋…„ ๋ฏธ์ˆ ๊ด€ ํ• ์ธ"
),
HomeData(
background = R.drawable.img_home_item_background,
title = "์ฒญ์†Œ๋…„ ๋ฏธ์ˆ ๊ด€ ํ• ์ธ"
),
HomeData(
background = R.drawable.img_home_item_background,
title = "์ฒญ์†Œ๋…„ ๋ฏธ์ˆ ๊ด€ ํ• ์ธ"
),
HomeData(
background = R.drawable.img_home_item_background,
title = "์ฒญ์†Œ๋…„ ๋ฏธ์ˆ ๊ด€ ํ• ์ธ"
)
)
_itemList.value = mainList
}
}
class NewViewModel : ViewModel()
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.keyneez.presentation.splash

import android.content.Intent
import android.os.Bundle
import android.os.Handler
import com.keyneez.presentation.onboarding.OnboardingActivity
import com.keyneez.util.binding.BindingActivity
import com.lab.keyneez.R
import com.lab.keyneez.databinding.ActivitySplashBinding

class SplashActivity : BindingActivity<ActivitySplashBinding>(R.layout.activity_splash) {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_splash)

Handler().postDelayed({
val intent = Intent(this, OnboardingActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
startActivity(intent)
finish()
}, DURATION)
}

companion object {
private const val DURATION: Long = 3000
}
}
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/ic_splash_bottom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="94dp"
android:height="36dp"
android:viewportWidth="94"
android:viewportHeight="36">
<group>
<clip-path
android:pathData="M39.5,0h15v19h-15z"/>
<path
android:pathData="M46.34,9.28C46.213,7.846 45.954,4.921 45.151,2.922C45.038,2.569 44.876,2.248 44.677,1.969C44.224,1.248 43.645,0.801 42.904,0.85C42.727,0.829 42.546,0.83 42.364,0.855C41.089,1.031 40.174,2.313 40.17,3.825C40.14,4.951 40.473,6.235 40.778,7.412L40.778,7.412C40.98,8.193 41.17,8.928 41.233,9.535C41.556,12.131 41.415,12.882 41.235,13.842C41.139,14.35 41.032,14.918 40.977,15.85C40.861,17.829 42.634,18.592 44.113,17.991C44.726,17.742 44.957,17.12 45.176,16.53C45.486,15.696 45.772,14.926 47.079,15.359L47.338,15.445C49.596,16.196 53.172,17.386 53.812,15.463C54.168,14.391 52.661,13.869 50.913,13.264C48.928,12.576 46.633,11.781 46.405,9.951C46.386,9.803 46.366,9.573 46.34,9.28L46.34,9.28ZM50.913,8.343C52.516,6.907 53.305,4.936 52.675,3.941C52.045,2.946 50.235,3.304 48.632,4.74C47.028,6.176 46.239,8.146 46.869,9.141C47.499,10.136 49.309,9.779 50.913,8.343Z"
android:fillColor="#ADADAD"
android:fillType="evenOdd"/>
</group>
<path
android:pathData="M4.456,33.371C6.614,33.371 8.367,31.623 8.372,29.465C8.367,27.312 6.614,25.559 4.456,25.559C2.303,25.559 0.555,27.312 0.55,29.465C0.555,31.623 2.303,33.371 4.456,33.371ZM1.438,29.465C1.443,27.8 2.801,26.447 4.456,26.447C6.121,26.447 7.479,27.8 7.474,29.465C7.479,31.13 6.121,32.482 4.456,32.482C2.801,32.482 1.443,31.13 1.438,29.465ZM2.923,29.465C2.923,30.583 3.602,31.223 4.524,31.223C5.408,31.223 5.94,30.637 6.009,30.002H5.257C5.193,30.358 4.915,30.563 4.534,30.559C4.026,30.563 3.68,30.188 3.685,29.465C3.68,28.767 4.017,28.371 4.534,28.371C4.93,28.371 5.208,28.591 5.257,28.967H6.009C5.921,28.161 5.32,27.707 4.524,27.707C3.616,27.707 2.923,28.347 2.923,29.465ZM12.62,33L13.265,31.135H16.019L16.663,33H17.806L15.257,25.93H14.017L11.477,33H12.62ZM13.572,30.236L14.612,27.219H14.661L15.706,30.236H13.572ZM19.661,25.93H18.616V33H19.661V25.93ZM21.976,25.93H20.931V33H21.976V25.93ZM25.687,33H26.731V29.768C26.731,29.074 27.269,28.571 27.991,28.576C28.206,28.571 28.45,28.615 28.538,28.635V27.639C28.431,27.629 28.226,27.614 28.099,27.619C27.479,27.614 26.946,27.971 26.751,28.537H26.692V27.697H25.687V33ZM29.319,33H30.364V27.697H29.319V33ZM29.183,26.262C29.188,26.604 29.485,26.882 29.847,26.877C30.203,26.882 30.501,26.604 30.501,26.262C30.501,25.92 30.203,25.646 29.847,25.646C29.485,25.646 29.188,25.92 29.183,26.262ZM33.86,35.1C35.228,35.1 36.258,34.479 36.253,33.117V27.697H35.237V28.557H35.169C34.974,28.225 34.612,27.629 33.626,27.629C32.352,27.629 31.399,28.601 31.399,30.295C31.399,31.989 32.366,32.922 33.616,32.922C34.593,32.922 34.974,32.375 35.159,32.033H35.228V33.078C35.223,33.903 34.7,34.265 33.87,34.26C33.182,34.265 32.713,34.021 32.61,33.518H31.546C31.639,34.509 32.522,35.1 33.86,35.1ZM32.464,30.315C32.459,29.299 32.928,28.513 33.851,28.518C34.749,28.513 35.237,29.24 35.237,30.315C35.237,31.408 34.739,32.058 33.851,32.063C32.938,32.058 32.459,31.354 32.464,30.315ZM38.567,29.855C38.567,29.011 39.1,28.527 39.837,28.527C40.54,28.527 40.96,28.977 40.96,29.758V33H42.005V29.631C42.005,28.303 41.277,27.629 40.188,27.629C39.363,27.629 38.865,27.99 38.616,28.566H38.548V25.93H37.522V33H38.567V29.855ZM45.745,27.697H44.661V26.428H43.626V27.697H42.845V28.527H43.626V31.652C43.616,32.619 44.354,33.068 45.169,33.068C45.457,33.068 45.682,33.049 45.823,33.029V32.121C45.677,32.136 45.447,32.15 45.296,32.15C44.959,32.146 44.666,32.038 44.661,31.438V28.527H45.745V27.697ZM49.651,29.143H50.657C50.555,28.229 49.817,27.629 48.636,27.629C47.405,27.629 46.585,28.278 46.585,29.221C46.585,29.953 47.083,30.466 48.04,30.676L48.87,30.852C49.432,30.983 49.686,31.203 49.69,31.545C49.686,31.989 49.251,32.272 48.577,32.268C47.947,32.272 47.586,32.033 47.493,31.555H46.429C46.561,32.541 47.313,33.107 48.587,33.107C49.939,33.107 50.75,32.424 50.755,31.467C50.75,30.715 50.276,30.251 49.3,30.031L48.46,29.836C47.874,29.699 47.625,29.475 47.63,29.162C47.625,28.757 48.05,28.449 48.646,28.449C49.222,28.449 49.554,28.723 49.651,29.143ZM54.212,33H55.257V29.768C55.257,29.074 55.794,28.571 56.517,28.576C56.731,28.571 56.976,28.615 57.063,28.635V27.639C56.956,27.629 56.751,27.614 56.624,27.619C56.004,27.614 55.472,27.971 55.276,28.537H55.218V27.697H54.212V33ZM59.954,33.107C61.121,33.107 61.937,32.531 62.171,31.672H61.116C60.94,31.994 60.555,32.248 59.964,32.248C59.095,32.248 58.499,31.677 58.47,30.666H62.239V30.295C62.239,28.376 61.092,27.629 59.886,27.629C58.406,27.629 57.43,28.752 57.435,30.383C57.43,32.028 58.392,33.107 59.954,33.107ZM58.475,29.885C58.519,29.138 59.061,28.483 59.896,28.488C60.691,28.483 61.214,29.079 61.214,29.885H58.475ZM66.253,29.143H67.259C67.156,28.229 66.419,27.629 65.237,27.629C64.007,27.629 63.187,28.278 63.187,29.221C63.187,29.953 63.685,30.466 64.642,30.676L65.472,30.852C66.033,30.983 66.287,31.203 66.292,31.545C66.287,31.989 65.853,32.272 65.179,32.268C64.549,32.272 64.188,32.033 64.095,31.555H63.03C63.162,32.541 63.914,33.107 65.188,33.107C66.541,33.107 67.352,32.424 67.356,31.467C67.352,30.715 66.878,30.251 65.901,30.031L65.062,29.836C64.476,29.699 64.227,29.475 64.231,29.162C64.227,28.757 64.651,28.449 65.247,28.449C65.823,28.449 66.155,28.723 66.253,29.143ZM70.657,33.107C71.824,33.107 72.64,32.531 72.874,31.672H71.819C71.644,31.994 71.258,32.248 70.667,32.248C69.798,32.248 69.202,31.677 69.173,30.666H72.942V30.295C72.942,28.376 71.795,27.629 70.589,27.629C69.109,27.629 68.133,28.752 68.138,30.383C68.133,32.028 69.095,33.107 70.657,33.107ZM69.178,29.885C69.222,29.138 69.764,28.483 70.599,28.488C71.395,28.483 71.917,29.079 71.917,29.885H69.178ZM73.978,33H75.022V29.768C75.022,29.074 75.56,28.571 76.282,28.576C76.497,28.571 76.741,28.615 76.829,28.635V27.639C76.722,27.629 76.517,27.614 76.39,27.619C75.77,27.614 75.237,27.971 75.042,28.537H74.983V27.697H73.978V33ZM82.327,27.697H81.204L79.866,31.77H79.817L78.479,27.697H77.356L79.28,33H80.403L82.327,27.697ZM85.276,33.107C86.443,33.107 87.259,32.531 87.493,31.672H86.438C86.263,31.994 85.877,32.248 85.286,32.248C84.417,32.248 83.821,31.677 83.792,30.666H87.562V30.295C87.562,28.376 86.414,27.629 85.208,27.629C83.729,27.629 82.752,28.752 82.757,30.383C82.752,32.028 83.714,33.107 85.276,33.107ZM83.797,29.885C83.841,29.138 84.383,28.483 85.218,28.488C86.014,28.483 86.536,29.079 86.536,29.885H83.797ZM90.579,33.107C91.546,33.103 91.927,32.517 92.122,32.17H92.2V33H93.216V25.93H92.171V28.557H92.122C91.932,28.225 91.575,27.629 90.589,27.629C89.314,27.629 88.362,28.635 88.362,30.363C88.362,32.072 89.3,33.103 90.579,33.107ZM89.427,30.344C89.422,29.299 89.891,28.513 90.813,28.518C91.712,28.513 92.2,29.24 92.2,30.344C92.2,31.457 91.702,32.214 90.813,32.219C89.9,32.214 89.422,31.408 89.427,30.344Z"
android:fillColor="#ADADAD"/>
</vector>
Binary file added app/src/main/res/drawable/img_splash_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions app/src/main/res/layout/activity_splash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.keyneez.presentation.splash.SplashActivity">

<data>

</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_splash"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/iv_splash_logo"
android:layout_width="139dp"
android:layout_height="118dp"
android:layout_marginTop="341dp"
android:src="@drawable/img_splash_logo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageView
android:id="@+id/iv_splash_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="40dp"
android:src="@drawable/ic_splash_bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginEnd="16dp"
android:layout_marginEnd="12dp"
android:background="@null"
android:padding="12dp"
android:src="@drawable/ic_home_search"
Expand Down

0 comments on commit 80ae4c0

Please sign in to comment.