... | @@ -15,13 +15,17 @@ | ... | @@ -15,13 +15,17 @@ |
15 | <activity android:name=".ui.SplashActivity" | 15 | <activity android:name=".ui.SplashActivity" |
16 | android:screenOrientation="fullSensor" | 16 | android:screenOrientation="fullSensor" |
17 | android:noHistory="true"> | 17 | android:noHistory="true"> |
18 | + | ||
19 | + </activity> | ||
20 | + <activity android:name=".ui.MainActivity" > | ||
21 | + | ||
18 | <intent-filter> | 22 | <intent-filter> |
19 | <action android:name="android.intent.action.MAIN" /> | 23 | <action android:name="android.intent.action.MAIN" /> |
20 | 24 | ||
21 | <category android:name="android.intent.category.LAUNCHER" /> | 25 | <category android:name="android.intent.category.LAUNCHER" /> |
22 | </intent-filter> | 26 | </intent-filter> |
27 | + | ||
23 | </activity> | 28 | </activity> |
24 | - <activity android:name=".ui.MainActivity" /> | ||
25 | </application> | 29 | </application> |
26 | 30 | ||
27 | </manifest> | 31 | </manifest> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | package com.sunnni.smartdoorlock.ui; | 1 | package com.sunnni.smartdoorlock.ui; |
2 | 2 | ||
3 | import androidx.appcompat.app.AppCompatActivity; | 3 | import androidx.appcompat.app.AppCompatActivity; |
4 | +import androidx.appcompat.widget.Toolbar; | ||
4 | 5 | ||
5 | import android.os.Bundle; | 6 | import android.os.Bundle; |
6 | 7 | ||
7 | import com.sunnni.smartdoorlock.R; | 8 | import com.sunnni.smartdoorlock.R; |
8 | 9 | ||
10 | +import java.util.Objects; | ||
11 | + | ||
9 | public class MainActivity extends AppCompatActivity { | 12 | public class MainActivity extends AppCompatActivity { |
10 | 13 | ||
14 | + private Toolbar mToolbar; | ||
15 | + | ||
11 | @Override | 16 | @Override |
12 | protected void onCreate(Bundle savedInstanceState) { | 17 | protected void onCreate(Bundle savedInstanceState) { |
13 | super.onCreate(savedInstanceState); | 18 | super.onCreate(savedInstanceState); |
14 | setContentView(R.layout.activity_main); | 19 | setContentView(R.layout.activity_main); |
20 | + | ||
21 | + setToolbar(); | ||
22 | + } | ||
23 | + | ||
24 | + // 툴바 설정 | ||
25 | + private void setToolbar(){ | ||
26 | + mToolbar = findViewById(R.id.toolbar_main); | ||
27 | + setSupportActionBar(mToolbar); | ||
28 | + Objects.requireNonNull(getSupportActionBar()).setDisplayShowCustomEnabled(true); | ||
29 | + getSupportActionBar().setDisplayShowTitleEnabled(false); | ||
30 | + getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
31 | + getSupportActionBar().setHomeAsUpIndicator(R.drawable.baseline_menu_white_24); | ||
15 | } | 32 | } |
16 | -} | 33 | +} |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -3,14 +3,17 @@ package com.sunnni.smartdoorlock.ui; | ... | @@ -3,14 +3,17 @@ package com.sunnni.smartdoorlock.ui; |
3 | import androidx.appcompat.app.AppCompatActivity; | 3 | import androidx.appcompat.app.AppCompatActivity; |
4 | import androidx.constraintlayout.widget.ConstraintLayout; | 4 | import androidx.constraintlayout.widget.ConstraintLayout; |
5 | 5 | ||
6 | +import android.annotation.SuppressLint; | ||
6 | import android.content.Intent; | 7 | import android.content.Intent; |
7 | import android.os.Bundle; | 8 | import android.os.Bundle; |
8 | import android.os.Handler; | 9 | import android.os.Handler; |
9 | import android.util.Log; | 10 | import android.util.Log; |
11 | +import android.view.MotionEvent; | ||
10 | import android.view.View; | 12 | import android.view.View; |
11 | import android.view.animation.Animation; | 13 | import android.view.animation.Animation; |
12 | import android.view.animation.AnimationUtils; | 14 | import android.view.animation.AnimationUtils; |
13 | import android.widget.Button; | 15 | import android.widget.Button; |
16 | +import android.widget.ImageView; | ||
14 | import android.widget.LinearLayout; | 17 | import android.widget.LinearLayout; |
15 | import android.widget.Toast; | 18 | import android.widget.Toast; |
16 | 19 | ||
... | @@ -27,6 +30,9 @@ public class SplashActivity extends AppCompatActivity { | ... | @@ -27,6 +30,9 @@ public class SplashActivity extends AppCompatActivity { |
27 | 30 | ||
28 | private Animation logoAnimation; | 31 | private Animation logoAnimation; |
29 | 32 | ||
33 | + private ImageView test; | ||
34 | + | ||
35 | + @SuppressLint("ClickableViewAccessibility") | ||
30 | @Override | 36 | @Override |
31 | protected void onCreate(Bundle savedInstanceState) { | 37 | protected void onCreate(Bundle savedInstanceState) { |
32 | super.onCreate(savedInstanceState); | 38 | super.onCreate(savedInstanceState); |
... | @@ -39,6 +45,8 @@ public class SplashActivity extends AppCompatActivity { | ... | @@ -39,6 +45,8 @@ public class SplashActivity extends AppCompatActivity { |
39 | 45 | ||
40 | logoAnimation = AnimationUtils.loadAnimation(this, R.anim.anim_bottom_up); | 46 | logoAnimation = AnimationUtils.loadAnimation(this, R.anim.anim_bottom_up); |
41 | 47 | ||
48 | + test = findViewById(R.id.img_test); | ||
49 | + | ||
42 | splashLoading(); | 50 | splashLoading(); |
43 | init(); | 51 | init(); |
44 | } | 52 | } |
... | @@ -52,20 +60,49 @@ public class SplashActivity extends AppCompatActivity { | ... | @@ -52,20 +60,49 @@ public class SplashActivity extends AppCompatActivity { |
52 | 60 | ||
53 | textInputLayout.setVisibility(View.VISIBLE); | 61 | textInputLayout.setVisibility(View.VISIBLE); |
54 | btnEnter.setVisibility(View.VISIBLE); | 62 | btnEnter.setVisibility(View.VISIBLE); |
63 | + btnEnter.bringToFront(); | ||
64 | + | ||
65 | + test.setVisibility(View.VISIBLE); | ||
66 | + | ||
67 | + | ||
68 | + test.setOnClickListener(new View.OnClickListener() { | ||
69 | + @Override | ||
70 | + public void onClick(View v) { | ||
71 | + Log.d("스플래시", "테스트 버튼"); | ||
72 | + } | ||
73 | + }); | ||
74 | + | ||
75 | + btnEnter.setOnClickListener(new View.OnClickListener(){ | ||
76 | + @Override | ||
77 | + public void onClick(View v) { | ||
78 | + Log.d("스플래시", "버튼"); | ||
79 | + } | ||
80 | + }); | ||
81 | + | ||
55 | } | 82 | } |
56 | - }, 3000); | 83 | + }, 2000); |
57 | } | 84 | } |
58 | 85 | ||
59 | private void init() { | 86 | private void init() { |
60 | btnEnter.setOnClickListener(new View.OnClickListener() { | 87 | btnEnter.setOnClickListener(new View.OnClickListener() { |
61 | @Override | 88 | @Override |
62 | public void onClick(View v) { | 89 | public void onClick(View v) { |
90 | + Log.d("스플래시", "edtSuperKey.toString()"); | ||
63 | if(edtSuperKey.toString().isEmpty()){ | 91 | if(edtSuperKey.toString().isEmpty()){ |
64 | - Log.d("empty", "true"); | 92 | + Log.d("스플래시", "true"); |
65 | } else { | 93 | } else { |
66 | - // main 화면으로 이동 | 94 | + Intent intent = new Intent(SplashActivity.this, MainActivity.class); |
95 | + startActivity(intent); | ||
96 | + finish(); | ||
67 | } | 97 | } |
68 | } | 98 | } |
69 | }); | 99 | }); |
100 | + | ||
101 | + logoContainer.setOnClickListener(new View.OnClickListener() { | ||
102 | + @Override | ||
103 | + public void onClick(View v) { | ||
104 | + Log.d("스플래시", "edtSuperKey.toString()"); | ||
105 | + } | ||
106 | + }); | ||
70 | } | 107 | } |
71 | } | 108 | } | ... | ... |

