Skip to content

Commit

Permalink
#19 업적 페이지 기본 틀
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwater00 committed May 26, 2022
1 parent c8c1c4a commit 276e6f9
Show file tree
Hide file tree
Showing 24 changed files with 565 additions and 57 deletions.
6 changes: 6 additions & 0 deletions SHAPEUP2022/.idea/misc.xml

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

1 change: 1 addition & 0 deletions SHAPEUP2022/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand Down
10 changes: 5 additions & 5 deletions SHAPEUP2022/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
android:supportsRtl="true"
android:theme="@style/Theme.SHAPEUP2022">
<activity
android:name=".preferenceActivity"
android:name=".AchieveActivity"
android:exported="false" />
<!-- 시작 및 회원가입/로그인 -->
<activity
android:name=".preferenceActivity"
android:exported="false" /> <!-- 시작 및 회원가입/로그인 -->
<activity
android:name=".StartActivity"
android:exported="true" />
Expand All @@ -33,9 +35,7 @@
</activity>
<activity
android:name=".ToDoActivity"
android:exported="false" />

<!-- 정보 -->
android:exported="false" /> <!-- 정보 -->
<activity android:name=".AlarmActivity" />
<activity android:name=".BudgetActivity" />
</application>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.example.shape_up_2022

import com.example.progressbar.ViewPagerAdapter
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.shape_up_2022.databinding.ActivityAchieveBinding
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator

class AchieveActivity : AppCompatActivity() {

lateinit var binding: ActivityAchieveBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityAchieveBinding.inflate(layoutInflater)
setContentView(binding.root)


binding.btn.setOnClickListener { view ->
binding.pb4.incrementProgressBy(5)
}

binding.btn2.setOnClickListener { view ->
binding.pb4.incrementProgressBy(-5)
}

binding.btn3.setOnClickListener { view ->
binding.pb4.progress = 50
}

binding.tabs.addOnTabSelectedListener(object :TabLayout.OnTabSelectedListener{
override fun onTabSelected(tab: TabLayout.Tab?) {

}
override fun onTabUnselected(tab: TabLayout.Tab?) {

}

override fun onTabReselected(tab: TabLayout.Tab?) {

}

})
binding.pager.adapter = ViewPagerAdapter(this)


TabLayoutMediator(binding.tabs, binding.pager) {
tab,position->
when(position){
0->tab.text = "탭1"
1->tab.text = "탭2"
2->tab.text = "탭3"
3->tab.text = "탭4"
}
}.attach()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.example.shape_up_2022

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

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [Fragment1.newInstance] factory method to
* create an instance of this fragment.
*/
class AchieveFragment1 : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}

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

companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment Fragment1.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
AchieveFragment1().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.example.shape_up_2022

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

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [Fragment2.newInstance] factory method to
* create an instance of this fragment.
*/
class AchieveFragment2 : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}

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

companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment Fragment2.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
AchieveFragment2().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.example.shape_up_2022

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

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [Fragment3.newInstance] factory method to
* create an instance of this fragment.
*/
class AchieveFragment3 : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}

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

companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment Fragment3.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
AchieveFragment3().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.example.shape_up_2022

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

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [Fragment4.newInstance] factory method to
* create an instance of this fragment.
*/
class AchieveFragment4 : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}

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

companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment Fragment4.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
AchieveFragment4().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
<<<<<<< HEAD
package com.example.shape_up_2022
=======
package com.example.shape_upapptest
>>>>>>> e162eb89f48732050dca3ebbd7b84501d5ec16c4

import android.content.Intent
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
<<<<<<< HEAD
import com.example.shape_up_2022.databinding.AccountJoinBinding

class JoinActivity : AppCompatActivity() {
// 바인딩 변수 선언
private val binding by lazy { AccountJoinBinding.inflate(layoutInflater)}
=======
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import com.example.shape_upapptest.databinding.AccountJoinBinding

class JoinActivity : AppCompatActivity() {
// 바인딩 변수 선언
private val binding by lazy {AccountJoinBinding.inflate(layoutInflater)}
>>>>>>> e162eb89f48732050dca3ebbd7b84501d5ec16c4

override fun onCreate(savedInstanceState: Bundle?) {

Expand Down
Loading

0 comments on commit 276e6f9

Please sign in to comment.