浏览代码

[공통][Common] 소프트키 있을경우 판별, 패딩 추가

Hasemi 7 年之前
父节点
当前提交
eefe025704

+ 11 - 9
app/src/main/java/kr/co/zumo/app/lifeplus/activity/ActivityBase.java

@@ -9,6 +9,7 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.support.annotation.CallSuper;
 import android.support.annotation.IntDef;
+import android.support.design.widget.CoordinatorLayout;
 import android.support.v7.app.AppCompatActivity;
 import android.util.Log;
 import android.view.KeyCharacterMap;
@@ -16,7 +17,6 @@ import android.view.KeyEvent;
 import android.view.View;
 
 import com.bumptech.glide.Glide;
-import com.githang.statusbar.StatusBarCompat;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -80,19 +80,20 @@ public abstract class ActivityBase extends AppCompatActivity {
     Log.w("APP# ActivityBase | onCreate", "| >> " + this.getClass().getSimpleName() + " HC: " + this.hashCode());
     if (hasLayout()) {
       setContentView(R.layout.activity_main);
-
       //resize screen in full screen
       //AndroidBug5497Workaround.assistActivity(this);
 
-//      //소프트키 있을 경우 판별하여 레이아웃 조절
-//      if(hasNavBar(this , ((CoordinatorLayout)findViewById(R.id.layout_container)))){
-//        findViewById(R.id.layout_container).setPadding(0, 0, 0, ResourceUtil.getSoftKeyHeight());
-//      }
-      findViewById(R.id.layout_app_bar).setPadding(0, ResourceUtil.getStatusBarHeightManual(), 0, 0);
+      // TODO: 소프트키 있을경우 판별하여 레이아웃 패딩 추가, 추후 수정예정 
+      //소프트키 있을 경우 판별하여 레이아웃 조절
+      if (hasNavBar(this, ((CoordinatorLayout) findViewById(R.id.layout_container)))) {
+        findViewById(R.id.layout_container).setPadding(0, 0, 0, ResourceUtil.getSoftKeyHeight());
+      }
+      findViewById(R.id.layout_app_bar).setPadding(0, ResourceUtil.getStatusBarHeight(), 0, 0);
+
+//      StatusBarCompat.setStatusBarColor(this, getResources().getColor(R.color.C80FFFFFF));
+//      StatusBarCompat.setTranslucent(getWindow(), true);
 
-      StatusBarCompat.setStatusBarColor(this, getResources().getColor(R.color.C80FFFFFF));
 
-      //StatusBarCompat.setTranslucent(getWindow(), true);
       /*
          setting helpers
        */
@@ -339,6 +340,7 @@ public abstract class ActivityBase extends AppCompatActivity {
     boolean hasHomeKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_HOME);
     return (!(hasBackKey && hasHomeKey));
   }
+
 }
 
 

+ 0 - 1
app/src/main/res/layout/activity_main.xml

@@ -5,7 +5,6 @@
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
-  android:fitsSystemWindows="true"
   android:layout_height="match_parent"
   android:background="@color/CFFFFFF"
   android:orientation="vertical">

+ 1 - 0
app/src/main/res/layout/contents_listicle_cover.xml

@@ -11,6 +11,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:src="@color/CC4C4C4"
+    tools:src="@drawable/banner_bg_1"
     android:scaleType="centerCrop"
     app:layout_constraintBottom_toBottomOf="parent"
     app:layout_constraintEnd_toEndOf="parent"