Skip to content

Commit

Permalink
Merge pull request #5 from SOPT-29th-Joint-Seminar-10/subeen
Browse files Browse the repository at this point in the history
[Pull request]
  • Loading branch information
ub1n authored Nov 15, 2021
2 parents 67e6759 + a98bfc5 commit 0c1e83f
Show file tree
Hide file tree
Showing 75 changed files with 472 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.psd filter=lfs diff=lfs merge=lfs -text
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ plugins {
id 'kotlin-android'
}

//build오류 해결 코드
configurations.all { resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' } }


android {
compileSdkVersion 30
buildToolsVersion "30.0.2"

buildFeatures{
viewBinding true
}

defaultConfig {
applicationId "kr.ac.smu.cs.soptsocar"
minSdkVersion 26
Expand Down Expand Up @@ -34,12 +42,17 @@ android {

dependencies {

//viewpager2 추가
implementation "androidx.viewpager2:viewpager2:1.1.0-beta01"

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

}
21 changes: 21 additions & 0 deletions app/src/main/java/kr/ac/smu/cs/soptsocar/CarPlanFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package kr.ac.smu.cs.soptsocar

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup


class CarPlanFragment : Fragment() {


override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_car_plan, container, false)
}

}
21 changes: 21 additions & 0 deletions app/src/main/java/kr/ac/smu/cs/soptsocar/HomeFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package kr.ac.smu.cs.soptsocar

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

class HomeFragment : Fragment() {


override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_home, container, false)
}


}
58 changes: 57 additions & 1 deletion app/src/main/java/kr/ac/smu/cs/soptsocar/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,66 @@ package kr.ac.smu.cs.soptsocar

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.viewpager2.widget.ViewPager2
import kr.ac.smu.cs.soptsocar.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding
private lateinit var mainViewPagerAdapter: MainViewPagerAdapter

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
binding= ActivityMainBinding.inflate(layoutInflater)

initViewPagerAdapter()
initBottomNavigation()
setContentView(binding.root)
}

private fun initViewPagerAdapter(){
val fragmentList=listOf(HomeFragment(),CarPlanFragment(),PairingFragment(),MyPageFragment())

mainViewPagerAdapter= MainViewPagerAdapter(this)
mainViewPagerAdapter.fragments.addAll(fragmentList)

binding.vpMain.adapter=mainViewPagerAdapter
}

private fun initBottomNavigation(){
binding.vpMain.registerOnPageChangeCallback(object: ViewPager2.OnPageChangeCallback(){
override fun onPageSelected(position: Int) {
binding.bnvMain.menu.getItem(position).isChecked=true
}
})

binding.bnvMain.setOnItemSelectedListener {
when(it.itemId){
R.id.menu_home ->{
binding.vpMain.currentItem=FIRST_FRAGMENT
return@setOnItemSelectedListener true
}
R.id.menu_carplan->{
binding.vpMain.currentItem=SECOND_FRAGMENT
return@setOnItemSelectedListener true
}
R.id.menu_pairing ->{
binding.vpMain.currentItem=THIRD_FRAGMENT
return@setOnItemSelectedListener true
}
else->{
binding.vpMain.currentItem= FOURTH_FRAGMENT
return@setOnItemSelectedListener true
}
}
}
}

companion object{
const val FIRST_FRAGMENT=0
const val SECOND_FRAGMENT=1
const val THIRD_FRAGMENT=2
const val FOURTH_FRAGMENT=3

}
}
14 changes: 14 additions & 0 deletions app/src/main/java/kr/ac/smu/cs/soptsocar/MainViewPagerAdapter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package kr.ac.smu.cs.soptsocar

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

class MainViewPagerAdapter (fragmentActivity: FragmentActivity):
FragmentStateAdapter(fragmentActivity){
val fragments=mutableListOf<Fragment>()

override fun getItemCount()=fragments.size

override fun createFragment(position: Int): Fragment =fragments[position]
}
21 changes: 21 additions & 0 deletions app/src/main/java/kr/ac/smu/cs/soptsocar/MyPageFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package kr.ac.smu.cs.soptsocar

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup


class MyPageFragment : Fragment() {


override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_home, container, false)
}

}
20 changes: 20 additions & 0 deletions app/src/main/java/kr/ac/smu/cs/soptsocar/PairingFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package kr.ac.smu.cs.soptsocar

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

class PairingFragment : Fragment() {

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_pairing, container, false)
}


}
6 changes: 6 additions & 0 deletions app/src/main/res/color/selector_bottom_navi.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#28323c" android:state_checked="true"/>
<item android:color="#28323c" android:state_checked="false" />

