-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from Nbti/feat-sally-2
마이페이지(프로필)
- Loading branch information
Showing
130 changed files
with
4,099 additions
and
215 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.nbit.Idear | ||
|
||
import com.nbit.Idear.write.WriteInterface | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
|
||
object RetrofitBuilder { | ||
private val retrofit by lazy { | ||
Retrofit.Builder() | ||
.baseUrl("http://54.180.95.50:9010") | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.build() | ||
} | ||
|
||
val writeApi: WriteInterface by lazy { | ||
retrofit.create(WriteInterface::class.java) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.nbit.Idear.home | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import com.nbit.Idear.R | ||
import com.nbit.Idear.databinding.ActivityStarBinding | ||
|
||
class StarActivity : AppCompatActivity() { | ||
|
||
lateinit var binding:ActivityStarBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
binding=ActivityStarBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
val dataDataList:ArrayList<StarData> = arrayListOf() | ||
|
||
dataDataList.apply{ | ||
add(StarData(2023,6,23,"dfjslkdfjlksdjfkl")) | ||
add(StarData(2023,6,23,"dfjslkdfjlksdjfkl")) | ||
add(StarData(2023,6,23,"dfjslkdfjlksdjfkl")) | ||
|
||
} | ||
|
||
binding.leftArrowBtn.setOnClickListener { | ||
finish() | ||
} | ||
|
||
binding.starRecyclerView.layoutManager= LinearLayoutManager(this) | ||
val adapter=StarAdapter(dataDataList) | ||
binding.starRecyclerView.adapter=adapter | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.nbit.Idear.home | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.core.content.ContextCompat.getMainExecutor | ||
import androidx.core.content.ContextCompat.startActivity | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.nbit.Idear.R | ||
import com.nbit.Idear.databinding.ItemStarBinding | ||
import com.nbit.Idear.databinding.ItemWriteBinding | ||
import com.nbit.Idear.write.WriteActivity | ||
|
||
class StarAdapter (private val dataList:ArrayList<StarData>): | ||
RecyclerView.Adapter<StarAdapter.DataViewHolder>() { | ||
inner class DataViewHolder(private val viewBinding: ItemStarBinding) : RecyclerView.ViewHolder(viewBinding.root) { | ||
// var chk=false; | ||
private val context = viewBinding.root.context | ||
|
||
fun bind(data: StarData) { | ||
viewBinding.yearText.text = data.year.toString() | ||
viewBinding.monthText.text = data.month.toString() | ||
viewBinding.dayText.text = data.day.toString() | ||
|
||
viewBinding.mainContent.text = data.content | ||
|
||
viewBinding.rightBtn.setOnClickListener { | ||
val intent = Intent(context, StartInfoActivity::class.java) | ||
// startActivity(intent) | ||
intent.run { context.startActivity(this) } | ||
|
||
} | ||
|
||
} } | ||
|
||
|
||
|
||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StarAdapter.DataViewHolder { | ||
val binding = ItemStarBinding.inflate(LayoutInflater.from(parent.context), parent, false) | ||
return DataViewHolder(binding) | ||
} | ||
|
||
override fun onBindViewHolder(holder: DataViewHolder, position: Int) { | ||
holder.bind(dataList[position]) | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return dataList.size | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.nbit.Idear.home | ||
|
||
data class StarData( | ||
val year:Int, | ||
val month:Int, | ||
val day:Int, | ||
val content:String | ||
) |
Oops, something went wrong.