Toggle navigation
Toggle navigation
This project
Loading...
Sign in
장연우
/
WELLO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
신기성
2019-11-19 17:07:23 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
bb2ff6c982b2ac505097b46e6ea66b0fbf690864
bb2ff6c9
2 parents
22774b3f
9e6083c6
signin conflict solving
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
11 deletions
vip/app/src/main/java/com/example/vip/CircleIndicator.kt
vip/app/src/main/java/com/example/vip/DetailActivity.kt
vip/app/src/main/java/com/example/vip/SignInActivity.kt
vip/app/src/main/res/drawable/indicator_dot_off.xml
vip/app/src/main/res/drawable/indicator_dot_on.xml
vip/app/src/main/res/layout/activity_signin.xml
vip/app/src/main/java/com/example/vip/CircleIndicator.kt
0 → 100644
View file @
bb2ff6c
package
com.example.vip
import
android.content.Context
import
android.util.AttributeSet
import
android.util.TypedValue
import
android.widget.ImageView
import
android.widget.LinearLayout
class
CircleIndicator
:
LinearLayout
{
private
var
mContext
:
Context
?
=
null
private
var
mDefaultCircle
:
Int
=
0
private
var
mSelectCircle
:
Int
=
0
private
var
imageDot
:
MutableList
<
ImageView
>
=
mutableListOf
()
// 4.5dp 를 픽셀 단위로 바꿉니다.
private
val
temp
=
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_DIP
,
4.5f
,
resources
.
displayMetrics
)
constructor
(
context
:
Context
)
:
super
(
context
)
{
mContext
=
context
}
constructor
(
context
:
Context
,
attrs
:
AttributeSet
)
:
super
(
context
,
attrs
)
{
mContext
=
context
}
/**
* 기본 점 생성
* @param count 점의 갯수
* @param defaultCircle 기본 점의 이미지
* @param selectCircle 선택된 점의 이미지
* @param position 선택된 점의 포지션
*/
fun
createDotPanel
(
count
:
Int
,
defaultCircle
:
Int
,
selectCircle
:
Int
,
position
:
Int
)
{
this
.
removeAllViews
()
mDefaultCircle
=
defaultCircle
mSelectCircle
=
selectCircle
for
(
i
in
0
until
count
)
{
imageDot
.
add
(
ImageView
(
mContext
).
apply
{
setPadding
(
temp
.
toInt
(),
0
,
temp
.
toInt
(),
0
)
})
this
.
addView
(
imageDot
[
i
])
}
//인덱스 선택
selectDot
(
position
)
}
/**
* 선택된 점 표시
* @param position
*/
fun
selectDot
(
position
:
Int
)
{
for
(
i
in
imageDot
.
indices
)
{
if
(
i
==
position
)
{
imageDot
[
i
].
setImageResource
(
mSelectCircle
)
}
else
{
imageDot
[
i
].
setImageResource
(
mDefaultCircle
)
}
}
}
}
\ No newline at end of file
vip/app/src/main/java/com/example/vip/DetailActivity.kt
View file @
bb2ff6c
...
...
@@ -177,7 +177,7 @@ class DetailActivity : AppCompatActivity() {
setSupportActionBar
(
toolbar
)
// 2. 툴바 왼쪽 버튼 설정
supportActionBar
!!
.
setDisplayHomeAsUpEnabled
(
tru
e
)
// 왼쪽 버튼 사용 여부 true
supportActionBar
!!
.
setDisplayHomeAsUpEnabled
(
fals
e
)
// 왼쪽 버튼 사용 여부 true
supportActionBar
!!
.
setHomeAsUpIndicator
(
R
.
drawable
.
return_page
)
// 왼쪽 버튼 아이콘 설정
supportActionBar
!!
.
setDisplayShowTitleEnabled
(
false
)
// 타이틀 안보이게 하기
...
...
vip/app/src/main/java/com/example/vip/SignInActivity.kt
View file @
bb2ff6c
...
...
@@ -12,7 +12,9 @@ import android.widget.Toast
import
androidx.appcompat.app.ActionBar
import
androidx.appcompat.app.AlertDialog
import
androidx.appcompat.app.AppCompatActivity
import
androidx.core.app.ActivityCompat.finishAffinity
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat.startActivity
import
androidx.viewpager.widget.ViewPager
import
com.google.android.material.bottomnavigation.BottomNavigationView
import
com.google.android.material.snackbar.Snackbar
...
...
@@ -150,6 +152,25 @@ class SignInActivity : AppCompatActivity() {
val
viewpageradapter
=
ViewPagerAdapter
(
this
)
viewpager
.
adapter
=
viewpageradapter
viewpager
.
addOnPageChangeListener
(
object
:
ViewPager
.
OnPageChangeListener
{
override
fun
onPageScrollStateChanged
(
p0
:
Int
)
{
}
override
fun
onPageScrolled
(
p0
:
Int
,
p1
:
Float
,
p2
:
Int
)
{
}
override
fun
onPageSelected
(
p0
:
Int
)
{
ciMainActivity
.
selectDot
(
p0
)
}
})
//init indicator
ciMainActivity
.
createDotPanel
(
3
,
R
.
drawable
.
indicator_dot_off
,
R
.
drawable
.
indicator_dot_on
,
0
)
// 1. 툴바 사용 설정
setSupportActionBar
(
toolbar
)
...
...
vip/app/src/main/res/drawable/indicator_dot_off.xml
0 → 100644
View file @
bb2ff6c
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
<solid
android:color=
"#FFF"
/>
<size
android:height=
"7dp"
android:width=
"7dp"
/>
</shape>
\ No newline at end of file
vip/app/src/main/res/drawable/indicator_dot_on.xml
0 → 100644
View file @
bb2ff6c
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
<solid
android:color=
"#29ABE2"
/>
<size
android:height=
"7dp"
android:width=
"7dp"
/>
</shape>
\ No newline at end of file
vip/app/src/main/res/layout/activity_signin.xml
View file @
bb2ff6c
...
...
@@ -34,16 +34,6 @@
android:src=
"@drawable/toolbar_logo"
/>
</androidx.appcompat.widget.Toolbar>
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/welcomeViewPager"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"top"
android:layout_weight=
"1"
android:elevation=
"-7dp"
>
</androidx.viewpager.widget.ViewPager>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
@@ -61,6 +51,30 @@
</LinearLayout>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/welcomeViewPager"
android:layout_width=
"match_parent"
android:layout_height=
"262dp"
android:layout_gravity=
"top"
android:layout_weight=
"1"
>
</androidx.viewpager.widget.ViewPager>
<com.example.vip.CircleIndicator
android:id=
"@+id/ciMainActivity"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|center_horizontal"
android:layout_marginBottom=
"20dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
</FrameLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
Please
register
or
login
to post a comment