Pārlūkot izejas kodu

home list layout

billyyoyo 6 gadi atpakaļ
vecāks
revīzija
1bec3f02b0

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java

@@ -49,8 +49,8 @@ public class NetModule {
     public Retrofit provideRetrofit(OkHttpClient okhttpClient) {
         Retrofit retrofit = new Retrofit.Builder()
                 .client(okhttpClient)
-                .baseUrl(SheepApp.getInstance().getConnectAddress().getAppUrl()+"v1/")
-//                .baseUrl("http://ss.17xmy.com/v1/")
+//                .baseUrl(SheepApp.getInstance().getConnectAddress().getAppUrl()+"v1/")
+                .baseUrl("http://ss.17xmy.com/v1/")
 //                .baseUrl("http://192.168.0.109:8080/v1/")
 //                .baseUrl("http://10.8.240.193:8080/v1/")
                 .addConverterFactory(StringConverterFactory.create())

+ 29 - 28
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -32,6 +32,7 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSONObject;
 import com.alipay.sdk.app.PayTask;
 import com.bumptech.glide.Glide;
+import com.kfzs.duanduan.cardview.ScreenUtil;
 import com.kfzs.duanduan.utils.ApkUtils;
 import com.mdad.sdk.mdsdk.AdManager;
 import com.mdad.sdk.mdsdk.common.AdData;
@@ -3013,32 +3014,32 @@ public class CommonUtil {
         int x = 35;
         int y = -50;
 
-        if (TestUtil.isDev()) {//测试部分
-            CharSequence copyText = StringUtils.getCopyText();
-            String copy;
-            if (copyText == null) {
-                copy = "1;0;100;35;-50";
-            } else {
-                copy = copyText.toString();
-            }
-            String[] items = copy.split(";");
-            int i = 0;
-            try {
-                int n = Integer.parseInt(items[i++]);
-                p = Integer.parseInt(items[i++]);
-                w = Integer.parseInt(items[i++]);
-                x = Integer.parseInt(items[i++]);
-                y = Integer.parseInt(items[i++]);
-                while (n != child_list.size()) {
-                    if (n > child_list.size())
-                        child_list.add(child_list.get(0));
-                    else
-                        child_list.remove(0);
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
+//        if (TestUtil.isDev()) {//测试部分
+//            CharSequence copyText = StringUtils.getCopyText();
+//            String copy;
+//            if (copyText == null) {
+//                copy = "1;0;100;35;-50";
+//            } else {
+//                copy = copyText.toString();
+//            }
+//            String[] items = copy.split(";");
+//            int i = 0;
+//            try {
+//                int n = Integer.parseInt(items[i++]);
+//                p = Integer.parseInt(items[i++]);
+//                w = Integer.parseInt(items[i++]);
+//                x = Integer.parseInt(items[i++]);
+//                y = Integer.parseInt(items[i++]);
+//                while (n != child_list.size()) {
+//                    if (n > child_list.size())
+//                        child_list.add(child_list.get(0));
+//                    else
+//                        child_list.remove(0);
+//                }
+//            } catch (Exception e) {
+//                e.printStackTrace();
+//            }
+//        }
 
         View contentView = LayoutInflater.from(activity).inflate(R.layout.pop_hom_list_tip, null, false);
         int padding = G.getRealPix(p);
@@ -3052,7 +3053,7 @@ public class CommonUtil {
         home_list_rv.setHasFixedSize(true);
         home_list_rv.setNestedScrollingEnabled(false);
         home_list_rv.setLayoutManager(manager);
-        AdpHomeList<HomeListEntity> adpHomeList = new AdpHomeList<>(R.layout.item_my_list_but2, child_list);
+        AdpHomeList<HomeListEntity> adpHomeList = new AdpHomeList<>(R.layout.item_my_list_but2, ScreenUtil.getScreenWidth(activity) / 4, child_list);
         adpHomeList.bindToRecyclerView(home_list_rv);
         adpHomeList.setOnItemClickListener((adapter, view, position) -> {
             HomeListEntity item = ListUtil.getItem(child_list, position);
@@ -3064,7 +3065,7 @@ public class CommonUtil {
         });
 
         PopupWindowUtil.showLayout(activity, new PopupWindowUtil.PopupWindowParams(contentView).setAnchor(anchor)
-                .setWidth(G.getRealPix(spanCount * w + p)).setXoff(G.getRealPix(x)).setYoff(G.getRealPix(y))
+                .setWidth(ViewGroup.LayoutParams.MATCH_PARENT).setXoff(G.getRealPix(x)).setYoff(G.getRealPix(y))
                 .setGravity(Gravity.BOTTOM).setOutsideTouchable(true).setFocusable(true));
     }
 }

+ 6 - 0
app/src/main/res/drawable/shape_black_trans_16.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="#90000000"/>
+    <corners android:radius="16dp"/>
+</shape>

+ 12 - 12
app/src/main/res/layout/item_my_list_but2.xml

@@ -40,16 +40,16 @@
         android:gravity="center"
         />
 
-    <TextView
-        android:id="@+id/my_item_tag"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentTop="true"
-        android:layout_alignParentEnd="true"
-        android:layout_marginEnd="5dp"
-        android:gravity="center"
-        android:text="试玩"
-        android:visibility="gone"
-        android:textColor="@color/black_6_3"
-        android:textSize="7sp" />
+    <!--<TextView-->
+        <!--android:id="@+id/my_item_tag"-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:layout_alignParentTop="true"-->
+        <!--android:layout_alignParentEnd="true"-->
+        <!--android:layout_marginEnd="5dp"-->
+        <!--android:gravity="center"-->
+        <!--android:text="试玩"-->
+        <!--android:visibility="gone"-->
+        <!--android:textColor="@color/black_6_3"-->
+        <!--android:textSize="7sp" />-->
 </RelativeLayout>

+ 13 - 6
app/src/main/res/layout/pop_hom_list_tip.xml

@@ -1,13 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@mipmap/bg_home_list_tip"
+    android:gravity="center"
     android:orientation="horizontal">
 
-    <android.support.v7.widget.RecyclerView
-        android:id="@+id/view_list"
-        android:layout_marginTop="10dp"
+    <LinearLayout
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
+        android:layout_height="wrap_content"
+        android:background="@drawable/shape_black_trans_16"
+        android:orientation="horizontal">
+
+        <android.support.v7.widget.RecyclerView
+            android:id="@+id/view_list"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp" />
+    </LinearLayout>
 </LinearLayout>