Showing
55 changed files
with
222 additions
and
2 deletions
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <project version="4"> | 2 | <project version="4"> |
3 | + <component name="GradleMigrationSettings" migrationVersion="1" /> | ||
3 | <component name="GradleSettings"> | 4 | <component name="GradleSettings"> |
4 | <option name="linkedExternalProjectsSettings"> | 5 | <option name="linkedExternalProjectsSettings"> |
5 | <GradleProjectSettings> | 6 | <GradleProjectSettings> | ... | ... |
... | @@ -12,13 +12,16 @@ | ... | @@ -12,13 +12,16 @@ |
12 | android:roundIcon="@mipmap/ic_launcher_round" | 12 | android:roundIcon="@mipmap/ic_launcher_round" |
13 | android:supportsRtl="true" | 13 | android:supportsRtl="true" |
14 | android:theme="@style/AppTheme"> | 14 | android:theme="@style/AppTheme"> |
15 | - <activity android:name=".ui.MainActivity"> | 15 | + <activity android:name=".ui.SplashActivity" |
16 | + android:screenOrientation="fullSensor" | ||
17 | + android:noHistory="true"> | ||
16 | <intent-filter> | 18 | <intent-filter> |
17 | <action android:name="android.intent.action.MAIN" /> | 19 | <action android:name="android.intent.action.MAIN" /> |
18 | 20 | ||
19 | <category android:name="android.intent.category.LAUNCHER" /> | 21 | <category android:name="android.intent.category.LAUNCHER" /> |
20 | </intent-filter> | 22 | </intent-filter> |
21 | </activity> | 23 | </activity> |
24 | + <activity android:name=".ui.MainActivity" /> | ||
22 | </application> | 25 | </application> |
23 | 26 | ||
24 | </manifest> | 27 | </manifest> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | +package com.sunnni.smartdoorlock.ui; | ||
2 | + | ||
3 | +import androidx.appcompat.app.AppCompatActivity; | ||
4 | +import androidx.constraintlayout.widget.ConstraintLayout; | ||
5 | + | ||
6 | +import android.content.Intent; | ||
7 | +import android.os.Bundle; | ||
8 | +import android.os.Handler; | ||
9 | +import android.util.Log; | ||
10 | +import android.view.View; | ||
11 | +import android.view.animation.Animation; | ||
12 | +import android.view.animation.AnimationUtils; | ||
13 | +import android.widget.Button; | ||
14 | +import android.widget.LinearLayout; | ||
15 | +import android.widget.Toast; | ||
16 | + | ||
17 | +import com.google.android.material.textfield.TextInputEditText; | ||
18 | +import com.google.android.material.textfield.TextInputLayout; | ||
19 | +import com.sunnni.smartdoorlock.R; | ||
20 | + | ||
21 | +public class SplashActivity extends AppCompatActivity { | ||
22 | + | ||
23 | + private LinearLayout logoContainer; | ||
24 | + private TextInputLayout textInputLayout; | ||
25 | + private TextInputEditText edtSuperKey; | ||
26 | + private ConstraintLayout btnEnter; | ||
27 | + | ||
28 | + private Animation logoAnimation; | ||
29 | + | ||
30 | + @Override | ||
31 | + protected void onCreate(Bundle savedInstanceState) { | ||
32 | + super.onCreate(savedInstanceState); | ||
33 | + setContentView(R.layout.activity_splash); | ||
34 | + | ||
35 | + logoContainer = findViewById(R.id.ll_logo); | ||
36 | + textInputLayout = findViewById(R.id.til_super_key); | ||
37 | + btnEnter = findViewById(R.id.cl_enter); | ||
38 | + edtSuperKey = findViewById(R.id.edt_super_key); | ||
39 | + | ||
40 | + logoAnimation = AnimationUtils.loadAnimation(this, R.anim.anim_bottom_up); | ||
41 | + | ||
42 | + splashLoading(); | ||
43 | + init(); | ||
44 | + } | ||
45 | + | ||
46 | + private void splashLoading() { | ||
47 | + Handler handler = new Handler(); | ||
48 | + handler.postDelayed(new Runnable() { | ||
49 | + @Override | ||
50 | + public void run() { | ||
51 | + logoContainer.startAnimation(logoAnimation); | ||
52 | + | ||
53 | + textInputLayout.setVisibility(View.VISIBLE); | ||
54 | + btnEnter.setVisibility(View.VISIBLE); | ||
55 | + } | ||
56 | + }, 3000); | ||
57 | + } | ||
58 | + | ||
59 | + private void init() { | ||
60 | + btnEnter.setOnClickListener(new View.OnClickListener() { | ||
61 | + @Override | ||
62 | + public void onClick(View v) { | ||
63 | + if(edtSuperKey.toString().isEmpty()){ | ||
64 | + Log.d("empty", "true"); | ||
65 | + } else { | ||
66 | + // main 화면으로 이동 | ||
67 | + } | ||
68 | + } | ||
69 | + }); | ||
70 | + } | ||
71 | +} |
app/src/main/res/anim/anim_bottom_up.xml
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<set xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:interpolator="@android:anim/linear_interpolator" | ||
4 | + android:fillAfter="true"> | ||
5 | + | ||
6 | + <translate | ||
7 | + android:duration="400" | ||
8 | + android:fromYDelta="0%" | ||
9 | + android:toYDelta="-150%" /> | ||
10 | + | ||
11 | +</set> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |

282 Bytes

326 Bytes

451 Bytes

556 Bytes

263 Bytes

269 Bytes

364 Bytes

353 Bytes

222 Bytes

227 Bytes

326 Bytes

412 Bytes

223 Bytes

232 Bytes

269 Bytes

307 Bytes

326 Bytes

412 Bytes

556 Bytes

736 Bytes

269 Bytes

307 Bytes

353 Bytes

429 Bytes

451 Bytes

556 Bytes

842 Bytes

1 KB

364 Bytes

353 Bytes

500 Bytes

574 Bytes

556 Bytes

736 Bytes

1 KB

1.27 KB

353 Bytes

429 Bytes

574 Bytes

751 Bytes
1 | +<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + android:width="24dp" | ||
3 | + android:height="24dp" | ||
4 | + android:viewportWidth="24" | ||
5 | + android:viewportHeight="24" | ||
6 | + android:tint="?attr/colorControlNormal"> | ||
7 | + <path | ||
8 | + android:fillColor="@android:color/white" | ||
9 | + android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/> | ||
10 | +</vector> |
1 | +<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + android:width="24dp" | ||
3 | + android:height="24dp" | ||
4 | + android:viewportWidth="24" | ||
5 | + android:viewportHeight="24" | ||
6 | + android:tint="?attr/colorControlNormal" | ||
7 | + android:autoMirrored="true"> | ||
8 | + <path | ||
9 | + android:fillColor="@android:color/white" | ||
10 | + android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/> | ||
11 | +</vector> |
app/src/main/res/drawable/bg_btn_splash.xml
0 → 100644
app/src/main/res/font/GmarketSansTTFBold.ttf
0 → 100644
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
app/src/main/res/layout/activity_splash.xml
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + xmlns:tools="http://schemas.android.com/tools" | ||
5 | + android:layout_width="match_parent" | ||
6 | + android:layout_height="match_parent" | ||
7 | + android:background="@color/colorBackground" | ||
8 | + tools:context=".ui.SplashActivity"> | ||
9 | + | ||
10 | + <LinearLayout | ||
11 | + android:id="@+id/ll_logo" | ||
12 | + android:layout_width="wrap_content" | ||
13 | + android:layout_height="wrap_content" | ||
14 | + android:orientation="horizontal" | ||
15 | + app:layout_constraintBottom_toBottomOf="parent" | ||
16 | + app:layout_constraintEnd_toEndOf="parent" | ||
17 | + app:layout_constraintStart_toStartOf="parent" | ||
18 | + app:layout_constraintTop_toTopOf="parent"> | ||
19 | + | ||
20 | + <ImageView | ||
21 | + android:layout_width="wrap_content" | ||
22 | + android:layout_height="wrap_content" | ||
23 | + android:layout_gravity="center" | ||
24 | + android:src="@drawable/baseline_lock_white_36" /> | ||
25 | + | ||
26 | + <TextView | ||
27 | + android:layout_width="wrap_content" | ||
28 | + android:layout_height="wrap_content" | ||
29 | + android:layout_gravity="center" | ||
30 | + android:fontFamily="@font/g_market_sans_ttf_bold" | ||
31 | + android:text="게이트웨이" | ||
32 | + android:textColor="@color/colorMainText" | ||
33 | + android:textSize="36sp" /> | ||
34 | + | ||
35 | + </LinearLayout> | ||
36 | + | ||
37 | + <com.google.android.material.textfield.TextInputLayout | ||
38 | + android:visibility="gone" | ||
39 | + android:id="@+id/til_super_key" | ||
40 | + android:layout_width="0dp" | ||
41 | + android:layout_height="0dp" | ||
42 | + android:layout_marginTop="50dp" | ||
43 | + android:hint="고유번호" | ||
44 | + app:boxStrokeColor="@color/colorMainText" | ||
45 | + app:boxStrokeWidth="1dp" | ||
46 | + app:hintTextColor="@color/colorMainText" | ||
47 | + app:layout_constraintDimensionRatio="75:25" | ||
48 | + app:layout_constraintEnd_toStartOf="@id/cl_enter" | ||
49 | + app:layout_constraintStart_toStartOf="@+id/ll_logo" | ||
50 | + app:layout_constraintTop_toBottomOf="@id/ll_logo" | ||
51 | + app:layout_constraintWidth_default="percent" | ||
52 | + app:layout_constraintWidth_percent="0.36"> | ||
53 | + | ||
54 | + <com.google.android.material.textfield.TextInputEditText | ||
55 | + android:id="@+id/edt_super_key" | ||
56 | + android:layout_width="match_parent" | ||
57 | + android:layout_height="match_parent" | ||
58 | + android:autoSizeTextType="uniform" | ||
59 | + android:ems="10" | ||
60 | + android:inputType="number" | ||
61 | + android:singleLine="true" | ||
62 | + android:textColor="@color/colorMainText" | ||
63 | + android:textSize="15sp" /> | ||
64 | + | ||
65 | + </com.google.android.material.textfield.TextInputLayout> | ||
66 | + | ||
67 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
68 | + android:visibility="gone" | ||
69 | + android:id="@+id/cl_enter" | ||
70 | + android:layout_width="0dp" | ||
71 | + android:layout_height="0dp" | ||
72 | + android:layout_marginStart="10dp" | ||
73 | + app:layout_constraintBottom_toBottomOf="@id/til_super_key" | ||
74 | + app:layout_constraintDimensionRatio="51:36" | ||
75 | + app:layout_constraintEnd_toEndOf="@id/ll_logo" | ||
76 | + app:layout_constraintStart_toEndOf="@id/til_super_key" | ||
77 | + app:layout_constraintTop_toTopOf="@id/til_super_key"> | ||
78 | + | ||
79 | + <Button | ||
80 | + android:id="@+id/btn_enter" | ||
81 | + style="?android:attr/borderlessButtonStyle" | ||
82 | + android:layout_width="0dp" | ||
83 | + android:layout_height="0dp" | ||
84 | + android:background="@drawable/bg_btn_splash" | ||
85 | + app:layout_constraintBottom_toBottomOf="parent" | ||
86 | + app:layout_constraintEnd_toEndOf="parent" | ||
87 | + app:layout_constraintStart_toStartOf="parent" | ||
88 | + app:layout_constraintTop_toTopOf="parent" /> | ||
89 | + | ||
90 | + <ImageView | ||
91 | + android:layout_width="wrap_content" | ||
92 | + android:layout_height="wrap_content" | ||
93 | + android:src="@drawable/baseline_send_white_24" | ||
94 | + app:layout_constraintBottom_toBottomOf="@id/btn_enter" | ||
95 | + app:layout_constraintEnd_toEndOf="@id/btn_enter" | ||
96 | + app:layout_constraintStart_toStartOf="@id/btn_enter" | ||
97 | + app:layout_constraintTop_toTopOf="@id/btn_enter" /> | ||
98 | + | ||
99 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
100 | + | ||
101 | + | ||
102 | +</androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -2,5 +2,8 @@ | ... | @@ -2,5 +2,8 @@ |
2 | <resources> | 2 | <resources> |
3 | <color name="colorPrimary">#6200EE</color> | 3 | <color name="colorPrimary">#6200EE</color> |
4 | <color name="colorPrimaryDark">#3700B3</color> | 4 | <color name="colorPrimaryDark">#3700B3</color> |
5 | - <color name="colorAccent">#03DAC5</color> | 5 | + <color name="colorAccent">#ffffff</color> |
6 | + | ||
7 | + <color name="colorBackground">#090938</color> | ||
8 | + <color name="colorMainText">#ffffff</color> | ||
6 | </resources> | 9 | </resources> | ... | ... |
-
Please register or login to post a comment