</selector>
Binary file added app/src/main/res/drawable-hdpi/img.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 added app/src/main/res/drawable-hdpi/img_11.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 added app/src/main/res/drawable-hdpi/img_allnewk_3.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 added app/src/main/res/drawable-hdpi/img_cona.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 added app/src/main/res/drawable-hdpi/img_santafe.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 added app/src/main/res/drawable-hdpi/img_sportage.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/main/res/drawable-hdpi/img_tosan.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 added app/src/main/res/drawable-mdpi/img.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 added app/src/main/res/drawable-mdpi/img_11.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 added app/src/main/res/drawable-mdpi/img_allnewk_3.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 added app/src/main/res/drawable-mdpi/img_cona.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 added app/src/main/res/drawable-mdpi/img_santafe.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 added app/src/main/res/drawable-mdpi/img_sportage.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/main/res/drawable-mdpi/img_tosan.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 added app/src/main/res/drawable-xhdpi/img.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 added app/src/main/res/drawable-xhdpi/img_11.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 added app/src/main/res/drawable-xhdpi/img_allnewk_3.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 added app/src/main/res/drawable-xhdpi/img_cona.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 added app/src/main/res/drawable-xhdpi/img_santafe.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 added app/src/main/res/drawable-xhdpi/img_sportage.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/main/res/drawable-xhdpi/img_tosan.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 added app/src/main/res/drawable-xxhdpi/img.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 added app/src/main/res/drawable-xxhdpi/img_11.png
Binary file added app/src/main/res/drawable-xxhdpi/img_cona.png
Binary file added app/src/main/res/drawable-xxhdpi/img_santafe.png
Binary file added app/src/main/res/drawable-xxhdpi/img_sportage.png
Binary file added app/src/main/res/drawable-xxhdpi/img_tosan.png
Binary file added app/src/main/res/drawable-xxxhdpi/img.png
Binary file added app/src/main/res/drawable-xxxhdpi/img_11.png
Binary file added app/src/main/res/drawable-xxxhdpi/img_cona.png
Binary file added app/src/main/res/drawable-xxxhdpi/img_santafe.png
Binary file added app/src/main/res/drawable-xxxhdpi/img_tosan.png
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/ic_carplan.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M5.982,16.15h2.85V18a1,1 0,0 1,-1 1h-0.85a1,1 0,0 1,-1 -1v-1.85zM14.531,16.15h2.85V18a1,1 0,0 1,-1 1h-0.85a1,1 0,0 1,-1 -1v-1.85zM7.901,15.157a0.928,0.928 0,1 0,0 -1.856,0.928 0.928,0 0,0 0,1.856zM15.83,15.157a0.928,0.928 0,1 0,0 -1.856,0.928 0.928,0 0,0 0,1.856z"
android:fillColor="#28323C"/>
<path
android:pathData="M6.973,5v-0.5h-0.296l-0.142,0.26 0.438,0.24zM4,10.451l-0.439,-0.239 -0.061,0.112v0.127L4,10.451zM16.885,5l0.44,-0.24 -0.143,-0.26h-0.297L16.885,5zM19.859,10.451h0.5v-0.127l-0.061,-0.112 -0.44,0.24zM19.859,16.398v0.5h0.5v-0.5h-0.5zM4,16.398h-0.5v0.5L4,16.898v-0.5zM6.478,10.451 L6.044,10.203 5.616,10.951h0.862v-0.5zM17.381,10.451v0.5h0.861l-0.427,-0.748 -0.434,0.248zM15.398,6.982 L15.833,6.734 15.689,6.482h-0.29v0.5zM8.46,6.982v-0.5h-0.29l-0.144,0.252 0.434,0.248zM6.535,4.761 L3.56,10.212l0.878,0.479 2.973,-5.452 -0.877,-0.478zM16.885,4.5L6.973,4.5v1h9.912v-1zM20.298,10.212 L17.324,4.761 16.446,5.239 19.42,10.691 20.298,10.212zM19.358,10.452v5.946h1v-5.947h-1zM19.858,15.898L4,15.898v1h15.859v-1zM4.5,16.398v-5.947h-1v5.947h1zM6.478,10.951L17.38,10.951v-1L6.478,9.951v1zM14.964,7.231 L16.947,10.7 17.815,10.203 15.833,6.734 14.964,7.23zM8.46,7.482h6.938v-1L8.46,6.482v1zM6.912,10.7l1.982,-3.47 -0.868,-0.496 -1.982,3.47 0.868,0.495z"
android:fillColor="#28323C"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_home.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12.38,4 L5,11.38v8.72h5.175v-6.038h4.217V20.1h5.366v-8.72L12.38,4z"
android:fillColor="#28323C"/>
</vector>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/ic_mypage.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="24dp"
android:height="25dp"
android:viewportWidth="24"
android:viewportHeight="25">
<path
android:strokeWidth="1"
android:pathData="M12,5.5L12,5.5A7.5,7.5 0,0 1,19.5 13L19.5,13A7.5,7.5 0,0 1,12 20.5L12,20.5A7.5,7.5 0,0 1,4.5 13L4.5,13A7.5,7.5 0,0 1,12 5.5z"
android:fillColor="#00000000"
android:strokeColor="#28323C"/>
<path
android:pathData="M12,10m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"
android:fillColor="#28323C"/>
<path
android:pathData="M8,17a4,4 0,0 1,8 0H8z"
android:fillColor="#28323C"/>
</vector>
16 changes: 16 additions & 0 deletions app/src/main/res/drawable/ic_pairing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:strokeWidth="1"
android:pathData="M4.5,5.5h11.727v9.182H4.5z"
android:fillColor="#00000000"
android:strokeColor="#28323C"/>
<path
android:strokeWidth="1"
android:pathData="M8.318,9.318h11.727V18.5H8.318z"
android:fillColor="#fff"
android:strokeColor="#28323C"/>
</vector>
16 changes: 16 additions & 0 deletions app/src/main/res/font/spoqa_han_sans_neo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:fontStyle="normal"
android:fontWeight="500"
android:font="@font/spoqa_han_sans_neo_medium" />
<font
android:fontStyle="normal"
android:fontWeight="700"
android:font="@font/spoqa_han_sans_neo_bold" />
<font
android:fontStyle="normal"
android:fontWeight="400"
android:font="@font/spoqa_han_sans_neo_regular" />
</font-family>

Binary file added app/src/main/res/font/spoqa_han_sans_neo_bold.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 0c1e83f

Please sign in to comment.