Page 378 - MDP2022-2
P. 378

public  class  SplashActivity  extends  AppCompatActivity  {
            @Override
            protected  void  onCreate(Bundle  savedInstanceState)  {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_splash);

            ActionBar  actionBar  =  getSupportActionBar();
            actionBar.hide();
            //ImageView  gitImageView  =  (ImageView)  findViewById(R.id.gitImageView);
            //gitImageView.setVisibility(View.INVISIBLE);
            //Glide.with(this).load(R.drawable.Loading).into(gitImageView);

            Handler  handler  =  new  Handler();
            handler.postDelayed(new  splashHandler()  ,1500);
            }
            private  class  splashHandler  implements  Runnable  {
            @Override
            public  void  run()  {
            Intent  intent  =  new  Intent(SplashActivity.this,  LoginActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
            startActivity(intent);
            SplashActivity.this.finish();
            }
            }
            }

            MainActivity  -
            import  android.os.Bundle;
            import  android.view.WindowManager;
            import  android.webkit.WebView;
            import  android.webkit.WebViewClient;
            import  androidx.appcompat.app.ActionBar;
            import  androidx.appcompat.app.AppCompatActivity;
            public  class  MainActivity  extends  AppCompatActivity  {
            private  String  TAG  =  MainActivity.class.getSimpleName();
            private  WebView  webView  =  null;

            @Override
            protected  void  onCreate(Bundle  savedInstanceState)  {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            //타이틀바  없애기
            ActionBar  actionBar  =  getSupportActionBar();
            actionBar.hide();
            webView  =  (WebView)  findViewById(R.id.webview);
            webView.setWebViewClient(new  WebViewClient());    //  새  창  띄우기  않기
            webView.getSettings().setLoadWithOverviewMode(true);    //  WebView  화면크기에  맞추도록  설정-
            setUseWideViewPort  와  같이  써야함
            webView.getSettings().setUseWideViewPort(true);    //  wide  viewport  설정-  setLoadWithOverviewMode  와  같이
            써야함
            webView.getSettings().setSupportZoom(false);    //  줌  설정  여부
            webView.getSettings().setBuiltInZoomControls(false);    //  줌  확대/축소  버튼  여부
            webView.getSettings().setJavaScriptEnabled(true);  //  자바스크립트  사용여부
            webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);  //  javascript가window.open()을  사용할
            수  있도록  설정
            webView.getSettings().setSupportMultipleWindows(true);  //  멀티  윈도우  사용  여부
            webView.getSettings().setDomStorageEnabled(true);    //  로컬  스토리지(localStorage)  사용여부
            getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
            webView.clearCache(true);
            webView.loadUrl("https://console.firebase.google.com/project/prototype-de155/database/prototype-de155-default
            -rtdb/data");
            }
            }

            Login  Activity  -
            import  android.app.Activity;
            import  android.content.Intent;
            import  android.content.SharedPreferences;
            import  android.os.Bundle;
            import  android.view.View;
            import  android.widget.Button;
   373   374   375   376   377   378   379   380   381   382   383