songjunekeun vor 5 Jahren
Ursprung
Commit
a69d9747a0

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 8 - 8
app/build.gradle

@@ -54,9 +54,9 @@ android {
             buildConfigField "String", "CONSENT_SERVER_URL", "\"http://128.127.95.125/\""
             buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://emadev.knuh.kr:8095/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"031\""
-            manifestPlaceholders = [ appLabel: "로컬" ]
+            manifestPlaceholders = [appLabel: "로컬"]
         }
-        bonwon{
+        bonwon {
 //            versionCode 1
 //            versionName "1.0.0"
 
@@ -64,7 +64,7 @@ android {
             buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema031.knuh.kr:9091/\""
             buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://ema031.knuh.kr:9090/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"031\""
-            manifestPlaceholders = [ appLabel: "본원운영" ]
+            manifestPlaceholders = [appLabel: "본원운영"]
         }
         bonwon_dev {
             applicationIdSuffix ".dev1"
@@ -72,23 +72,23 @@ android {
             buildConfigField "String", "CONSENT_SERVER_URL", "\"https://emadev.knuh.kr:8096\""
             buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://emadev.knuh.kr:8095/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"031\""
-            manifestPlaceholders = [ appLabel: "본원교육" ]
+            manifestPlaceholders = [appLabel: "본원교육"]
         }
-        chilgok{
+        chilgok {
             applicationIdSuffix ".chilgok"
             buildConfigField "String", "originalPackageName", "\"com.dbs.mplus.knuh\""
             buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema032.knuh.kr:8091\""
             buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://ema032.knuh.kr:8090/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"032\""
-            manifestPlaceholders = [ appLabel: "칠곡운영" ]
+            manifestPlaceholders = [appLabel: "칠곡운영"]
         }
-        chilgok_dev{
+        chilgok_dev {
             applicationIdSuffix ".chilgok.dev1"
             buildConfigField "String", "originalPackageName", "\"com.dbs.mplus.knuh\""
             buildConfigField "String", "CONSENT_SERVER_URL", "\"https://emadev.knuh.kr:9096\""
             buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://emadev.knuh.kr:9095/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"032\""
-            manifestPlaceholders = [ appLabel: "칠곡교육" ]
+            manifestPlaceholders = [appLabel: "칠곡교육"]
         }
     }
 }

+ 13 - 0
app/src/bonwon/res/drawable-xxxhdpi/ripple.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    android:color="#00ccb4"> <!-- Ripple Effect 색상 -->
+
+    <!-- 배경색 -->
+    <item android:id="@android:id/background">
+        <shape android:shape="rectangle">
+            <corners android:radius="5dp"/>
+            <solid android:color="@color/loginBtnColor"/>
+        </shape>
+    </item>
+
+</ripple>

+ 17 - 0
app/src/bonwon/res/drawable-xxxhdpi/shape.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape android:shape="rectangle">
+            <solid android:color="#CCffffff"/>
+            <stroke android:width="1dp" android:color="#CCCCCC"/>
+            <corners android:radius="5dp"/>
+            <!-- You can create different radius for different corners -->
+            <!--corners
+                android:topLeftRadius="5dp"
+                android:topRightRadius="5dp"
+                android:bottomLeftRadius="5dp"
+                android:bottomRightRadius="5dp"
+                /-->
+        </shape>
+    </item>
+</selector>

+ 14 - 12
app/src/main/AndroidManifest.xml

@@ -1,16 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.dbs.mplus.knuh">
-
     <!-- 인터넷 사용 -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <!-- 스토리지 접근 -->
+    <uses-permission android:name="android.permission.INTERNET" /> <!-- 스토리지 접근 -->
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
-
-    <!-- 네트워크 상태 확인 -->
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <!-- 폰 상태 확인 -->
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 네트워크 상태 확인 -->
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 폰 상태 확인 -->
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
@@ -23,15 +18,22 @@
 
     <application
         android:allowBackup="true"
+        android:hardwareAccelerated="true"
         android:icon="@mipmap/ic_launcher"
         android:label="${appLabel}"
+        android:largeHeap="true"
         android:roundIcon="@mipmap/ic_launcher"
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
-        android:usesCleartextTraffic="true"
-        android:hardwareAccelerated="true"
-        android:largeHeap="true">
-        <activity android:name=".MainActivity">
+        android:usesCleartextTraffic="true">
+        <activity
+            android:name=".activity.LoginActivity"
+            android:screenOrientation="landscape"
+            android:windowSoftInputMode="adjustResize|stateHidden">
+        </activity>
+        <activity
+            android:name=".MainActivity"
+            android:screenOrientation="landscape">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

+ 15 - 3
app/src/main/java/com/dbs/mplus/knuh/MainActivity.java

@@ -2,12 +2,21 @@ package com.dbs.mplus.knuh;
 
 import androidx.appcompat.app.AppCompatActivity;
 
+import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
+import android.util.Log;
+
+import com.dbs.mplus.knuh.activity.LoginActivity;
 
 public class MainActivity extends AppCompatActivity {
 
+  private static final String TAG = "MainActivity";
+
+  private AppCompatActivity mActivity;
+  private Context mContext;
+
   @Override
   protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
@@ -17,7 +26,10 @@ public class MainActivity extends AppCompatActivity {
   }
 
   private void init() {
+    mActivity = this;
+    mContext  = this;
 
+    nextActivity();
   }
 
   private void nextActivity() {
@@ -25,9 +37,9 @@ public class MainActivity extends AppCompatActivity {
       @Override
       public void run() {
         // 수행할 내용 입력
-//        Intent intent = new Intent(mContext, LoginActivity.class);
-//        startActivity(intent);
-//        finish();
+        Intent intent = new Intent(mContext, LoginActivity.class);
+        startActivity(intent);
+        finish();
       }
     }, 2000); // 2초 뒤에 수행할 내용에 입력된게 실행됨, 시간은 사용자에 맞게 변경하면됨
   }

+ 44 - 0
app/src/main/java/com/dbs/mplus/knuh/activity/LoginActivity.java

@@ -0,0 +1,44 @@
+package com.dbs.mplus.knuh.activity;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.widget.ImageView;
+
+import com.dbs.mplus.knuh.BuildConfig;
+import com.dbs.mplus.knuh.R;
+
+public class LoginActivity extends AppCompatActivity {
+
+  private AppCompatActivity mActivity;
+  private Context mContext;
+  private ImageView ivLogo;
+
+  @Override
+  protected void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    setContentView(R.layout.activity_login);
+
+    init();
+  }
+
+  private void init() {
+    mActivity = this;
+    mContext  = this;
+
+    setLayout();
+  }
+
+  private void setLayout() {
+    ivLogo = (ImageView) findViewById(R.id.ivLogo);
+
+    int logo = 0;
+    if (BuildConfig.INST_CD.equals("032")) {
+      logo = R.drawable.chilgok_logo;
+    } else {
+      logo = R.drawable.knuh_logo;
+    }
+    ivLogo.setImageResource(logo);
+  }
+}

+ 161 - 0
app/src/main/res/layout/activity_login.xml

@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout 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"
+    tools:context=".activity.LoginActivity">
+
+    <LinearLayout
+        android:layout_width="420dp"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_centerVertical="true"
+        android:background="@drawable/shape"
+        android:orientation="vertical"
+        android:weightSum="6">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="70dp">
+
+            <ImageView
+                android:id="@+id/ivLogo"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginTop="0dp"
+                android:paddingLeft="50dp"
+                android:paddingTop="20dp"
+                android:paddingRight="50dp"
+                android:paddingBottom="10dp" />
+            <!--android:src="@mipmap/ci"-->
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="120dp"
+            android:orientation="vertical"
+            android:padding="10dp"
+            android:weightSum="3">
+
+            <EditText
+                android:id="@+id/etId"
+                style="@style/EditTextStyle"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+
+                android:layout_marginRight="10dp"
+                android:layout_marginBottom="10dp"
+                android:layout_weight="1"
+                android:background="@drawable/shape"
+                android:hint="@string/idHint"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                app:theme="@style/EditTextStyle" />
+
+            <!--<EditText-->
+            <!--android:id="@+id/etPw"-->
+            <!--style="@style/EditTextStyle"-->
+            <!--android:layout_width="match_parent"-->
+            <!--android:layout_height="wrap_content"-->
+            <!--android:layout_marginLeft="10dp"-->
+            <!--android:layout_marginRight="10dp"-->
+            <!--android:layout_marginBottom="10dp"-->
+            <!--android:layout_weight="1"-->
+            <!--android:background="@drawable/shape"-->
+            <!--android:hint="@string/passwdHint"-->
+            <!--android:paddingLeft="10dp"-->
+            <!--android:paddingRight="10dp"-->
+            <!--android:singleLine="true"-->
+            <!--android:inputType="textPassword"-->
+            <!--app:theme="@style/EditTextStyle" />-->
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="22dp"
+                android:layout_marginLeft="10dp"
+                android:layout_marginRight="10dp"
+                android:layout_weight="1"
+                android:orientation="horizontal"
+                android:weightSum="10">
+
+                <EditText
+                    android:id="@+id/etPasswd"
+                    style="@style/EditTextStyle"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_weight="3"
+                    android:background="@drawable/shape"
+                    android:hint="@string/certPwdHint"
+                    android:inputType="textPassword"
+                    android:paddingLeft="10dp"
+                    android:paddingRight="10dp"
+                    android:singleLine="true"
+                    app:theme="@style/EditTextStyle" />
+
+                <RelativeLayout
+                    android:id="@+id/certCheckLayout"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_weight="7">
+
+                    <LinearLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_centerHorizontal="true"
+                        android:layout_centerVertical="true"
+                        android:orientation="horizontal">
+
+                        <!--<android.support.v7.widget.AppCompatCheckBox-->
+                        <CheckBox
+                            android:id="@+id/certCheck"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center"
+                            android:background="@android:color/transparent"
+                            android:buttonTint="@color/black"
+                            android:text="@string/certficate" />
+
+<!--                        <TextView-->
+<!--                            android:id="@+id/certTv"-->
+<!--                            android:layout_width="wrap_content"-->
+<!--                            android:layout_height="wrap_content"-->
+<!--                            android:layout_gravity="center"-->
+<!--                            android:text="@string/certficate"-->
+<!--                            android:textSize="18sp" />-->
+
+                    </LinearLayout>
+                </RelativeLayout>
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <Button
+                android:id="@+id/btnLogin"
+                style="?android:attr/borderlessButtonStyle"
+                android:layout_width="match_parent"
+                android:layout_height="40dp"
+                android:layout_marginLeft="20dp"
+                android:layout_marginRight="20dp"
+                android:layout_marginBottom="20dp"
+                android:background="@drawable/ripple"
+
+                android:text="@string/login"
+                android:textColor="@color/white"
+                android:textSize="20sp" />
+
+            <!--android:background="?android:attr/selectableItemBackground"-->
+        </RelativeLayout>
+
+    </LinearLayout>
+
+
+</RelativeLayout>

+ 3 - 0
app/src/main/res/values/colors.xml

@@ -5,6 +5,9 @@
     <color name="colorAccent">#D81B60</color>
 
     <color name="black">#000000</color>
+    <color name="white">#FFFFFF</color>
     <color name="darkGray">#aaaaaa</color>
     <color name="commonColor">#1380d7</color>
+    <color name="transparentColor">@android:color/transparent</color>
+    <color name="loginBtnColor">#00AC98</color>
 </resources>

+ 7 - 0
app/src/main/res/values/strings.xml

@@ -1,3 +1,10 @@
 <resources>
     <string name="app_name">knuh_consent</string>
+    
+    <string name="idHint">아이디</string>
+    <string name="certPwdHint">인증서 패스워드</string>
+    <string name="pwdHint">패스워드</string>
+    <string name="certficate">인증적용</string>
+    <string name="login">로그인</string>
+
 </resources>

+ 9 - 0
app/src/main/res/values/styles.xml

@@ -18,4 +18,13 @@
         <item name="buttonTint">@drawable/radio_button_selector</item>
     </style>
 
+    <style name="EditTextStyle" parent="Widget.AppCompat.EditText">
+        <item name="colorControlNormal">@color/transparentColor</item>
+        <item name="colorControlActivated">@color/transparentColor</item>
+        <item name="android:textCursorDrawable">@color/black</item>
+        <item name="android:textColor">@color/black</item>
+        <!--<item name="android:textColorHint">@color/darkGray</item>-->
+        <!--<item name="android:textColorHighlight">@color/transparentColor</item>-->
+    </style>
+
 </resources>