Commit 1ca679e0724c8471b087524ff747707fe7f96387

Authored by 陶汉栋
1 parent 6f7b175c

no message

Showing 35 changed files with 1100 additions and 437 deletions   Show diff stats
.gitignore
... ... @@ -7,3 +7,4 @@
7 7 /build
8 8 /captures
9 9 .externalNativeBuild
  10 +app/release/app-release.apk
... ...
app/build.gradle
1 1 apply plugin: 'com.android.application'
2 2  
3 3 android {
  4 + signingConfigs {
  5 + config {
  6 + keyAlias 'key0'
  7 + keyPassword '123456'
  8 + storeFile file('E:/parentwork/app/parent.jks')
  9 + storePassword '123456'
  10 + }
  11 + }
4 12 compileSdkVersion 26
5 13 defaultConfig {
6 14 applicationId "com.shunzhi.parent"
... ... @@ -14,6 +22,7 @@ android {
14 22 release {
15 23 minifyEnabled false
16 24 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  25 + signingConfig signingConfigs.config
17 26 }
18 27 }
19 28 }
... ... @@ -28,5 +37,5 @@ dependencies {
28 37 androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
29 38 implementation project(':mvpsdk')
30 39 implementation project(':roundedimageview-2.2.1')
31   -
  40 + implementation files('libs/AMap_Location_V3.8.0_20180201.jar')
32 41 }
... ...
app/libs/AMap_Location_V3.8.0_20180201.jar 0 → 100644
No preview for this file type
app/parent.jks 0 → 100644
No preview for this file type
app/release/output.json 0 → 100644
... ... @@ -0,0 +1 @@
  1 +[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.shunzhi.parent","split":"","minSdkVersion":"16"}}]
0 2 \ No newline at end of file
... ...
app/src/main/AndroidManifest.xml
... ... @@ -2,17 +2,27 @@
2 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 3 package="com.shunzhi.parent">
4 4  
  5 + <!-- 用于进行网络定位 -->
  6 + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  7 + <!-- 用于访问GPS定位 -->
  8 + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
5 9 <uses-permission android:name="android.permission.GET_TASKS" />
6   - <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
  10 + <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
7 11 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
8 12 <!-- Android 6.0版本可去除,用于选举信息(通道复用)的同步 -->
9 13 <uses-permission android:name="android.permission.WRITE_SETTINGS" />
10 14 <!-- 进行网络访问和网络状态监控相关的权限声明 -->
11 15 <uses-permission android:name="android.permission.INTERNET" />
  16 + <!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
12 17 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  18 + <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
13 19 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  20 + <!-- 用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
  21 + <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
14 22 <!-- 允许对sd卡进行读写操作 -->
15 23 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  24 + <!-- 用于申请调用A-GPS模块 -->
  25 + <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
16 26 <!-- 网络库使用,当网络操作时需要确保事务完成不被杀掉 -->
17 27 <uses-permission android:name="android.permission.WAKE_LOCK" />
18 28 <!-- 用于读取手机硬件信息等,用于机型过滤 -->
... ... @@ -31,10 +41,9 @@
31 41 <uses-permission android:name="android.permission.VIBRATE" />
32 42 <!-- 允许task重排序 -->
33 43 <uses-permission android:name="android.permission.REORDER_TASKS" />
34   -
35   -
36   -
37   -
  44 + <!-- 用于申请获取蓝牙信息进行室内定位 -->
  45 + <uses-permission android:name="android.permission.BLUETOOTH" />
  46 + <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
38 47  
39 48 <application
40 49 android:name=".AppContext"
... ... @@ -45,6 +54,16 @@
45 54 android:supportsRtl="true"
46 55 android:theme="@style/Theme.AppCompat.Light.NoActionBar">
47 56  
  57 + <!-- 高德地图服务 -->
  58 + <service android:name="com.amap.api.location.APSService" />
  59 + <!-- 高德地图密钥 -->
  60 + <!-- <meta-data -->
  61 + <!-- android:name="com.amap.api.v2.apikey" -->
  62 + <!-- android:value="0da7965006ae0c8e4106c76c1867d976"/> -->
  63 + <meta-data
  64 + android:name="com.amap.api.v2.apikey"
  65 + android:value="1d130afb822d8a1019e6592cbaf10bcc" />
  66 +
48 67 <activity android:name=".ui.MainActivity">
49 68 <intent-filter>
50 69 <action android:name="android.intent.action.MAIN" />
... ... @@ -52,14 +71,15 @@
52 71 <category android:name="android.intent.category.LAUNCHER" />
53 72 </intent-filter>
54 73 </activity>
55   - <!--<activity android:name=".ui.activity.LoginAndRegistActivity" />-->
56   - <activity android:name=".ui.activity.StartActivity"></activity>
57   - <activity android:name=".ui.activity.LoginAndRegistActivity"
58   - android:screenOrientation="portrait"
59   - />
60   - <activity android:name=".ui.activity.MyChildActivity"
61   - android:screenOrientation="portrait"
62   - />
  74 + <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" /> -->
  75 + <activity android:name=".ui.activity.StartActivity" />
  76 + <activity
  77 + android:name=".ui.activity.LoginAndRegistActivity"
  78 + android:screenOrientation="portrait" />
  79 + <activity
  80 + android:name=".ui.activity.MyChildActivity"
  81 + android:screenOrientation="portrait" />
  82 + <activity android:name=".ui.activity.consult.ConsultOneLevelActivity"></activity>
63 83 </application>
64 84  
65 85 </manifest>
66 86 \ No newline at end of file
... ...
app/src/main/java/com/shunzhi/parent/AppContext.java
1 1 package com.shunzhi.parent;
2 2  
  3 +import android.content.Intent;
  4 +import android.util.Log;
  5 +
  6 +import com.amap.api.location.AMapLocation;
  7 +import com.amap.api.location.AMapLocationClient;
  8 +import com.amap.api.location.AMapLocationClientOption;
  9 +import com.amap.api.location.AMapLocationListener;
3 10 import com.share.mvpsdk.global.GlobalApplication;
  11 +import com.amap.api.location.AMapLocationClientOption.AMapLocationMode;
4 12  
5 13 /**
6 14 * Created by Administrator on 2018/3/7 0007.
... ... @@ -9,17 +17,108 @@ import com.share.mvpsdk.global.GlobalApplication;
9 17 public class AppContext extends GlobalApplication {
10 18 private static AppContext appContext;
11 19  
  20 + public final static int LOCATION_CITYNAME=0x00;
  21 +
  22 + public String cityName="";
  23 +
  24 + public static AppContext getInstance() {
  25 + return appContext;
  26 + }
  27 +
  28 + //声明AMapLocationClient类对象
  29 + public AMapLocationClient mLocationClient = null;
  30 +
  31 + //声明AMapLocationClientOption对象
  32 + public AMapLocationClientOption mLocationOption=null;
12 33  
13 34 @Override
14 35 public void onCreate() {
15 36 appContext=this;
16 37 super.onCreate();
  38 + //开启地图地位
  39 + initMapLocal();
17 40 }
18 41  
19   - public static AppContext getInstance() {
20   - return appContext;
  42 + private void initMapLocal() {
  43 + //初始化定位
  44 + mLocationClient = new AMapLocationClient(getApplicationContext());
  45 +//设置定位回调监听
  46 + mLocationClient.setLocationListener(mLocationListener);
  47 +
  48 + //初始化AMapLocationClientOption对象
  49 + mLocationOption = new AMapLocationClientOption();
  50 + /**
  51 + * 设置定位场景,目前支持三种场景(签到、出行、运动,默认无场景)
  52 + */
  53 + mLocationOption.setLocationPurpose(AMapLocationClientOption.AMapLocationPurpose.SignIn);
  54 + //设置定位模式为AMapLocationMode.Hight_Accuracy,高精度模式。
  55 + mLocationOption.setLocationMode(AMapLocationMode.Hight_Accuracy);
  56 + //设置定位模式为AMapLocationMode.Battery_Saving,低功耗模式。
  57 +// mLocationOption.setLocationMode(AMapLocationMode.Battery_Saving);
  58 + //设置定位模式为AMapLocationMode.Device_Sensors,仅设备模式。
  59 +// mLocationOption.setLocationMode(AMapLocationMode.Device_Sensors);
  60 +
  61 + //设置定位间隔,单位毫秒,默认为2000ms,最低1000ms。
  62 + mLocationOption.setInterval(1000);
  63 + //设置是否允许模拟位置,默认为true,允许模拟位置
  64 + mLocationOption.setMockEnable(true);
  65 + //单位是毫秒,默认30000毫秒,建议超时时间不要低于8000毫秒。
  66 + mLocationOption.setHttpTimeOut(20000);
  67 + //关闭缓存机制
  68 + mLocationOption.setLocationCacheEnable(false);
  69 + if (null!=mLocationClient)
  70 + mLocationClient.setLocationOption(mLocationOption);
  71 + //启动定位
  72 + startLocation();
  73 +
  74 + }
  75 +
  76 + public void startLocation(){
  77 + //启动定位
  78 + if (null!=mLocationClient){
  79 +// mLocationClient.setLocationOption(mLocationOption);
  80 + //设置场景模式后最好调用一次stop,再调用start以保证场景模式生效
  81 + stopLocation();
  82 + mLocationClient.startLocation();
  83 + }else initMapLocal();
  84 + }
  85 +
  86 + public void stopLocation(){
  87 + if (null!=mLocationClient)mLocationClient.stopLocation();
  88 + }
  89 +
  90 + public void destoryLocation(){
  91 + if (null!=mLocationClient)mLocationClient.onDestroy();
21 92 }
22 93  
  94 + //声明定位回调监听器
  95 + public AMapLocationListener mLocationListener = new AMapLocationListener() {
  96 + @Override
  97 + public void onLocationChanged(AMapLocation aMapLocation) {
  98 + if(null!=aMapLocation){
  99 +
  100 + if (aMapLocation.getErrorCode()==0){
  101 + cityName=aMapLocation.getCity();
  102 + Log.d("mlocation:","handler="+handler);
  103 + Intent intent=new Intent();
  104 + intent.setAction(LOCATION_CITYNAME+"");
  105 + sendBroadcast(intent);
  106 + stopLocation();
  107 + }else {
  108 + Log.d("mlocation:","errorCode="+aMapLocation.getErrorCode()+"errorInfo="+aMapLocation.getErrorInfo());
  109 + cityName="定位失败";
  110 + }
  111 +
  112 + }
  113 + }
  114 + };
23 115  
  116 + @Override
  117 + public void onLowMemory() {
  118 + super.onLowMemory();
  119 + //设置定位模式为AMapLocationMode.Battery_Saving,低功耗模式。
  120 + mLocationOption.setLocationMode(AMapLocationMode.Battery_Saving);
  121 +
  122 + }
24 123  
25 124 }
... ...
app/src/main/java/com/shunzhi/parent/bean/GrallyBean.java 0 → 100644
... ... @@ -0,0 +1,29 @@
  1 +package com.shunzhi.parent.bean;
  2 +
  3 +import android.view.Gravity;
  4 +
  5 +import java.io.Serializable;
  6 +
  7 +/**
  8 + * Created by ToaHanDong on 2018/3/10.
  9 + */
  10 +
  11 +public class GrallyBean implements Serializable{
  12 +
  13 + public GrallyBean(String imgUrl,String imgTitle){
  14 + this.imgUrl=imgUrl;
  15 + this.imgTitle=imgTitle;
  16 + }
  17 +
  18 + public String imgUrl;
  19 +
  20 + public String imgTitle;
  21 +
  22 + @Override
  23 + public String toString() {
  24 + return "GrallyBean{" +
  25 + "imgUrl='" + imgUrl + '\'' +
  26 + ", imgTitle='" + imgTitle + '\'' +
  27 + '}';
  28 + }
  29 +}
