Ver Fonte

优化体验

詹子聪 há 5 anos atrás
pai
commit
679181e6dc

+ 6 - 1
app/build.gradle

@@ -41,6 +41,11 @@ android {
             // todo 正式上线
             buildConfigField("String", "BASE_URL", '"http://app.jianjie.life:11111/"')
         }
+
+        company {
+            // 开发2
+            buildConfigField("String", "BASE_URL", '"http://10.16.0.184:8080/"')
+        }
     }
 
     buildTypes {
@@ -100,7 +105,7 @@ dependencies {
     //implementation 'com.makeramen:roundedimageview:2.3.0'
 
     // 文字对齐
-    implementation 'me.codeboy.android:align-text-view:2.3.2'
+    //implementation 'me.codeboy.android:align-text-view:2.3.2'
 }
 repositories {
     mavenCentral()

+ 1 - 1
app/src/main/java/com/itant/shibei/base/ApiService.java

@@ -57,7 +57,7 @@ public interface ApiService {
 
     /**根据关键字分页查询京东商品*/
     @GET("/shibei/api/getGoodsListByKeyword")
-    Observable<BaseResponse<List<GoodsBean>>> getGoodsListByKeyword(@Query("keyword") String keyword, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);
+    Observable<BaseResponse<List<GoodsBean>>> getGoodsListByKeyword(@Query("keywords") String keyword, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);
 
     /**根据链接查询京东商品*/
     //@GET("/shibei/api/getGoodsByUrl")

+ 2 - 0
app/src/main/java/com/itant/shibei/ui/home/search/SearchActivity.java

@@ -114,6 +114,8 @@ public class SearchActivity extends BaseBeiActivity implements View.OnClickListe
                 }
                 showLoading();
                 mCurrentPage = PAGE_START;
+                mGoodsList.clear();
+                mAdapter.notifyDataSetChanged();
                 mIsRefresh = true;
                 searchPresenter.searchByKeyword(mKeyword, mCurrentPage, PAGE_SIZE);
                 break;

Diff do ficheiro suprimidas por serem muito extensas
+ 2 - 2
app/src/main/res/layout/fragment_about.xml


+ 25 - 18
app/src/main/res/layout/item_template.xml

@@ -2,7 +2,7 @@
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/rl_template"
     android:layout_width="match_parent"
-    android:layout_height="@dimen/height_cover"
+    android:layout_height="wrap_content"
     android:background="@color/gray_divider_light"
     android:foreground="@drawable/selectable_item_background"
     android:padding="@dimen/width_stroke"
@@ -10,24 +10,31 @@
     android:layout_marginEnd="@dimen/margin_s"
     android:layout_marginTop="@dimen/margin_sss">
 
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <ImageView
+            android:id="@+id/iv_template"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/height_cover"
+            android:src="@mipmap/logo_gray"
+            android:scaleType="centerCrop" />
+
+        <TextView
+            android:id="@+id/tv_template"
+            android:layout_below="@+id/iv_template"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="bottom"
+            android:background="@color/black_light_transparent"
+            android:gravity="center"
+            android:paddingTop="@dimen/margin_ss"
+            android:paddingBottom="@dimen/margin_ss"
+            android:textColor="@color/white_slight"
+            android:textSize="@dimen/text_s"
+            android:layout_alignParentBottom="true"/>
+    </RelativeLayout>
 
 
-    <ImageView
-        android:id="@+id/iv_template"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:src="@mipmap/logo_gray"
-        android:scaleType="centerCrop" />
 
-    <TextView
-        android:id="@+id/tv_template"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_gravity="bottom"
-        android:background="@color/black_light_transparent"
-        android:gravity="center"
-        android:paddingTop="@dimen/margin_ss"
-        android:paddingBottom="@dimen/margin_ss"
-        android:textColor="@color/white_slight"
-        android:textSize="@dimen/text_s" />
 </FrameLayout>

+ 1 - 1
app/src/main/res/values/colors.xml

@@ -33,7 +33,7 @@
 
     <color name="black">#000000</color>
     <color name="black_light">#252525</color>
-    <color name="black_light_transparent">#851B1B1B</color>
+    <color name="black_light_transparent">#941B1B1B</color>
     <color name="black_dark">#1b1b1b</color>
     <color name="black_standard">#333333</color>
     <color name="black_title">#5F6267</color>

+ 1 - 1
app/src/main/res/values/dimens.xml

@@ -66,7 +66,7 @@
     <dimen name="height_sliding_tab">48dp</dimen>
     <dimen name="height_edit_text_s">32dp</dimen>
     <dimen name="height_edit_text_search">36dp</dimen>
-    <dimen name="height_cover">192dp</dimen>
+    <dimen name="height_cover">144dp</dimen>
     <dimen name="height_tool_bar">52dp</dimen>
 
     <dimen name="width_indicator">25dp</dimen>

+ 5 - 0
network/build.gradle

@@ -37,6 +37,11 @@ android {
             // todo 正式上线
             buildConfigField("String", "BASE_URL", '"http://app.jianjie.life:11111/"')
         }
+
+        company {
+            // 开发2
+            buildConfigField("String", "BASE_URL", '"http://10.16.0.184:8080/"')
+        }
     }
 }