sunnnl

splash activity publishing

Showing 55 changed files with 222 additions and 2 deletions
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
......
......@@ -12,13 +12,16 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.MainActivity">
<activity android:name=".ui.SplashActivity"
android:screenOrientation="fullSensor"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ui.MainActivity" />
</application>
</manifest>
\ No newline at end of file
......
package com.sunnni.smartdoorlock.ui;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import com.sunnni.smartdoorlock.R;
public class SplashActivity extends AppCompatActivity {
private LinearLayout logoContainer;
private TextInputLayout textInputLayout;
private TextInputEditText edtSuperKey;
private ConstraintLayout btnEnter;
private Animation logoAnimation;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
logoContainer = findViewById(R.id.ll_logo);
textInputLayout = findViewById(R.id.til_super_key);
btnEnter = findViewById(R.id.cl_enter);
edtSuperKey = findViewById(R.id.edt_super_key);
logoAnimation = AnimationUtils.loadAnimation(this, R.anim.anim_bottom_up);
splashLoading();
init();
}
private void splashLoading() {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
logoContainer.startAnimation(logoAnimation);
textInputLayout.setVisibility(View.VISIBLE);
btnEnter.setVisibility(View.VISIBLE);
}
}, 3000);
}
private void init() {
btnEnter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(edtSuperKey.toString().isEmpty()){
Log.d("empty", "true");
} else {
// main 화면으로 이동
}
}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true">
<translate
android:duration="400"
android:fromYDelta="0%"
android:toYDelta="-150%" />
</set>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
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"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#1D1DB8" />
<corners android:radius="2dp" />
</shape>
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground"
tools:context=".ui.SplashActivity">
<LinearLayout
android:id="@+id/ll_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/baseline_lock_white_36" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/g_market_sans_ttf_bold"
android:text="게이트웨이"
android:textColor="@color/colorMainText"
android:textSize="36sp" />
</LinearLayout>
<com.google.android.material.textfield.TextInputLayout
android:visibility="gone"
android:id="@+id/til_super_key"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="50dp"
android:hint="고유번호"
app:boxStrokeColor="@color/colorMainText"
app:boxStrokeWidth="1dp"
app:hintTextColor="@color/colorMainText"
app:layout_constraintDimensionRatio="75:25"
app:layout_constraintEnd_toStartOf="@id/cl_enter"
app:layout_constraintStart_toStartOf="@+id/ll_logo"
app:layout_constraintTop_toBottomOf="@id/ll_logo"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.36">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edt_super_key"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoSizeTextType="uniform"
android:ems="10"
android:inputType="number"
android:singleLine="true"
android:textColor="@color/colorMainText"
android:textSize="15sp" />
</com.google.android.material.textfield.TextInputLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:visibility="gone"
android:id="@+id/cl_enter"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="@id/til_super_key"
app:layout_constraintDimensionRatio="51:36"
app:layout_constraintEnd_toEndOf="@id/ll_logo"
app:layout_constraintStart_toEndOf="@id/til_super_key"
app:layout_constraintTop_toTopOf="@id/til_super_key">
<Button
android:id="@+id/btn_enter"
style="?android:attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/bg_btn_splash"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_send_white_24"
app:layout_constraintBottom_toBottomOf="@id/btn_enter"
app:layout_constraintEnd_toEndOf="@id/btn_enter"
app:layout_constraintStart_toStartOf="@id/btn_enter"
app:layout_constraintTop_toTopOf="@id/btn_enter" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -2,5 +2,8 @@
<resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
<color name="colorAccent">#ffffff</color>
<color name="colorBackground">#090938</color>
<color name="colorMainText">#ffffff</color>
</resources>
......