Explorar el Código

Merge remote-tracking branch 'origin/sheep_develop' into sheep_develop

# Conflicts:
#	app/build.gradle
zengjiebin hace 7 años
padre
commit
688e4401db

+ 2 - 0
app/build.gradle

@@ -286,6 +286,8 @@ dependencies {
     implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.2'
 
     implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
+
+    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
     //有米科技
     implementation(name: 'YoumiSdk_v8.3.0_2018-09-20', ext: 'aar')
 }

+ 7 - 0
app/src/main/AndroidManifest.xml

@@ -738,6 +738,13 @@
         <!-- 搜索界面 -->
         <activity
             android:name=".ui.activity.SearchActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoTitleBar.AlphaStatusBar"
+            android:windowSoftInputMode="stateHidden" />
+        <!-- 签到 -->
+        <activity
+            android:name=".ui.activity.SignActivity"
             android:screenOrientation="portrait"
             android:theme="@style/AppTheme.NoTitleBar.AlphaStatusBar" />
     </application>

+ 10 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -7,6 +7,7 @@ import android.content.ClipData;
 import android.content.ClipboardManager;
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.Build;
@@ -95,6 +96,7 @@ import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.ui.activity.SearchActivity;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sunfusheng.marqueeview.MarqueeView;
@@ -353,7 +355,11 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
                 popupWindow.dismiss();
             }
         });
+    }
 
