Skip to content

Commit 1867662

Browse files
authored
Merge pull request #5 from msnodeve/develop
[Merge] develop->master : release 완료
2 parents 7e8bc4b + f445794 commit 1867662

81 files changed

Lines changed: 2369 additions & 1345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,9 @@ fastlane/readme.md
7070
.DS_Store
7171
.idea/runConfigurations.xml
7272

73-
# font
74-
spoqa_han_sans_*.ttf
73+
.settings
74+
release
75+
.project
76+
.classpath
77+
78+
network_security_config.xml

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ set_env:
55
echo "PREFERENCES_FILE=\"file_name\"" >> app/gradle.properties
66
echo "PREFERENCES_TOKEN_KEY=\"token_key\"" >> app/gradle.properties
77
echo "BASIC_AUTH_KEY=\"basic_auth_key\"" >> app/gradle.properties
8-
echo "GFD_API_URL=\"gfd_api_url\"" >> app/gradle.properties
8+
echo "GFD_API_URL=\"gfd_api_url\"" >> app/gradle.properties
9+
echo "GITHUB_OAUTH_URL=\"gfd_oauth_url\"" >> app/gradle.properties

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
# Release
99

10-
v1.10.3 릴리즈 [Google Paly Store](https://play.google.com/store/apps/details?id=com.seok.gitfordeveloper)
10+
v2.17.7 릴리즈 [Google Paly Store](https://play.google.com/store/apps/details?id=com.seok.gfd)
1111

1212
# Preview
1313

14-
<img src="./img/preview01.png" width="40%" height="40%">
15-
<img src="./img/preview02.png" width="40%" height="40%">
14+
<img src="./img/preview05.png" width="40%" height="40%">
15+
<img src="./img/preview04.png" width="40%" height="40%">
16+
<img src="./img/preview03.png" width="40%" height="40%">
1617

1718

1819
# Notice
@@ -30,3 +31,7 @@ v2.16.6 릴리즈 작업 완료
3031
- 대대적인 UI/UX 개선
3132
- 도움을 주신 분 탭 추가
3233
- 앱 성능 최적화
34+
35+
v.2.17.7
36+
- Github Contribution 그래프 UI 변경
37+
- 랭킹 서비스 오류로 인해 수정 진행 중

app/build.gradle

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ android {
1616
compileSdkVersion 28
1717
defaultConfig {
1818
applicationId "com.seok.gfd"
19-
minSdkVersion 21
19+
minSdkVersion 26
2020
targetSdkVersion 28
21-
versionCode 5
22-
versionName "1.10.3"
21+
versionCode 7
22+
versionName "2.17.7"
2323
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2424
}
2525
buildTypes {
2626
release {
2727
minifyEnabled false
2828
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2929
testCoverageEnabled false
30+
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
3031
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
3132
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
3233
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
@@ -37,6 +38,7 @@ android {
3738
}
3839
debug {
3940
testCoverageEnabled true
41+
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
4042
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
4143
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
4244
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
@@ -141,4 +143,12 @@ dependencies {
141143
// NavigationBar
142144
implementation 'androidx.navigation:navigation-fragment-ktx:2.1.0'
143145
implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'
146+
147+
// UI Scale
148+
implementation 'com.ssomai:android.scalablelayout:2.1.6'
149+
150+
// Tab Layout
151+
implementation 'com.ogaclejapan.smarttablayout:library:2.0.0@aar'
152+
implementation 'com.ogaclejapan.smarttablayout:utils-v4:2.0.0@aar'
153+
144154
}

app/release/output.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/src/androidTest/java/com/seok/gfd/GithubRetrofitTest.kt

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
package com.seok.gfd.adapter
2+
3+
import android.util.Log
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import androidx.annotation.LayoutRes
8+
import androidx.recyclerview.widget.RecyclerView
9+
import com.bumptech.glide.Glide
10+
import com.bumptech.glide.request.RequestOptions
11+
import com.seok.gfd.R
12+
import com.seok.gfd.retrofit.domain.resopnse.CommitResponse
13+
import kotlinx.android.synthetic.main.rv_rank_item.view.*
14+
15+
class CommitsAdapter(private val commit: ArrayList<CommitResponse>) :
16+
RecyclerView.Adapter<CommitsAdapter.CommitsHolder>() {
17+
private var index = 1
18+
override fun getItemCount() = commit.size
19+
override fun onCreateViewHolder(
20+
parent: ViewGroup,
21+
viewType: Int
22+
): CommitsHolder {
23+
val inflatedView = parent.inflate(R.layout.rv_rank_item, false)
24+
return CommitsHolder(inflatedView)
25+
}
26+
27+
fun ViewGroup.inflate(@LayoutRes layoutRes: Int, attachToRoot: Boolean = false): View {
28+
return LayoutInflater.from(context).inflate(layoutRes, this, attachToRoot)
29+
}
30+
31+
override fun onBindViewHolder(holder: CommitsHolder, position: Int) {
32+
val itemCommit = commit[position]
33+
holder.bindCommit(itemCommit)
34+
}
35+
36+
class CommitsHolder(v: View) : RecyclerView.ViewHolder(v), View.OnClickListener {
37+
private var view: View = v
38+
private var commit: CommitResponse? = null
39+
init {
40+
v.setOnClickListener(this)
41+
}
42+
43+
override fun onClick(v: View) {
44+
Log.d("RecyclerView", v.id.toString())
45+
}
46+
47+
companion object {
48+
private val COMMIT_KEY = "COMMIT"
49+
}
50+
51+
fun bindCommit(commitResponse: CommitResponse) {
52+
this.commit = commitResponse
53+
view.tv_rank_commit.text = commitResponse.data_count.toString()
54+
view.tv_rv_rank_username.text = commitResponse.user_id
55+
Glide.with(view).load(commitResponse.user_image).apply(RequestOptions.circleCropTransform()).into(view.img_rv_user_profile)
56+
// view.tv_rv_rank_username.text = commitResponse.uid
57+
// view.tv_rv_rank_num.text = rank
58+
// Glide.with(view).load(commitResponse.profile_image)
59+
// .apply(RequestOptions.circleCropTransform()).into(view.img_rv_user_profile)
60+
}
61+
}
62+
63+
}
64+
//class CommitsAdapter(private val application: Application, private val items: List<TRCommitResponseDto>, private val fragment: Fragment) :
65+
// RecyclerView.Adapter<CommitsAdapter.TRCommitRankViewHolder>() {
66+
//
67+
// private lateinit var sharedPreferencesForUser: SharedPreferencesForUser
68+
//
69+
// override fun getItemCount() = items.size
70+
//
71+
// override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TRCommitRankViewHolder {
72+
// sharedPreferencesForUser = SharedPreferencesForUser(application)
73+
// val inflatedView = LayoutInflater.from(parent.context).inflate(R.layout.rv_rank_item, parent, false)
74+
// return TRCommitRankViewHolder(inflatedView)
75+
// }
76+
//
77+
// override fun onBindViewHolder(holder: TRCommitRankViewHolder, position: Int) {
78+
// val item = items[position]
79+
// val rank = (position+1).toString()
80+
// if(item.uid == sharedPreferencesForUser.getValue(application.getString(R.string.user_id))){
81+
// fragment.tv_rv_rank.text = rank
82+
// fragment.tv_rv_commit.text = item.data_count.toString()
83+
// Glide.with(fragment).load(item.profile_image).apply(RequestOptions.circleCropTransform()).into(fragment.img_rv_profile)
84+
// }
85+
// holder.apply {
86+
// bind(rank, item, sharedPreferencesForUser.getValue(application.getString(R.string.user_id)))
87+
// itemView.tag = item
88+
// }
89+
// }
90+
//
91+
// class TRCommitRankViewHolder(private var view: View) : RecyclerView.ViewHolder(view) {
92+
// fun bind(rank: String, item: TRCommitResponseDto, userId: String) {
93+
// view.tv_rv_rank_num.text = rank
94+
// view.tv_rv_rank_username.text = item.uid
95+
// view.tv_rank_commit.text = item.data_count.toString()
96+
// Glide.with(view.context).load(item.profile_image).apply(RequestOptions.circleCropTransform()).into(view.img_rv_user_profile)
97+
// if(item.uid == userId){
98+
// view.layout_rv_back.setBackgroundResource(R.color.nonCommit)
99+
// }
100+
// }
101+
// }
102+
//}

app/src/main/java/com/seok/gfd/adapter/TRCommitListAdapter.kt

Lines changed: 0 additions & 55 deletions
This file was deleted.

app/src/main/java/com/seok/gfd/retrofit/ApiUtils.kt

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/src/main/java/com/seok/gfd/retrofit/RetrofitClient.kt

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,54 @@ package com.seok.gfd.retrofit
22

33
import com.google.gson.GsonBuilder
44
import com.seok.gfd.BuildConfig
5-
import com.seok.gfd.retrofit.service.GUserService
6-
import com.seok.gfd.retrofit.service.TRCommitService
75
import com.seok.gfd.retrofit.service.UserService
6+
import com.seok.gfd.retrofit.service.CommitService
7+
import com.seok.gfd.retrofit.service.GithubApiService
8+
import com.seok.gfd.retrofit.service.GithubCommitService
89
import retrofit2.Retrofit
910
import retrofit2.converter.gson.GsonConverterFactory
1011

1112
class RetrofitClient {
1213
companion object {
1314
lateinit var retrofit: Retrofit
14-
fun githubUserApiService(): UserService {
15+
fun githubApiService(): GithubApiService {
1516
val gson = GsonBuilder().setLenient().create()
1617
retrofit = Retrofit.Builder()
1718
.baseUrl("https://api.github.com/")
1819
.addConverterFactory(GsonConverterFactory.create(gson))
1920
.build()
20-
return retrofit.create(UserService::class.java)
21+
return retrofit.create(GithubApiService::class.java)
2122
}
22-
fun getGithubCode(): UserService{
23+
fun githubAuthService(): GithubApiService{
2324
retrofit = Retrofit.Builder()
2425
.baseUrl("https://github.com/login/oauth/")
2526
.addConverterFactory(GsonConverterFactory.create())
2627
.build()
27-
return retrofit.create(UserService::class.java)
28+
return retrofit.create(GithubApiService::class.java)
2829
}
29-
fun gUserService() : GUserService{
30+
fun userService() : UserService{
3031
val gson = GsonBuilder().setLenient().create()
3132
retrofit = Retrofit.Builder()
32-
.baseUrl("http://10.0.2.2:8080/api/v1/")
33+
.baseUrl(BuildConfig.GFD_API_URL)
3334
.addConverterFactory(GsonConverterFactory.create(gson))
3435
.build()
35-
return retrofit.create(GUserService::class.java)
36+
return retrofit.create(UserService::class.java)
3637
}
37-
fun trCommitService() : TRCommitService{
38+
fun commitService() : CommitService{
3839
val gson = GsonBuilder().setLenient().create()
3940
retrofit = Retrofit.Builder()
4041
.baseUrl(BuildConfig.GFD_API_URL)
4142
.addConverterFactory(GsonConverterFactory.create(gson))
4243
.build()
43-
return retrofit.create(TRCommitService::class.java)
44+
return retrofit.create(CommitService::class.java)
45+
}
46+
fun githubCommitService(): GithubCommitService{
47+
val gson = GsonBuilder().setLenient().create()
48+
retrofit = Retrofit.Builder()
49+
.baseUrl("https://github-contributions-api.now.sh/v1/")
50+
.addConverterFactory(GsonConverterFactory.create(gson))
51+
.build()
52+
return retrofit.create(GithubCommitService::class.java)
4453
}
4554
}
4655
}

0 commit comments

Comments
 (0)