合并分支
This commit is contained in:
commit
aa5177ec9d
@ -48,20 +48,8 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
productFlavors {
|
||||
sangzhuzi {
|
||||
applicationId "com.tengshisoft.cultural"
|
||||
dimension 'market'
|
||||
resValue("string", "CITY_CODE", "540200000000")
|
||||
resValue("string", "CITY_ID", "640675")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "cultural",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "640675",
|
||||
CITY_CODE : "540200000000",
|
||||
BD_KEY : "sdX2qpmzj85dEUGLS74982Gt1fFBjvS7",
|
||||
APP_NAME : "日喀则市数字文化云"]
|
||||
}
|
||||
}
|
||||
|
||||
productFlavors projectProductFlavors
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
|
||||
apply from: "${project.rootDir}/common.gradle"
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
@ -114,6 +114,6 @@ ext {
|
||||
gSmartRefreshLayoutVersion = '1.1.2'
|
||||
leonidslibVersion = '1.3.2'
|
||||
ijkPlayer = '0.8.8'
|
||||
pdfVersion='2.8.2'
|
||||
downloadVersion='1.7.7'
|
||||
pdfVersion = '2.8.2'
|
||||
downloadVersion = '1.7.7'
|
||||
}
|
@ -10,6 +10,20 @@ public class UserRegisterPostBean {
|
||||
private String phone;
|
||||
private String verificationCode;
|
||||
private String password;
|
||||
private String verifyCode;
|
||||
// {
|
||||
// "phone": "",
|
||||
// "verifyCode": ""
|
||||
// }
|
||||
|
||||
|
||||
public String getVerifyCode() {
|
||||
return verifyCode;
|
||||
}
|
||||
|
||||
public void setVerifyCode(String verifyCode) {
|
||||
this.verifyCode = verifyCode;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
|
@ -9,14 +9,11 @@ import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
*/
|
||||
public class BaseUrlApi {
|
||||
|
||||
// public static final String IP = "https://www.xzszwhy.cn/usercenter/";/* 第一版正式IP */
|
||||
// public static final String IP = "https://www.wgink.ink/usercenter/";/* 正式IP */
|
||||
// public static final String IP_URL = "http://v3.xzszwhy.cn/";/* 测试IP */
|
||||
public static final String IP_URL = "http://192.168.0.120:8081/";/* 测试IP */
|
||||
|
||||
public static final String IP_URL = "http://192.168.0.120.:8081/";/* 测试IP */
|
||||
// public static final String IP_URL = "http://v3.xzszwhy.cn/";/* 正式IP */
|
||||
|
||||
// public static final String BASE_SYSTEM_IP = "http://v3.xzszwhy.cn/xzszwhy/";
|
||||
public static final String BASE_SYSTEM_IP = "http://192.168.0.120.:8081/xzszwhy/";/*测试IP*/
|
||||
public static final String BASE_SYSTEM_IP = "http://192.168.0.120:8081/xzszwhy/";/*测试IP*/
|
||||
// public static final String BASE_SYSTEM_IP = "http://v3.xzszwhy.cn/xzszwhy/";/*正式IP*/
|
||||
|
||||
public static final String PROJECT_NAME = "app/";
|
||||
public static final String BASE_URL = BASE_SYSTEM_IP;
|
||||
@ -70,7 +67,7 @@ public class BaseUrlApi {
|
||||
// public static final String BASE_NEWS_DETAIL = "http://192.168.0.104/";//新闻
|
||||
|
||||
|
||||
public static final String BASE_NEWS_DETAIL = BASE_SYSTEM_IP;//新闻
|
||||
public static final String BASE_NEWS_DETAIL = IP_URL;//新闻
|
||||
// public static final String BASE_IMG_URL = BASE_IP + "route/file/download/true/";
|
||||
// GET /app/appversion/downloadapp/{appVersionId}
|
||||
public static final String APP_DOWNLOAD_URL = BASE_URL + "app/appversion/download/" + PathConfig.APP_VERSION_ID;
|
||||
|
@ -86,7 +86,7 @@ public interface BaseApiService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type: application/json", "Accept: application/json", "is_need_area:false"})
|
||||
@Headers({"Content-Type: application/json", "Accept: application/json", "need_area:false"})
|
||||
@GET("app/appversion/get-number/{appVersionId}")
|
||||
Observable<VersionBean> doCheckAppVersion(@Path("appVersionId") String appVersionId);
|
||||
|
||||
@ -203,7 +203,7 @@ public interface BaseApiService {
|
||||
* 通过手机号验证码
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@POST("app/register/saveregisteruser")
|
||||
@POST("app/register/phone")
|
||||
Observable<BaseSuccessBean> doRegisterUser(@Body RequestBody body);
|
||||
|
||||
/**
|
||||
@ -271,7 +271,7 @@ public interface BaseApiService {
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/dataarea/getareabyidrelease/{areaId}")
|
||||
@GET("app/area/getrelease/{areaId}")
|
||||
Observable<AreaBean> getAreaListByPid(@Path("areaId") String id);
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.sucstepsoft.cm_utils.core.retrofit_net.conver;
|
||||
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.utils.UserInfoSPUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
|
||||
@ -25,17 +24,12 @@ public class AreaInterceptor implements Interceptor {
|
||||
public okhttp3.Response intercept(Chain chain) throws IOException {
|
||||
Request originalRequest = chain.request();
|
||||
Request request;
|
||||
int cityLevel = UserLgUtils.getCityLevel();
|
||||
if (cityLevel == -1) {
|
||||
cityLevel = PathConfig.CITY_DEFAULT_LEVEL;
|
||||
}
|
||||
String areaCode = UserLgUtils.getCityCode();
|
||||
//判断是否需要添加
|
||||
List<String> baseUrlName = originalRequest.headers("is_need_area");
|
||||
List<String> baseUrlName = originalRequest.headers("need_area");
|
||||
if (baseUrlName.size() > 0) {
|
||||
//需要添加
|
||||
//判断值是什么
|
||||
if (Boolean.parseBoolean(baseUrlName.get(0))) {
|
||||
//需要添加
|
||||
HttpUrl modifiedUrl = originalRequest.url().newBuilder()
|
||||
.addPathSegment(areaCode)
|
||||
.build();
|
||||
|
@ -34,7 +34,7 @@ public class BaseFunctionAdapter extends BaseRecyclerAdapter<UserLoginBean.UseAp
|
||||
public void bindHolder(BaseFunctionHolder holder, int i) {
|
||||
if (!TextUtils.isEmpty(mData.get(i).getAppPhotoPath())) {
|
||||
Glide.with(mContext)
|
||||
.load(BaseUrlApi.BASE_URL + mData.get(i).getAppPhotoPath())
|
||||
.load(BaseUrlApi.BASE_IMG_URL + mData.get(i).getAppPhotoPath())
|
||||
.apply(new RequestOptions()
|
||||
.error(R.drawable.ic_party)
|
||||
.placeholder(R.drawable.ic_party)
|
||||
|
@ -75,6 +75,9 @@ public class BottomCancelOrderDialog extends Dialog {
|
||||
EditText etRemark = view.findViewById(R.id.et_remark);
|
||||
RecyclerView rlvReason = view.findViewById(R.id.rlv_reason);
|
||||
rlvReason.setLayoutManager(new LinearLayoutManager(context));
|
||||
if (list != null && list.size() > 0) {
|
||||
list.get(0).setCheck(true);
|
||||
}
|
||||
DicSelAdapter adapter = new DicSelAdapter(context, list);
|
||||
rlvReason.setAdapter(adapter);
|
||||
if (list != null && list.size() > 0) {
|
||||
|
@ -0,0 +1,87 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.sucstepsoft.cm_utils.R;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/4/27 - 16:40
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 加载状态view
|
||||
*/
|
||||
public class CustomStateView extends LinearLayout {
|
||||
public static final int STATE_LOAD = 0x123;//加载中
|
||||
public static final int STATE_EMPTY = 0x124;//空数据
|
||||
public static final int STATE_ERROR = 0x125;//加载失败
|
||||
public static final int STATE_SUCCESS = 0x126;//加载成功
|
||||
public static final int STATE_ERROR_NET = 0x127;//加载失败,网络错误
|
||||
public static final int STATE_SEARCH = 0x128;//搜索默认状态
|
||||
private ProgressBar mPbStateLoading;
|
||||
private ImageView mIvStateDate;
|
||||
private TextView mTvStateHint;
|
||||
|
||||
public CustomStateView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public CustomStateView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.layout_state_view, this, true);
|
||||
mPbStateLoading = view.findViewById(R.id.pb_loading);
|
||||
mIvStateDate = view.findViewById(R.id.iv_state_data);
|
||||
mTvStateHint = view.findViewById(R.id.tv_state_hint);
|
||||
setState(STATE_LOAD);
|
||||
}
|
||||
|
||||
public CustomStateView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
switch (state) {
|
||||
case STATE_LOAD://加载中
|
||||
mIvStateDate.setVisibility(View.GONE);
|
||||
mPbStateLoading.setVisibility(View.VISIBLE);
|
||||
mTvStateHint.setVisibility(View.VISIBLE);
|
||||
mTvStateHint.setText("加载中...");
|
||||
break;
|
||||
case STATE_EMPTY://没有数据
|
||||
mIvStateDate.setVisibility(View.VISIBLE);
|
||||
mIvStateDate.setBackgroundResource(R.drawable.ic_empty_data);
|
||||
mPbStateLoading.setVisibility(View.GONE);
|
||||
mTvStateHint.setVisibility(View.VISIBLE);
|
||||
mTvStateHint.setText("暂无数据");
|
||||
break;
|
||||
case STATE_ERROR:
|
||||
mIvStateDate.setVisibility(View.VISIBLE);
|
||||
mIvStateDate.setBackgroundResource(R.drawable.ic_load_error);
|
||||
mPbStateLoading.setVisibility(View.GONE);
|
||||
mTvStateHint.setVisibility(View.VISIBLE);
|
||||
mTvStateHint.setText("加载失败");
|
||||
break;
|
||||
case STATE_SUCCESS:
|
||||
mIvStateDate.setVisibility(GONE);
|
||||
mPbStateLoading.setVisibility(GONE);
|
||||
mTvStateHint.setVisibility(GONE);
|
||||
break;
|
||||
case STATE_SEARCH://搜索默认
|
||||
mIvStateDate.setVisibility(View.VISIBLE);
|
||||
mIvStateDate.setBackgroundResource(R.drawable.ic_empty_data);
|
||||
mPbStateLoading.setVisibility(View.GONE);
|
||||
mTvStateHint.setVisibility(View.VISIBLE);
|
||||
mTvStateHint.setText("请输入要搜索的内容");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Tobias Rohloff
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.sucstepsoft.cm_utils.core.widget.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.MotionEventCompat;
|
||||
|
||||
public class ViewPageWebView extends WebView {
|
||||
private boolean isScrollX = false;
|
||||
|
||||
public ViewPageWebView(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ViewPageWebView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public ViewPageWebView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (MotionEventCompat.getPointerCount(event) == 1) {
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
isScrollX = false;
|
||||
//事件由webview处理
|
||||
getParent().getParent()
|
||||
.requestDisallowInterceptTouchEvent(true);
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
//嵌套Viewpager时
|
||||
getParent().getParent()
|
||||
.requestDisallowInterceptTouchEvent(!isScrollX);
|
||||
break;
|
||||
default:
|
||||
getParent().getParent()
|
||||
.requestDisallowInterceptTouchEvent(false);
|
||||
}
|
||||
} else {
|
||||
//使webview可以双指缩放(前提是webview必须开启缩放功能,并且加载的网页也支持缩放)
|
||||
getParent().getParent().
|
||||
requestDisallowInterceptTouchEvent(true);
|
||||
}
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
//当webview滚动到边界时执行
|
||||
@Override
|
||||
protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
|
||||
super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
|
||||
isScrollX = clampedX;
|
||||
}
|
||||
}
|
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_load_error.png
Normal file
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_load_error.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
38
cm_utils/src/main/res/layout/layout_state_view.xml
Normal file
38
cm_utils/src/main/res/layout/layout_state_view.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll_state_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_loading"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading_pic" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_state_data"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@drawable/ic_empty_data" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_state_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:textColor="@color/gray_text"
|
||||
android:textSize="@dimen/text_14"
|
||||
tools:text="加载数据失败" />
|
||||
|
||||
</LinearLayout>
|
256
common.gradle
Normal file
256
common.gradle
Normal file
@ -0,0 +1,256 @@
|
||||
project.ext {
|
||||
//Android编译相关版本
|
||||
//混淆相关
|
||||
minify_enabled = false
|
||||
//渠道包
|
||||
projectProductFlavors = {
|
||||
//市一级
|
||||
city {
|
||||
applicationId "com.tengshisoft.cultural"
|
||||
dimension 'market'
|
||||
resValue("string", "CITY_CODE", "540200000000")
|
||||
resValue("string", "CITY_ID", "640675")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "cultural",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "640675",
|
||||
CITY_CODE : "540200000000",
|
||||
BD_KEY : "sdX2qpmzj85dEUGLS74982Gt1fFBjvS7",
|
||||
APP_NAME : "日喀则市数字文化云"]
|
||||
}
|
||||
//区县
|
||||
sangzhuzi {
|
||||
applicationId "com.tenlion.cultural.sangzhuzi"
|
||||
dimension 'market'
|
||||
resValue("string", "APP_CHANNEL", "sangzhuzi")
|
||||
resValue("string", "CITY_CODE", "540202000000")
|
||||
resValue("string", "CITY_ID", "640676")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "sangzhuzi",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "640676",
|
||||
CITY_CODE : "540202000000",
|
||||
BD_KEY : "ipb1ae32sNDRMbwOOpApG6bVBji9K86R",
|
||||
APP_NAME : "桑珠孜区数字文化云"]
|
||||
}
|
||||
nanmulin {
|
||||
applicationId "com.tenlion.cultural.nanmulin"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "nanmulin"
|
||||
resValue("string", "CITY_CODE", "540221000000")
|
||||
resValue("string", "CITY_ID", "640865")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "nanmulin",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "640865",
|
||||
CITY_CODE : "540221000000",
|
||||
BD_KEY : "g0G2QLpGCAFV8QKxKo5irCZDwPlCPRTQ",
|
||||
APP_NAME : "南木林县数字文化云"]
|
||||
}
|
||||
jiangzi {
|
||||
applicationId "com.tenlion.cultural.jiangzi"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "jiangzi"
|
||||
resValue("string", "CITY_CODE", "540222000000")
|
||||
resValue("string", "CITY_ID", "641029")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "jiangzi",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "641029",
|
||||
CITY_CODE : "540222000000",
|
||||
BD_KEY : "ZkcqIoGvjy8EfIwaal796KSNEWFsmObL",
|
||||
APP_NAME : "江孜县数字文化云"]
|
||||
}
|
||||
dingri {
|
||||
applicationId "com.tenlion.cultural.dingri"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "dingri"
|
||||
resValue("string", "CITY_CODE", "540223000000")
|
||||
resValue("string", "CITY_ID", "641204")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "dingri",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "641204",
|
||||
CITY_CODE : "540223000000",
|
||||
BD_KEY : "ql1MLXVWxztmqN2cdxGpe7aYdcvNdRSd",
|
||||
APP_NAME : "定日县数字文化云"]
|
||||
}
|
||||
sajia {
|
||||
applicationId "com.tenlion.cultural.sajia"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "sajia"
|
||||
resValue("string", "CITY_CODE", "540224000000")
|
||||
resValue("string", "CITY_ID", "641393")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "sajia",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "641393",
|
||||
CITY_CODE : "540224000000",
|
||||
BD_KEY : "PoMpzyP5FGptOGR4dFByXd6euQ66IDI5",
|
||||
APP_NAME : "萨迦县数字文化云"]
|
||||
}
|
||||
lazi {
|
||||
applicationId "com.tenlion.cultural.lazi"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "lazi"
|
||||
resValue("string", "CITY_CODE", "540225000000")
|
||||
resValue("string", "CITY_ID", "641512")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "lazi",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "641512",
|
||||
CITY_CODE : "540225000000",
|
||||
BD_KEY : "LYw9cxjZ6eNLQ5vFIMvmcvafENtfIG8y",
|
||||
APP_NAME : "拉孜县数字文化云"]
|
||||
}
|
||||
angren {
|
||||
applicationId "com.tenlion.cultural.angren"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "angren"
|
||||
resValue("string", "CITY_CODE", "540226000000")
|
||||
resValue("string", "CITY_ID", "641622")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "angren",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "641622",
|
||||
CITY_CODE : "540226000000",
|
||||
BD_KEY : "YGTBM02Sgut6xqT9D5lrcfeYqBhE6Ncr",
|
||||
APP_NAME : "昂仁县数字文化云"]
|
||||
}
|
||||
xietongmen {
|
||||
applicationId "com.tenlion.cultural.xietongmen"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "xietongmen"
|
||||
resValue("string", "CITY_CODE", "540227000000")
|
||||
resValue("string", "CITY_ID", "641825")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "xietongmen",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "641825",
|
||||
CITY_CODE : "540227000000",
|
||||
BD_KEY : "3Y4ZNEGjTGt9iFSHpF1r1iNdnCBxmYIg",
|
||||
APP_NAME : "谢通门县数字文化云"]
|
||||
}
|
||||
bailang {
|
||||
applicationId "com.tenlion.cultural.bailang"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "bailang"
|
||||
resValue("string", "CITY_CODE", "540228000000")
|
||||
resValue("string", "CITY_ID", "641940")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "bailang",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "641940",
|
||||
CITY_CODE : "540228000000",
|
||||
BD_KEY : "DlnhdI1CmTqBZBCRFkGdnxrDaStkQsu5",
|
||||
APP_NAME : "白朗县数字文化云"]
|
||||
}
|
||||
renbu {
|
||||
applicationId "com.tenlion.cultural.renbu"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "renbu"
|
||||
resValue("string", "CITY_CODE", "540229000000")
|
||||
resValue("string", "CITY_ID", "642063")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "renbu",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642063",
|
||||
CITY_CODE : "540229000000",
|
||||
BD_KEY : "UL2rUUtPhOq3xBBWpnDGiEuTNHLvtWuh",
|
||||
APP_NAME : "仁布县数字文化云"]
|
||||
}
|
||||
kangma {
|
||||
applicationId "com.tenlion.cultural.kangma"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "kangma"
|
||||
resValue("string", "CITY_CODE", "540230000000")
|
||||
resValue("string", "CITY_ID", "642146")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "kangma",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642146",
|
||||
CITY_CODE : "540230000000",
|
||||
BD_KEY : "kQsUL41b09E3nhtNIo2ohEKalWwhDFeV",
|
||||
APP_NAME : "康马县数字文化云"]
|
||||
}
|
||||
dingjie {
|
||||
applicationId "com.tenlion.cultural.dingjie"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "dingjie"
|
||||
resValue("string", "CITY_CODE", "540231000000")
|
||||
resValue("string", "CITY_ID", "642203")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "dingjie",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642203",
|
||||
CITY_CODE : "540231000000",
|
||||
BD_KEY : "4rGrPthpteXXbkyrQXYkbX34YQ31PpH5",
|
||||
APP_NAME : "定结县数字文化云"]
|
||||
}
|
||||
zhongba {
|
||||
applicationId "com.tenlion.cultural.zhongba"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "zhongba"
|
||||
resValue("string", "CITY_CODE", "540232000000")
|
||||
resValue("string", "CITY_ID", "642284")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "zhongba",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642284",
|
||||
CITY_CODE : "540232000000",
|
||||
BD_KEY : "HpPUfcA5QdexPDpP7QOakTFGHGGtmSQo",
|
||||
APP_NAME : "仲巴县数字文化云"]
|
||||
}
|
||||
yadong {
|
||||
applicationId "com.tenlion.cultural.yadong"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "yadong"
|
||||
resValue("string", "CITY_CODE", "540233000000")
|
||||
resValue("string", "CITY_ID", "642356")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "yadong",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642356",
|
||||
CITY_CODE : "540233000000",
|
||||
BD_KEY : "vICh5EdGtR5k2RdTaXYWoyDLBai2fVof",
|
||||
APP_NAME : "亚东县数字文化云"]
|
||||
}
|
||||
jilong {
|
||||
applicationId "com.tenlion.cultural.jilong"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "jilong"
|
||||
resValue("string", "CITY_CODE", "540234000000")
|
||||
resValue("string", "CITY_ID", "642389")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "jilong",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642389",
|
||||
CITY_CODE : "540234000000",
|
||||
BD_KEY : "1uYUV884B8jzRnQG3FlZe5484mWWBkr4",
|
||||
APP_NAME : "吉隆县数字文化云"]
|
||||
}
|
||||
nielamu {
|
||||
applicationId "com.tenlion.cultural.nielamu"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "nielamu"
|
||||
resValue("string", "CITY_CODE", "540235000000")
|
||||
resValue("string", "CITY_ID", "642437")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "nielamu",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642437",
|
||||
CITY_CODE : "540235000000",
|
||||
BD_KEY : "EZOGc1TFrNolwpiwDNWgaTIzCYQOKrk0",
|
||||
APP_NAME : "聂拉木县数字文化云"]
|
||||
}
|
||||
saga {
|
||||
applicationId "com.tenlion.cultural.saga"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "saga"
|
||||
resValue("string", "CITY_CODE", "540236000000")
|
||||
resValue("string", "CITY_ID", "642489")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "saga",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642489",
|
||||
CITY_CODE : "540236000000",
|
||||
BD_KEY : "FzlGpMenDV34XFpGWIuiO4s6Tw2otlIK",
|
||||
APP_NAME : "萨嘎县数字文化云"]
|
||||
}
|
||||
gangba {
|
||||
applicationId "com.tenlion.cultural.gangba"
|
||||
dimension 'market'
|
||||
resValue "string", "APP_CHANNEL", "gangba"
|
||||
resValue("string", "CITY_CODE", "540237000000")
|
||||
resValue("string", "CITY_ID", "642536")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "gangba",
|
||||
APP_LOGO : "@drawable/app_logo",
|
||||
CITY_ID : "642536",
|
||||
CITY_CODE : "540237000000",
|
||||
BD_KEY : "PCSYjtiOsUEBCpK5SjZ2xsBN55jqfsIl",
|
||||
APP_NAME : "岗巴县数字文化云"]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,40 +1,74 @@
|
||||
package com.tengshisoft.moduleactivity.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseDictionaryBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
import com.tengshisoft.moduleactivity.R;
|
||||
import com.tengshisoft.moduleactivity.R2;
|
||||
import com.tengshisoft.moduleijkplayer.controller.CompleteView;
|
||||
import com.tengshisoft.moduleijkplayer.controller.ErrorView;
|
||||
import com.tengshisoft.moduleijkplayer.controller.GestureView;
|
||||
import com.tengshisoft.moduleijkplayer.controller.LiveControlView;
|
||||
import com.tengshisoft.moduleijkplayer.controller.PrepareView;
|
||||
import com.tengshisoft.moduleijkplayer.controller.StandardVideoController;
|
||||
import com.tengshisoft.moduleijkplayer.controller.TitleView;
|
||||
import com.tengshisoft.moduleijkplayer.controller.VodControlView;
|
||||
import com.tengshisoft.moduleijkplayer.player.VideoView;
|
||||
import com.tengshisoft.moduleijkplayer.util.L;
|
||||
import com.tengshisoft.moduleactivity.adapter.ActivityAdapter;
|
||||
import com.tengshisoft.moduleactivity.beans.ActivityListBeans;
|
||||
import com.tengshisoft.moduleactivity.net.ApiActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 活动主页
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULEACTIVITY_ACTIVITY_MAIN)
|
||||
public class ActivityMainActivity extends BaseActivity {
|
||||
public static final int STATE_LOAD = 1234;//加载中
|
||||
public static final int STATE_ERROR = 1235;//加载失败
|
||||
public static final int STATE_SUCCESS = 1236;//加载成功
|
||||
public static final int STATE_EMPTY = 1237;//无数据
|
||||
@BindView(R2.id.rlv_content)
|
||||
RecyclerView mRlvContent;
|
||||
@BindView(R2.id.xtl_type)
|
||||
TabLayout mTlType;
|
||||
@BindView(R2.id.pb_loading)
|
||||
ProgressBar mPbLoading;
|
||||
@BindView(R2.id.iv_empty)
|
||||
ImageView mIvEmpty;
|
||||
@BindView(R2.id.tv_hint)
|
||||
TypeFaceTextView mTvHint;
|
||||
@BindView(R2.id.srl_content)
|
||||
SmartRefreshLayout mLayout;
|
||||
@BindView(R2.id.vv_player)
|
||||
VideoView mVvPlayer;
|
||||
SmartRefreshLayout mSrlContent;
|
||||
private Unbinder mBind;
|
||||
private String mStatus;
|
||||
private int mCurrentPageNo = 1;
|
||||
private Disposable mD;
|
||||
private List<ActivityListBeans.RowsBean> mDatas;
|
||||
private ActivityAdapter mAdapter;
|
||||
private int mTotalSize = 0;
|
||||
private String mCurrentType;
|
||||
private Typeface mTypeface;
|
||||
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -45,103 +79,228 @@ public class ActivityMainActivity extends BaseActivity {
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("活动主页");
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mLayout.setEnableRefresh(false);
|
||||
mLayout.setEnableLoadMore(false);
|
||||
StandardVideoController controller = new StandardVideoController(mActivity);
|
||||
controller.setEnableOrientation(true);
|
||||
PrepareView prepareView = new PrepareView(this);//准备播放界面
|
||||
ImageView thumb = prepareView.findViewById(R.id.thumb);//封面图
|
||||
Glide.with(this).load(R.drawable.ic_img_default).into(thumb);
|
||||
controller.addControlComponent(prepareView);
|
||||
prepareView.setClickStart();
|
||||
CompleteView completeView = new CompleteView(this);
|
||||
controller.addControlComponent(completeView);//自动完成播放界面
|
||||
ErrorView errorView = new ErrorView(this);
|
||||
controller.addControlComponent(errorView);//错误界面
|
||||
|
||||
TitleView titleView = new TitleView(this);//标题栏
|
||||
controller.addControlComponent(titleView);
|
||||
|
||||
//根据是否为直播设置不同的底部控制条
|
||||
boolean isLive = false;
|
||||
if (isLive) {
|
||||
controller.addControlComponent(new LiveControlView(this));//直播控制条
|
||||
} else {
|
||||
VodControlView vodControlView = new VodControlView(this);//点播控制条
|
||||
controller.addControlComponent(vodControlView);
|
||||
}
|
||||
GestureView gestureControlView = new GestureView(this);//滑动控制视图
|
||||
controller.addControlComponent(gestureControlView);
|
||||
controller.setCanChangePosition(!isLive);
|
||||
//设置标题
|
||||
titleView.setTitle("测试");
|
||||
mVvPlayer.setVideoController(controller);
|
||||
mVvPlayer.setUrl("rtmp://192.168.0.104:1935/live/device0001");
|
||||
mVvPlayer.addOnStateChangeListener(mOnStateChangeListener);
|
||||
mVvPlayer.start();
|
||||
}
|
||||
|
||||
private VideoView.OnStateChangeListener mOnStateChangeListener = new VideoView.SimpleOnStateChangeListener() {
|
||||
@Override
|
||||
public void onPlayerStateChanged(int playerState) {
|
||||
switch (playerState) {
|
||||
case VideoView.PLAYER_NORMAL://小屏
|
||||
break;
|
||||
case VideoView.PLAYER_FULL_SCREEN://全屏
|
||||
break;
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mTypeface = Typeface.createFromAsset(mActivity.getAssets(), "fonts/zhangti.TTF");
|
||||
mDatas = new ArrayList<>();
|
||||
getTypeList();
|
||||
mAdapter = new ActivityAdapter(mActivity, mDatas);
|
||||
mRlvContent.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
|
||||
mRlvContent.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::showDetail);
|
||||
mSrlContent.setOnLoadMoreListener(refreshLayout -> {
|
||||
if (mTotalSize > mDatas.size()) {
|
||||
++mCurrentPageNo;
|
||||
mSrlContent.setNoMoreData(false);
|
||||
getActivityListDataByType(mCurrentPageNo);
|
||||
} else {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayStateChanged(int playState) {
|
||||
switch (playState) {
|
||||
case VideoView.STATE_IDLE:
|
||||
break;
|
||||
case VideoView.STATE_PREPARING:
|
||||
//在STATE_PREPARING时设置setMute(true)可实现静音播放
|
||||
// mVideoView.setMute(true);
|
||||
break;
|
||||
case VideoView.STATE_PREPARED:
|
||||
break;
|
||||
case VideoView.STATE_PLAYING:
|
||||
//需在此时获取视频宽高
|
||||
int[] videoSize = mVvPlayer.getVideoSize();
|
||||
L.d("视频宽:" + videoSize[0]);
|
||||
L.d("视频高:" + videoSize[1]);
|
||||
break;
|
||||
case VideoView.STATE_PAUSED:
|
||||
break;
|
||||
case VideoView.STATE_BUFFERING:
|
||||
break;
|
||||
case VideoView.STATE_BUFFERED:
|
||||
break;
|
||||
case VideoView.STATE_PLAYBACK_COMPLETED:
|
||||
break;
|
||||
case VideoView.STATE_ERROR:
|
||||
break;
|
||||
});
|
||||
mSrlContent.setOnRefreshListener(refreshLayout -> {
|
||||
if (!TextUtils.isEmpty(mCurrentType)) {
|
||||
mCurrentPageNo = 1;
|
||||
mTotalSize = 0;
|
||||
mDatas.clear();
|
||||
getActivityListDataByType(mCurrentPageNo);
|
||||
} else {
|
||||
mSrlContent.finishRefresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void getTypeList() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(ApiActivity.class)
|
||||
.getActivityTypeList("e36ad682-c6b4-44fe-a05c-889a5ff7c284")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<BaseDictionaryBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<BaseDictionaryBean> baseDictionaryBeans) {
|
||||
if (baseDictionaryBeans != null && baseDictionaryBeans.size() > 0) {
|
||||
for (int i = 0; i < baseDictionaryBeans.size(); i++) {
|
||||
BaseDictionaryBean bean = baseDictionaryBeans.get(i);
|
||||
View view = View.inflate(mActivity, R.layout.item_tab_custom_view, null);
|
||||
TypeFaceTextView textView = view.findViewById(R.id.tv_tab_title);
|
||||
textView.setText(bean.getDataName());
|
||||
TabLayout.Tab tab = mTlType.newTab();
|
||||
tab.setTag(bean);
|
||||
tab.setCustomView(view);
|
||||
mTlType.addTab(tab);
|
||||
}
|
||||
mCurrentType = baseDictionaryBeans.get(0).getDataId();
|
||||
mTlType.setTabIndicatorFullWidth(false);
|
||||
mTlType.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
setState(STATE_LOAD);
|
||||
View tabView = tab.getCustomView();
|
||||
tabView.findViewById(R.id.iv_right).setVisibility(View.VISIBLE);
|
||||
tabView.findViewById(R.id.iv_Left).setVisibility(View.VISIBLE);
|
||||
TextView tvTab = tabView.findViewById(R.id.tv_tab_title);
|
||||
tvTab.setTextColor(Color.RED);
|
||||
BaseDictionaryBean bean = (BaseDictionaryBean) tab.getTag();
|
||||
mCurrentType = bean.getDataId();
|
||||
mCurrentPageNo = 1;
|
||||
mTotalSize = 0;
|
||||
getActivityListDataByType(mCurrentPageNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
View tabView = tab.getCustomView();
|
||||
tabView.findViewById(R.id.iv_right).setVisibility(View.INVISIBLE);
|
||||
tabView.findViewById(R.id.iv_Left).setVisibility(View.INVISIBLE);
|
||||
TextView tvTab = tabView.findViewById(R.id.tv_tab_title);
|
||||
tvTab.setTextColor(Color.GRAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
});
|
||||
View customView = mTlType.getTabAt(0).getCustomView();
|
||||
customView.findViewById(R.id.iv_right).setVisibility(View.VISIBLE);
|
||||
customView.findViewById(R.id.iv_Left).setVisibility(View.VISIBLE);
|
||||
TextView tvTab = customView.findViewById(R.id.tv_tab_title);
|
||||
tvTab.setTextColor(Color.RED);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
setState(STATE_LOAD);
|
||||
getActivityListDataByType(mCurrentPageNo);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void getActivityListDataByType(int page) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(ApiActivity.class)
|
||||
.getActivityListByType(mCurrentType, page + "")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ActivityListBeans>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(ActivityListBeans activityListBeans) {
|
||||
if (page == 1) {
|
||||
//第一次
|
||||
if (activityListBeans.getRows() != null && activityListBeans.getRows().size() > 0) {
|
||||
mDatas = activityListBeans.getRows();
|
||||
mAdapter.setData(mDatas);
|
||||
mTotalSize = activityListBeans.getTotal();
|
||||
mSrlContent.finishRefresh();
|
||||
mSrlContent.setNoMoreData(false);
|
||||
setState(STATE_SUCCESS);
|
||||
} else {
|
||||
mSrlContent.finishRefresh();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
setState(STATE_EMPTY);
|
||||
}
|
||||
} else {
|
||||
//多次
|
||||
if (activityListBeans.getRows() != null && activityListBeans.getRows().size() > 0) {
|
||||
mDatas.addAll(activityListBeans.getRows());
|
||||
mAdapter.setData(mDatas);
|
||||
mSrlContent.finishLoadMore();
|
||||
} else {
|
||||
mSrlContent.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
setState(STATE_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
mSrlContent.finishRefresh();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void showDetail(ActivityListBeans.RowsBean rowsBean) {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULEACTIVITY_ACTIVITY_DETAIL)
|
||||
.withString("id", rowsBean.getActivityLibraryId())
|
||||
.navigation();
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// protected void refreshView() {
|
||||
// getTypeList();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void loadMoreData() {
|
||||
// mSrlView.finishLoadMore();
|
||||
// }
|
||||
|
||||
private void setState(int state) {
|
||||
switch (state) {
|
||||
case STATE_LOAD:
|
||||
mRlvContent.setVisibility(View.GONE);
|
||||
mTvHint.setVisibility(View.VISIBLE);
|
||||
mTvHint.setText("加载中...");
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case STATE_EMPTY:
|
||||
mRlvContent.setVisibility(View.GONE);
|
||||
mTvHint.setVisibility(View.VISIBLE);
|
||||
mTvHint.setText("暂无数据");
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_SUCCESS:
|
||||
mRlvContent.setVisibility(View.VISIBLE);
|
||||
mTvHint.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_ERROR:
|
||||
mRlvContent.setVisibility(View.GONE);
|
||||
mTvHint.setVisibility(View.VISIBLE);
|
||||
mTvHint.setText("数据加载失败,请稍后重试");
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mVvPlayer.pause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mVvPlayer.pause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
mOnStateChangeListener = null;
|
||||
if (mVvPlayer != null) {
|
||||
mVvPlayer.release();
|
||||
}
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ package com.tengshisoft.moduleactivity.net;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseDictionaryBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.UserLoginBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.bean.UserBean;
|
||||
import com.tengshisoft.moduleactivity.beans.ActivityDetail;
|
||||
import com.tengshisoft.moduleactivity.beans.ActivityListBeans;
|
||||
import com.tengshisoft.moduleactivity.beans.MineActivityListBean;
|
||||
@ -43,8 +41,9 @@ public interface ApiActivity {
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:activity", "Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/activitylibrary/listpageactivitylibraryrelease")
|
||||
@Headers({"base_url_name:activity", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
// @GET("app/activitylibrary/listpageactivitylibraryrelease") 原接口
|
||||
@GET("app/activitylibrary/listpageactivitylibraryfornetrelease")
|
||||
Observable<ActivityListBeans> getActivityListByType(@Query("activityType") String type, @Query("page") String page);
|
||||
|
||||
/**
|
||||
@ -62,7 +61,8 @@ public interface ApiActivity {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:activity", "Content-Type:application/json", "Accept:application/json","is_need_area:false"})
|
||||
@Headers({"base_url_name:activity", "Content-Type:application/json", "Accept:application/json", "need_area" +
|
||||
":false"})
|
||||
@GET("app/dictionaryself/listdictionarybyparentidrelease/{dictionaryParentId}")
|
||||
Observable<List<BaseDictionaryBean>> getActivityTypeList(@Path("dictionaryParentId") String id);
|
||||
|
||||
@ -78,7 +78,8 @@ public interface ApiActivity {
|
||||
//GET /app/activitylibrary/getactivitylibrarybyid/{activityLibraryId}
|
||||
@Headers({"base_url_name:activity", "Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/activitylibrary/getactivitylibrarybyid/{activityLibraryId}")
|
||||
Observable<ActivityDetail> getActivityByIdToken(@Path("activityLibraryId") String id, @Header("token") String token);
|
||||
Observable<ActivityDetail> getActivityByIdToken(@Path("activityLibraryId") String id,
|
||||
@Header("token") String token);
|
||||
|
||||
/**
|
||||
* 报名
|
||||
@ -96,7 +97,8 @@ public interface ApiActivity {
|
||||
*/
|
||||
@Headers({"base_url_name:activity", "Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/activityuserapply/cancelapply/{activityid}/{activityApplyUserId}")
|
||||
Observable<BaseSuccessBean> doCancelSignUp(@Path("activityid") String id, @Path("activityApplyUserId") String aId, @Header("token") String token);
|
||||
Observable<BaseSuccessBean> doCancelSignUp(@Path("activityid") String id, @Path("activityApplyUserId") String aId
|
||||
, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
|
@ -1,18 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/srl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.ActivityMainActivity">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/Theme.AppCompat">
|
||||
|
||||
<com.tengshisoft.moduleijkplayer.player.VideoView
|
||||
android:id="@+id/vv_player"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="220dp"
|
||||
app:layout_constraintDimensionRatio="16:10"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_tab_bg">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/xtl_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="@color/white"
|
||||
app:tabMode="scrollable"
|
||||
app:tabSelectedTextColor="@color/app_title"
|
||||
app:tabTextAppearance="@style/TabLayoutTextStyle"
|
||||
app:tabTextColor="@color/gray_text" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_loading"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading_pic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/ic_empty_data" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/iv_empty"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textColor="@color/text_detail_24"
|
||||
android:textSize="16sp"
|
||||
tools:text="暂无数据" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</LinearLayout>
|
@ -62,7 +62,7 @@ public class ChooseMineTeamActivity extends BaseActivity {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("id", chooseBean.getTeamId());
|
||||
intent.putExtra("name", chooseBean.getTeamName());
|
||||
setResult(333, intent);
|
||||
setResult(RESULT_OK, intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
@ -11,6 +11,8 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.gson.Gson;
|
||||
@ -42,7 +44,6 @@ import com.youth.banner.util.BannerUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@ -98,6 +99,8 @@ public class VolunteerActivityDetailActivity extends BaseActivity {
|
||||
TextView mTvTypeContent;
|
||||
@BindView(R2.id.tv_activity_log)
|
||||
TypeFaceTextView mTvActivityLog;
|
||||
@BindView(R2.id.tv_area_content)
|
||||
TextView mTvArea;
|
||||
private Unbinder mBind;
|
||||
private String mId;
|
||||
private WebView mWebView;
|
||||
@ -426,6 +429,7 @@ public class VolunteerActivityDetailActivity extends BaseActivity {
|
||||
mTvContactPeo.setText(detailBean.getLinkMan());//联系人
|
||||
mTvPhone.setText(detailBean.getLinkTel());//联系电话
|
||||
mTvAwards.setText(detailBean.getServiceReward());//服务奖补
|
||||
mTvArea.setText(detailBean.getServiceAreaCodeName());//活动区域
|
||||
mWebView = new WebView(mActivity);
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDefaultTextEncodingName("utf-8");
|
||||
|
@ -171,7 +171,7 @@ public class VolunteerActivitySignTeamActivity extends BaseActivity {
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 123) {
|
||||
if (resultCode == 333) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
mTeamId = data.getStringExtra("id");
|
||||
mTeamName = data.getStringExtra("name");
|
||||
mTvChooseTeam.setText(mTeamName);
|
||||
|
@ -112,6 +112,10 @@ public class VolunteerPublishActivity extends BaseActivity {
|
||||
LinearLayout mLlChooseTeam;
|
||||
@BindView(R2.id.tv_choose_team)
|
||||
TextView mTvChooseTeam;
|
||||
@BindView(R2.id.ll_area)
|
||||
LinearLayout mllArea;
|
||||
@BindView(R2.id.tv_choose_area)
|
||||
TextView mTvChooseArea;
|
||||
private Unbinder mBind;
|
||||
private TimePickerView mTimePicker;
|
||||
private TimePickerView mEndTimePicker;
|
||||
@ -120,6 +124,7 @@ public class VolunteerPublishActivity extends BaseActivity {
|
||||
private String mType = "1";
|
||||
private String mPhotoIds = "";
|
||||
private String mChooseTeamId = "";
|
||||
private String mChooseArea = "";
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
@ -161,6 +166,9 @@ public class VolunteerPublishActivity extends BaseActivity {
|
||||
mLlChooseTeam.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
mTvChooseArea.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAIN_CHOOSE_CITY)
|
||||
.navigation(mActivity, 444));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -266,11 +274,18 @@ public class VolunteerPublishActivity extends BaseActivity {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
case 888:
|
||||
String name = data.getStringExtra("name");
|
||||
mTvChooseTeam.setText(name);
|
||||
mChooseTeamId = data.getStringExtra("id");
|
||||
break;
|
||||
}
|
||||
} else if (resultCode == 333) {
|
||||
String name = data.getStringExtra("name");
|
||||
mTvChooseTeam.setText(name);
|
||||
mChooseTeamId = data.getStringExtra("id");
|
||||
//活动区域
|
||||
String chooseCity = data.getStringExtra("chooseCity");
|
||||
String code = data.getStringExtra("chooseCityId");
|
||||
mTvChooseArea.setText(chooseCity);
|
||||
mChooseArea = code;
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
@ -413,6 +428,7 @@ public class VolunteerPublishActivity extends BaseActivity {
|
||||
String endTime = mTvEndTimeContent.getText().toString().trim();//结束时间
|
||||
String awards = mEtServiceAwards.getText().toString().trim();//服务奖补
|
||||
String serviceContent = mEtServiceContent.getText().toString().trim();
|
||||
bean.setServiceAreaCode(mChooseArea);//服务区域
|
||||
if (!TextUtils.isEmpty(awards)) {
|
||||
bean.setServiceReward(awards);
|
||||
}
|
||||
@ -442,6 +458,10 @@ public class VolunteerPublishActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private boolean checkParams() {
|
||||
if (TextUtils.isEmpty(mChooseArea)) {
|
||||
ToastUtils.showShort("请选择活动区域");
|
||||
return false;
|
||||
}
|
||||
String name = mEtName.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
ToastUtils.showShort("请输入活动名称");
|
||||
|
@ -43,6 +43,16 @@ public class ActivityPublishBean {
|
||||
private String voluntaryType;
|
||||
private String volunteerId;
|
||||
private String volunteerName;
|
||||
private String serviceAreaCode;
|
||||
|
||||
|
||||
public String getServiceAreaCode() {
|
||||
return serviceAreaCode;
|
||||
}
|
||||
|
||||
public void setServiceAreaCode(String serviceAreaCode) {
|
||||
this.serviceAreaCode = serviceAreaCode;
|
||||
}
|
||||
|
||||
public String getCount() {
|
||||
return count;
|
||||
|
@ -49,6 +49,15 @@ public class VolunteerActivityDetailBean {
|
||||
private String isVolunteer;
|
||||
private int joinCount;
|
||||
private String creatStatus;
|
||||
private String serviceAreaCodeName;
|
||||
|
||||
public String getServiceAreaCodeName() {
|
||||
return serviceAreaCodeName;
|
||||
}
|
||||
|
||||
public void setServiceAreaCodeName(String serviceAreaCodeName) {
|
||||
this.serviceAreaCodeName = serviceAreaCodeName;
|
||||
}
|
||||
|
||||
public String getCreatStatus() {
|
||||
return creatStatus;
|
||||
|
@ -1,22 +1,20 @@
|
||||
package com.tengshisoft.modulecultural.fragments;
|
||||
|
||||
import android.net.MacAddress;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.ethanhua.skeleton.RecyclerViewSkeletonScreen;
|
||||
import com.ethanhua.skeleton.Skeleton;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.beans.FuncBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseFragment;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
import com.tengshisoft.modulecultural.R;
|
||||
import com.tengshisoft.modulecultural.R2;
|
||||
@ -28,9 +26,6 @@ import com.tengshisoft.modulecultural.net.CulturalApi;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@ -60,8 +55,13 @@ public class CulturalMainFragment extends BaseFragment {
|
||||
private Disposable mD1;
|
||||
private LegacyMainAdapter mMainAdapter;
|
||||
private List<String> mFuncStr = new ArrayList<>();
|
||||
private String[] mTitls = new String[]{"非物质文化遗产数据库", "文化直播", "文化分享"};
|
||||
private int[] mIcons = new int[]{R.drawable.ic_cultural_icon, R.drawable.ic_cultural_icon, R.drawable.ic_cultural_icon};
|
||||
|
||||
// private String[] mTitls = new String[]{"非物质文化遗产数据库", "文化直播", "文化分享"};
|
||||
// private int[] mIcons = new int[]{R.drawable.ic_cultural_icon, R.drawable.ic_cultural_icon, R.drawable.ic_cultural_icon};
|
||||
|
||||
private String[] mTitls = new String[]{"非物质文化遗产数据库", "文化分享"};
|
||||
private int[] mIcons = new int[]{R.drawable.ic_cultural_icon, R.drawable.ic_cultural_icon};
|
||||
|
||||
private List<FuncBean> mFuncBeans = new ArrayList<>();
|
||||
private RecyclerViewSkeletonScreen mSkeleton;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.tengshisoft.modulecultural.net;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseDictionaryBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.DictionaryBean;
|
||||
import com.tengshisoft.modulecultural.bean.ActivityLogBean;
|
||||
@ -46,14 +45,14 @@ public interface CulturalApi {
|
||||
/**
|
||||
* 获取非遗列表
|
||||
*/
|
||||
@Headers({"base_url_name:legacy", "Content-Type:application/json", "Accept:application/json","is_need_area:true"})
|
||||
@Headers({"base_url_name:legacy", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/intangiblelibrary/listpageintangiblelibraryrelease")
|
||||
Observable<LegacyListBean> getLegacyList(@Query("page") String page);
|
||||
|
||||
/**
|
||||
* 获取非遗列表
|
||||
*/
|
||||
@Headers({"base_url_name:legacy", "Content-Type:application/json", "Accept:application/json","is_need_area:true"})
|
||||
@Headers({"base_url_name:legacy", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/intangiblelibrary/listpageintangiblelibraryrelease")
|
||||
Observable<LegacyListBean> getLegacyListByType(@Query("page") String page, @Query("rows") String rows, @Query("libraryDirectoriesId") String id);
|
||||
|
||||
@ -62,7 +61,7 @@ public interface CulturalApi {
|
||||
* GET /app/intangibledirectories/listztreeintangibledirectoriesrelease
|
||||
* GET /app/intangiblelibrary/listpageintangiblelibraryrelease
|
||||
*/
|
||||
@Headers({"base_url_name:legacy", "Content-Type:application/json", "Accept:application/json","is_need_area:true"})
|
||||
@Headers({"base_url_name:legacy", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
|
||||
@GET("app/intangibledirectories/listztreeintangibledirectoriesrelease")
|
||||
Observable<List<LegacyListTypeBean>> getLegacyTypeList(@Query("id") String id);
|
||||
|
||||
@ -234,7 +233,7 @@ public interface CulturalApi {
|
||||
* 志愿者活动列表
|
||||
* GET /app/volunteerservice/listpagevolunteerservicerelease
|
||||
*/
|
||||
@Headers({"base_url_name:volunteer", "Content-Type:application/json", "Accept:application/json"})
|
||||
@Headers({"base_url_name:volunteer", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/volunteerservice/listpagevolunteerservicerelease")
|
||||
Observable<VolunteerActivitybean> getVolunteerActivityList(@Query("rows") String rows, @Query("page") String page);
|
||||
|
||||
@ -331,7 +330,7 @@ public interface CulturalApi {
|
||||
* 直播回放列表
|
||||
* http://192.168.0.104:8084/live/
|
||||
*/
|
||||
@Headers({"base_url_name:live", "Content-Type:application/json", "Accept:application/json","is_need_area:false"})
|
||||
@Headers({"base_url_name:live", "Content-Type:application/json", "Accept:application/json", "need_area:false"})
|
||||
@GET("app/liveplan/listpageliveplanrelease")
|
||||
Observable<CulturalLiveBean> getLiveRecord(@Query("page") String page);
|
||||
|
||||
@ -339,7 +338,7 @@ public interface CulturalApi {
|
||||
* 直播详情
|
||||
* http://192.168.0.104:8084/live/app/liveplan/listpageliveplanrelease
|
||||
*/
|
||||
@Headers({"base_url_name:live", "Content-Type:application/json", "Accept:application/json" ,"is_need_area:false"})
|
||||
@Headers({"base_url_name:live", "Content-Type:application/json", "Accept:application/json", "need_area:false"})
|
||||
@GET("app/liveplan/getliveplanbyidrelease/{livePlanId}")
|
||||
Observable<CulturalLiveDetailBean> getLiveDetail(@Path("livePlanId") String id);
|
||||
|
||||
@ -347,7 +346,7 @@ public interface CulturalApi {
|
||||
* 直播回放文件
|
||||
* GET /app/liverecord/listpageliverecordrelease/{planId}
|
||||
*/
|
||||
@Headers({"base_url_name:live", "Content-Type:application/json", "Accept:application/json" ,"is_need_area:false"})
|
||||
@Headers({"base_url_name:live", "Content-Type:application/json", "Accept:application/json", "need_area:false"})
|
||||
@GET("app/liverecord/listpageliverecordrelease/{planId}")
|
||||
Observable<LiveFilesBean> getLiveFiles(@Path("planId") String id, @Query("page") String page);
|
||||
|
||||
|
@ -76,6 +76,38 @@
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_area"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:src="@drawable/ic_icon_location" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_toRightOf="@id/iv_area"
|
||||
android:text="活动区域:"
|
||||
android:textColor="#BBBBBB"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_area_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/tv_area_title"
|
||||
android:textColor="#242424"
|
||||
android:textSize="10sp"
|
||||
tools:text="活动区域" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -11,6 +10,21 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_area"
|
||||
style="@style/register_item_container">
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
style="@style/register_text_title"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="活动区域:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_choose_area"
|
||||
style="@style/register_text_sel"
|
||||
android:hint="请选择活动区域" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/register_item_container">
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
|
@ -11,6 +11,9 @@ import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.beloo.widget.chipslayoutmanager.ChipsLayoutManager;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
@ -30,8 +33,6 @@ import com.tengshisoft.mudulemain.cultural.net.HomeApi;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@ -75,6 +76,7 @@ public class ChooseCityActivity extends BaseActivity {
|
||||
private Unbinder mBind;
|
||||
private String mCurrentCityName = "";
|
||||
private String mCurrentCityCode = "";
|
||||
private String mCurrentCityId = "";
|
||||
private AreaListAdapter mArea1Adapter;
|
||||
private AreaListAdapter mArea2Adapter;
|
||||
private AreaListAdapter mArea3Adapter;
|
||||
@ -231,6 +233,7 @@ public class ChooseCityActivity extends BaseActivity {
|
||||
mArea4Adapter.notifyDataSetChanged();
|
||||
}
|
||||
mCurrentCityCode = PathConfig.CITY_DEFAULT_CODE;
|
||||
mCurrentCityId = UserLgUtils.getCityCode();
|
||||
mCurrentCityName = PathConfig.CITY_DEFAULT_NAME;
|
||||
UserLgUtils.setCityLevel(2);
|
||||
} else {
|
||||
@ -240,6 +243,7 @@ public class ChooseCityActivity extends BaseActivity {
|
||||
mCurrentCityName = PathConfig.CITY_DEFAULT_NAME;
|
||||
}
|
||||
mCurrentCityCode = UserLgUtils.getCurrentCityCode();
|
||||
mCurrentCityId = UserLgUtils.getCityCode();
|
||||
}
|
||||
mTvCurrentArea.setText(mCurrentCityName);
|
||||
}
|
||||
@ -306,6 +310,7 @@ public class ChooseCityActivity extends BaseActivity {
|
||||
}
|
||||
mCurrentCityName = bean.getAreaName();
|
||||
mCurrentCityCode = bean.getAreaId();
|
||||
mCurrentCityId = bean.getAreaCode();
|
||||
mTvCurrentArea.setText(mCurrentCityName);
|
||||
}
|
||||
|
||||
@ -506,6 +511,7 @@ public class ChooseCityActivity extends BaseActivity {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("chooseCity", mCurrentCityName);
|
||||
intent.putExtra("chooseCityCode", mCurrentCityCode);
|
||||
intent.putExtra("chooseCityId", mCurrentCityId);
|
||||
setResult(333, intent);
|
||||
finish();
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.tengshisoft.mudulemain.cultural.activitys.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.Selection;
|
||||
@ -7,6 +8,7 @@ import android.text.TextUtils;
|
||||
import android.text.method.HideReturnsTransformationMethod;
|
||||
import android.text.method.PasswordTransformationMethod;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
|
||||
@ -15,13 +17,13 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.gson.Gson;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.api.BaseApiService;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.bean.BaseUserInfo;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
|
||||
import com.sucstepsoft.cm_utils.utils.AppUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.EncryptUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.RegexUtils;
|
||||
@ -34,9 +36,12 @@ import com.tengshisoft.mudulemain.cultural.beans.BaseUserBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.LoginUser;
|
||||
import com.tengshisoft.mudulemain.cultural.net.HomeApi;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
@ -61,10 +66,16 @@ public class LoginActivity extends BaseActivity {
|
||||
EditText mEtPwd;
|
||||
@BindView(R2.id.iv_show_pwd)
|
||||
ImageView mIvShowPwd;
|
||||
@BindView(R2.id.btn_verify_code)
|
||||
Button mBtnVerifyCode;
|
||||
@BindView(R2.id.et_verify_code)
|
||||
EditText mEtVerifyCode;
|
||||
|
||||
private Unbinder mBind;
|
||||
private boolean isShowPwd = false;
|
||||
private Disposable mD1;
|
||||
private int mCountDownNum = 120;//倒计时秒
|
||||
private Disposable mCountDownDis;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -100,8 +111,103 @@ public class LoginActivity extends BaseActivity {
|
||||
mEtPwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
|
||||
}
|
||||
});
|
||||
mBtnVerifyCode.setOnClickListener(v -> getVerifyCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
private void getVerifyCode() {
|
||||
if (checkPhone()) {
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
dialog.show();
|
||||
mBtnVerifyCode.setEnabled(false);
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.getVerifyCodeBean(phone)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseSuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseSuccessBean baseSuccessBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showShort("获取成功");
|
||||
countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
mBtnVerifyCode.setEnabled(true);
|
||||
mBtnVerifyCode.setText("重新获取");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkPhone() {
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(phone) || !RegexUtils.isMobileExact(phone)) {
|
||||
ToastUtils.showShort("请输入合法的手机号码");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码倒计时
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void countDown() {
|
||||
Observable.interval(0, 1, TimeUnit.SECONDS).take(mCountDownNum)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Long>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mCountDownDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(Long aLong) {
|
||||
long l = mCountDownNum - aLong;
|
||||
if (l == 1) {
|
||||
mBtnVerifyCode.setEnabled(true);
|
||||
mBtnVerifyCode.setText("重新获取");
|
||||
} else {
|
||||
mBtnVerifyCode.setEnabled(false);
|
||||
mBtnVerifyCode.setText(l + "s后重新获取");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
mBtnVerifyCode.setEnabled(true);
|
||||
mBtnVerifyCode.setText("重新获取");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录
|
||||
@ -111,20 +217,19 @@ public class LoginActivity extends BaseActivity {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "登录中...");
|
||||
dialog.show();
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
String pwd = mEtPwd.getText().toString().trim();
|
||||
String verifyCode = mEtVerifyCode.getText().toString().trim();
|
||||
LoginUser info = new LoginUser();
|
||||
info.setAppVersion(AppUtils.getAppVersionCode());
|
||||
info.setAppId(PathConfig.APP_VERSION_ID);
|
||||
info.setUsername(phone);
|
||||
String md5Pwd = EncryptUtils.encryptMD5ToStringTimes(pwd, 3);
|
||||
info.setPassword(md5Pwd);
|
||||
info.setDeviceNo("deviceId");
|
||||
info.setVerificationCode(verifyCode);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(info);
|
||||
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(HomeApi.class)
|
||||
.doLogin(body)
|
||||
.doLoginWithPhone(body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseUserBean>() {
|
||||
@ -217,9 +322,9 @@ public class LoginActivity extends BaseActivity {
|
||||
ToastUtils.showShort("请输入合法的手机号码");
|
||||
return false;
|
||||
}
|
||||
String pwd = mEtPwd.getText().toString().trim();
|
||||
String pwd = mEtVerifyCode.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(pwd)) {
|
||||
ToastUtils.showShort("请输入密码");
|
||||
ToastUtils.showShort("请输入验证码");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -228,6 +333,9 @@ public class LoginActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mCountDownDis != null && !mCountDownDis.isDisposed()) {
|
||||
mCountDownDis.dispose();
|
||||
}
|
||||
if (mD1 != null && !mD1.isDisposed()) {
|
||||
mD1.dispose();
|
||||
}
|
||||
|
@ -14,14 +14,12 @@ import android.widget.ImageView;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.constant.RegexConstants;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.UserRegisterPostBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.api.BaseApiService;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
|
||||
import com.sucstepsoft.cm_utils.utils.EncryptUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
import com.sucstepsoft.cm_utils.utils.RegexUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
@ -151,14 +149,11 @@ public class RegisterActivity extends BaseActivity {
|
||||
if (checkAllParams()) {
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
String code = mEtVerifyCode.getText().toString().trim();
|
||||
String pwd = mEtPwd.getText().toString().trim();
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "注册中...");
|
||||
dialog.show();
|
||||
UserRegisterPostBean info = new UserRegisterPostBean();
|
||||
String md5Pwd = EncryptUtils.encryptMD5ToStringTimes(pwd, 3);
|
||||
info.setPassword(md5Pwd);
|
||||
info.setPhone(phone);
|
||||
info.setVerificationCode(code);
|
||||
info.setVerifyCode(code);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(info);
|
||||
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
@ -182,8 +177,8 @@ public class RegisterActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -210,20 +205,20 @@ public class RegisterActivity extends BaseActivity {
|
||||
ToastUtils.showShort("请输入验证码");
|
||||
return false;
|
||||
}
|
||||
String pwd = mEtPwd.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(pwd) || !RegexUtils.isMatch(RegexConstants.REGEX_PWD, pwd)) {
|
||||
ToastUtils.showShort("密码最少为6位且包含数字和字母");
|
||||
return false;
|
||||
}
|
||||
String confirmpwd = mEtConfirmPwd.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(confirmpwd)) {
|
||||
ToastUtils.showShort("请输入确认密码");
|
||||
return false;
|
||||
}
|
||||
if (!confirmpwd.equals(pwd)) {
|
||||
ToastUtils.showShort("密码与确认密码不符");
|
||||
return false;
|
||||
}
|
||||
// String pwd = mEtPwd.getText().toString().trim();
|
||||
// if (TextUtils.isEmpty(pwd) || !RegexUtils.isMatch(RegexConstants.REGEX_PWD, pwd)) {
|
||||
// ToastUtils.showShort("密码最少为6位且包含数字和字母");
|
||||
// return false;
|
||||
// }
|
||||
// String confirmpwd = mEtConfirmPwd.getText().toString().trim();
|
||||
// if (TextUtils.isEmpty(confirmpwd)) {
|
||||
// ToastUtils.showShort("请输入确认密码");
|
||||
// return false;
|
||||
// }
|
||||
// if (!confirmpwd.equals(pwd)) {
|
||||
// ToastUtils.showShort("密码与确认密码不符");
|
||||
// return false;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -278,6 +273,7 @@ public class RegisterActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_register;
|
||||
|
@ -9,7 +9,6 @@ import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.constant.PermissionConstants;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.PermissionUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.toast.ToastUtils;
|
||||
@ -40,7 +39,7 @@ public class SplashActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
ImmersionBar.with(this).init();
|
||||
mRlTitleBar1.setVisibility(View.GONE);
|
||||
// getCityCode();
|
||||
getConfigAppName();
|
||||
PermissionUtils.permission(PermissionConstants.STORAGE, PermissionConstants.LOCATION, PermissionConstants.PHONE)
|
||||
.callback(new PermissionUtils.SimpleCallback() {
|
||||
@Override
|
||||
@ -89,17 +88,10 @@ public class SplashActivity extends BaseActivity {
|
||||
/**
|
||||
* 获取城市代码
|
||||
*/
|
||||
private void getCityCode() {
|
||||
String cityCode = "";
|
||||
String cityId = "";
|
||||
private void getConfigAppName() {
|
||||
try {
|
||||
ApplicationInfo info = getPackageManager().getApplicationInfo(getPackageName(),
|
||||
PackageManager.GET_META_DATA);
|
||||
cityCode = String.valueOf(info.metaData.get("CITY_CODE"));
|
||||
LogUtils.e(cityCode);
|
||||
cityId = String.valueOf(info.metaData.get("CITY_ID"));
|
||||
UserLgUtils.setCityCode(cityCode);
|
||||
UserLgUtils.setCityId(cityId);
|
||||
String appName = String.valueOf(info.metaData.get("APP_NAME"));
|
||||
UserLgUtils.setAppName(appName);
|
||||
} catch (Exception e) {
|
||||
|
@ -1092,4 +1092,4 @@ public class NewsDetailActivity extends BaseActivity {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,11 +1,33 @@
|
||||
package com.tengshisoft.mudulemain.cultural.activitys.news;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseFragment;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
|
||||
import com.tengshisoft.mudulemain.R;
|
||||
import com.tengshisoft.mudulemain.R2;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsTabBean;
|
||||
import com.tengshisoft.mudulemain.cultural.fragment.NewsFragment;
|
||||
import com.tengshisoft.mudulemain.cultural.fragment.NewsWebFragment;
|
||||
import com.tengshisoft.mudulemain.cultural.net.HomeApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
@ -14,28 +36,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
import com.tengshisoft.mudulemain.R;
|
||||
import com.tengshisoft.mudulemain.R2;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsTabBean;
|
||||
import com.tengshisoft.mudulemain.cultural.fragment.NewsFragment;
|
||||
import com.tengshisoft.mudulemain.cultural.net.HomeApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Route(path = PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
public class NewsMainActivity extends BaseActivity {
|
||||
@BindView(R2.id.xtl_new_type)
|
||||
@ -83,7 +83,15 @@ public class NewsMainActivity extends BaseActivity {
|
||||
for (int i = 0; i < newsTabBeans.size(); i++) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("type", newsTabBeans.get(i).getNewsDirectoriesId());
|
||||
NewsFragment fragment = new NewsFragment();
|
||||
BaseFragment fragment = null;
|
||||
//0 外部链接 1存在子集 2没有子集
|
||||
if ("0".equals(newsTabBeans.get(i).getDirectoriesView())) {
|
||||
//列表
|
||||
bundle.putString("url", newsTabBeans.get(i).getDirectoriesTarget2());
|
||||
fragment = new NewsWebFragment();
|
||||
} else {
|
||||
fragment = new NewsFragment();
|
||||
}
|
||||
fragment.setArguments(bundle);
|
||||
mFragments.add(fragment);
|
||||
View view = View.inflate(mActivity, R.layout.item_tab_custom_view, null);
|
||||
|
@ -3,7 +3,6 @@ package com.tengshisoft.mudulemain.cultural.activitys.news;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.webkit.HttpAuthHandler;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.SslErrorHandler;
|
||||
@ -12,14 +11,11 @@ import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.StringUtils;
|
||||
import com.tengshisoft.mudulemain.R;
|
||||
import com.tengshisoft.mudulemain.R2;
|
||||
|
||||
@ -43,10 +39,11 @@ public class NewsWebActivity extends BaseActivity {
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
ImmersionBar.with(this)
|
||||
.init();
|
||||
mRlTitleBar.setVisibility(View.GONE);
|
||||
mRlTitleBar1.setVisibility(View.GONE);
|
||||
// ImmersionBar.with(this)
|
||||
// .init();
|
||||
// mRlTitleBar.setVisibility(View.GONE);
|
||||
// mRlTitleBar1.setVisibility(View.GONE);
|
||||
mTvBaseTitle.setText("详情");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
initWebView();
|
||||
}
|
||||
|
@ -4,22 +4,20 @@ import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ScreenUtils;
|
||||
import com.tengshisoft.mudulemain.R;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.MainFuncBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsTabBean;
|
||||
import com.tengshisoft.mudulemain.cultural.holder.MainFuncHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
@ -27,8 +25,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class MainFuncAdapter extends BaseRecyclerAdapter<MainFuncBean, MainFuncHolder> {
|
||||
public MainFuncAdapter(Context ctx, List<MainFuncBean> list) {
|
||||
public class MainFuncAdapter extends BaseRecyclerAdapter<NewsTabBean, MainFuncHolder> {
|
||||
public MainFuncAdapter(Context ctx, List<NewsTabBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@ -37,8 +35,8 @@ public class MainFuncAdapter extends BaseRecyclerAdapter<MainFuncBean, MainFuncH
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_main_func, parent, false);
|
||||
RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) itemView.getLayoutParams();
|
||||
// if (mData.size() <= 10) {//处理居中
|
||||
int width = (ScreenUtils.getScreenWidth()) / 4;
|
||||
layoutParams.width = width;
|
||||
int width = (ScreenUtils.getScreenWidth()) / 4;
|
||||
layoutParams.width = width;
|
||||
// }
|
||||
itemView.setLayoutParams(layoutParams);
|
||||
return new MainFuncHolder(itemView);
|
||||
@ -47,9 +45,17 @@ public class MainFuncAdapter extends BaseRecyclerAdapter<MainFuncBean, MainFuncH
|
||||
@Override
|
||||
public void bindHolder(MainFuncHolder mainFuncHolder, int i) {
|
||||
mainFuncHolder.mTvName.setTypeFaceType(1);
|
||||
Glide.with(mContext)
|
||||
.load(mData.get(i).getIconRes())
|
||||
.into(mainFuncHolder.mIvIcon);
|
||||
mainFuncHolder.mTvName.setText(mData.get(i).getTitle());
|
||||
if (mData.get(i).getLocalRes() == -1) {
|
||||
Glide.with(mContext)
|
||||
.load(BaseUrlApi.BASE_IMG_URL + mData.get(i).getDirectoriesPhoto())
|
||||
.placeholder(R.drawable.ic_loading)
|
||||
.error(R.drawable.ic_cultural_trends_icon)
|
||||
.into(mainFuncHolder.mIvIcon);
|
||||
} else {
|
||||
Glide.with(mContext)
|
||||
.load(mData.get(i).getLocalRes())
|
||||
.into(mainFuncHolder.mIvIcon);
|
||||
}
|
||||
mainFuncHolder.mTvName.setText(mData.get(i).getDirectoriesName());
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,25 @@ public class LoginUser {
|
||||
private String username;
|
||||
private String verificationCode;
|
||||
private String password;
|
||||
private String phone;
|
||||
private String verifyCode;
|
||||
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getVerifyCode() {
|
||||
return verifyCode;
|
||||
}
|
||||
|
||||
public void setVerifyCode(String verifyCode) {
|
||||
this.verifyCode = verifyCode;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
|
@ -0,0 +1,421 @@
|
||||
package com.tengshisoft.mudulemain.cultural.beans;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新闻详情
|
||||
*/
|
||||
public class NewsDetailBean {
|
||||
|
||||
private String contentCoverId;
|
||||
private List<FileListBean> fileList;
|
||||
private String gmtCreate;
|
||||
private String newsContentAuthor;
|
||||
private String newsContentCheckContent;
|
||||
private String newsContentCheckStatus;
|
||||
private String newsContentCheckTime;
|
||||
private String newsContentCheckUser;
|
||||
private String newsContentCheckUserId;
|
||||
private int newsContentCollectionNumber;
|
||||
private int newsContentCommentNumber;
|
||||
private String newsContentContent;
|
||||
private List<NewsContentCoverListBean> newsContentCoverList;
|
||||
private int newsContentHotNumber;
|
||||
private String newsContentId;
|
||||
private String newsContentLabel;
|
||||
private List<?> newsContentLabelList;
|
||||
private int newsContentLikeNumber;
|
||||
private String newsContentLink;
|
||||
private String newsContentMusic;
|
||||
private String newsContentPublishDepartment;
|
||||
private String newsContentPublishStatus;
|
||||
private String newsContentPublishTime;
|
||||
private String newsContentResource;
|
||||
private int newsContentScore;
|
||||
private String newsContentSummary;
|
||||
private String newsContentTitle;
|
||||
private String newsContentType;
|
||||
private int newsContentVisitNumber;
|
||||
private String newsDirectoriesId;
|
||||
private String newsDirectoriesName;
|
||||
private String newsTypesettingId;
|
||||
private String templateRecordUrl;
|
||||
private String typesettingCode;
|
||||
private String typesettingImage;
|
||||
private String typesettingName;
|
||||
|
||||
public String getContentCoverId() {
|
||||
return contentCoverId;
|
||||
}
|
||||
|
||||
public void setContentCoverId(String contentCoverId) {
|
||||
this.contentCoverId = contentCoverId;
|
||||
}
|
||||
|
||||
public List<FileListBean> getFileList() {
|
||||
return fileList;
|
||||
}
|
||||
|
||||
public void setFileList(List<FileListBean> fileList) {
|
||||
this.fileList = fileList;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate;
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getNewsContentAuthor() {
|
||||
return newsContentAuthor;
|
||||
}
|
||||
|
||||
public void setNewsContentAuthor(String newsContentAuthor) {
|
||||
this.newsContentAuthor = newsContentAuthor;
|
||||
}
|
||||
|
||||
public String getNewsContentCheckContent() {
|
||||
return newsContentCheckContent;
|
||||
}
|
||||
|
||||
public void setNewsContentCheckContent(String newsContentCheckContent) {
|
||||
this.newsContentCheckContent = newsContentCheckContent;
|
||||
}
|
||||
|
||||
public String getNewsContentCheckStatus() {
|
||||
return newsContentCheckStatus;
|
||||
}
|
||||
|
||||
public void setNewsContentCheckStatus(String newsContentCheckStatus) {
|
||||
this.newsContentCheckStatus = newsContentCheckStatus;
|
||||
}
|
||||
|
||||
public String getNewsContentCheckTime() {
|
||||
return newsContentCheckTime;
|
||||
}
|
||||
|
||||
public void setNewsContentCheckTime(String newsContentCheckTime) {
|
||||
this.newsContentCheckTime = newsContentCheckTime;
|
||||
}
|
||||
|
||||
public String getNewsContentCheckUser() {
|
||||
return newsContentCheckUser;
|
||||
}
|
||||
|
||||
public void setNewsContentCheckUser(String newsContentCheckUser) {
|
||||
this.newsContentCheckUser = newsContentCheckUser;
|
||||
}
|
||||
|
||||
public String getNewsContentCheckUserId() {
|
||||
return newsContentCheckUserId;
|
||||
}
|
||||
|
||||
public void setNewsContentCheckUserId(String newsContentCheckUserId) {
|
||||
this.newsContentCheckUserId = newsContentCheckUserId;
|
||||
}
|
||||
|
||||
public int getNewsContentCollectionNumber() {
|
||||
return newsContentCollectionNumber;
|
||||
}
|
||||
|
||||
public void setNewsContentCollectionNumber(int newsContentCollectionNumber) {
|
||||
this.newsContentCollectionNumber = newsContentCollectionNumber;
|
||||
}
|
||||
|
||||
public int getNewsContentCommentNumber() {
|
||||
return newsContentCommentNumber;
|
||||
}
|
||||
|
||||
public void setNewsContentCommentNumber(int newsContentCommentNumber) {
|
||||
this.newsContentCommentNumber = newsContentCommentNumber;
|
||||
}
|
||||
|
||||
public String getNewsContentContent() {
|
||||
return newsContentContent;
|
||||
}
|
||||
|
||||
public void setNewsContentContent(String newsContentContent) {
|
||||
this.newsContentContent = newsContentContent;
|
||||
}
|
||||
|
||||
public List<NewsContentCoverListBean> getNewsContentCoverList() {
|
||||
return newsContentCoverList;
|
||||
}
|
||||
|
||||
public void setNewsContentCoverList(List<NewsContentCoverListBean> newsContentCoverList) {
|
||||
this.newsContentCoverList = newsContentCoverList;
|
||||
}
|
||||
|
||||
public int getNewsContentHotNumber() {
|
||||
return newsContentHotNumber;
|
||||
}
|
||||
|
||||
public void setNewsContentHotNumber(int newsContentHotNumber) {
|
||||
this.newsContentHotNumber = newsContentHotNumber;
|
||||
}
|
||||
|
||||
public String getNewsContentId() {
|
||||
return newsContentId;
|
||||
}
|
||||
|
||||
public void setNewsContentId(String newsContentId) {
|
||||
this.newsContentId = newsContentId;
|
||||
}
|
||||
|
||||
public String getNewsContentLabel() {
|
||||
return newsContentLabel;
|
||||
}
|
||||
|
||||
public void setNewsContentLabel(String newsContentLabel) {
|
||||
this.newsContentLabel = newsContentLabel;
|
||||
}
|
||||
|
||||
public List<?> getNewsContentLabelList() {
|
||||
return newsContentLabelList;
|
||||
}
|
||||
|
||||
public void setNewsContentLabelList(List<?> newsContentLabelList) {
|
||||
this.newsContentLabelList = newsContentLabelList;
|
||||
}
|
||||
|
||||
public int getNewsContentLikeNumber() {
|
||||
return newsContentLikeNumber;
|
||||
}
|
||||
|
||||
public void setNewsContentLikeNumber(int newsContentLikeNumber) {
|
||||
this.newsContentLikeNumber = newsContentLikeNumber;
|
||||
}
|
||||
|
||||
public String getNewsContentLink() {
|
||||
return newsContentLink;
|
||||
}
|
||||
|
||||
public void setNewsContentLink(String newsContentLink) {
|
||||
this.newsContentLink = newsContentLink;
|
||||
}
|
||||
|
||||
public String getNewsContentMusic() {
|
||||
return newsContentMusic;
|
||||
}
|
||||
|
||||
public void setNewsContentMusic(String newsContentMusic) {
|
||||
this.newsContentMusic = newsContentMusic;
|
||||
}
|
||||
|
||||
public String getNewsContentPublishDepartment() {
|
||||
return newsContentPublishDepartment;
|
||||
}
|
||||
|
||||
public void setNewsContentPublishDepartment(String newsContentPublishDepartment) {
|
||||
this.newsContentPublishDepartment = newsContentPublishDepartment;
|
||||
}
|
||||
|
||||
public String getNewsContentPublishStatus() {
|
||||
return newsContentPublishStatus;
|
||||
}
|
||||
|
||||
public void setNewsContentPublishStatus(String newsContentPublishStatus) {
|
||||
this.newsContentPublishStatus = newsContentPublishStatus;
|
||||
}
|
||||
|
||||
public String getNewsContentPublishTime() {
|
||||
return newsContentPublishTime;
|
||||
}
|
||||
|
||||
public void setNewsContentPublishTime(String newsContentPublishTime) {
|
||||
this.newsContentPublishTime = newsContentPublishTime;
|
||||
}
|
||||
|
||||
public String getNewsContentResource() {
|
||||
return newsContentResource;
|
||||
}
|
||||
|
||||
public void setNewsContentResource(String newsContentResource) {
|
||||
this.newsContentResource = newsContentResource;
|
||||
}
|
||||
|
||||
public int getNewsContentScore() {
|
||||
return newsContentScore;
|
||||
}
|
||||
|
||||
public void setNewsContentScore(int newsContentScore) {
|
||||
this.newsContentScore = newsContentScore;
|
||||
}
|
||||
|
||||
public String getNewsContentSummary() {
|
||||
return newsContentSummary;
|
||||
}
|
||||
|
||||
public void setNewsContentSummary(String newsContentSummary) {
|
||||
this.newsContentSummary = newsContentSummary;
|
||||
}
|
||||
|
||||
public String getNewsContentTitle() {
|
||||
return newsContentTitle;
|
||||
}
|
||||
|
||||
public void setNewsContentTitle(String newsContentTitle) {
|
||||
this.newsContentTitle = newsContentTitle;
|
||||
}
|
||||
|
||||
public String getNewsContentType() {
|
||||
return newsContentType;
|
||||
}
|
||||
|
||||
public void setNewsContentType(String newsContentType) {
|
||||
this.newsContentType = newsContentType;
|
||||
}
|
||||
|
||||
public int getNewsContentVisitNumber() {
|
||||
return newsContentVisitNumber;
|
||||
}
|
||||
|
||||
public void setNewsContentVisitNumber(int newsContentVisitNumber) {
|
||||
this.newsContentVisitNumber = newsContentVisitNumber;
|
||||
}
|
||||
|
||||
public String getNewsDirectoriesId() {
|
||||
return newsDirectoriesId;
|
||||
}
|
||||
|
||||
public void setNewsDirectoriesId(String newsDirectoriesId) {
|
||||
this.newsDirectoriesId = newsDirectoriesId;
|
||||
}
|
||||
|
||||
public String getNewsDirectoriesName() {
|
||||
return newsDirectoriesName;
|
||||
}
|
||||
|
||||
public void setNewsDirectoriesName(String newsDirectoriesName) {
|
||||
this.newsDirectoriesName = newsDirectoriesName;
|
||||
}
|
||||
|
||||
public String getNewsTypesettingId() {
|
||||
return newsTypesettingId;
|
||||
}
|
||||
|
||||
public void setNewsTypesettingId(String newsTypesettingId) {
|
||||
this.newsTypesettingId = newsTypesettingId;
|
||||
}
|
||||
|
||||
public String getTemplateRecordUrl() {
|
||||
return templateRecordUrl;
|
||||
}
|
||||
|
||||
public void setTemplateRecordUrl(String templateRecordUrl) {
|
||||
this.templateRecordUrl = templateRecordUrl;
|
||||
}
|
||||
|
||||
public String getTypesettingCode() {
|
||||
return typesettingCode;
|
||||
}
|
||||
|
||||
public void setTypesettingCode(String typesettingCode) {
|
||||
this.typesettingCode = typesettingCode;
|
||||
}
|
||||
|
||||
public String getTypesettingImage() {
|
||||
return typesettingImage;
|
||||
}
|
||||
|
||||
public void setTypesettingImage(String typesettingImage) {
|
||||
this.typesettingImage = typesettingImage;
|
||||
}
|
||||
|
||||
public String getTypesettingName() {
|
||||
return typesettingName;
|
||||
}
|
||||
|
||||
public void setTypesettingName(String typesettingName) {
|
||||
this.typesettingName = typesettingName;
|
||||
}
|
||||
|
||||
public static class FileListBean {
|
||||
private String contentFileFileId;
|
||||
private int contentFileOrder;
|
||||
private String contentFileText;
|
||||
private String newsContentFileId;
|
||||
private String newsContentId;
|
||||
|
||||
public String getContentFileFileId() {
|
||||
return contentFileFileId;
|
||||
}
|
||||
|
||||
public void setContentFileFileId(String contentFileFileId) {
|
||||
this.contentFileFileId = contentFileFileId;
|
||||
}
|
||||
|
||||
public int getContentFileOrder() {
|
||||
return contentFileOrder;
|
||||
}
|
||||
|
||||
public void setContentFileOrder(int contentFileOrder) {
|
||||
this.contentFileOrder = contentFileOrder;
|
||||
}
|
||||
|
||||
public String getContentFileText() {
|
||||
return contentFileText;
|
||||
}
|
||||
|
||||
public void setContentFileText(String contentFileText) {
|
||||
this.contentFileText = contentFileText;
|
||||
}
|
||||
|
||||
public String getNewsContentFileId() {
|
||||
return newsContentFileId;
|
||||
}
|
||||
|
||||
public void setNewsContentFileId(String newsContentFileId) {
|
||||
this.newsContentFileId = newsContentFileId;
|
||||
}
|
||||
|
||||
public String getNewsContentId() {
|
||||
return newsContentId;
|
||||
}
|
||||
|
||||
public void setNewsContentId(String newsContentId) {
|
||||
this.newsContentId = newsContentId;
|
||||
}
|
||||
}
|
||||
|
||||
public static class NewsContentCoverListBean {
|
||||
private String contentCoverId;
|
||||
private int contentCoverOrder;
|
||||
private String newsContentCoverId;
|
||||
private String newsContentId;
|
||||
|
||||
public String getContentCoverId() {
|
||||
return contentCoverId;
|
||||
}
|
||||
|
||||
public void setContentCoverId(String contentCoverId) {
|
||||
this.contentCoverId = contentCoverId;
|
||||
}
|
||||
|
||||
public int getContentCoverOrder() {
|
||||
return contentCoverOrder;
|
||||
}
|
||||
|
||||
public void setContentCoverOrder(int contentCoverOrder) {
|
||||
this.contentCoverOrder = contentCoverOrder;
|
||||
}
|
||||
|
||||
public String getNewsContentCoverId() {
|
||||
return newsContentCoverId;
|
||||
}
|
||||
|
||||
public void setNewsContentCoverId(String newsContentCoverId) {
|
||||
this.newsContentCoverId = newsContentCoverId;
|
||||
}
|
||||
|
||||
public String getNewsContentId() {
|
||||
return newsContentId;
|
||||
}
|
||||
|
||||
public void setNewsContentId(String newsContentId) {
|
||||
this.newsContentId = newsContentId;
|
||||
}
|
||||
}
|
||||
}
|
@ -21,17 +21,69 @@ public class NewsTabBean {
|
||||
* newsDirectoriesId : string
|
||||
*/
|
||||
|
||||
private int localRes = -1;
|
||||
private String directoriesAreas;
|
||||
private String directoriesAuth;
|
||||
private String directoriesCheck;
|
||||
private String directoriesCode;
|
||||
private String directoriesDescription;
|
||||
private String directoriesMenuShow;
|
||||
private String directoriesName;
|
||||
private String directoriesParentId;
|
||||
private String directoriesParentName;
|
||||
private String directoriesPhoto;
|
||||
private int directoriesSort;
|
||||
private String directoriesPlateShow;
|
||||
private double directoriesSort;
|
||||
private String directoriesSummary;
|
||||
private String directoriesSwitch;
|
||||
private String directoriesTarget1;
|
||||
private String directoriesTarget2;
|
||||
private String directoriesTarget3;
|
||||
private String directoriesView;
|
||||
private String newsDirectoriesId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NewsTabBean{" +
|
||||
"directoriesCheck='" + directoriesCheck + '\'' +
|
||||
", directoriesCode='" + directoriesCode + '\'' +
|
||||
", directoriesDescription='" + directoriesDescription + '\'' +
|
||||
", directoriesName='" + directoriesName + '\'' +
|
||||
", directoriesParentId='" + directoriesParentId + '\'' +
|
||||
", directoriesPhoto='" + directoriesPhoto + '\'' +
|
||||
", directoriesSort=" + directoriesSort +
|
||||
", directoriesSummary='" + directoriesSummary + '\'' +
|
||||
", directoriesSwitch='" + directoriesSwitch + '\'' +
|
||||
", newsDirectoriesId='" + newsDirectoriesId + '\'' +
|
||||
", localRes=" + localRes +
|
||||
", directoriesView='" + directoriesView + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public int getLocalRes() {
|
||||
return localRes;
|
||||
}
|
||||
|
||||
public void setLocalRes(int localRes) {
|
||||
this.localRes = localRes;
|
||||
}
|
||||
|
||||
public String getDirectoriesAreas() {
|
||||
return directoriesAreas;
|
||||
}
|
||||
|
||||
public void setDirectoriesAreas(String directoriesAreas) {
|
||||
this.directoriesAreas = directoriesAreas;
|
||||
}
|
||||
|
||||
public String getDirectoriesAuth() {
|
||||
return directoriesAuth;
|
||||
}
|
||||
|
||||
public void setDirectoriesAuth(String directoriesAuth) {
|
||||
this.directoriesAuth = directoriesAuth;
|
||||
}
|
||||
|
||||
public String getDirectoriesCheck() {
|
||||
return directoriesCheck;
|
||||
}
|
||||
@ -56,6 +108,14 @@ public class NewsTabBean {
|
||||
this.directoriesDescription = directoriesDescription;
|
||||
}
|
||||
|
||||
public String getDirectoriesMenuShow() {
|
||||
return directoriesMenuShow;
|
||||
}
|
||||
|
||||
public void setDirectoriesMenuShow(String directoriesMenuShow) {
|
||||
this.directoriesMenuShow = directoriesMenuShow;
|
||||
}
|
||||
|
||||
public String getDirectoriesName() {
|
||||
return directoriesName;
|
||||
}
|
||||
@ -72,6 +132,14 @@ public class NewsTabBean {
|
||||
this.directoriesParentId = directoriesParentId;
|
||||
}
|
||||
|
||||
public String getDirectoriesParentName() {
|
||||
return directoriesParentName;
|
||||
}
|
||||
|
||||
public void setDirectoriesParentName(String directoriesParentName) {
|
||||
this.directoriesParentName = directoriesParentName;
|
||||
}
|
||||
|
||||
public String getDirectoriesPhoto() {
|
||||
return directoriesPhoto;
|
||||
}
|
||||
@ -80,11 +148,19 @@ public class NewsTabBean {
|
||||
this.directoriesPhoto = directoriesPhoto;
|
||||
}
|
||||
|
||||
public int getDirectoriesSort() {
|
||||
public String getDirectoriesPlateShow() {
|
||||
return directoriesPlateShow;
|
||||
}
|
||||
|
||||
public void setDirectoriesPlateShow(String directoriesPlateShow) {
|
||||
this.directoriesPlateShow = directoriesPlateShow;
|
||||
}
|
||||
|
||||
public double getDirectoriesSort() {
|
||||
return directoriesSort;
|
||||
}
|
||||
|
||||
public void setDirectoriesSort(int directoriesSort) {
|
||||
public void setDirectoriesSort(double directoriesSort) {
|
||||
this.directoriesSort = directoriesSort;
|
||||
}
|
||||
|
||||
@ -104,6 +180,38 @@ public class NewsTabBean {
|
||||
this.directoriesSwitch = directoriesSwitch;
|
||||
}
|
||||
|
||||
public String getDirectoriesTarget1() {
|
||||
return directoriesTarget1;
|
||||
}
|
||||
|
||||
public void setDirectoriesTarget1(String directoriesTarget1) {
|
||||
this.directoriesTarget1 = directoriesTarget1;
|
||||
}
|
||||
|
||||
public String getDirectoriesTarget2() {
|
||||
return directoriesTarget2;
|
||||
}
|
||||
|
||||
public void setDirectoriesTarget2(String directoriesTarget2) {
|
||||
this.directoriesTarget2 = directoriesTarget2;
|
||||
}
|
||||
|
||||
public String getDirectoriesTarget3() {
|
||||
return directoriesTarget3;
|
||||
}
|
||||
|
||||
public void setDirectoriesTarget3(String directoriesTarget3) {
|
||||
this.directoriesTarget3 = directoriesTarget3;
|
||||
}
|
||||
|
||||
public String getDirectoriesView() {
|
||||
return directoriesView;
|
||||
}
|
||||
|
||||
public void setDirectoriesView(String directoriesView) {
|
||||
this.directoriesView = directoriesView;
|
||||
}
|
||||
|
||||
public String getNewsDirectoriesId() {
|
||||
return newsDirectoriesId;
|
||||
}
|
||||
|
@ -3,10 +3,12 @@ package com.tengshisoft.mudulemain.cultural.fragment;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@ -24,8 +26,11 @@ import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BannerImageTextAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseFragment;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.CustomStateView;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.ItemSplitDivider;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
|
||||
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.toast.ToastUtils;
|
||||
import com.tengshisoft.moduleactivity.beans.ActivityListBeans;
|
||||
@ -40,7 +45,6 @@ import com.tengshisoft.mudulemain.cultural.adapter.MainFuncAdapter;
|
||||
import com.tengshisoft.mudulemain.cultural.adapter.NewsAdapter;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.LiveBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.MainCommendBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.MainFuncBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsCommentCount;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsItemBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsTabBean;
|
||||
@ -50,7 +54,6 @@ import com.youth.banner.transformer.ScaleInTransformer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -76,33 +79,35 @@ public class HomeFragment extends BaseFragment {
|
||||
RecyclerView mRlvMainFunc;
|
||||
@BindView(R2.id.rlv_commend)
|
||||
RecyclerView mRlvCommend;
|
||||
@BindView(R2.id.tv_main_news)
|
||||
TextView mTvMainNews;
|
||||
@BindView(R2.id.rlv_main_news)
|
||||
RecyclerView mRlvMainNews;
|
||||
// @BindView(R2.id.tv_main_news)
|
||||
// TextView mTvMainNews;
|
||||
// @BindView(R2.id.rlv_main_news)
|
||||
// RecyclerView mRlvMainNews;
|
||||
@BindView(R2.id.iv_arrow_hint)
|
||||
ImageView mIvArrowHint;
|
||||
@BindView(R2.id.rlv_lives)
|
||||
RecyclerView mRlvLives;
|
||||
@BindView(R2.id.iv_live_empty)
|
||||
ImageView mIvLiveEmpty;
|
||||
@BindView(R2.id.iv_news_empty)
|
||||
ImageView mIvNewsEmpty;
|
||||
// @BindView(R2.id.iv_news_empty)
|
||||
// ImageView mIvNewsEmpty;
|
||||
@BindView(R2.id.iv_commend_empty)
|
||||
ImageView mIvCommendEmpty;
|
||||
@BindView(R2.id.tv_live)
|
||||
TypeFaceTextView mTvLive;
|
||||
@BindView(R2.id.ll_live)
|
||||
LinearLayout mLlLive;
|
||||
@BindView(R2.id.ll_main_news)
|
||||
LinearLayout mLlMainNews;
|
||||
// @BindView(R2.id.ll_main_news)
|
||||
// LinearLayout mLlMainNews;
|
||||
@BindView(R2.id.ll_news_content)
|
||||
LinearLayout mLlNewsContent;
|
||||
private Unbinder mBind;
|
||||
private List<MainFuncBean> mFuncBeans = new ArrayList<>();
|
||||
private List<NewsTabBean> mFuncBeans = new ArrayList<>();
|
||||
private List<BaseImageBean> mBannerList = new ArrayList<>();
|
||||
private List<NewsItemBean.RowsBean> mNewsBeans = new ArrayList<>();
|
||||
private List<LiveBean> mLiveBeans = new ArrayList<>();
|
||||
private NewsAdapter mMAdapter;
|
||||
private RecyclerViewSkeletonScreen mNewsSkeleton;
|
||||
private ViewSkeletonScreen mNewsSkeleton;
|
||||
private MainCommendAdapter mCommendAdapter;
|
||||
private RecyclerViewSkeletonScreen mCommendSkeleton;
|
||||
private ViewSkeletonScreen mBannerSkeleton;
|
||||
@ -115,20 +120,19 @@ public class HomeFragment extends BaseFragment {
|
||||
mBind = ButterKnife.bind(this, dataView);
|
||||
setStateView(STATE_SUCCESS);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
mSrlView.setEnableRefresh(false);
|
||||
mSrlView.setEnableRefresh(true);
|
||||
// mLlMainNews.setOnClickListener(v -> ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
// .navigation());
|
||||
mRlvMainNews.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
|
||||
mRlvMainNews.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1,
|
||||
Color.parseColor("#F2F2F2")));
|
||||
mRlvMainNews.setAdapter(mMAdapter);
|
||||
|
||||
mRlvLives.setLayoutManager(new GridLayoutManager(mActivity, 2));
|
||||
mRlvLives.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1,
|
||||
Color.parseColor("#F2F2F2")));
|
||||
mLiveAdapter = new LiveAdapter(mActivity, mLiveBeans);
|
||||
mRlvLives.setAdapter(mLiveAdapter);
|
||||
|
||||
mMAdapter = new NewsAdapter(mActivity, mNewsBeans);
|
||||
mMAdapter.addOnItemClickByType(this::showNewsDetail);
|
||||
|
||||
mCommendAdapter = new MainCommendAdapter(mActivity, mMainCommendBeans);
|
||||
mRlvCommend.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.HORIZONTAL, false));
|
||||
mRlvCommend.setAdapter(mCommendAdapter);
|
||||
@ -175,10 +179,8 @@ public class HomeFragment extends BaseFragment {
|
||||
}
|
||||
});
|
||||
mMainCommendBeans.clear();
|
||||
mNewsSkeleton = Skeleton.bind(mRlvMainNews)
|
||||
.adapter(mMAdapter)
|
||||
.count(5)
|
||||
.load(R.layout.item_skeleton_news)
|
||||
mNewsSkeleton = Skeleton.bind(mLlNewsContent)
|
||||
.load(R.layout.item_skeleton_news_content)
|
||||
.show();
|
||||
mCommendSkeleton = Skeleton.bind(mRlvCommend)
|
||||
.adapter(mCommendAdapter)
|
||||
@ -193,10 +195,12 @@ public class HomeFragment extends BaseFragment {
|
||||
.count(5)
|
||||
.load(R.layout.item_skeleton_live_grid)
|
||||
.show();
|
||||
buildMainFuncMenu();
|
||||
buildMainFuncMenu(null);
|
||||
buildBannerData();
|
||||
getNewsList(null);
|
||||
getLiveList();
|
||||
getMainFuncMenu();//获取首页功能按钮
|
||||
getMainNewsTab();//获取首页动态新闻tab
|
||||
// getNewsList(null);
|
||||
//TODO 县城一级无直播 getLiveList();
|
||||
getMainCommendList();
|
||||
getBannerData();
|
||||
mBanner.setOnBannerListener((data, position) -> {
|
||||
@ -229,7 +233,77 @@ public class HomeFragment extends BaseFragment {
|
||||
// .navigation());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页动态栏目列表
|
||||
*/
|
||||
private void getMainNewsTab() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(HomeApi.class)
|
||||
.getMainNewsTab()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<NewsTabBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<NewsTabBean> newsTabBeans) {
|
||||
createNewsContent(newsTabBeans);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
e.printStackTrace();
|
||||
//TODO 错误处理
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页功能
|
||||
*/
|
||||
private void getMainFuncMenu() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(HomeApi.class)
|
||||
.getMainFunc()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<NewsTabBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<NewsTabBean> newsTabBeans) {
|
||||
if (newsTabBeans != null && newsTabBeans.size() > 0) {
|
||||
buildMainFuncMenu(newsTabBeans);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取精彩推荐
|
||||
* 3条场馆 3条活动
|
||||
*/
|
||||
private void getMainCommendList() {
|
||||
Observable[] mObservales = new Observable[2];
|
||||
Observable<PlaceListBean> hot = RetrofitManager.getInstance()
|
||||
@ -302,6 +376,7 @@ public class HomeFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mSrlView.finishRefresh();
|
||||
}
|
||||
});
|
||||
|
||||
@ -482,59 +557,116 @@ public class HomeFragment extends BaseFragment {
|
||||
private List<MainCommendBean> mMainCommendBeans = new ArrayList<>();
|
||||
|
||||
|
||||
// /**
|
||||
// * 获取新闻类型
|
||||
// */
|
||||
// private void getNewsTabs() {
|
||||
// RetrofitManager.getInstance()
|
||||
// .create(HomeApi.class)
|
||||
// .getNewsTabListByPid(PathConfig.NEWS_ID)
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new Observer<List<NewsTabBean>>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(List<NewsTabBean> newsTabBeans) {
|
||||
// if (newsTabBeans != null && newsTabBeans.size() > 0) {
|
||||
// mIvNewsEmpty.setVisibility(View.GONE);
|
||||
// Random random = new Random();
|
||||
// int i = random.nextInt(newsTabBeans.size());
|
||||
// if (TextUtils.isEmpty(UserLgUtils.getToken())) {
|
||||
//
|
||||
// } else {
|
||||
// getNewsListByToken(newsTabBeans.get(i));
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// if (mNewsSkeleton != null) {
|
||||
// mNewsSkeleton.hide();
|
||||
// }
|
||||
// mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e) {
|
||||
// if (mNewsSkeleton != null) {
|
||||
// mNewsSkeleton.hide();
|
||||
// }
|
||||
// mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// private void getNewsListByToken(NewsTabBean newsTabBean) {
|
||||
// RetrofitManager.getInstance()
|
||||
// .create(HomeApi.class)
|
||||
// .getNewsMainListByToken(newsTabBean.getNewsDirectoriesId(), "5", "1", UserLgUtils.getToken())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new Observer<NewsItemBean>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(NewsItemBean newsItemBean) {
|
||||
// if (newsItemBean != null) {
|
||||
// if (newsItemBean.getRows() != null) {
|
||||
// if (newsItemBean.getRows().size() > 5) {
|
||||
// mNewsBeans = newsItemBean.getRows().subList(0, 5);
|
||||
// } else {
|
||||
// mNewsBeans = newsItemBean.getRows();
|
||||
// }
|
||||
// if (newsItemBean.getRows().size() > 0) {
|
||||
// mIvNewsEmpty.setVisibility(View.GONE);
|
||||
// } else {
|
||||
// mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// } else {
|
||||
// mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// getCommentCount(1, newsItemBean);
|
||||
//// TODO mMAdapter.setData(mNewsBeans);
|
||||
// } else {
|
||||
// mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// if (mNewsSkeleton != null) {
|
||||
// mNewsSkeleton.hide();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e) {
|
||||
// if (mNewsSkeleton != null) {
|
||||
// mNewsSkeleton.hide();
|
||||
// }
|
||||
// mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取新闻类型
|
||||
* 获取新闻
|
||||
*/
|
||||
private void getNewsTabs() {
|
||||
private void getNewsList(NewsTabBean newsTabBean, BaseRecyclerAdapter adapter, RecyclerView rlvContent, CustomStateView stateView) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(HomeApi.class)
|
||||
.getNewsTabListByPid(PathConfig.NEWS_ID)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<NewsTabBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<NewsTabBean> newsTabBeans) {
|
||||
if (newsTabBeans != null && newsTabBeans.size() > 0) {
|
||||
mIvNewsEmpty.setVisibility(View.GONE);
|
||||
Random random = new Random();
|
||||
int i = random.nextInt(newsTabBeans.size());
|
||||
if (TextUtils.isEmpty(UserLgUtils.getToken())) {
|
||||
|
||||
} else {
|
||||
getNewsListByToken(newsTabBeans.get(i));
|
||||
}
|
||||
|
||||
} else {
|
||||
if (mNewsSkeleton != null) {
|
||||
mNewsSkeleton.hide();
|
||||
}
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (mNewsSkeleton != null) {
|
||||
mNewsSkeleton.hide();
|
||||
}
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getNewsListByToken(NewsTabBean newsTabBean) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(HomeApi.class)
|
||||
.getNewsMainListByToken(newsTabBean.getNewsDirectoriesId(), "5", "1", UserLgUtils.getToken())
|
||||
.getNewsTabListByPid(newsTabBean.getNewsDirectoriesId(), "5", "1")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<NewsItemBean>() {
|
||||
@ -547,23 +679,24 @@ public class HomeFragment extends BaseFragment {
|
||||
public void onNext(NewsItemBean newsItemBean) {
|
||||
if (newsItemBean != null) {
|
||||
if (newsItemBean.getRows() != null) {
|
||||
List<NewsItemBean.RowsBean> tempList;
|
||||
if (newsItemBean.getRows().size() > 5) {
|
||||
mNewsBeans = newsItemBean.getRows().subList(0, 5);
|
||||
tempList = newsItemBean.getRows().subList(0, 5);
|
||||
} else {
|
||||
mNewsBeans = newsItemBean.getRows();
|
||||
tempList = newsItemBean.getRows();
|
||||
}
|
||||
adapter.setData(tempList);
|
||||
if (newsItemBean.getRows().size() > 0) {
|
||||
mIvNewsEmpty.setVisibility(View.GONE);
|
||||
stateView.setState(CustomStateView.STATE_SUCCESS);
|
||||
} else {
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
stateView.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
} else {
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
stateView.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
getCommentCount(1, newsItemBean);
|
||||
// TODO mMAdapter.setData(mNewsBeans);
|
||||
} else {
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
stateView.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
if (mNewsSkeleton != null) {
|
||||
mNewsSkeleton.hide();
|
||||
@ -575,62 +708,7 @@ public class HomeFragment extends BaseFragment {
|
||||
if (mNewsSkeleton != null) {
|
||||
mNewsSkeleton.hide();
|
||||
}
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getNewsList(NewsTabBean newsTabBean) {
|
||||
//获取新闻
|
||||
RetrofitManager.getInstance()
|
||||
.create(HomeApi.class)
|
||||
.getNewsTabListByPid(PathConfig.NEWS_ID, "5", "1")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<NewsItemBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(NewsItemBean newsItemBean) {
|
||||
if (newsItemBean != null) {
|
||||
if (newsItemBean.getRows() != null) {
|
||||
if (newsItemBean.getRows().size() > 5) {
|
||||
mNewsBeans = newsItemBean.getRows().subList(0, 5);
|
||||
} else {
|
||||
mNewsBeans = newsItemBean.getRows();
|
||||
}
|
||||
if (newsItemBean.getRows().size() > 0) {
|
||||
mIvNewsEmpty.setVisibility(View.GONE);
|
||||
} else {
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
}
|
||||
getCommentCount(1, newsItemBean);
|
||||
// TODO mMAdapter.setData(mNewsBeans);
|
||||
} else {
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (mNewsSkeleton != null) {
|
||||
mNewsSkeleton.hide();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (mNewsSkeleton != null) {
|
||||
mNewsSkeleton.hide();
|
||||
}
|
||||
mIvNewsEmpty.setVisibility(View.VISIBLE);
|
||||
stateView.setState(CustomStateView.STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -698,49 +776,56 @@ public class HomeFragment extends BaseFragment {
|
||||
/**
|
||||
* 构建首页按钮
|
||||
*/
|
||||
private void buildMainFuncMenu() {
|
||||
private void buildMainFuncMenu(List<NewsTabBean> list) {
|
||||
mFuncBeans.clear();
|
||||
MainFuncBean activityBean = new MainFuncBean();
|
||||
activityBean.setIconRes(R.drawable.ic_activity_icon);
|
||||
activityBean.setTitle("精彩活动");
|
||||
MainFuncBean placeBean = new MainFuncBean();
|
||||
placeBean.setIconRes(R.drawable.ic_place_icon);
|
||||
placeBean.setTitle("场馆导航");
|
||||
MainFuncBean culturalBean = new MainFuncBean();
|
||||
culturalBean.setIconRes(R.drawable.ic_legacy_icon);
|
||||
culturalBean.setTitle("非遗文化");
|
||||
MainFuncBean movieBean = new MainFuncBean();
|
||||
movieBean.setIconRes(R.drawable.ic_live_icon);
|
||||
movieBean.setTitle("直播点播");
|
||||
MainFuncBean volunBean = new MainFuncBean();
|
||||
volunBean.setIconRes(R.drawable.ic_volunteer_icon);
|
||||
volunBean.setTitle("志愿者服务");
|
||||
MainFuncBean showBean = new MainFuncBean();
|
||||
showBean.setIconRes(R.drawable.ic_show_icon);
|
||||
showBean.setTitle("展览展示");
|
||||
MainFuncBean culBean = new MainFuncBean();
|
||||
culBean.setIconRes(R.drawable.ic_cultural_trends_icon);
|
||||
culBean.setTitle("文化动态");
|
||||
MainFuncBean bookBean = new MainFuncBean();
|
||||
bookBean.setIconRes(R.drawable.ic_legacy_icon);
|
||||
bookBean.setTitle("数图资源");
|
||||
MainFuncBean cultivlateBean = new MainFuncBean();
|
||||
cultivlateBean.setIconRes(R.drawable.ic_live_icon);
|
||||
cultivlateBean.setTitle("在线培训");
|
||||
MainFuncBean tourBean = new MainFuncBean();
|
||||
tourBean.setIconRes(R.drawable.ic_place_icon);
|
||||
tourBean.setTitle("文化旅游");
|
||||
// MainFuncBean movieBean = new MainFuncBean();
|
||||
// movieBean.setIconRes(R.drawable.ic_live_icon);
|
||||
// movieBean.setTitle("直播点播");
|
||||
|
||||
mFuncBeans.add(showBean);
|
||||
mFuncBeans.add(culBean);
|
||||
mFuncBeans.add(cultivlateBean);
|
||||
mFuncBeans.add(tourBean);
|
||||
mFuncBeans.add(bookBean);
|
||||
// MainFuncBean showBean = new MainFuncBean();
|
||||
// showBean.setIconRes(R.drawable.ic_show_icon);
|
||||
// showBean.setTitle("展览展示");
|
||||
// MainFuncBean culBean = new MainFuncBean();
|
||||
// culBean.setIconRes(R.drawable.ic_cultural_trends_icon);
|
||||
// culBean.setTitle("文化动态");
|
||||
// MainFuncBean bookBean = new MainFuncBean();
|
||||
// bookBean.setIconRes(R.drawable.ic_legacy_icon);
|
||||
// bookBean.setTitle("数图资源");
|
||||
// MainFuncBean cultivlateBean = new MainFuncBean();
|
||||
// cultivlateBean.setIconRes(R.drawable.ic_live_icon);
|
||||
// cultivlateBean.setTitle("在线培训");
|
||||
// MainFuncBean tourBean = new MainFuncBean();
|
||||
// tourBean.setIconRes(R.drawable.ic_place_icon);
|
||||
// tourBean.setTitle("文化旅游");
|
||||
|
||||
// mFuncBeans.add(showBean);
|
||||
// mFuncBeans.add(culBean);
|
||||
// mFuncBeans.add(cultivlateBean);
|
||||
// mFuncBeans.add(tourBean);
|
||||
// mFuncBeans.add(bookBean);
|
||||
if (list != null && list.size() > 0) {
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// list.get(i).setLocalRes(-1);
|
||||
// }
|
||||
mFuncBeans.addAll(list);
|
||||
}
|
||||
NewsTabBean activityBean = new NewsTabBean();
|
||||
activityBean.setLocalRes(R.drawable.ic_activity_icon);
|
||||
activityBean.setDirectoriesName("精彩活动");
|
||||
NewsTabBean placeBean = new NewsTabBean();
|
||||
placeBean.setLocalRes(R.drawable.ic_place_icon);
|
||||
placeBean.setDirectoriesName("场馆导航");
|
||||
NewsTabBean culturalBean = new NewsTabBean();
|
||||
culturalBean.setLocalRes(R.drawable.ic_legacy_icon);
|
||||
culturalBean.setDirectoriesName("非遗文化");
|
||||
NewsTabBean volunBean = new NewsTabBean();
|
||||
volunBean.setLocalRes(R.drawable.ic_volunteer_icon);
|
||||
volunBean.setDirectoriesName("志愿者服务");
|
||||
mFuncBeans.add(volunBean);
|
||||
mFuncBeans.add(activityBean);
|
||||
mFuncBeans.add(placeBean);
|
||||
mFuncBeans.add(culturalBean);
|
||||
mFuncBeans.add(movieBean);
|
||||
// mFuncBeans.add(movieBean);
|
||||
|
||||
MainFuncAdapter funcAdapter = new MainFuncAdapter(getActivity(), mFuncBeans);
|
||||
LinearLayoutManager manager = new LinearLayoutManager(mActivity, LinearLayoutManager.HORIZONTAL, false);
|
||||
@ -781,48 +866,170 @@ public class HomeFragment extends BaseFragment {
|
||||
*
|
||||
* @param mainFuncBean
|
||||
*/
|
||||
private void chooseFuncPage(MainFuncBean mainFuncBean) {
|
||||
if ("精彩活动".equals(mainFuncBean.getTitle())) {
|
||||
// TODO mMainActivity.setCurrentPage(1, "活动");
|
||||
} else if ("场馆导航".equals(mainFuncBean.getTitle())) {
|
||||
private void chooseFuncPage(NewsTabBean mainFuncBean) {
|
||||
if ("精彩活动".equals(mainFuncBean.getDirectoriesName())) {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULEACTIVITY_ACTIVITY_MAIN)
|
||||
.navigation();
|
||||
} else if ("场馆导航".equals(mainFuncBean.getDirectoriesName())) {
|
||||
mMainActivity.setCurrentPage(2, "场馆");
|
||||
} else if ("非遗文化".equals(mainFuncBean.getTitle())) {
|
||||
} else if ("非遗文化".equals(mainFuncBean.getDirectoriesName())) {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_CULTURAL_ACTIVITY_LEGACY).navigation();
|
||||
} else if ("直播点播".equals(mainFuncBean.getTitle())) {
|
||||
} else if ("直播点播".equals(mainFuncBean.getDirectoriesName())) {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_CULTURAL_LIVE).navigation();
|
||||
} else if ("志愿者服务".equals(mainFuncBean.getTitle())) {
|
||||
} else if ("志愿者服务".equals(mainFuncBean.getDirectoriesName())) {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_CULTURAL_VOUNTEER_MAIN).navigation();
|
||||
} else if ("文化动态".equals(mainFuncBean.getTitle())) {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
.withString("title", "文化动态")
|
||||
.withString("id", PathConfig.NEWS_ID)
|
||||
.navigation();
|
||||
} else if ("展览展示".equals(mainFuncBean.getTitle())) {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
.withString("title", "展览展示")
|
||||
.withString("id", PathConfig.NEWS_SHOW_ID)
|
||||
.navigation();
|
||||
} else if ("数图资源".equals(mainFuncBean.getTitle())) {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
.withString("title", "数图资源")
|
||||
.withString("id", PathConfig.NEWS_BOOKS_ID)
|
||||
.navigation();
|
||||
} else if ("在线培训".equals(mainFuncBean.getTitle())) {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
.withString("title", "在线培训")
|
||||
.withString("id", PathConfig.NEWS_CULTIVATE_ID)
|
||||
.navigation();
|
||||
} else if ("文化旅游".equals(mainFuncBean.getTitle())) {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_LIST)
|
||||
.withString("id", PathConfig.NEWS_TOUR_ID)
|
||||
.withString("title", "文化旅游")
|
||||
.navigation();
|
||||
} else {
|
||||
//0外部连接 1列表 2详情
|
||||
if ("1".equals(mainFuncBean.getDirectoriesView())) {
|
||||
//列表
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_LIST)
|
||||
.withString("id", mainFuncBean.getNewsDirectoriesId())
|
||||
.withString("title", mainFuncBean.getDirectoriesName())
|
||||
.navigation();
|
||||
} else if ("0".equals(mainFuncBean.getDirectoriesView())) {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAIN_NEWS_WEB)
|
||||
.withString("url", mainFuncBean.getDirectoriesTarget2())
|
||||
.withString("title", mainFuncBean.getDirectoriesName())
|
||||
.navigation();
|
||||
} else {
|
||||
ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
.withString("title", mainFuncBean.getDirectoriesName())
|
||||
.withString("id", mainFuncBean.getNewsDirectoriesId())
|
||||
.navigation();
|
||||
}
|
||||
//在线培训 文化旅游 文化动态 展览展示 数图资源
|
||||
//判断跳转列表页面或带下级页面
|
||||
// if ("文化动态".equals(mainFuncBean.getDirectoriesName())) {
|
||||
// ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
// .withString("title", "文化动态")
|
||||
// .withString("id", PathConfig.NEWS_ID)
|
||||
// .navigation();
|
||||
// } else if ("展览展示".equals(mainFuncBean.getDirectoriesName())) {
|
||||
// ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
// .withString("title", "展览展示")
|
||||
// .withString("id", PathConfig.NEWS_SHOW_ID)
|
||||
// .navigation();
|
||||
// } else if ("数图资源".equals(mainFuncBean.getDirectoriesName())) {
|
||||
// ARouter.getInstance().build(PathConfig.PATH_MODULE_MAIN_NEWS_MAIN)
|
||||
// .withString("title", "数图资源")
|
||||
// .withString("id", PathConfig.NEWS_BOOKS_ID)
|
||||
// .navigation();
|
||||
// } else if ("在线培训".equals(mainFuncBean.getDirectoriesName())) {
|
||||
|
||||
// } else if ("文化旅游".equals(mainFuncBean.getDirectoriesName())) {
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
private void createNewsContent(List<NewsTabBean> list) {
|
||||
if (list != null && list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
NewsTabBean b = list.get(i);
|
||||
List<NewsItemBean.RowsBean> tempList = new ArrayList<>();
|
||||
LinearLayout contentLayout = new LinearLayout(mActivity);
|
||||
contentLayout.setOrientation(LinearLayout.VERTICAL);
|
||||
LinearLayout.LayoutParams contentParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
contentParams.gravity = Gravity.CENTER_HORIZONTAL;
|
||||
contentLayout.setLayoutParams(contentParams);
|
||||
|
||||
LinearLayout titleLayout = new LinearLayout(mActivity);
|
||||
titleLayout.setOrientation(LinearLayout.HORIZONTAL);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
params.gravity = Gravity.CENTER;
|
||||
titleLayout.setLayoutParams(params);
|
||||
titleLayout.setGravity(Gravity.CENTER);
|
||||
titleLayout.setPadding(ConvertUtils.dp2px(8), ConvertUtils.dp2px(8), ConvertUtils.dp2px(8), ConvertUtils.dp2px(8));
|
||||
|
||||
LinearLayout.LayoutParams imgParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
ImageView ivLeft = new ImageView(mActivity);
|
||||
ivLeft.setLayoutParams(imgParams);
|
||||
ivLeft.setBackgroundResource(R.drawable.ic_tab_icon_left);
|
||||
|
||||
ImageView ivRight = new ImageView(mActivity);
|
||||
ivRight.setLayoutParams(imgParams);
|
||||
ivRight.setBackgroundResource(R.drawable.ic_tab_icon_right);
|
||||
|
||||
TypeFaceTextView titleView = new TypeFaceTextView(mActivity);
|
||||
LinearLayout.LayoutParams titleParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
titleParams.gravity = Gravity.CENTER;
|
||||
titleView.setPadding(ConvertUtils.dp2px(8), 0, ConvertUtils.dp2px(8), 0);
|
||||
titleView.setText(b.getDirectoriesName());
|
||||
titleView.setTypeFaceType(2);
|
||||
titleView.setLayoutParams(titleParams);
|
||||
titleView.setTextColor(mActivity.getResources().getColor(R.color.app_title_9f_no));
|
||||
|
||||
titleLayout.addView(ivLeft);
|
||||
titleLayout.addView(titleView);
|
||||
titleLayout.addView(ivRight);
|
||||
titleLayout.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAIN_NEWS_LIST)
|
||||
.withString("id", b.getNewsDirectoriesId())
|
||||
.withString("title", b.getDirectoriesName())
|
||||
.navigation());
|
||||
//分割线
|
||||
View line = new View(mActivity);
|
||||
LinearLayout.LayoutParams lineParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
lineParams.height = ConvertUtils.dp2px(1);
|
||||
line.setLayoutParams(lineParams);
|
||||
line.setBackgroundColor(mActivity.getResources().getColor(R.color.gray_line));
|
||||
// recyclerview
|
||||
RelativeLayout.LayoutParams conParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
RecyclerView rlvContent = new RecyclerView(mActivity);
|
||||
rlvContent.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
rlvContent.setLayoutParams(conParams);
|
||||
|
||||
NewsAdapter adapter = new NewsAdapter(mActivity, tempList);
|
||||
adapter.addOnItemClickByType(this::showNewsDetail);
|
||||
RelativeLayout rlvLayout = new RelativeLayout(mActivity);
|
||||
rlvLayout.setBackgroundColor(Color.parseColor("#000000"));
|
||||
RelativeLayout.LayoutParams rlvParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
rlvParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
|
||||
rlvLayout.setLayoutParams(rlvParams);
|
||||
|
||||
rlvContent.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
|
||||
rlvContent.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1,
|
||||
Color.parseColor("#F2F2F2")));
|
||||
rlvContent.setAdapter(adapter);
|
||||
//状态
|
||||
CustomStateView stateView = new CustomStateView(mActivity);
|
||||
RelativeLayout.LayoutParams stateParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
stateParams.addRule(RelativeLayout.CENTER_IN_PARENT);
|
||||
stateView.setLayoutParams(stateParams);
|
||||
stateView.setState(CustomStateView.STATE_LOAD);
|
||||
|
||||
rlvLayout.addView(rlvContent);
|
||||
rlvLayout.addView(stateView);
|
||||
//添加View
|
||||
contentLayout.addView(titleLayout);
|
||||
contentLayout.addView(line);
|
||||
contentLayout.addView(rlvLayout);
|
||||
mLlNewsContent.addView(contentLayout);
|
||||
//获取数据
|
||||
getNewsList(b, adapter, rlvContent, stateView);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshView() {
|
||||
mSrlView.finishRefresh();
|
||||
mBannerList.clear();
|
||||
mNewsBeans.clear();
|
||||
mMainCommendBeans.clear();
|
||||
if (mNewsSkeleton != null) {
|
||||
mNewsSkeleton.show();
|
||||
}
|
||||
// getNewsList(null);
|
||||
mLlNewsContent.removeAllViews();
|
||||
getMainFuncMenu();
|
||||
getMainNewsTab();
|
||||
getBannerData();
|
||||
getMainCommendList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -837,9 +1044,12 @@ public class HomeFragment extends BaseFragment {
|
||||
public void notifyData() {
|
||||
//重新加载数据
|
||||
mMainCommendBeans.clear();
|
||||
mLlNewsContent.removeAllViews();
|
||||
buildBannerData();
|
||||
getNewsList(null);
|
||||
getLiveList();
|
||||
getMainFuncMenu();
|
||||
getMainNewsTab();
|
||||
// getNewsList(null);
|
||||
// getLiveList();
|
||||
getMainCommendList();
|
||||
getBannerData();
|
||||
}
|
||||
|
@ -111,6 +111,7 @@ public class NewsFragment extends BaseFragment {
|
||||
private void showNewsDetail(NewsItemBean.RowsBean rowsBean, int type) {
|
||||
String url = "";
|
||||
if ("6".equals(rowsBean.getNewsContentType())) {
|
||||
//链接新闻
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAIN_NEWS_WEB)
|
||||
.withString("url", rowsBean.getNewsContentContent())
|
||||
|
@ -0,0 +1,143 @@
|
||||
package com.tengshisoft.mudulemain.cultural.fragment;
|
||||
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.webkit.HttpAuthHandler;
|
||||
import android.webkit.JsResult;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseFragment;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.ViewPageWebView;
|
||||
import com.tengshisoft.mudulemain.R;
|
||||
import com.tengshisoft.mudulemain.R2;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/29 - 4:26 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 新闻页面
|
||||
*/
|
||||
public class NewsWebFragment extends BaseFragment {
|
||||
@BindView(R2.id.wv_content)
|
||||
ViewPageWebView mWvContent;
|
||||
|
||||
private Unbinder mBind;
|
||||
private String mType;
|
||||
|
||||
@Override
|
||||
protected void setDataToView(View dataView) {
|
||||
mBind = ButterKnife.bind(this, dataView);
|
||||
setStateView(STATE_SUCCESS);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
mSrlView.setEnableRefresh(false);
|
||||
mType = getArguments().getString("type");
|
||||
String url = getArguments().getString("url");
|
||||
if (!TextUtils.isEmpty(url)) {
|
||||
setData(url);
|
||||
} else {
|
||||
setStateView(STATE_EMPTY);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
mSrlView.setEnableRefresh(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void setData(String url) {
|
||||
WebSettings settings = mWvContent.getSettings();
|
||||
settings.setCacheMode(WebSettings.LOAD_DEFAULT);
|
||||
settings.setAppCacheEnabled(true);
|
||||
settings.setJavaScriptEnabled(true);//启用JS
|
||||
settings.setBlockNetworkImage(true);//阻塞页面图片加载
|
||||
settings.setDomStorageEnabled(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
mWvContent.loadUrl(url);
|
||||
mWvContent.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
handler.proceed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
view.getSettings().setBlockNetworkImage(false);//开启页面图片加载
|
||||
mActivity.runOnUiThread(() -> mWvContent.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
|
||||
super.onReceivedHttpAuthRequest(view, handler, host, realm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (url.contains(BaseUrlApi.BASE_SYSTEM_IP + "news/route/file/download/true")) {
|
||||
//TODO 数图资源
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAIN_NEWS_PDF)
|
||||
.withString("title", "详情")
|
||||
.withString("url", url)
|
||||
.navigation();
|
||||
} else {
|
||||
view.loadUrl(url);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
mWvContent.setWebChromeClient(new WebChromeClient() {
|
||||
|
||||
@Override
|
||||
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
|
||||
return super.onJsAlert(view, url, message, result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void refreshView() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (mWvContent != null) {
|
||||
mWvContent = null;
|
||||
}
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void loadMoreData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getContentViewId() {
|
||||
return R.layout.fragment_news_web;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
@ -9,6 +9,7 @@ import com.tengshisoft.mudulemain.cultural.beans.AreaListBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.BaseUserBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.CommentListBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsCommentCount;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsDetailBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsItemBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.NewsTabBean;
|
||||
import com.tengshisoft.mudulemain.cultural.beans.SearchBean;
|
||||
@ -60,6 +61,7 @@ public interface HomeApi {
|
||||
@POST("app/sign/default")
|
||||
Observable<BaseUserBean> doLogin(@Body RequestBody user);
|
||||
|
||||
|
||||
/**
|
||||
* 登录-手机号
|
||||
*
|
||||
@ -67,7 +69,7 @@ public interface HomeApi {
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type: application/json", "Accept: application/json"})
|
||||
@POST("app/sign/loginphone")
|
||||
@POST("app/sign/phone")
|
||||
Observable<BaseUserBean> doLoginWithPhone(@Body RequestBody user);
|
||||
|
||||
/**
|
||||
@ -90,9 +92,8 @@ public interface HomeApi {
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:activity", "Content-Type:application/json", "Accept:application/json", "is_need_area" +
|
||||
":true"})
|
||||
@GET("app/activitylibrary/listpageactivitylibraryrelease")
|
||||
@Headers({"base_url_name:activity", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/activitylibrary/listpageactivitylibraryfornetrelease")
|
||||
Observable<ActivityListBeans> getMainActivityList(@Query("page") String page, @Query("rows") String rows);
|
||||
|
||||
/**
|
||||
@ -105,28 +106,43 @@ public interface HomeApi {
|
||||
Observable<List<NewsTabBean>> getNewsTabList();
|
||||
|
||||
/**
|
||||
* 获取新闻子类别
|
||||
*
|
||||
* @return
|
||||
* 首页功能按钮
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
|
||||
@GET("app/newsdirectories/listnewsdirectoriesrelease")
|
||||
Observable<List<NewsTabBean>> getNewsTabListByPid(@Query("directoriesParentId") String pid);
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/newsdirectories/list/areamenu/release")
|
||||
Observable<List<NewsTabBean>> getMainFunc();
|
||||
|
||||
/**
|
||||
* 首页动态列表
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/newsdirectories/list/areaplate/release")
|
||||
Observable<List<NewsTabBean>> getMainNewsTab();
|
||||
|
||||
/**
|
||||
* 获取新闻子类别
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
// @GET("app/newsdirectories/listnewsdirectoriesrelease")
|
||||
@GET("app/newsdirectories/listsub/areaauth/release/{newsDirectoriesId}")
|
||||
Observable<List<NewsTabBean>> getNewsTabListByPid(@Path("newsDirectoriesId") String pid);
|
||||
|
||||
/**
|
||||
* 获取新闻子类别
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/newscontent/listpagenewscontentrelease")
|
||||
Observable<NewsItemBean> getNewsTabListByPid(@Query("newsDirectoriesParentId") String pid,
|
||||
@Query("rows") String rows, @Query("page") String page);
|
||||
Observable<NewsItemBean> getNewsTabListByPid(@Query("newsDirectoriesId") String pid, @Query("rows") String rows, @Query("page") String page);
|
||||
// Observable<NewsItemBean> getNewsTabListByPid(@Query("newsDirectoriesParentId") String pid, @Query("rows") String rows, @Query("page") String page);
|
||||
|
||||
/**
|
||||
* 获取新闻列表-不需要token
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/newscontent/listpagenewscontentrelease")
|
||||
Observable<NewsItemBean> getNewsList(@Query("newsDirectoriesId") String newsDirectoriesId,
|
||||
@Query("page") String page);
|
||||
@ -141,7 +157,7 @@ public interface HomeApi {
|
||||
/**
|
||||
* 获取新闻列表-不需要token
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/newscontent/listpagenewscontentrelease")
|
||||
Observable<NewsItemBean> getMainNewsList(@Query("newsDirectoriesId") String newsDirectoriesId,
|
||||
@Query("rows") String rows, @Query("page") String page);
|
||||
@ -149,7 +165,7 @@ public interface HomeApi {
|
||||
/**
|
||||
* 获取新闻列表-需要token
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/newscontent/listpagenewscontent")
|
||||
Observable<NewsItemBean> getNewsListByToken(@Query("newsDirectoriesId") String newsDirectoriesId,
|
||||
@Query("page") String page, @Header("token") String token);
|
||||
@ -157,11 +173,19 @@ public interface HomeApi {
|
||||
/**
|
||||
* 获取新闻列表-需要token
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/newscontent/listpagenewscontent")
|
||||
Observable<NewsItemBean> getNewsMainListByToken(@Query("newsDirectoriesId") String newsDirectoriesId, @Query(
|
||||
"rows") String rows, @Query("page") String page, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 获取新闻详情
|
||||
*/
|
||||
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/newscontent/getnewscontentbyidrelease/{id}")
|
||||
Observable<NewsDetailBean> getNewsDetail(@Path("id") String id);
|
||||
|
||||
|
||||
/**
|
||||
* 获取评论列表
|
||||
*/
|
||||
@ -246,7 +270,7 @@ public interface HomeApi {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:place", "Content-Type:application/json", "Accept:application/json"})
|
||||
@Headers({"base_url_name:place", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/venuesinfo/listpagevenuesinforelease")
|
||||
Observable<PlaceListBean> getPlaceByOrder(@Query("latitude") String lat, @Query("longitude") String lng, @Query(
|
||||
"orderKey") String order, @Query("page") String page, @Query("rows") String rows);
|
||||
@ -255,7 +279,7 @@ public interface HomeApi {
|
||||
* 直播回放列表
|
||||
* http://192.168.0.104:8084/live/
|
||||
*/
|
||||
@Headers({"base_url_name:live", "Content-Type:application/json", "Accept:application/json", "is_need_area:false"})
|
||||
@Headers({"base_url_name:live", "Content-Type:application/json", "Accept:application/json", "need_area:false"})
|
||||
@GET("app/liveplan/listpageliveplanrelease")
|
||||
Observable<CulturalLiveBean> getLiveRecord(@Query("page") String page, @Query("rows") String rows);
|
||||
|
||||
@ -266,7 +290,7 @@ public interface HomeApi {
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/area/listallbyparentidrelease/{areaParentId}")
|
||||
@GET("app/area/listbyparentidrelease/{areaParentId}")
|
||||
Observable<List<AreaListBean>> getAreaListByPid(@Path("areaParentId") String pId);
|
||||
|
||||
/**
|
||||
|
@ -79,6 +79,53 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/shape_login_gray_border"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="验  证  码:"
|
||||
android:textColor="@color/app_title_9f_no"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_verify_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="请输入验证码"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_verify_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sel_register_btn_verify_bg"
|
||||
android:minHeight="0dp"
|
||||
android:padding="5dp"
|
||||
android:text="获取验证码"
|
||||
android:textColor="@color/col_activity_code"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -86,7 +133,8 @@
|
||||
android:background="@drawable/shape_login_gray_border"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
android:padding="8dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -138,7 +186,7 @@
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/btn_do_login"
|
||||
@ -146,10 +194,10 @@
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_register"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
@ -172,6 +220,7 @@
|
||||
android:text="忘记密码"
|
||||
android:textColor="@color/app_title_9f_no"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -89,7 +88,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp">
|
||||
android:padding="5dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -121,7 +121,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="5dp">
|
||||
android:padding="5dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -119,73 +119,26 @@
|
||||
android:background="@color/gray_line" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_main_news"
|
||||
android:id="@+id/ll_news_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_tab_icon_left" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_main_news"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:text="文化动态"
|
||||
android:textColor="@color/app_title_9f_no"
|
||||
android:textSize="18sp"
|
||||
app:text_type_cus="2" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_tab_icon_right" />
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/gray_line" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_main_news"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_news_empty"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/ic_empty_data"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@color/gray_line" />
|
||||
android:background="@color/gray_line"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_live"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
@ -213,11 +166,13 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/gray_line" />
|
||||
android:background="@color/gray_line"
|
||||
android:visibility="gone" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_lives"
|
||||
|
15
modulemain/src/main/res/layout/fragment_news_web.xml
Executable file
15
modulemain/src/main/res/layout/fragment_news_web.xml
Executable file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/Theme.AppCompat"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.ViewPageWebView
|
||||
android:id="@+id/wv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
@ -66,6 +66,7 @@ public class ChangePhoneActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
setEditTextInputSpeChar(mEtPhone);
|
||||
setEditTextInputSpeChar(mEtOldPhone);
|
||||
mEtOldPhone.setText(UserLgUtils.getUserName());
|
||||
mBtnVerifyCode.setOnClickListener(v -> getVerifyCode());
|
||||
mBtnDoRegister.setOnClickListener(v -> doRegister());
|
||||
}
|
||||
@ -201,7 +202,7 @@ public class ChangePhoneActivity extends BaseActivity {
|
||||
*/
|
||||
private void getVerifyCode() {
|
||||
if (checkPhone()) {
|
||||
String phone = mEtOldPhone.getText().toString().trim();
|
||||
String phone = mEtPhone.getText().toString().trim();
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
dialog.show();
|
||||
mBtnVerifyCode.setEnabled(false);
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@ -30,6 +28,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_bottom_line"
|
||||
android:enabled="false"
|
||||
android:hint="请输入您原来的手机号码"
|
||||
android:inputType="number"
|
||||
android:padding="8dp"
|
||||
|
@ -82,6 +82,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardElevation="3dp">
|
||||
|
||||
|
@ -35,7 +35,7 @@ public interface ApiPlace {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:place", "Content-Type:application/json", "Accept:application/json"})
|
||||
@Headers({"base_url_name:place", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/venuesinfo/listpagevenuesinforelease")
|
||||
Observable<PlaceListBean> getPlaceByOrder(@Query("latitude") String lat, @Query("longitude") String lng, @Query(
|
||||
"orderKey") String order, @Query("page") String page, @Query("rows") String rows);
|
||||
@ -45,11 +45,10 @@ public interface ApiPlace {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:place", "Content-Type:application/json", "Accept:application/json"})
|
||||
@Headers({"base_url_name:place", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
|
||||
@GET("app/venuesinfo/listpagevenuesinforelease")
|
||||
Observable<PlaceListBean> getPlaceByDictionId(@Query("latitude") String lat, @Query("longitude") String lng,
|
||||
@Query("venueType") String dId, @Query("page") String page, @Query(
|
||||
"rows") String rows);
|
||||
Observable<PlaceListBean> getPlaceByDictionId(@Query("latitude") String lat, @Query("longitude") String lng, @Query("venueType") String dId, @Query("page") String page,
|
||||
@Query("rows") String rows);
|
||||
|
||||
/**
|
||||
* 获取场馆类型-全部
|
||||
|
Loading…
Reference in New Issue
Block a user