Skip to content

Commit

Permalink
[Refactor] #38 -login, signup 수정
Browse files Browse the repository at this point in the history
1. 로그인, 회원가입, 스플래시 디자인 변경
2. 앱 아이콘 이미지 변경
3. 그래들에서 충돌하는거 삭제
  • Loading branch information
dlrlfgh1210 committed Jan 30, 2023
1 parent 3e1a520 commit bca86f1
Show file tree
Hide file tree
Showing 81 changed files with 547 additions and 208 deletions.
7 changes: 6 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id("com.google.devtools.ksp") version("1.8.0-1.0.9")
id 'org.jetbrains.kotlin.android'
}

android {
Expand Down Expand Up @@ -67,6 +68,7 @@ dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.databinding:databinding-runtime:7.4.0'
implementation 'com.android.car.ui:car-ui-lib:2.3.0'
implementation 'androidx.core:core-ktx:+'
androidTestImplementation "androidx.arch.core:core-testing:$arch_version"
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1'
implementation 'androidx.fragment:fragment-ktx:1.5.5'
Expand All @@ -75,7 +77,6 @@ dependencies {
implementation "androidx.room:room-ktx:$room_version"
implementation("androidx.room:room-runtime:$room_version")
annotationProcessor("androidx.room:room-compiler:$room_version")
kapt("androidx.room:room-compiler:$room_version")
implementation "androidx.room:room-rxjava2:$room_version"
testImplementation "androidx.room:room-testing:$room_version"
ksp("androidx.room:room-compiler:$room_version")
Expand Down Expand Up @@ -122,8 +123,11 @@ dependencies {

//naver maps
implementation "com.naver.maps:map-sdk:$naver_map_version"

//location request
implementation "com.google.android.gms:play-services-location:$fused_location_provider_client_version"



implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
Expand All @@ -132,6 +136,7 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

}

kapt {
Expand Down
Binary file added app/src/debug/ic_cazait-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_cazait_background"/>
<foreground android:drawable="@mipmap/ic_kazait_foreground"/>
<foreground android:drawable="@mipmap/ic_cazait_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_cazait_background"/>
<foreground android:drawable="@mipmap/ic_kazait_foreground"/>
<foreground android:drawable="@mipmap/ic_cazait_foreground"/>
</adaptive-icon>
Binary file added app/src/debug/res/mipmap-hdpi/ic_cazait.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.
Binary file added app/src/debug/res/mipmap-hdpi/ic_cazait_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/debug/res/mipmap-hdpi/ic_kazait.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/debug/res/mipmap-hdpi/ic_kazait_round.png
Binary file not shown.
Binary file added app/src/debug/res/mipmap-mdpi/ic_cazait.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.
Binary file added app/src/debug/res/mipmap-mdpi/ic_cazait_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/debug/res/mipmap-mdpi/ic_kazait.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/debug/res/mipmap-mdpi/ic_kazait_round.png
Binary file not shown.
Binary file added app/src/debug/res/mipmap-xhdpi/ic_cazait.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.
Binary file removed app/src/debug/res/mipmap-xhdpi/ic_kazait.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/debug/res/mipmap-xhdpi/ic_kazait_round.png
Binary file not shown.
Binary file added app/src/debug/res/mipmap-xxhdpi/ic_cazait.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.
Binary file removed app/src/debug/res/mipmap-xxhdpi/ic_kazait.png
Binary file not shown.
Binary file not shown.
Binary file removed app/src/debug/res/mipmap-xxhdpi/ic_kazait_round.png
Binary file not shown.
Binary file added app/src/debug/res/mipmap-xxxhdpi/ic_cazait.png
Binary file removed app/src/debug/res/mipmap-xxxhdpi/ic_kazait.png
Diff not rendered.
Diff not rendered.
Binary file removed app/src/debug/res/mipmap-xxxhdpi/ic_kazait_round.png
Diff not rendered.
2 changes: 1 addition & 1 deletion app/src/debug/res/values/ic_cazait_background.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_cazait_background">#FAF0DD</color>
<color name="ic_cazait_background">#F5F5F5</color>
</resources>
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_kazait"
android:icon="@mipmap/ic_cazait"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_kazait_round"
android:roundIcon="@mipmap/ic_cazait_round"
android:supportsRtl="true"
android:theme="@style/Theme.CaZaItAndroid"
tools:targetApi="31">
Expand Down Expand Up @@ -51,7 +51,7 @@
</activity>
<activity
android:name=".ui.view.splash.SplashActivity"
android:exported="false">
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Binary file added app/src/main/ic_cazait-playstore.png
49 changes: 49 additions & 0 deletions app/src/main/java/org/cazait/cazait_android/SignUpDBHelper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package org.cazait.cazait_android

import android.content.ContentValues
import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper

class SignUpDBHelper(context: Context?) :
SQLiteOpenHelper(context, "Login.db", null, 1) {
override fun onCreate(MyDB: SQLiteDatabase) {
MyDB.execSQL("create Table users(username TEXT primary key, password TEXT)")
}

override fun onUpgrade(MyDB: SQLiteDatabase, i: Int, i1: Int) {
MyDB.execSQL("drop Table if exists users")
}

fun insertData(username: String?, password: String?): Boolean {
val MyDB = this.writableDatabase
val contentValues = ContentValues()
contentValues.put("username", username)
contentValues.put("password", password)
val result = MyDB.insert("users", null, contentValues)
return if (result == -1L) false else true
}

fun checkUsername(username: String): Boolean {
val MyDB = this.writableDatabase
var res = true
val cursor = MyDB.rawQuery("Select * from users where username = ?", arrayOf(username))
if (cursor.count <= 0) res = false
return res
}

fun checkUserpass(username: String, password: String): Boolean {
val MyDB = this.writableDatabase
var res = true
val cursor = MyDB.rawQuery(
"Select * from users where username = ? and password = ?",
arrayOf(username, password)
)
if (cursor.count <= 0) res = false
return res
}

companion object {
const val DBNAME = "Login.db"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.cazait.cazait_android.data.model.CafeState
import org.cazait.cazait_android.databinding.ItemCafeMainBinding

Expand All @@ -16,6 +20,7 @@ class CafeListItemAdapter(
fun bind(item: CafeState) {
binding.cafeState = item
}

}

override fun getItemCount() = dataset.size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class CafeListFragment : BaseFragment<FragmentCafeListBinding, CafeInfoViewModel

override fun initView() {
initRecyclerView()

}

override fun initAfterBinding() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ package org.cazait.cazait_android.ui.view.login
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import androidx.databinding.DataBindingUtil
import dagger.hilt.android.AndroidEntryPoint
import org.cazait.cazait_android.R
import org.cazait.cazait_android.SignUpDBHelper
import org.cazait.cazait_android.ui.view.signup.SignUpActivity
import org.cazait.cazait_android.databinding.ActivityLoginBinding
import org.cazait.cazait_android.ui.view.MainActivity

@AndroidEntryPoint
class LoginActivity : AppCompatActivity() {
var DB: SignUpDBHelper? = null
private val binding: ActivityLoginBinding by lazy {
DataBindingUtil.setContentView(
this,
Expand All @@ -21,16 +24,43 @@ class LoginActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
DB = SignUpDBHelper(this)

binding.tvLoginSignup.setOnClickListener {
val next = Intent(this, SignUpActivity::class.java)
startActivity(next)
}

binding.tvLoginDoing.setOnClickListener {
val next = Intent(this, MainActivity::class.java)
startActivity(next)
finish()
binding.tvLoginDoing!!.setOnClickListener {
val loginid = binding.etLoginUserName!!.text.toString()
val loginpw = binding.etLoginPassword!!.text.toString()
if (loginid == "" || loginpw == "")
Toast.makeText(
this@LoginActivity,
"회원정보를 전부 입력해주세요",
Toast.LENGTH_SHORT
).show()
else {
val checkUserpass = DB!!.checkUserpass(loginid, loginpw)
if (checkUserpass == true) {
Toast.makeText(
this@LoginActivity,
"로그인 되었습니다",
Toast.LENGTH_SHORT
).show()
val intent = Intent(applicationContext, MainActivity::class.java)
startActivity(intent)
} else {
Toast.makeText(
this@LoginActivity,
"회원정보가 존재하지 않습니다",
Toast.LENGTH_SHORT
).show()
}

}

}

}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package org.cazait.cazait_android.ui.view.mypage


import android.content.Intent
import android.text.TextUtils.replace
import androidx.fragment.app.viewModels
import dagger.hilt.android.AndroidEntryPoint
import org.cazait.cazait_android.CafeInterestFragment
import org.cazait.cazait_android.R
import org.cazait.cazait_android.databinding.FragmentMyPageBinding
import org.cazait.cazait_android.ui.base.BaseFragment
import org.cazait.cazait_android.ui.base.BaseViewModel
import org.cazait.cazait_android.ui.util.extension.replace


@AndroidEntryPoint
class MyPageFragment : BaseFragment<FragmentMyPageBinding, BaseViewModel>() {
Expand All @@ -22,7 +28,10 @@ class MyPageFragment : BaseFragment<FragmentMyPageBinding, BaseViewModel>() {

}


override fun initView() {

}
}
}


Loading

0 comments on commit bca86f1

Please sign in to comment.