liuzhenxing1118 5 months ago
parent
commit
e547ee4746

+ 3 - 3
app/src/main/java/com/xplora/xpvideo/activity/MainActivity.java

@@ -46,7 +46,7 @@ public class MainActivity extends BaseActivity implements Listener.VideoListener
     private RelativeLayout mVideoLayout = null;
     private RelativeLayout mLoadingLayout = null;
     private RelativeLayout mInfoLayout = null;
-    private ImageView mIconView = null;
+    //private ImageView mIconView = null;
     private TextView mNameText = null;
     private TextView mHintText = null;
     private ImageButton mCancelBtn = null;
@@ -80,7 +80,7 @@ public class MainActivity extends BaseActivity implements Listener.VideoListener
         mVideoLayout = findViewById(R.id.layout_video);
         mLoadingLayout = findViewById(R.id.layout_loading);
         mInfoLayout = findViewById(R.id.layout_info);
-        mIconView = findViewById(R.id.iconIv);
+        //mIconView = findViewById(R.id.iconIv);
         mNameText = findViewById(R.id.nameTv);
         mHintText = findViewById(R.id.hintTv);
         mCancelBtn = findViewById(R.id.cancelBtn);
@@ -116,7 +116,7 @@ public class MainActivity extends BaseActivity implements Listener.VideoListener
         Log.d(TAG, "initData: VideoType:" + mVideoType + " TargetId:" + mTargetId );
         mContactBean = new DatabaseUtils().loadContact(mTargetId);
 
-        ToolsUtils.setImageView(mIconView, mContactBean.profilePath, 0, R.drawable.default_avatar);
+        //ToolsUtils.setImageView(mIconView, mContactBean.profilePath, 0, R.drawable.default_avatar);
         mNameText.setText(mContactBean.name);
         mHintText.setText(mVideoType == 0 ? R.string.invite : R.string.calling);
     }

+ 93 - 56
app/src/main/res/layout/activity_main.xml

@@ -3,7 +3,6 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="#000000"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     >
 
     <RelativeLayout
@@ -17,84 +16,122 @@
         android:id="@+id/layout_loading"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:gravity="center"
-        >
+        android:gravity="center">
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:text="@string/loading"
             android:textColor="@color/white"
             android:textSize="13sp"
-            android:textStyle="bold"
-            android:text="@string/loading"
-            />
+            android:textStyle="bold" />
     </RelativeLayout>
 
     <RelativeLayout
         android:id="@+id/layout_info"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:visibility="gone"
-        >
-        <RelativeLayout
+        android:layout_height="match_parent">
+
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="30dp"
-            >
-            <com.makeramen.roundedimageview.RoundedImageView
-                android:id="@+id/iconIv"
-                android:layout_width="30dp"
-                android:layout_height="30dp"
-                android:layout_marginStart="10dp"
-                app:riv_oval="true"
-                app:riv_corner_radius="15dp"
-                android:scaleType="centerCrop"
-                android:src="@drawable/default_avatar"
-                />
+            android:layout_marginTop="25dp"
+            android:gravity="center"
+            android:orientation="vertical">
+
             <TextView
                 android:id="@+id/nameTv"
-                android:layout_width="wrap_content"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_toEndOf="@+id/iconIv"
-                android:layout_alignTop="@+id/iconIv"
-                android:layout_marginStart="5dp"
+                android:textAlignment="center"
                 android:textColor="@color/white"
-                android:textSize="13sp"
-                android:textStyle="bold"
-                />
+                android:textSize="20sp"
+                android:textStyle="bold" />
+
             <TextView
                 android:id="@+id/hintTv"
-                android:layout_width="wrap_content"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_toEndOf="@+id/iconIv"
-                android:layout_alignBottom="@+id/iconIv"
-                android:layout_marginStart="5dp"
-                android:textColor="@color/white"
-                android:textSize="11sp"
-                android:textStyle="bold"
-                />
-        </RelativeLayout>
+                android:layout_marginTop="1dp"
+                android:textAlignment="center"
+                android:textColor="#74777D"
+                android:textSize="17sp" />
+        </LinearLayout>
 
-        <LinearLayout
-            android:id="@+id/layout_accept"
+        <RelativeLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
-            android:layout_marginBottom="20dp"
-            android:gravity="center"
-            >
-            <ImageButton
-                android:id="@+id/cancelBtn"
-                android:layout_width="50dp"
-                android:layout_height="50dp"
-                android:background="@drawable/hangup"/>
-            <ImageButton
-                android:id="@+id/answerBtn"
-                android:layout_width="50dp"
-                android:layout_height="50dp"
-                android:layout_marginStart="30dp"
-                android:background="@drawable/answer"
-                />
-        </LinearLayout>
+            android:layout_marginBottom="8dp">
+
+            <LinearLayout
+                android:id="@+id/layout_accept"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:visibility="gone">
+
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical">
+
+                    <ImageButton
+                        android:id="@+id/cancelBtn"
+                        android:layout_width="52dp"
+                        android:layout_height="52dp"
+                        android:background="@drawable/hangup" />
 
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:text="@string/btn_refuse"
+                        android:textAlignment="center"
+                        android:textColor="#FFFFFF"
+                        android:textSize="15sp" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="30dp"
+                    android:orientation="vertical">
+
+                    <ImageButton
+                        android:id="@+id/answerBtn"
+                        android:layout_width="52dp"
+                        android:layout_height="52dp"
+                        android:background="@drawable/answer" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:text="@string/btn_answer"
+                        android:textAlignment="center"
+                        android:textColor="#FFFFFF"
+                        android:textSize="15sp" />
+                </LinearLayout>
+            </LinearLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+                <ImageButton
+                    android:id="@+id/cancelBtn2"
+                    android:layout_width="52dp"
+                    android:layout_height="52dp"
+                    android:layout_centerHorizontal="true"
+                    android:background="@drawable/hangup" />
+
+                <ImageButton
+                    android:id="@+id/cameraBtn"
+                    android:layout_width="45dp"
+                    android:layout_height="45dp"
+                    android:layout_alignParentEnd="true"
+                    android:layout_centerVertical="true"
+                    android:layout_marginEnd="10dp"
+                    android:background="@drawable/hangup" />
+            </RelativeLayout>
+        </RelativeLayout>
     </RelativeLayout>
 </RelativeLayout>

+ 3 - 1
app/src/main/res/values/strings.xml

@@ -3,7 +3,9 @@
     <string name="invite">邀请你视频通话</string>
     <string name="calling">正在呼叫中</string>
     <string name="connecting">连接中…</string>
-    <string name="loading">Loading…</string>
+    <string name="btn_refuse">拒绝</string>
+    <string name="btn_answer">接听</string>
+    <string name="loading">加载中…</string>
     <string name="timeout">超时</string>
     <string name="network_error">网络错误</string>
 </resources>