221 Bytes

158 Bytes

213 Bytes

295 Bytes

124 Bytes

92 Bytes

116 Bytes

93 Bytes

248 Bytes

281 Bytes

352 Bytes

362 Bytes

202 Bytes

212 Bytes

272 Bytes

295 Bytes

318 Bytes

399 Bytes

540 Bytes

671 Bytes

282 Bytes

321 Bytes

464 Bytes

590 Bytes

117 Bytes

143 Bytes

158 Bytes

216 Bytes

87 Bytes

90 Bytes

92 Bytes

93 Bytes

199 Bytes

199 Bytes

281 Bytes

284 Bytes

162 Bytes

139 Bytes

212 Bytes

212 Bytes

256 Bytes

282 Bytes

399 Bytes

468 Bytes

214 Bytes

239 Bytes

321 Bytes

420 Bytes

158 Bytes

216 Bytes

295 Bytes

364 Bytes

92 Bytes

93 Bytes

93 Bytes

99 Bytes

281 Bytes

284 Bytes

362 Bytes

465 Bytes

212 Bytes

212 Bytes

295 Bytes

356 Bytes

399 Bytes

468 Bytes

671 Bytes

874 Bytes

321 Bytes

420 Bytes

590 Bytes

779 Bytes

213 Bytes

295 Bytes

373 Bytes

497 Bytes

116 Bytes

93 Bytes

100 Bytes

107 Bytes

352 Bytes

362 Bytes

579 Bytes

685 Bytes

272 Bytes

295 Bytes

446 Bytes

498 Bytes

540 Bytes

671 Bytes

971 Bytes

1.15 KB

464 Bytes

590 Bytes

874 Bytes

1.1 KB

295 Bytes

364 Bytes

497 Bytes

634 Bytes

93 Bytes

99 Bytes

107 Bytes

112 Bytes

362 Bytes

465 Bytes

685 Bytes

851 Bytes

295 Bytes

356 Bytes

498 Bytes

642 Bytes

671 Bytes

874 Bytes

1.15 KB

1.44 KB

590 Bytes

779 Bytes

1.1 KB

1.33 KB
-
Please register or login to post a comment