Skip to content

Commit 4d89647

Browse files
committed
feature:
- 앱 UI 변경 중 - 앱 용량 최적화 - Guest 서비스 추가 중
1 parent 92a87e7 commit 4d89647

17 files changed

Lines changed: 119 additions & 59 deletions

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ android {
1818
applicationId "com.seok.gfd"
1919
minSdkVersion 26
2020
targetSdkVersion 28
21-
versionCode 7
22-
versionName "2.17.7"
21+
versionCode 9
22+
versionName "2.17.8"
2323
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2424
}
2525
buildTypes {

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<application
99
android:allowBackup="true"
1010
android:fullBackupContent="@xml/backup_descriptor"
11-
android:icon="@drawable/gfd_logo_foreground"
11+
android:icon="@drawable/gfd_app_logo"
1212
android:label="@string/app_name"
1313
android:supportsRtl="true"
1414
android:theme="@style/AppTheme"

app/src/main/java/com/seok/gfd/views/LoginActivity.kt

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,36 @@ package com.seok.gfd.views
44
import android.content.Intent
55
import android.net.Uri
66
import android.os.Bundle
7+
import android.os.Handler
8+
import android.view.View
79
import androidx.appcompat.app.AppCompatActivity
810
import androidx.lifecycle.Observer
911
import androidx.lifecycle.ViewModelProviders
1012
import com.seok.gfd.BuildConfig
1113
import com.seok.gfd.R
12-
import com.seok.gfd.utils.ProgressbarDialog
1314
import com.seok.gfd.utils.SharedPreference
1415
import com.seok.gfd.viewmodel.UserViewModel
1516
import kotlinx.android.synthetic.main.activity_login.*
1617
import org.jetbrains.anko.longToast
1718
import java.net.HttpURLConnection
1819

19-
@Suppress(
20-
"NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS",
21-
"RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS"
22-
)
2320
class LoginActivity : AppCompatActivity() {
2421

2522
private lateinit var userViewModel: UserViewModel
2623
private lateinit var sharedPreference: SharedPreference
27-
private lateinit var progressbar: ProgressbarDialog
2824

2925
override fun onCreate(savedInstanceState: Bundle?) {
3026
super.onCreate(savedInstanceState)
3127
setContentView(R.layout.activity_login)
3228

3329
init()
3430
initViewModelFun()
35-
36-
// 로그인 버튼 눌렀을 경우 Github login 창으로 넘김
37-
login_img_login.setOnClickListener {
38-
progressbar.show()
39-
val intent = Intent(
40-
Intent.ACTION_VIEW,
41-
Uri.parse(BuildConfig.GITHUB_OAUTH_URL + BuildConfig.GITHUB_CLIENT_ID)
42-
)
43-
// onNewIntent() 리다이렉트
44-
startActivityForResult(intent, HttpURLConnection.HTTP_OK)
45-
}
46-
userViewModel.getUserInfoAndSignInGithub(sharedPreference.getValue(BuildConfig.PREFERENCES_TOKEN_KEY))
31+
setOnClickFun()
4732

4833
}
4934

5035
// ViewModel 세팅 및 초기화
5136
private fun init() {
52-
progressbar = ProgressbarDialog(this)
53-
progressbar.show()
5437
sharedPreference = SharedPreference(application)
5538
userViewModel = ViewModelProviders.of(this).get(UserViewModel::class.java)
5639
userViewModel.getUsersCount()
@@ -72,7 +55,7 @@ class LoginActivity : AppCompatActivity() {
7255
if (it == HttpURLConnection.HTTP_OK) {
7356
goToMainActivity()
7457
} else {
75-
progressbar.hide()
58+
login_progress_bar.visibility = View.INVISIBLE
7659
longToast(getString(R.string.fail_access_token))
7760
}
7861
})
@@ -92,7 +75,34 @@ class LoginActivity : AppCompatActivity() {
9275
private fun goToMainActivity() {
9376
startActivity(Intent(this, MainActivity::class.java))
9477
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
95-
progressbar.hide()
96-
finish()
78+
}
79+
80+
private fun setOnClickFun(){
81+
// Guest 로그인 버튼을 눌렀을 경우
82+
login_img_guest.setOnClickListener {
83+
syncUI()
84+
}
85+
86+
// 로그인 버튼 눌렀을 경우 Github login 창으로 넘김
87+
login_img_login.setOnClickListener {
88+
syncUI()
89+
val intent = Intent(
90+
Intent.ACTION_VIEW,
91+
Uri.parse(BuildConfig.GITHUB_OAUTH_URL + BuildConfig.GITHUB_CLIENT_ID)
92+
)
93+
// onNewIntent() 리다이렉트
94+
startActivityForResult(intent, HttpURLConnection.HTTP_OK)
95+
}
96+
}
97+
98+
private fun syncUI(){
99+
login_progress_bar.visibility = View.VISIBLE
100+
login_img_login.isClickable = false
101+
login_img_guest.isClickable = false
102+
Handler().postDelayed({
103+
login_progress_bar.visibility = View.INVISIBLE
104+
login_img_login.isClickable = true
105+
login_img_guest.isClickable = true
106+
}, 3000)
97107
}
98108
}

app/src/main/java/com/seok/gfd/views/MainSub.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class MainSub : Fragment() {
6666
val weekText = TextView(activity)
6767
weekText.textColor = activity!!.getColor(R.color.userRankPos)
6868
weekText.text = index.toString() + "W"
69-
weekText.typeface = ResourcesCompat.getFont(context!!, R.font.spoqa_han_sans_light)
69+
weekText.typeface = ResourcesCompat.getFont(context!!, R.font.spoqa_han_sans_regular)
7070
main_sub_scalable_layout.addView(weekText, 20f, weekPosTop, 100f, 50f)
7171
main_sub_scalable_layout.setScale_TextSize(weekText, 35f)
7272
weekPosTop += 55f
@@ -75,7 +75,7 @@ class MainSub : Fragment() {
7575
for (index in 2..commitSize / 7 step 2) {
7676
val weekText = TextView(activity)
7777
weekText.textColor = activity!!.getColor(R.color.userRankPos)
78-
weekText.typeface = ResourcesCompat.getFont(context!!, R.font.spoqa_han_sans_light)
78+
weekText.typeface = ResourcesCompat.getFont(context!!, R.font.spoqa_han_sans_regular)
7979
weekText.text = index.toString() + "W"
8080
main_sub_scalable_layout.addView(weekText, 570f, weekPosTop, 100f, 50f)
8181
main_sub_scalable_layout.setScale_TextSize(weekText, 35f)
10.2 KB
Loading
21.3 KB
Loading
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3+
<solid android:color="#444444" />
4+
<corners android:radius="40dip"/>
5+
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
6+
</shape>
-28.3 MB
Binary file not shown.
-28.1 MB
Binary file not shown.

app/src/main/res/layout/activity_launcher.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,11 @@
1212
android:layout_width="300dp"
1313
android:layout_height="300dp"
1414
android:layout_weight="1"
15-
android:visibility="gone"
15+
android:visibility="visible"
1616
app:layout_constraintBottom_toBottomOf="parent"
1717
app:layout_constraintEnd_toEndOf="parent"
1818
app:layout_constraintStart_toStartOf="parent"
1919
app:layout_constraintTop_toTopOf="parent"
2020
app:srcCompat="@drawable/gfd_launcher" />
2121

22-
<com.ssomai.android.scalablelayout.ScalableLayout
23-
android:id="@+id/scale_layout"
24-
android:layout_width="match_parent"
25-
android:layout_height="match_parent"
26-
android:visibility="gone"
27-
app:layout_constraintBottom_toBottomOf="parent"
28-
app:layout_constraintEnd_toEndOf="parent"
29-
app:layout_constraintStart_toStartOf="parent"
30-
app:layout_constraintTop_toTopOf="parent">
31-
32-
</com.ssomai.android.scalablelayout.ScalableLayout>
3322
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)