Browse Source

[공통][Common] 버튼 내 로딩 뷰 구현 중

Hasemi 7 years ago
parent
commit
2b470e4f0d

+ 51 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/common/ButtonLoadingView.java

@@ -0,0 +1,51 @@
+package kr.co.zumo.app.lifeplus.view.screen.common;
+
+import android.content.Context;
+import android.support.annotation.Nullable;
+import android.support.constraint.ConstraintLayout;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+
+import kr.co.zumo.app.R;
+
+/**
+ * ButtonLoadingView
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-11]   [최초 작성]
+ * @since 2019-01-11
+ */
+public class ButtonLoadingView extends ConstraintLayout {
+
+  private Context context;
+
+  public ButtonLoadingView(Context context) {
+    super(context);
+    this.context = context;
+  }
+
+  public ButtonLoadingView(Context context, @Nullable AttributeSet attrs) {
+    super(context, attrs);
+    this.context = context;
+  }
+
+  public ButtonLoadingView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+    super(context, attrs, defStyleAttr);
+    this.context = context;
+  }
+
+  public void init(){
+    LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+    View view = inflater.inflate(R.layout.circle_animation, this, false);
+    View circle = view.findViewById(R.id.loading_circle);
+    
+  }
+
+  public void setStartAlpha(float startAlpha){
+
+  }
+}

+ 9 - 0
app/src/main/res/drawable/loading_circle.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="oval">
+  <size
+    android:width="8dp"
+    android:height="8dp"/>
+  <solid
+    android:color="@color/CFFFFFF"/>
+</shape>

+ 14 - 0
app/src/main/res/layout/circle_animation.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  xmlns:tools="http://schemas.android.com/tools"
+  android:layout_width="wrap_content"
+  android:layout_height="wrap_content">
+
+  <View
+    android:id="@+id/loading_circle"
+    android:layout_width="8dp"
+    android:layout_height="8dp"
+    android:background="@drawable/loading_circle"
+    />
+</merge>