sunnnl

main activity publishing

Showing 141 changed files with 63 additions and 5 deletions
...@@ -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 }
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.