... ...
app/src/main/java/com/shunzhi/parent/ui/MainActivity.java
... ... @@ -9,15 +9,15 @@ import android.view.MenuItem;
9 9  
10 10 import com.share.mvpsdk.base.activity.BaseCompatActivity;
11 11 import com.share.mvpsdk.helper.BottomNavigationViewHelper;
  12 +import com.share.mvpsdk.utils.PermissionUtils;
  13 +import com.shunzhi.parent.AppContext;
12 14 import com.shunzhi.parent.R;
13 15 import com.shunzhi.parent.ui.fragment.CePingFragment;
14 16 import com.shunzhi.parent.ui.fragment.ConsultFragment;
15 17 import com.shunzhi.parent.ui.fragment.MineFragment;
16 18 import com.shunzhi.parent.ui.fragment.ReportFragment;
17 19  
18   -import butterknife.BindView;
19   -
20   -public class MainActivity extends BaseCompatActivity {
  20 +public class MainActivity extends BaseCompatActivity implements PermissionUtils.PermissionGrant {
21 21  
22 22 BottomNavigationView bottom_navigationView;
23 23  
... ... @@ -37,7 +37,7 @@ public class MainActivity extends BaseCompatActivity {
37 37  
38 38 @Override
39 39 protected void initView(Bundle savedInstanceState) {
40   -
  40 + PermissionUtils.requestMultiPermissions(this, this);
41 41 bottom_navigationView = findViewById(R.id.bottom_navigationView);
42 42  
43 43 BottomNavigationViewHelper.disableShiftMode(bottom_navigationView);
... ... @@ -104,4 +104,14 @@ public class MainActivity extends BaseCompatActivity {
104 104 return R.layout.activity_main;
105 105 }
106 106  
  107 + @Override
  108 + protected void onDestroy() {
  109 + super.onDestroy();
  110 + AppContext.getInstance().destoryLocation();
  111 + }
  112 +
  113 + @Override
  114 + public void onPermissionGranted(int requestCode) {
  115 +
  116 + }
107 117 }
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultOneLevelActivity.java 0 → 100644
... ... @@ -0,0 +1,60 @@
  1 +package com.shunzhi.parent.ui.activity.consult;
  2 +
  3 +import android.content.Context;
  4 +import android.content.Intent;
  5 +import android.support.v7.app.AppCompatActivity;
  6 +import android.os.Bundle;
  7 +import android.view.View;
  8 +import android.widget.EditText;
  9 +import android.widget.ImageView;
  10 +import android.widget.TextView;
  11 +
  12 +import com.share.mvpsdk.base.activity.BaseCompatActivity;
  13 +import com.shunzhi.parent.R;
  14 +
  15 +public class ConsultOneLevelActivity extends BaseCompatActivity implements View.OnClickListener{
  16 +
  17 +
  18 + public static void getInstance(Context context){
  19 + Intent intent=new Intent(context,ConsultOneLevelActivity.class);
  20 + context.startActivity(intent);
  21 + }
  22 +
  23 + TextView tvLocalAddress;
  24 +
  25 + EditText et_search;
  26 +
  27 + ImageView ivSearch;
  28 + @Override
  29 + protected void initView(Bundle savedInstanceState) {
  30 +
  31 + initViews();
  32 +
  33 + }
  34 +
  35 + private void initViews() {
  36 +
  37 + tvLocalAddress=findViewById(R.id.tvLocalAddress);
  38 + et_search=findViewById(R.id.et_search);
  39 + ivSearch=findViewById(R.id.ivSearch);
  40 +
  41 + ivSearch.setOnClickListener(this);
  42 + tvLocalAddress.setBackgroundResource(R.drawable.back);
  43 + tvLocalAddress.setText("");
  44 +
  45 + }
  46 +
  47 + @Override
  48 + protected int getLayoutId() {
  49 + return R.layout.activity_consult_one_level;
  50 + }
  51 +
  52 + @Override
  53 + public void onClick(View view) {
  54 + switch (view.getId()){
  55 + case R.id.ivSearch:
  56 +
  57 + break;
  58 + }
  59 + }
  60 +}
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/CePingFragment.java
1 1 package com.shunzhi.parent.ui.fragment;
2 2  
  3 +import android.content.BroadcastReceiver;
  4 +import android.content.Context;
  5 +import android.content.Intent;
  6 +import android.content.IntentFilter;
3 7 import android.os.Bundle;
4 8 import android.support.annotation.NonNull;
5 9 import android.support.annotation.Nullable;
  10 +import android.support.design.widget.FloatingActionButton;
6 11 import android.view.View;
7 12 import android.widget.FrameLayout;
8 13 import android.widget.ImageView;
... ... @@ -10,12 +15,12 @@ import android.widget.TextView;
10 15  
11 16 import com.share.mvpsdk.base.BasePresenter;
12 17 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  18 +import com.share.mvpsdk.utils.ToastUtils;
  19 +import com.shunzhi.parent.AppContext;
13 20 import com.shunzhi.parent.R;
14 21 import com.shunzhi.parent.views.TextAndImgShowView;
15 22  
16   -import butterknife.OnClick;
17   -
18   -public class CePingFragment extends BaseMVPCompatFragment {
  23 +public class CePingFragment extends BaseMVPCompatFragment implements View.OnClickListener{
19 24  
20 25 TextView tvLocalAddress;
21 26  
... ... @@ -25,6 +30,8 @@ public class CePingFragment extends BaseMVPCompatFragment {
25 30  
26 31 FrameLayout frame_hot1;
27 32  
  33 + FloatingActionButton floatingActionButton;
  34 +
28 35 @Override
29 36 public int getLayoutId() {
30 37 return R.layout.fragment_ce_ping;
... ... @@ -41,7 +48,7 @@ public class CePingFragment extends BaseMVPCompatFragment {
41 48 textAndImg_xqjc=view.findViewById(R.id.textAndImg_xqjc);
42 49 textAndImg_zxlx=view.findViewById(R.id.textAndImg_zxlx);
43 50 frame_hot1=view.findViewById(R.id.frame_hot1);
44   -
  51 + floatingActionButton=view.findViewById(R.id.floatingActionButton);
45 52  
46 53 textAndImg1.setTextColor(R.color.textColor);
47 54 textAndImg1.setText("高校直通");
... ... @@ -72,6 +79,36 @@ public class CePingFragment extends BaseMVPCompatFragment {
72 79 textAndImg_zxlx.setTextColor(R.color.white);
73 80 textAndImg_zxlx.setImgs(R.drawable.zxlx,R.drawable.zxlx);
74 81 textAndImg_zxlx.setSelect(true);
  82 +
  83 + initListeners(view);
  84 + floatingActionButton.setRippleColor(getResources().getColor(R.color.white));
  85 + }
  86 +
  87 + @Override
  88 + public void onResume() {
  89 + super.onResume();
  90 + }
  91 +
  92 + private void initListeners(View view) {
  93 + view.findViewById(R.id.frame_hot1).setOnClickListener(this);
  94 + view.findViewById(R.id.frame_hot2).setOnClickListener(this);
  95 + view.findViewById(R.id.frame_hot3).setOnClickListener(this);
  96 + tvLocalAddress.setOnClickListener(this);
  97 + textAndImg1.setOnClickListener(this);
  98 + textAndImg2.setOnClickListener(this);
  99 + textAndImg3.setOnClickListener(this);
  100 + textAndImg4.setOnClickListener(this);
  101 + ivCamera.setOnClickListener(this);
  102 +
  103 + initBroadCast();
  104 + }
  105 +
  106 + private void initBroadCast() {
  107 +
  108 + IntentFilter intentFilter=new IntentFilter();
  109 + intentFilter.addAction(AppContext.LOCATION_CITYNAME+"");
  110 + getActivity().registerReceiver(broadcastReceiver,intentFilter);
  111 +
75 112 }
76 113  
77 114 @NonNull
... ... @@ -80,19 +117,52 @@ public class CePingFragment extends BaseMVPCompatFragment {
80 117 return null;
81 118 }
82 119  
83   - @OnClick({R.id.frame_hot1,R.id.frame_hot2,R.id.frame_hot3})
84   - void click(View view){
  120 +
  121 + @Override
  122 + public void onClick(View view) {
85 123 switch (view.getId()){
86 124 case R.id.frame_hot1://热门课程
87   -
  125 + ToastUtils.showToast("remen1");
88 126 break;
89 127 case R.id.frame_hot2:
90   -
  128 + ToastUtils.showToast("remen2");
91 129 break;
92 130 case R.id.frame_hot3:
  131 + ToastUtils.showToast("remen3");
  132 + break;
  133 + case R.id.tvLocalAddress:
  134 + AppContext.getInstance().startLocation();
  135 + break;
  136 + case R.id.textAndImg1:
  137 +
  138 + break;
  139 + case R.id.textAndImg2:
  140 +
  141 + break;
  142 + case R.id.textAndImg3:
93 143  
94 144 break;
  145 + case R.id.textAndImg4:
  146 +
  147 + break;
  148 + case R.id.ivCamera:
  149 + ToastUtils.showToast("功能暂未上线");
  150 + break;
95 151 }
96 152 }
97 153  
  154 + private BroadcastReceiver broadcastReceiver=new BroadcastReceiver() {
  155 + @Override
  156 + public void onReceive(Context context, Intent intent) {
  157 + if (intent.getAction().equals(AppContext.LOCATION_CITYNAME+"")){
  158 + tvLocalAddress.setText(AppContext.getInstance().cityName);
  159 + }
  160 + }
  161 + };
  162 +
  163 + @Override
  164 + public void onDestroy() {
  165 + super.onDestroy();
  166 + if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver);
  167 + }
98 168 }
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
1 1 package com.shunzhi.parent.ui.fragment;
2 2  
  3 +import android.content.BroadcastReceiver;
  4 +import android.content.Context;
  5 +import android.content.Intent;
  6 +import android.content.IntentFilter;
3 7 import android.os.Bundle;
  8 +import android.os.Handler;
  9 +import android.os.Message;
4 10 import android.support.annotation.NonNull;
5 11 import android.support.annotation.Nullable;
6   -import android.support.v4.app.Fragment;
7   -import android.view.LayoutInflater;
  12 +import android.util.Log;
8 13 import android.view.View;
9   -import android.view.ViewGroup;
10 14 import android.widget.ImageView;
  15 +import android.widget.TextView;
11 16  
12 17 import com.bumptech.glide.Glide;
13 18 import com.share.mvpsdk.base.BasePresenter;
14 19 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  20 +import com.shunzhi.parent.AppContext;
15 21 import com.shunzhi.parent.R;
  22 +import com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity;
16 23 import com.shunzhi.parent.views.TextAndImgShowView;
17 24 import com.stx.xhb.xbanner.XBanner;
18 25  
... ... @@ -22,16 +29,22 @@ import java.io.InputStream;
22 29 import java.util.ArrayList;
23 30 import java.util.List;
24 31  
25   -public class ConsultFragment extends BaseMVPCompatFragment {
  32 +import cn.jzvd.JZVideoPlayerStandard;
  33 +
  34 +public class ConsultFragment extends BaseMVPCompatFragment implements View.OnClickListener {
26 35  
27 36 ImageView ivSearch;
28 37  
29   - TextAndImgShowView textAndImg1,textAndImg2,textAndImg3,textAndImg4;
  38 + TextAndImgShowView textAndImg1, textAndImg2, textAndImg3, textAndImg4;
30 39  
31 40 XBanner xBanner;
32 41  
33 42 List<String> imgesUrl = new ArrayList<>();
34 43  
  44 + JZVideoPlayerStandard videoplayer;
  45 +
  46 + TextView tvLocalAddress;
  47 +
35 48 @Override
36 49 public int getLayoutId() {
37 50 return R.layout.fragment_zi_xun;
... ... @@ -40,39 +53,58 @@ public class ConsultFragment extends BaseMVPCompatFragment {
40 53 @Override
41 54 public void initUI(View view, @Nullable Bundle savedInstanceState) {
42 55  
43   - ivSearch=view.findViewById(R.id.ivSearch);
44   - textAndImg1=view.findViewById(R.id.textAndImg1);
45   - textAndImg2=view.findViewById(R.id.textAndImg2);
46   - textAndImg3=view.findViewById(R.id.textAndImg3);
47   - textAndImg4=view.findViewById(R.id.textAndImg4);
48   - xBanner=view.findViewById(R.id.xBanner);
  56 + ivSearch = view.findViewById(R.id.ivSearch);
  57 + textAndImg1 = view.findViewById(R.id.textAndImg1);
  58 + textAndImg2 = view.findViewById(R.id.textAndImg2);
  59 + textAndImg3 = view.findViewById(R.id.textAndImg3);
  60 + textAndImg4 = view.findViewById(R.id.textAndImg4);
  61 + xBanner = view.findViewById(R.id.xBanner);
  62 + videoplayer = view.findViewById(R.id.videoplayer);
  63 + tvLocalAddress = view.findViewById(R.id.tvLocalAddress);
  64 +
  65 + videoplayer.batteryLevel.setVisibility(View.GONE);
  66 + videoplayer.replayTextView.setVisibility(View.GONE);
  67 + videoplayer.backButton.setVisibility(View.GONE);
49 68  
50 69 textAndImg1.setTextColor(R.color.textColor);
51 70 textAndImg1.setText("小学");
52   - textAndImg1.setImgs(R.drawable.play,R.drawable.xiaoxue);
  71 + textAndImg1.setImgs(R.drawable.play, R.drawable.xiaoxue);
53 72 textAndImg1.setSelect(true);
54 73  
55 74 textAndImg2.setTextColor(R.color.textColor);
56 75 textAndImg2.setText("中学");
57   - textAndImg2.setImgs(R.drawable.play,R.drawable.zhongxue);
  76 + textAndImg2.setImgs(R.drawable.play, R.drawable.zhongxue);
58 77 textAndImg2.setSelect(true);
59 78  
60 79 textAndImg3.setTextColor(R.color.textColor);
61 80 textAndImg3.setText("高中");
62   - textAndImg3.setImgs(R.drawable.play,R.drawable.gaozhong);
  81 + textAndImg3.setImgs(R.drawable.play, R.drawable.gaozhong);
63 82 textAndImg3.setSelect(true);
64 83  
65 84 textAndImg4.setTextColor(R.color.textColor);
66 85 textAndImg4.setText("家长");
67   - textAndImg4.setImgs(R.drawable.play,R.drawable.parent);
  86 + textAndImg4.setImgs(R.drawable.play, R.drawable.parent);
68 87 textAndImg4.setSelect(true);
69 88  
70 89 initBanners();
  90 +
  91 + initBroadCast();
  92 +
  93 + initListeners();
  94 + }
  95 +
  96 + private void initListeners() {
  97 + textAndImg1.setOnClickListener(this);
  98 + textAndImg2.setOnClickListener(this);
  99 + textAndImg3.setOnClickListener(this);
  100 + textAndImg4.setOnClickListener(this);
  101 + ivSearch.setOnClickListener(this);
  102 + tvLocalAddress.setOnClickListener(this);
71 103 }
72 104  
73 105 private void initBanners() {
74 106  
75   - InputStream inputStream=getClass().getResourceAsStream("/assets/banners.png");
  107 + InputStream inputStream = getClass().getResourceAsStream("/assets/banners.png");
76 108 try {
77 109 imgesUrl.add(new String(InputStreamToByte(inputStream)));
78 110 imgesUrl.add(new String(InputStreamToByte(inputStream)));
... ... @@ -80,8 +112,8 @@ public class ConsultFragment extends BaseMVPCompatFragment {
80 112 imgesUrl.add(new String(InputStreamToByte(inputStream)));
81 113 } catch (IOException e) {
82 114 e.printStackTrace();
83   - }
84   - xBanner.setData(imgesUrl,null);
  115 + }
  116 + xBanner.setData(imgesUrl, null);
85 117 xBanner.setmAdapter(new XBanner.XBannerAdapter() {
86 118 @Override
87 119 public void loadBanner(XBanner banner, Object model, View view, int position) {
... ... @@ -121,4 +153,52 @@ public class ConsultFragment extends BaseMVPCompatFragment {
121 153 super.onStop();
122 154 xBanner.stopAutoPlay();
123 155 }
  156 +
  157 + @Override
  158 + public void onClick(View view) {
  159 + switch (view.getId()) {
  160 + case R.id.tvLocalAddress:
  161 + AppContext.getInstance().startLocation();
  162 + break;
  163 + case R.id.textAndImg1:
  164 + ConsultOneLevelActivity.getInstance(getActivity());
  165 + break;
  166 + case R.id.textAndImg2:
  167 + ConsultOneLevelActivity.getInstance(getActivity());
  168 + break;
  169 + case R.id.textAndImg3:
  170 + ConsultOneLevelActivity.getInstance(getActivity());
  171 + break;
  172 + case R.id.textAndImg4:
  173 + ConsultOneLevelActivity.getInstance(getActivity());
  174 + break;
  175 + case R.id.ivSearch://搜索按钮
  176 +
  177 + break;
  178 + }
  179 + }
  180 +
  181 +
  182 + private void initBroadCast() {
  183 +
  184 + IntentFilter intentFilter = new IntentFilter();
  185 + intentFilter.addAction(AppContext.LOCATION_CITYNAME + "");
  186 + getActivity().registerReceiver(broadcastReceiver, intentFilter);
  187 +
  188 + }
  189 +
  190 + private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
  191 + @Override
  192 + public void onReceive(Context context, Intent intent) {
  193 + if (intent.getAction().equals(AppContext.LOCATION_CITYNAME + "")) {
  194 + tvLocalAddress.setText(AppContext.getInstance().cityName);
  195 + }
  196 + }
  197 + };
  198 +
  199 + @Override
  200 + public void onDestroy() {
  201 + super.onDestroy();
  202 + if (null!=broadcastReceiver)getActivity().unregisterReceiver(broadcastReceiver);
  203 + }
124 204 }
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
... ... @@ -3,21 +3,34 @@ package com.shunzhi.parent.ui.fragment;
3 3 import android.content.Context;
4 4 import android.net.Uri;
5 5 import android.os.Bundle;
  6 +import android.support.annotation.NonNull;
  7 +import android.support.annotation.Nullable;
6 8 import android.support.v4.app.Fragment;
7 9 import android.view.LayoutInflater;
8 10 import android.view.View;
9 11 import android.view.ViewGroup;
10 12  
  13 +import com.share.mvpsdk.base.BasePresenter;
  14 +import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
11 15 import com.shunzhi.parent.R;
12 16  
13   -public class ReportFragment extends Fragment {
  17 +public class ReportFragment extends BaseMVPCompatFragment {
  18 +
14 19  
15 20 @Override
16   - public View onCreateView(LayoutInflater inflater, ViewGroup container,
17   - Bundle savedInstanceState) {
18   - // Inflate the layout for this fragment
19   - return inflater.inflate(R.layout.fragment_report, container, false);
  21 + public int getLayoutId() {
  22 + return R.layout.fragment_report;
20 23 }
21 24  
  25 + @Override
  26 + public void initUI(View view, @Nullable Bundle savedInstanceState) {
  27 +
  28 + }
22 29  
  30 +
  31 + @NonNull
  32 + @Override
  33 + public BasePresenter initPresenter() {
  34 + return null;
  35 + }
23 36 }
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java 0 → 100644
... ... @@ -0,0 +1,162 @@
  1 +package com.shunzhi.parent.ui.fragment.consult;
  2 +
  3 +import android.content.Context;
  4 +import android.net.Uri;
  5 +import android.os.Bundle;
  6 +import android.support.annotation.NonNull;
  7 +import android.support.annotation.Nullable;
  8 +import android.support.v4.app.Fragment;
  9 +import android.support.v7.widget.LinearLayoutManager;
  10 +import android.support.v7.widget.RecyclerView;
  11 +import android.util.Log;
  12 +import android.view.LayoutInflater;
  13 +import android.view.View;
  14 +import android.view.ViewGroup;
  15 +import android.widget.ImageView;
  16 +import android.widget.TextView;
  17 +
  18 +import com.bumptech.glide.Glide;
  19 +import com.share.mvpsdk.base.BasePresenter;
  20 +import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter;
  21 +import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder;
  22 +import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  23 +import com.share.mvpsdk.utils.ToastUtils;
  24 +import com.shunzhi.parent.AppContext;
  25 +import com.shunzhi.parent.R;
  26 +import com.shunzhi.parent.bean.GrallyBean;
  27 +import com.shunzhi.parent.views.TextAndImgShowView;
  28 +
  29 +import java.io.ByteArrayOutputStream;
  30 +import java.io.IOException;
  31 +import java.io.InputStream;
  32 +import java.util.ArrayList;
  33 +import java.util.List;
  34 +
  35 +public class ConsultOneLevelFragment extends BaseMVPCompatFragment implements View.OnClickListener {
  36 +
  37 + TextAndImgShowView textAndImg1, textAndImg2, textAndImg3, textAndImg4;
  38 +
  39 + RecyclerView recyclerViewGrally;
  40 +
  41 + MyGrallyAdapter myGrallyAdapter = null;
  42 +
  43 + List<GrallyBean> grallyBeanList = new ArrayList<>();
  44 +
  45 + @Override
  46 + public int getLayoutId() {
  47 + return R.layout.fragment_consult_one_level;
  48 + }
  49 +
  50 + @Override
  51 + public void initUI(View view, @Nullable Bundle savedInstanceState) {
  52 + try {
  53 + initViews(view);
  54 + } catch (Exception e) {
  55 + e.printStackTrace();
  56 + Log.d("exception:",e.toString());
  57 + }
  58 + }
  59 +
  60 + private void initRecyclerView() {
  61 + for (int i = 0; i < 4; i++) {
  62 + grallyBeanList.add(new GrallyBean(" ", "家长表示对孩子的情况更加了解"));
  63 + }
  64 + if (null == myGrallyAdapter) myGrallyAdapter = new MyGrallyAdapter();
  65 + myGrallyAdapter.addAll(grallyBeanList);
  66 + recyclerViewGrally.setAdapter(myGrallyAdapter);
  67 + }
  68 +
  69 + private void initViews(View view) {
  70 + textAndImg1 = view.findViewById(R.id.textAndImg1);
  71 + textAndImg2 = view.findViewById(R.id.textAndImg2);
  72 + textAndImg3 = view.findViewById(R.id.textAndImg3);
  73 + textAndImg4 = view.findViewById(R.id.textAndImg4);
  74 + recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally);
  75 +
  76 + textAndImg1.setTextColor(R.color.textColor);
  77 + textAndImg1.setText("政策咨询");
  78 + textAndImg1.setImgs(R.drawable.play, R.drawable.zczx);
  79 + textAndImg1.setSelect(true);
  80 +
  81 + textAndImg2.setTextColor(R.color.textColor);
  82 + textAndImg2.setText("公办/民办小学");
  83 + textAndImg2.setImgs(R.drawable.play, R.drawable.gbxx);
  84 + textAndImg2.setSelect(true);
  85 +
  86 + textAndImg3.setTextColor(R.color.textColor);
  87 + textAndImg3.setText("学校库");
  88 + textAndImg3.setImgs(R.drawable.play, R.drawable.xxk);
  89 + textAndImg3.setSelect(true);
  90 +
  91 + textAndImg4.setTextColor(R.color.textColor);
  92 + textAndImg4.setText("专题");
  93 + textAndImg4.setImgs(R.drawable.play, R.drawable.zhuanti);
  94 + textAndImg4.setSelect(true);
  95 +
  96 + textAndImg1.setOnClickListener(this);
  97 + textAndImg2.setOnClickListener(this);
  98 + textAndImg3.setOnClickListener(this);
  99 + textAndImg4.setOnClickListener(this);
  100 + initRecyclerView();
  101 + }
  102 +
  103 + @NonNull
  104 + @Override
  105 + public BasePresenter initPresenter() {
  106 + return null;
  107 + }
  108 +
  109 + @Override
  110 + public void onClick(View view) {
  111 + switch (view.getId()) {
  112 + case R.id.textAndImg1:
  113 +
  114 + break;
  115 + case R.id.textAndImg2:
  116 +
  117 + break;
  118 + case R.id.textAndImg3:
  119 +
  120 + break;
  121 + case R.id.textAndImg4:
  122 +
  123 + break;
  124 + }
  125 + }
  126 +
  127 + private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GrallyBean> {
  128 + @Override
  129 + public void onAttachedToRecyclerView(RecyclerView recyclerView) {
  130 + super.onAttachedToRecyclerView(recyclerView);
  131 + LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
  132 + linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
  133 + recyclerView.setLayoutManager(linearLayoutManager);
  134 + }
  135 +
  136 + @Override
  137 + public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  138 + View view = LayoutInflater.from(getActivity()).inflate(R.layout.item_grally, parent, false);
  139 + return new MyGrallyViewHolder(view);
  140 + }
  141 +
  142 + private class MyGrallyViewHolder extends BaseRecyclerViewHolder<GrallyBean> {
  143 +
  144 + ImageView iv_grally;
  145 + TextView tv_grally_title;
  146 +
  147 + public MyGrallyViewHolder(View itemView) {
  148 + super(itemView);
  149 + iv_grally = itemView.findViewById(R.id.iv_grally);
  150 + tv_grally_title = itemView.findViewById(R.id.tv_grally_title);
  151 + }
  152 +
  153 + @Override
  154 + public void onBindViewHolder(GrallyBean object, int position) {
  155 +// Glide.with(getActivity()).load(object.imgUrl).error(R.drawable.ic_launcher_foreground).into(iv_grally);
  156 + iv_grally.setImageResource(R.drawable.ic_launcher_background);
  157 + tv_grally_title.setText(object.imgTitle);
  158 + }
  159 + }
  160 + }
  161 +
  162 +}
... ...
app/src/main/res/drawable-xhdpi/back.png 0 → 100644

469 Bytes

app/src/main/res/drawable-xhdpi/gbxx.png 0 → 100644

4.86 KB

app/src/main/res/drawable-xhdpi/guanlianchild.png 0 → 100644

7.08 KB

app/src/main/res/drawable-xhdpi/shaixuan.png 0 → 100644

395 Bytes

app/src/main/res/drawable-xhdpi/xxk.png 0 → 100644

4.29 KB

app/src/main/res/drawable-xhdpi/zczx.png 0 → 100644

5.47 KB

app/src/main/res/drawable-xhdpi/zhuanti.png 0 → 100644

2.88 KB

app/src/main/res/layout/activity_consult_one_level.xml 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + android:orientation="vertical"
  8 + tools:context="com.shunzhi.parent.ui.activity.consult.ConsultOneLevelActivity">
  9 +
  10 + <include layout="@layout/layout_search"/>
  11 +
  12 +
  13 + <fragment
  14 + android:id="@+id/MyFragment"
  15 + android:layout_width="match_parent"
  16 + android:layout_height="match_parent"
  17 + android:name="com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment"
  18 + />
  19 +
  20 +</LinearLayout>
... ...
app/src/main/res/layout/fragment_ce_ping.xml
1   -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  1 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 2 xmlns:tools="http://schemas.android.com/tools"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
3 4 android:layout_width="match_parent"
4 5 android:layout_height="match_parent"
5 6 android:background="@color/bgColor"
6 7 android:orientation="vertical"
7 8 tools:context="com.shunzhi.parent.ui.fragment.CePingFragment">
8 9  
9   - <FrameLayout
10   - android:layout_width="match_parent"
11   - android:layout_height="?android:actionBarSize"
12   - android:background="@color/titleColor">
13   -
14   - <TextView
15   - android:id="@+id/tvLocalAddress"
16   - android:layout_width="wrap_content"
17   - android:layout_height="match_parent"
18   - android:drawablePadding="@dimen/size_dp_5"
19   - android:drawableRight="@drawable/pull"
20   - android:gravity="center"
21   - android:paddingLeft="@dimen/size_dp_15"
22   - android:text="杭州"
23   - android:textColor="@color/textColor"
24   - android:textSize="@dimen/textSize16" />
25   -
26   - <TextView
27   - style="@style/TextView_Wrap_16"
28   - android:layout_gravity="center"
29   - android:gravity="center"
30   - android:text="@string/ceping"
31   - android:textColor="@color/textColor" />
32   -
33   -
34   - <ImageView
35   - android:id="@+id/ivCamera"
36   - android:layout_width="wrap_content"
37   - android:layout_height="match_parent"
38   - android:layout_gravity="right"
39   - android:paddingLeft="@dimen/size_dp_15"
40   - android:paddingRight="@dimen/size_dp_15"
41   - android:src="@drawable/camera" />
42   -
43   - </FrameLayout>
44   -
45 10 <LinearLayout
46 11 android:layout_width="match_parent"
47   - android:layout_height="0dp"
48   - android:layout_margin="@dimen/size_dp_10"
49   - android:layout_weight="3"
50   - android:background="@drawable/shape_bg_radius8"
  12 + android:layout_height="match_parent"
51 13 android:orientation="vertical">
52 14  
  15 + <FrameLayout
  16 + android:layout_width="match_parent"
  17 + android:layout_height="?android:actionBarSize"
  18 + android:background="@color/titleColor">
  19 +
  20 + <TextView
  21 + android:id="@+id/tvLocalAddress"
  22 + android:layout_width="wrap_content"
  23 + android:layout_height="match_parent"
  24 + android:drawablePadding="@dimen/size_dp_5"
  25 + android:drawableRight="@drawable/pull"
  26 + android:gravity="center"
  27 + android:paddingLeft="@dimen/size_dp_15"
  28 + android:text="杭州"
  29 + android:textColor="@color/textColor"
  30 + android:textSize="@dimen/textSize16" />
  31 +
  32 + <TextView
  33 + style="@style/TextView_Wrap_16"
  34 + android:layout_gravity="center"
  35 + android:gravity="center"
  36 + android:text="@string/ceping"
  37 + android:textColor="@color/textColor" />
  38 +
  39 +
  40 + <ImageView
  41 + android:id="@+id/ivCamera"
  42 + android:layout_width="wrap_content"
  43 + android:layout_height="match_parent"
  44 + android:layout_gravity="right"
  45 + android:paddingLeft="@dimen/size_dp_15"
  46 + android:paddingRight="@dimen/size_dp_15"
  47 + android:src="@drawable/camera" />
  48 +
  49 + </FrameLayout>
53 50  
54   - <!--工具栏-->
55 51 <LinearLayout
56   - android:layout_marginTop="@dimen/size_dp_5"
57   - android:layout_marginBottom="@dimen/size_dp_5"
58 52 android:layout_width="match_parent"
59   - android:layout_height="wrap_content"
60   - android:orientation="horizontal"
61   - android:padding="@dimen/size_dp_10">
  53 + android:layout_height="0dp"
  54 + android:layout_margin="@dimen/size_dp_10"
  55 + android:layout_weight="3"
  56 + android:background="@drawable/shape_bg_radius8"
  57 + android:orientation="vertical">
62 58  
63   - <com.shunzhi.parent.views.TextAndImgShowView
64   - android:id="@+id/textAndImg1"
65   - android:layout_width="0dp"
66   - android:layout_height="wrap_content"
67   - android:layout_weight="1"
68   - android:background="?android:selectableItemBackground">
69 59  
70   - </com.shunzhi.parent.views.TextAndImgShowView>
  60 + <!--工具栏-->
  61 + <include layout="@layout/layout_textandimgshow"/>
71 62  
72   - <com.shunzhi.parent.views.TextAndImgShowView
73   - android:id="@+id/textAndImg2"
74   - android:layout_width="0dp"
75   - android:layout_height="wrap_content"
76   - android:layout_weight="1">
  63 + <View
  64 + android:layout_width="match_parent"
  65 + android:layout_height="0.5dp"
  66 + android:layout_marginLeft="@dimen/size_dp_5"
  67 + android:layout_marginRight="@dimen/size_dp_5"
  68 + android:background="@color/bg_gray" />
77 69  
78   - </com.shunzhi.parent.views.TextAndImgShowView>
  70 + <LinearLayout
  71 + android:layout_width="match_parent"
  72 + android:layout_height="match_parent"
  73 + android:gravity="center"
  74 + android:orientation="horizontal">
  75 +
  76 + <FrameLayout
  77 + android:id="@+id/frame_xqjc"
  78 + android:layout_width="0dp"
  79 + android:layout_height="match_parent"
  80 + android:layout_marginBottom="@dimen/size_dp_20"
  81 + android:layout_marginLeft="@dimen/size_dp_10"
  82 + android:layout_marginRight="@dimen/size_dp_5"
  83 + android:layout_marginTop="@dimen/size_dp_20"
  84 + android:layout_weight="1"
  85 + android:background="@drawable/shape_xueqing_radius8"
  86 + android:padding="@dimen/size_dp_5">
  87 +
  88 + <com.shunzhi.parent.views.TextAndImgShowView
  89 + android:id="@+id/textAndImg_xqjc"
  90 + android:layout_width="wrap_content"
  91 + android:layout_height="wrap_content"
  92 + android:layout_gravity="center"
  93 + android:src="@drawable/xqjc" />
79 94  
80   - <com.shunzhi.parent.views.TextAndImgShowView
81   - android:id="@+id/textAndImg3"
82   - android:layout_width="0dp"
83   - android:layout_height="wrap_content"
84   - android:layout_weight="1">
  95 + </FrameLayout>
85 96  
86   - </com.shunzhi.parent.views.TextAndImgShowView>
  97 + <FrameLayout
  98 + android:id="@+id/frame_zxxl"
  99 + android:layout_width="0dp"
  100 + android:layout_height="match_parent"
  101 + android:layout_marginBottom="@dimen/size_dp_20"
  102 + android:layout_marginLeft="@dimen/size_dp_5"
  103 + android:layout_marginRight="@dimen/size_dp_10"
  104 + android:layout_marginTop="@dimen/size_dp_20"
  105 + android:layout_weight="1"
  106 + android:background="@drawable/shape_zxlx_radius8"
  107 + android:padding="@dimen/size_dp_5">
  108 +
  109 + <com.shunzhi.parent.views.TextAndImgShowView
  110 + android:id="@+id/textAndImg_zxlx"
  111 + android:layout_width="wrap_content"
  112 + android:layout_height="wrap_content"
  113 + android:layout_gravity="center"
  114 + android:src="@drawable/zxlx" />
87 115  
88   - <com.shunzhi.parent.views.TextAndImgShowView
89   - android:id="@+id/textAndImg4"
90   - android:layout_width="0dp"
91   - android:layout_height="wrap_content"
92   - android:layout_weight="1">
  116 + </FrameLayout>
93 117  
94   - </com.shunzhi.parent.views.TextAndImgShowView>
  118 + </LinearLayout>
95 119  
96 120 </LinearLayout>
97 121  
98   - <View
99   - android:layout_width="match_parent"
100   - android:layout_height="0.5dp"
101   - android:layout_marginLeft="@dimen/size_dp_5"
102   - android:layout_marginRight="@dimen/size_dp_5"
103   - android:background="@color/bg_gray" />
104 122  
105 123 <LinearLayout
106 124 android:layout_width="match_parent"
107   - android:layout_height="match_parent"
108   - android:gravity="center"
109   - android:orientation="horizontal">
  125 + android:layout_height="wrap_content"
  126 + android:layout_marginLeft="@dimen/size_dp_10"
  127 + android:layout_marginRight="@dimen/size_dp_10"
  128 + android:gravity="center_vertical">
110 129  
111   - <FrameLayout
112   - android:id="@+id/frame_xqjc"
  130 + <View
113 131 android:layout_width="0dp"
  132 + android:layout_height="1dp"
114 133 android:layout_weight="1"
115   - android:layout_height="match_parent"
116   - android:layout_marginBottom="@dimen/size_dp_20"
117   - android:layout_marginRight="@dimen/size_dp_5"
118   - android:layout_marginLeft="@dimen/size_dp_10"
119   - android:layout_marginTop="@dimen/size_dp_20"
120   - android:background="@drawable/shape_xueqing_radius8"
121   - android:padding="@dimen/size_dp_20">
  134 + android:background="@color/huodong_blue"></View>
122 135  
123   - <com.shunzhi.parent.views.TextAndImgShowView
124   - android:id="@+id/textAndImg_xqjc"
125   - android:layout_width="wrap_content"
126   - android:layout_height="wrap_content"
127   - android:layout_gravity="center"
128   - android:src="@drawable/xqjc" />
  136 + <TextView
  137 + android:layout_width="wrap_content"
  138 + android:layout_height="wrap_content"
  139 + android:text="活动专栏"
  140 + android:textColor="@color/huodong_blue"
  141 + android:textSize="@dimen/textSize18"
129 142  
130   - </FrameLayout>
  143 + />
131 144  
132   - <FrameLayout
133   - android:id="@+id/frame_zxxl"
  145 + <View
134 146 android:layout_width="0dp"
  147 + android:layout_height="1dp"
135 148 android:layout_weight="1"
136   - android:layout_height="match_parent"
137   - android:layout_marginBottom="@dimen/size_dp_20"
138   - android:layout_marginLeft="@dimen/size_dp_5"
139   - android:layout_marginTop="@dimen/size_dp_20"
140   - android:background="@drawable/shape_zxlx_radius8"
141   - android:layout_marginRight="@dimen/size_dp_10"
142   - android:padding="@dimen/size_dp_20">
143   -
144   - <com.shunzhi.parent.views.TextAndImgShowView
145   - android:id="@+id/textAndImg_zxlx"
146   - android:layout_width="wrap_content"
147   - android:layout_height="wrap_content"
148   - android:layout_gravity="center"
149   - android:src="@drawable/zxlx" />
150   -
151   - </FrameLayout>
  149 + android:background="@color/huodong_blue"></View>
152 150  
153 151 </LinearLayout>
154 152  
155   - </LinearLayout>
156   -
157   -
158   - <LinearLayout
159   - android:layout_width="match_parent"
160   - android:layout_height="wrap_content"
161   - android:layout_marginLeft="@dimen/size_dp_10"
162   - android:layout_marginRight="@dimen/size_dp_10"
163   - android:gravity="center_vertical">
164   -
165   - <View
166   - android:layout_width="0dp"
167   - android:layout_height="1dp"
168   - android:layout_weight="1"
169   - android:background="@color/huodong_blue"></View>
170   -
171   - <TextView
172   - android:layout_width="wrap_content"
173   - android:layout_height="wrap_content"
174   - android:text="活动专栏"
175   - android:textColor="@color/huodong_blue"
176   - android:textSize="@dimen/textSize18"
177   -
178   - />
179   -
180   - <View
181   - android:layout_width="0dp"
182   - android:layout_height="1dp"
183   - android:layout_weight="1"
184   - android:background="@color/huodong_blue"></View>
185   -
186   - </LinearLayout>
187   -
188   - <LinearLayout
189   - android:layout_width="match_parent"
190   - android:layout_height="0dp"
191   - android:layout_margin="@dimen/size_dp_10"
192   - android:layout_weight="2">
193   -
194   - <FrameLayout
195   - android:id="@+id/frame_hot1"
196   - android:layout_width="0dp"
197   - android:layout_height="match_parent"
198   - android:layout_marginRight="@dimen/size_dp_5"
199   - android:layout_weight="1"
200   - android:background="@drawable/shape_xueqing_radius8">
201   -
202   - <LinearLayout
203   - android:layout_width="wrap_content"
204   - android:layout_height="wrap_content"
205   - android:layout_gravity="bottom|left"
206   - android:layout_marginBottom="@dimen/size_dp_5"
207   - android:layout_marginLeft="@dimen/size_dp_5"
208   - android:orientation="vertical">
209   -
210   - <TextView
211   - android:layout_width="wrap_content"
212   - android:layout_height="wrap_content"
213   - android:text="热门课程"
214   - android:textColor="@color/white"
215   - android:textSize="@dimen/textSize16" />
216   -
217   - <TextView
218   - android:layout_width="wrap_content"
219   - android:layout_height="wrap_content"
220   - android:layout_marginTop="@dimen/size_dp_5"
221   - android:background="@drawable/shape_stroke_radius4_white"
222   - android:padding="@dimen/size_dp_5"
223   - android:text="点击参与"
224   - android:textColor="@color/white"
225   - android:textSize="@dimen/textSize14" />
226   -
227   - </LinearLayout>
228   -
229   - </FrameLayout>
230   -
231 153 <LinearLayout
232   - android:layout_width="0dp"
233   - android:layout_height="match_parent"
234   - android:layout_marginLeft="@dimen/size_dp_5"
235   - android:layout_weight="1"
236   - android:orientation="vertical">
  154 + android:layout_width="match_parent"
  155 + android:layout_height="0dp"
  156 + android:layout_margin="@dimen/size_dp_10"
  157 + android:layout_weight="2">
237 158  
238 159 <FrameLayout
239   - android:id="@+id/frame_hot2"
240   - android:layout_width="match_parent"
241   - android:layout_height="0dp"
242   - android:layout_marginBottom="@dimen/size_dp_5"
  160 + android:id="@+id/frame_hot1"
  161 + android:layout_width="0dp"
  162 + android:layout_height="match_parent"
243 163 android:layout_marginRight="@dimen/size_dp_5"
244 164 android:layout_weight="1"
245 165 android:background="@drawable/shape_xueqing_radius8">
... ... @@ -273,44 +193,102 @@
273 193  
274 194 </FrameLayout>
275 195  
276   - <FrameLayout
277   - android:id="@+id/frame_hot3"
278   - android:layout_width="match_parent"
279   - android:layout_height="0dp"
280   - android:layout_marginRight="@dimen/size_dp_5"
281   - android:layout_marginTop="@dimen/size_dp_5"
  196 + <LinearLayout
  197 + android:layout_width="0dp"
  198 + android:layout_height="match_parent"
  199 + android:layout_marginLeft="@dimen/size_dp_5"
282 200 android:layout_weight="1"
283   - android:background="@drawable/shape_xueqing_radius8">
  201 + android:orientation="vertical">
284 202  
285   - <LinearLayout
286   - android:layout_width="wrap_content"
287   - android:layout_height="wrap_content"
288   - android:layout_gravity="bottom|left"
  203 + <FrameLayout
  204 + android:id="@+id/frame_hot2"
  205 + android:layout_width="match_parent"
  206 + android:layout_height="0dp"
289 207 android:layout_marginBottom="@dimen/size_dp_5"
290   - android:layout_marginLeft="@dimen/size_dp_5"
291   - android:orientation="vertical">
  208 + android:layout_marginRight="@dimen/size_dp_5"
  209 + android:layout_weight="1"
  210 + android:background="@drawable/shape_xueqing_radius8">
292 211  
293   - <TextView
  212 + <LinearLayout
294 213 android:layout_width="wrap_content"
295 214 android:layout_height="wrap_content"
296   - android:text="热门课程"
297   - android:textColor="@color/white"
298   - android:textSize="@dimen/textSize16" />
  215 + android:layout_gravity="bottom|left"
  216 + android:layout_marginBottom="@dimen/size_dp_5"
  217 + android:layout_marginLeft="@dimen/size_dp_5"
  218 + android:orientation="vertical">
  219 +
  220 + <TextView
  221 + android:layout_width="wrap_content"
  222 + android:layout_height="wrap_content"
  223 + android:text="热门课程"
  224 + android:textColor="@color/white"
  225 + android:textSize="@dimen/textSize16" />
  226 +
  227 + <TextView
  228 + android:layout_width="wrap_content"
  229 + android:layout_height="wrap_content"
  230 + android:layout_marginTop="@dimen/size_dp_5"
  231 + android:background="@drawable/shape_stroke_radius4_white"
  232 + android:padding="@dimen/size_dp_5"
  233 + android:text="点击参与"
  234 + android:textColor="@color/white"
  235 + android:textSize="@dimen/textSize14" />
  236 +
  237 + </LinearLayout>
  238 +
  239 + </FrameLayout>
  240 +
  241 + <FrameLayout
  242 + android:id="@+id/frame_hot3"
  243 + android:layout_width="match_parent"
  244 + android:layout_height="0dp"
  245 + android:layout_marginRight="@dimen/size_dp_5"
  246 + android:layout_marginTop="@dimen/size_dp_5"
  247 + android:layout_weight="1"
  248 + android:background="@drawable/shape_xueqing_radius8">
299 249  
300   - <TextView
  250 + <LinearLayout
301 251 android:layout_width="wrap_content"
302 252 android:layout_height="wrap_content"
303   - android:layout_marginTop="@dimen/size_dp_5"
304   - android:background="@drawable/shape_stroke_radius4_white"
305   - android:padding="@dimen/size_dp_5"
306   - android:text="点击参与"
307   - android:textColor="@color/white"
308   - android:textSize="@dimen/textSize14" />
309   -
310   - </LinearLayout>
311   -
312   - </FrameLayout>
  253 + android:layout_gravity="bottom|left"
  254 + android:layout_marginBottom="@dimen/size_dp_5"
  255 + android:layout_marginLeft="@dimen/size_dp_5"
  256 + android:orientation="vertical">
  257 +
  258 + <TextView
  259 + android:layout_width="wrap_content"
  260 + android:layout_height="wrap_content"
  261 + android:text="热门课程"
  262 + android:textColor="@color/white"
  263 + android:textSize="@dimen/textSize16" />
  264 +
  265 + <TextView
  266 + android:layout_width="wrap_content"
  267 + android:layout_height="wrap_content"
  268 + android:layout_marginTop="@dimen/size_dp_5"
  269 + android:background="@drawable/shape_stroke_radius4_white"
  270 + android:padding="@dimen/size_dp_5"
  271 + android:text="点击参与"
  272 + android:textColor="@color/white"
  273 + android:textSize="@dimen/textSize14" />
  274 +
  275 + </LinearLayout>
  276 +
  277 + </FrameLayout>
313 278  
  279 + </LinearLayout>
314 280 </LinearLayout>
315 281 </LinearLayout>
316   -</LinearLayout>
  282 +
  283 + <android.support.design.widget.FloatingActionButton
  284 + android:id="@+id/floatingActionButton"
  285 + android:layout_width="wrap_content"
  286 + android:layout_height="wrap_content"
  287 + android:layout_gravity="bottom|right"
  288 + android:layout_marginBottom="@dimen/size_dp_30"
  289 + android:layout_marginRight="@dimen/size_dp_30"
  290 + app:backgroundTint="@color/xueqing_blue"
  291 + app:rippleColor="@color/xueqing_blue"
  292 + android:scaleType="fitXY"
  293 + android:src="@drawable/guanlianchild" />
  294 +</FrameLayout>
... ...
app/src/main/res/layout/fragment_consult_one_level.xml 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:tools="http://schemas.android.com/tools"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical"
  6 + android:background="@color/bgColor"
  7 + tools:context="com.shunzhi.parent.ui.fragment.consult.ConsultOneLevelFragment">
  8 +
  9 + <android.support.v7.widget.RecyclerView
  10 + android:id="@+id/recyclerViewGrally"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="0dp"
  13 + android:layout_weight="1"
  14 + android:layout_marginRight="@dimen/size_dp_10"
  15 + android:layout_marginTop="@dimen/size_dp_10"
  16 + android:layout_marginLeft="@dimen/size_dp_10"
  17 + ></android.support.v7.widget.RecyclerView>
  18 +
  19 + <include layout="@layout/layout_textandimgshow"/>
  20 +
  21 + <android.support.v7.widget.RecyclerView
  22 + android:layout_width="match_parent"
  23 + android:layout_height="0dp"
  24 + android:layout_weight="3"
  25 + android:background="@color/white"
  26 + android:layout_marginLeft="@dimen/size_dp_10"
  27 + android:layout_marginRight="@dimen/size_dp_10"
  28 + ></android.support.v7.widget.RecyclerView>
  29 +
  30 +</LinearLayout>
... ...
app/src/main/res/layout/fragment_report.xml
1   -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  1 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 2 xmlns:tools="http://schemas.android.com/tools"
3 3 android:layout_width="match_parent"
4 4 android:layout_height="match_parent"
  5 + android:orientation="vertical"
5 6 tools:context="com.shunzhi.parent.ui.fragment.ReportFragment">
6 7  
7   - <!-- TODO: Update blank fragment layout -->
8   - <TextView
  8 + <FrameLayout
9 9 android:layout_width="match_parent"
10   - android:layout_height="match_parent"
11   - android:text="@string/hello_blank_fragment" />
  10 + android:layout_height="?android:actionBarSize"
  11 + android:background="@color/titleColor">
12 12  
13   -</FrameLayout>
  13 + <TextView
  14 + android:id="@+id/tvLocalAddress"
  15 + android:layout_width="wrap_content"
  16 + android:layout_height="match_parent"
  17 + android:drawablePadding="@dimen/size_dp_5"
  18 + android:drawableRight="@drawable/pull"
  19 + android:gravity="center"
  20 + android:paddingLeft="@dimen/size_dp_15"
  21 + android:text="马博晒"
  22 + android:textColor="@color/textColor"
  23 + android:textSize="@dimen/textSize16" />
  24 +
  25 + <TextView
  26 + style="@style/TextView_Wrap_16"
  27 + android:layout_gravity="center"
  28 + android:gravity="center"
  29 + android:text="2018年8月"
  30 + android:textColor="@color/textColor" />
  31 +
  32 +
  33 + <TextView
  34 + style="@style/TextView_Wrap_16"
  35 + android:layout_height="match_parent"
  36 + android:paddingRight="@dimen/size_dp_15"
  37 + android:layout_gravity="right"
  38 + android:gravity="center"
  39 + android:text="筛选"
  40 + android:drawableRight="@drawable/shaixuan"
  41 + android:drawablePadding="@dimen/size_dp_5"
  42 + android:textColor="@color/textColor" />
  43 +
  44 + </FrameLayout>
  45 +</LinearLayout>
... ...
app/src/main/res/layout/fragment_zi_xun.xml
... ... @@ -2,186 +2,88 @@
2 2 xmlns:tools="http://schemas.android.com/tools"
3 3 android:layout_width="match_parent"
4 4 android:layout_height="match_parent"
5   - android:orientation="vertical"
6 5 android:background="@color/bgColor"
  6 + android:orientation="vertical"
7 7 tools:context="com.shunzhi.parent.ui.fragment.ConsultFragment">
8 8  
9   - <LinearLayout
10   - android:layout_width="match_parent"
11   - android:layout_height="?android:actionBarSize"
12   - android:background="@color/titleColor">
13   -
14   - <TextView
15   - android:id="@+id/tvLocalAddress"
16   - android:layout_width="wrap_content"
17   - android:layout_height="match_parent"
18   - android:drawablePadding="@dimen/size_dp_5"
19   - android:drawableRight="@drawable/pull"
20   - android:gravity="center"
21   - android:paddingLeft="@dimen/size_dp_15"
22   - android:text="杭州"
23   - android:textColor="@color/textColor"
24   - android:textSize="@dimen/textSize16" />
25   -
26   - <FrameLayout
27   - android:focusableInTouchMode="true"
28   - android:focusable="true"
29   - android:layout_width="match_parent"
30   - android:layout_height="match_parent">
31   -
32   - <EditText
33   - android:layout_width="match_parent"
34   - android:layout_height="match_parent"
35   - android:background="@drawable/shape_edit_radius4_white"
36   - android:layout_margin="@dimen/size_dp_10"
37   - android:hint="请输入搜索内容"
38   - android:textSize="@dimen/textSize16"
39   - android:gravity="center"
40   - android:id="@+id/et_search"
41   - />
42   -
43   - <ImageView
44   - android:id="@+id/ivSearch"
45   - android:layout_width="wrap_content"
46   - android:layout_height="match_parent"
47   - android:layout_gravity="right"
48   - android:paddingLeft="@dimen/size_dp_15"
49   - android:paddingRight="@dimen/size_dp_15"
50   - android:src="@drawable/search_black" />
51   -
52   - </FrameLayout>
53   -
54   -
55   - </LinearLayout>
56   -
57   -<com.stx.xhb.xbanner.XBanner
58   - android:id="@+id/xBanner"
59   - android:layout_width="match_parent"
60   - android:layout_height="0dp"
61   - android:layout_weight="2"
62   - ></com.stx.xhb.xbanner.XBanner>
  9 + <include layout="@layout/layout_search"/>
63 10  
64   - <LinearLayout
65   - android:layout_margin="@dimen/size_dp_10"
66   - android:layout_marginTop="@dimen/size_dp_5"
67   - android:layout_marginBottom="@dimen/size_dp_5"
  11 + <com.stx.xhb.xbanner.XBanner
  12 + android:id="@+id/xBanner"
68 13 android:layout_width="match_parent"
69   - android:layout_height="wrap_content"
70   - android:orientation="horizontal"
71   - android:background="@color/white"
72   - android:padding="@dimen/size_dp_10">
73   -
74   - <com.shunzhi.parent.views.TextAndImgShowView
75   - android:id="@+id/textAndImg1"
76   - android:layout_width="0dp"
77   - android:layout_height="wrap_content"
78   - android:layout_weight="1"
79   - android:background="?android:selectableItemBackground">
80   -
81   - </com.shunzhi.parent.views.TextAndImgShowView>
82   -
83   - <com.shunzhi.parent.views.TextAndImgShowView
84   - android:id="@+id/textAndImg2"
85   - android:layout_width="0dp"
86   - android:layout_height="wrap_content"
87   - android:layout_weight="1">
88   -
89   - </com.shunzhi.parent.views.TextAndImgShowView>
90   -
91   - <com.shunzhi.parent.views.TextAndImgShowView
92   - android:id="@+id/textAndImg3"
93   - android:layout_width="0dp"
94   - android:layout_height="wrap_content"
95   - android:layout_weight="1">
96   -
97   - </com.shunzhi.parent.views.TextAndImgShowView>
98   -
99   - <com.shunzhi.parent.views.TextAndImgShowView
100   - android:id="@+id/textAndImg4"
101   - android:layout_width="0dp"
102   - android:layout_height="wrap_content"
103   - android:layout_weight="1">
104   -
105   - </com.shunzhi.parent.views.TextAndImgShowView>
106   -
107   - </LinearLayout>
  14 + android:layout_height="0dp"
  15 + android:layout_weight="2"></com.stx.xhb.xbanner.XBanner>
108 16  
  17 +<include layout="@layout/layout_textandimgshow"/>
109 18 <LinearLayout
110 19 android:layout_width="match_parent"
111   - android:layout_height="0dp"
112   - android:layout_weight="1"
113   - android:orientation="vertical"
114   - >
  20 + android:layout_height="wrap_content"
  21 + android:orientation="vertical">
115 22  
116 23 <TextView
117 24 android:layout_width="wrap_content"
118 25 android:layout_height="wrap_content"
119   - android:textSize="@dimen/textSize16"
120   - android:textColor="@color/xueqing_blue"
121   - android:text="@string/consult_huati"
122 26 android:layout_marginLeft="@dimen/size_dp_10"
123   - />
  27 + android:text="@string/consult_huati"
  28 + android:textColor="@color/xueqing_blue"
  29 + android:textSize="@dimen/textSize16" />
124 30  
125 31 <LinearLayout
  32 + android:layout_width="match_parent"
  33 + android:layout_height="match_parent"
126 34 android:layout_marginLeft="@dimen/size_dp_10"
127 35 android:layout_marginRight="@dimen/size_dp_10"
128   - android:background="@color/white"
129   - android:layout_width="match_parent"
130   - android:layout_height="match_parent">
  36 + android:background="@color/white">
131 37  
132 38 <LinearLayout
133 39 android:layout_width="0dp"
134 40 android:layout_height="match_parent"
135 41 android:layout_weight="4"
136 42 android:orientation="vertical"
137   - android:padding="@dimen/size_dp_5"
138   - >
  43 + android:padding="@dimen/size_dp_5">
139 44  
140 45 <TextView
  46 + android:id="@+id/tvConsultTitle"
141 47 android:layout_width="match_parent"
142   - android:layout_height="0dp"
143   - android:layout_weight="2"
  48 + android:layout_height="wrap_content"
  49 + android:ellipsize="end"
144 50 android:gravity="center_vertical"
145   - android:textColor="@color/textColor"
146   - android:textSize="@dimen/textSize14"
147   - android:text="学校初一段家长统一测试使用家长慧得到良好反馈评价"
148 51 android:maxLines="2"
149   - android:ellipsize="end"
150   - android:id="@+id/tvConsultTitle"
151   - />
  52 + android:text="学校初一段家长统一测试使用家长慧得到良好反馈评价"
  53 + android:textColor="@color/textColor"
  54 + android:textSize="@dimen/textSize14" />
  55 +
152 56 <TextView
153   - android:gravity="center_vertical"
  57 + android:id="@+id/tvConsultContent"
154 58 android:layout_width="match_parent"
155   - android:layout_height="0dp"
156   - android:layout_weight="2"
  59 + android:layout_height="wrap_content"
  60 + android:layout_marginTop="@dimen/size_dp_5"
  61 + android:ellipsize="end"
  62 + android:gravity="center_vertical"
  63 + android:maxLines="2"
157 64 android:singleLine="true"
158   - android:textColor="@color/zxlx"
159   - android:textSize="@dimen/textSize14"
160 65 android:text="家长表示对孩子学习情况更加了解"
161   - android:maxLines="2"
162   - android:ellipsize="end"
163   - android:id="@+id/tvConsultContent"
164   - />
  66 + android:textColor="@color/zxlx"
  67 + android:textSize="@dimen/textSize14" />
165 68  
166 69 <FrameLayout
167 70 android:layout_width="match_parent"
168   - android:layout_height="0dp"
169   - android:layout_weight="1"
170   - >
171   - <TextView
172   - style="@style/TextView_Wrap_16"
173   - android:textSize="@dimen/textSize14"
174   - android:text="评论:30"
175   - android:layout_gravity="center_vertical"
176   - android:id="@+id/tvPingLunNums"
177   - />
  71 + android:layout_height="wrap_content"
  72 + android:layout_marginTop="@dimen/size_dp_5">
  73 +
178 74 <TextView
  75 + android:id="@+id/tvPingLunNums"
179 76 style="@style/TextView_Wrap_16"
180   - android:textSize="@dimen/textSize14"
181   - android:text="转发:50"
182   - android:layout_gravity="right|center_vertical"
  77 + android:layout_gravity="center_vertical"
  78 + android:text="评论:30"
  79 + android:textSize="@dimen/textSize14" />
  80 +
  81 + <TextView
183 82 android:id="@+id/tvZhuanFaNums"
184   - />
  83 + style="@style/TextView_Wrap_16"
  84 + android:layout_gravity="right|center_vertical"
  85 + android:text="转发:50"
  86 + android:textSize="@dimen/textSize14" />
185 87 </FrameLayout>
186 88 </LinearLayout>
187 89  
... ... @@ -189,8 +91,7 @@
189 91 android:layout_width="0dp"
190 92 android:layout_height="match_parent"
191 93 android:layout_weight="2"
192   - android:src="@color/xueqing_blue"
193   - />
  94 + android:src="@color/xueqing_blue" />
194 95 </LinearLayout>
195 96  
196 97 </LinearLayout>
... ... @@ -199,14 +100,31 @@
199 100 <FrameLayout
200 101 android:layout_width="match_parent"
201 102 android:layout_height="0dp"
202   - android:layout_weight="2"
203 103 android:layout_margin="@dimen/size_dp_10"
204   - >
  104 + android:layout_weight="2">
  105 +
205 106 <cn.jzvd.JZVideoPlayerStandard
206 107 android:id="@+id/videoplayer"
207 108 android:layout_width="match_parent"
208   - android:layout_height="match_parent"
209   - ></cn.jzvd.JZVideoPlayerStandard>
  109 + android:layout_height="match_parent"></cn.jzvd.JZVideoPlayerStandard>
  110 +
  111 + <TextView
  112 + android:id="@+id/tvVideoTitle"
  113 + style="@style/TextView_Wrap_16"
  114 + android:layout_gravity="bottom"
  115 + android:layout_margin="@dimen/size_dp_5"
  116 + android:text="视频:关于图形工具的使用"
  117 + android:textColor="@color/white"
  118 + android:textSize="@dimen/textSize14" />
  119 +
  120 + <TextView
  121 + android:id="@+id/tvVideoPingluns"
  122 + style="@style/TextView_Wrap_16"
  123 + android:layout_gravity="right|bottom"
  124 + android:layout_margin="@dimen/size_dp_5"
  125 + android:text="评论:30"
  126 + android:textColor="@color/white"
  127 + android:textSize="@dimen/textSize14" />
210 128  
211 129 </FrameLayout>
212 130  
... ...
app/src/main/res/layout/item_grally.xml 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:layout_margin="@dimen/size_dp_10"
  6 + android:background="@color/txt_black">
  7 +
  8 +
  9 + <ImageView
  10 + android:id="@+id/iv_grally"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent"
  13 + android:scaleType="fitXY" />
  14 +
  15 + <TextView
  16 + android:id="@+id/tv_grally_title"
  17 + android:layout_width="match_parent"
  18 + android:layout_height="wrap_content"
  19 + android:layout_gravity="bottom"
  20 + android:background="@android:drawable/screen_background_light_transparent"
  21 + android:paddingBottom="@dimen/size_dp_3"
  22 + android:paddingLeft="@dimen/size_dp_10"
  23 + android:paddingTop="@dimen/size_dp_3"
  24 + android:text="撒飞洒发发"
  25 + android:textColor="@color/white"
  26 + android:textSize="@dimen/textSize16" />
  27 +
  28 +</FrameLayout>
0 29 \ No newline at end of file
... ...
app/src/main/res/layout/layout_search.xml 0 → 100644
... ... @@ -0,0 +1,48 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="?android:actionBarSize"
  5 + android:background="@color/titleColor">
  6 +
  7 + <TextView
  8 + android:id="@+id/tvLocalAddress"
  9 + android:layout_width="wrap_content"
  10 + android:layout_height="match_parent"
  11 + android:drawablePadding="@dimen/size_dp_5"
  12 + android:drawableRight="@drawable/pull"
  13 + android:gravity="center"
  14 + android:paddingLeft="@dimen/size_dp_15"
  15 + android:text="杭州"
  16 + android:textColor="@color/textColor"
  17 + android:textSize="@dimen/textSize16" />
  18 +
  19 + <FrameLayout
  20 + android:layout_width="match_parent"
  21 + android:layout_height="match_parent"
  22 + android:focusable="true"
  23 + android:focusableInTouchMode="true">
  24 +
  25 + <EditText
  26 + android:id="@+id/et_search"
  27 + android:layout_width="match_parent"
  28 + android:layout_height="match_parent"
  29 + android:layout_margin="@dimen/size_dp_10"
  30 + android:background="@drawable/shape_edit_radius4_white"
  31 + android:gravity="center"
  32 + android:hint="请输入搜索内容"
  33 + android:textSize="@dimen/textSize16" />
  34 +
  35 + <ImageView
  36 + android:id="@+id/ivSearch"
  37 + android:layout_width="wrap_content"
  38 + android:layout_height="match_parent"
  39 + android:layout_gravity="right"
  40 + android:paddingLeft="@dimen/size_dp_15"
  41 + android:background="?android:selectableItemBackground"
  42 + android:paddingRight="@dimen/size_dp_15"
  43 + android:src="@drawable/search_black" />
  44 +
  45 + </FrameLayout>
  46 +
  47 +
  48 +</LinearLayout>
0 49 \ No newline at end of file
... ...
app/src/main/res/layout/layout_textandimgshow.xml 0 → 100644
... ... @@ -0,0 +1,49 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:layout_margin="@dimen/size_dp_10"
  6 + android:layout_marginBottom="@dimen/size_dp_5"
  7 + android:layout_marginTop="@dimen/size_dp_5"
  8 + android:background="@color/white"
  9 + android:orientation="horizontal"
  10 + android:padding="@dimen/size_dp_10">
  11 +
  12 +
  13 + <com.shunzhi.parent.views.TextAndImgShowView
  14 + android:id="@+id/textAndImg1"
  15 + android:layout_width="0dp"
  16 + android:layout_height="wrap_content"
  17 + android:layout_weight="1"
  18 + android:background="?android:selectableItemBackground">
  19 +
  20 + </com.shunzhi.parent.views.TextAndImgShowView>
  21 +
  22 + <com.shunzhi.parent.views.TextAndImgShowView
  23 + android:id="@+id/textAndImg2"
  24 + android:layout_width="0dp"
  25 + android:layout_height="wrap_content"
  26 + android:layout_weight="1"
  27 + android:background="?android:selectableItemBackground">
  28 +
  29 + </com.shunzhi.parent.views.TextAndImgShowView>
  30 +
  31 + <com.shunzhi.parent.views.TextAndImgShowView
  32 + android:id="@+id/textAndImg3"
  33 + android:layout_width="0dp"
  34 + android:layout_height="wrap_content"
  35 + android:layout_weight="1"
  36 + android:background="?android:selectableItemBackground">
  37 +
  38 + </com.shunzhi.parent.views.TextAndImgShowView>
  39 +
  40 + <com.shunzhi.parent.views.TextAndImgShowView
  41 + android:id="@+id/textAndImg4"
  42 + android:layout_width="0dp"
  43 + android:layout_height="wrap_content"
  44 + android:layout_weight="1"
  45 + android:background="?android:selectableItemBackground">
  46 +
  47 + </com.shunzhi.parent.views.TextAndImgShowView>
  48 +
  49 +</LinearLayout>
0 50 \ No newline at end of file
... ...
build.gradle
... ... @@ -19,6 +19,7 @@ allprojects {
19 19 repositories {
20 20 google()
21 21 jcenter()
  22 +// maven { url 'https://jitpack.io' }
22 23 }
23 24 }
24 25  
... ...
mvpsdk/build.gradle
... ... @@ -107,4 +107,7 @@ dependencies {
107 107 //轮播图XBanner
108 108 compile 'com.xhb:xbanner:1.3.1'
109 109  
  110 + //悬浮窗
  111 +// compile 'com.github.yhaolpz:FloatWindow:1.0.8'
  112 +
110 113 }
... ...
mvpsdk/src/main/java/com/share/mvpsdk/base/activity/BaseCompatActivity.java
... ... @@ -65,6 +65,7 @@ public abstract class BaseCompatActivity extends SupportActivity {
65 65 setContentView(getLayoutId());
66 66 ButterKnife.bind(this);
67 67 // StatusBarUtils.setTransparent(this);
  68 + StatusBarUtils.setBarColor(this,getResources().getColor(R.color.titleColor));
68 69 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
69 70 initData();
70 71 initView(savedInstanceState);
... ...
mvpsdk/src/main/java/com/share/mvpsdk/utils/OkHttpExceptionUtil.java
... ... @@ -21,7 +21,6 @@ public class OkHttpExceptionUtil {
21 21 if (responseBody==null)return;
22 22 try {
23 23 JSONObject json = new JSONObject(responseBody.string());
24   - Log.d("77777",json.toString());
25 24 ToastUtils.showToast(json.optString("error"));
26 25 } catch (Exception e1) {
27 26 e1.printStackTrace();
... ...
mvpsdk/src/main/java/com/share/mvpsdk/utils/StatusBarUtils.java
... ... @@ -48,8 +48,9 @@ public class StatusBarUtils {
48 48 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {//android5.0以上设置透明效果
49 49 win.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);//清除flag,为了android5.0以上也全透明效果
50 50 //让应用的主体内容占用系统状态栏的空间
51   - int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
52   - | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
  51 +// int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
  52 +// | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
  53 + int option = View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
53 54 decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() | option);
54 55 win.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
55 56 win.setStatusBarColor(color);//设置状态栏背景色
... ...
mvpsdk/src/main/res/values/colors.xml
... ... @@ -3,6 +3,7 @@
3 3 <!-- basic -->
4 4 <!-- 主色调 -->
5 5 <color name="colorPrimary">#ffeeeeee</color>
  6 + <color name="titleColor">#C6DAFF</color>
6 7 <!-- 主题相关颜色 -->
7 8 <color name="window_background_light">#ffeeeeee</color>
8 9 <color name="window_background_dark">#ff303030</color>
... ...