+    @OnClick(R.id.to_search_but)
+    public void toSearchActivity() {
+        startActivity(new Intent(getActivity(), SearchActivity.class));
     }
 
     /**
@@ -607,6 +613,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         CommonUtil.getInstance().initUrlConfigByNet(null, null);
         isShowRedPackage();
     }
+
     private HomeListEntity ymHomeListEty;
 
 
@@ -789,8 +796,9 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         });
         RefreshUtil.newInstance().publicParameterRefresh(refresh, activity);
     }
+
     private void notifyDataSetChanged() {
-        if(refresh != null) {
+        if (refresh != null) {
             refresh.finishRefresh();
             refresh.finishLoadMore();
         }
@@ -1319,7 +1327,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
 
     @Override
     public void onPause() {
-        if(titleCardLayout != null){
+        if (titleCardLayout != null) {
             titleCardLayout.setVisibility(View.GONE);
         }
         super.onPause();

+ 26 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SearchActivity.java

@@ -1,8 +1,16 @@
 package com.sheep.jiuyan.samllsheep.ui.activity;
 
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.ui.base.BaseActivity;
 
+import butterknife.BindView;
+import butterknife.OnClick;
+
 /**
  * Created by: zhoujuncai.
  * Created date: 2018/10/30.
@@ -10,6 +18,15 @@ import com.sheep.jiuyan.samllsheep.ui.base.BaseActivity;
  */
 public class SearchActivity extends BaseActivity {
 
+    @BindView(R.id.search_but_back)
+    ImageView searchButBack;
+    @BindView(R.id.search_input_txt)
+    EditText searchInputTxt;
+    @BindView(R.id.search_but_search)
+    TextView searchButSearch;
+    @BindView(R.id.search_bar)
+    LinearLayout searchBar;
+
     @Override
     protected int onLayout() {
         return R.layout.activity_search;
@@ -29,4 +46,13 @@ public class SearchActivity extends BaseActivity {
     protected void onData() {
 
     }
+
+    @OnClick(R.id.search_but_back)
+    public void onSearchButBackClicked() {
+        this.finish();
+    }
+
+    @OnClick(R.id.search_but_search)
+    public void onSearchButSearchClicked() {
+    }
 }

+ 32 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/activity/SignActivity.java

@@ -0,0 +1,32 @@
+package com.sheep.jiuyan.samllsheep.ui.activity;
+
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.ui.base.BaseActivity;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/31.
+ * Description: 签到
+ */
+public class SignActivity extends BaseActivity {
+
+    @Override
+    protected int onLayout() {
+        return R.layout.activity_sign;
+    }
+
+    @Override
+    protected void onObject() {
+
+    }
+
+    @Override
+    protected void onView() {
+
+    }
+
+    @Override
+    protected void onData() {
+
+    }
+}

+ 25 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/adapter/SearchAdapter.java

@@ -0,0 +1,25 @@
+package com.sheep.jiuyan.samllsheep.ui.adapter;
+
+import android.support.annotation.Nullable;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+
+import java.util.List;
+
+/**
+ * Created by: zhoujuncai.
+ * Created date: 2018/10/31.
+ * Description: 搜索列表适配器
+ */
+public class SearchAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
+
+    public SearchAdapter(int layoutResId, @Nullable List<Object> data) {
+        super(layoutResId, data);
+    }
+
+    @Override
+    protected void convert(BaseViewHolder helper, Object item) {
+
+    }
+}

+ 0 - 40
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/base/BaseActivity.java

@@ -1,15 +1,10 @@
 package com.sheep.jiuyan.samllsheep.ui.base;
 
 import android.annotation.SuppressLint;
-import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.LayoutRes;
 import android.support.annotation.Nullable;
-import android.view.View;
-import android.view.Window;
-import android.view.WindowManager;
 
-import com.sheep.jiuyan.samllsheep.R;
 import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
 
 import butterknife.ButterKnife;
@@ -28,7 +23,6 @@ public abstract class BaseActivity extends RxAppCompatActivity {
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        alphaStatusBar();
         setContentView(onLayout());
         unbinder = ButterKnife.bind(this);
         onObject();
@@ -37,40 +31,6 @@ public abstract class BaseActivity extends RxAppCompatActivity {
     }
 
     /**
-     * 初始化透明状态栏,透明导航栏
-     */
-    private void alphaStatusBar() {
-        Window window = getWindow();
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
-                    | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
-            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
-                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
-                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
-                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
-            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
-            window.setStatusBarColor(getResources().getColor(R.color.app_translucent));
-            window.setNavigationBarColor(getResources().getColor(R.color.app_translucent));
-        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
-            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
-        }
-    }
-
-    @Override
-    public void onWindowFocusChanged(boolean hasFocus) {
-        super.onWindowFocusChanged(hasFocus);
-        if (hasFocus && Build.VERSION.SDK_INT >= 19) {
-            View decorView = getWindow().getDecorView();
-            decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
-                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
-                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
-                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
-                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
-        }
-    }
-
-    /**
      * 初始化布局
      *
      * @return 返回布局资源id

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/ui/base/BaseFragment.java

@@ -26,7 +26,7 @@ public abstract class BaseFragment extends RxFragment {
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
         View view = inflater.inflate(onLayout(), container, false);
-        unbinder = ButterKnife.bind(view);
+        unbinder = ButterKnife.bind(this, view);
         onObject();
         onView();
         onData();

+ 5 - 0
app/src/main/res/drawable/shape_input_background_radius.xml

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

+ 5 - 0
app/src/main/res/drawable/shape_main_search_bar_radius.xml

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

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

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners
+        android:bottomLeftRadius="25dp"
+        android:topLeftRadius="25dp" />
+    <gradient
+        android:endColor="#0060FB"
+        android:startColor="#51C2FE" />
+</shape>

+ 52 - 3
app/src/main/res/layout/activity_search.xml

@@ -1,9 +1,58 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="#ffffff"
     tools:context=".ui.activity.SearchActivity">
 
-</android.support.constraint.ConstraintLayout>
+    <LinearLayout
+        android:id="@+id/search_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true"
+        android:gravity="center"
+        android:orientation="horizontal"
+        android:padding="5dp">
+
+        <ImageView
+            android:id="@+id/search_but_back"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:contentDescription="@string/image_des"
+            android:padding="10dp"
+            android:src="@drawable/narrow_back_black" />
+
+        <EditText
+            android:id="@+id/search_input_txt"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="8dp"
+            android:layout_marginRight="8dp"
+            android:layout_weight="1"
+            android:background="@drawable/shape_input_background_radius"
+            android:hint="@string/search_hint_txt"
+            android:inputType="text"
+            android:paddingLeft="5dp"
+            android:paddingRight="5dp"
+            android:textColor="#666666"
+            android:textColorHint="#aaaaaa"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/search_but_search"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:paddingLeft="8dp"
+            android:paddingRight="8dp"
+            android:text="@string/search_but_text" />
+    </LinearLayout>
+
+    <android.support.v7.widget.RecyclerView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/search_bar"
+        android:layout_alignParentStart="true" />
+
+</RelativeLayout>

+ 47 - 0
app/src/main/res/layout/activity_sign.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:id="@+id/title_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="#ffffff"
+        android:gravity="center_vertical"
+        android:paddingLeft="16dp"
+        android:paddingRight="16dp">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:contentDescription="@string/image_des"
+            android:padding="10dp"
+            android:src="@drawable/narrow_back_black" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:gravity="center"
+            android:text="签到"
+            android:textColor="#333333"
+            android:textSize="17sp" />
+    </RelativeLayout>
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/title_bar"
+        android:layout_alignParentEnd="true"
+        android:layout_marginTop="15dp"
+        android:background="@drawable/shape_round_rect_bg"
+        android:gravity="center"
+        android:paddingLeft="15dp"
+        android:paddingTop="5dp"
+        android:paddingRight="15dp"
+        android:paddingBottom="5dp"
+        android:text="活动规则"
+        android:textColor="#ffffff"
+        android:textSize="12sp" />
+</RelativeLayout>

+ 30 - 0
app/src/main/res/layout/homepage_act_layout.xml

@@ -5,6 +5,7 @@
     android:layout_height="match_parent"
     android:background="@color/white"
     android:clipChildren="true">
+
     <com.scwang.smartrefresh.layout.SmartRefreshLayout
         android:id="@+id/refresh"
         android:layout_width="match_parent"
@@ -175,4 +176,33 @@
     <include
         layout="@layout/view_float_title_card"
         android:visibility="visible" />
+
+    <LinearLayout
+        android:id="@+id/to_search_but"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true"
+        android:layout_marginLeft="10dp"
+        android:layout_marginTop="@dimen/nav_title_size"
+        android:layout_marginRight="10dp"
+        android:background="@drawable/shape_main_search_bar_radius"
+        android:gravity="center"
+        android:orientation="horizontal"
+        android:padding="10dp">
+
+        <TextView
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="@string/search_hint_txt"
+            android:textColor="#666666"
+            android:textSize="12sp" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/search_but_text"
+            android:textColor="#666666"
+            android:textSize="14sp" />
+    </LinearLayout>
 </RelativeLayout>

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

@@ -109,4 +109,7 @@
 
     <string name="change_login_ing">登录授权中&#8230;</string>
     <string name="default_game_act_name">万圣节\n抽奖活动</string>
+    <string name="image_des">icon</string>
+    <string name="search_but_text">搜索</string>
+    <string name="search_hint_txt">搜索任务名称/游戏名称</string>
 </resources>