新闻详情接口方式

This commit is contained in:
itgaojian 2023-03-10 14:43:51 +08:00
parent 34e2a6d41e
commit 5618891fd1
56 changed files with 1602 additions and 432 deletions

View File

@ -96,7 +96,6 @@ public class PathConfig {
public static final String PATH_MODULE_MAIN_PLAN = "/modulemain/activity/planMap";
public static final String PATH_MODULE_MAIN_LOGIN = "/modulemain/activity/login";//登录
public static final String PATH_MODULE_MAIN_NEWS_DETAIL = "/modulemain/activity/news/detail";//详情页面
public static final String PATH_MODULE_MAIN_NEWS_DETAIL_INTERFACE = "/modulemain/activity/newsInterface";//新闻详情页面-接口方式
public static final String PATH_MODULE_MAIN_FRAGMENT_MAIN = "/modulemain/fragment/main";//首页fragment
public static final String PATH_MODULE_MAIN_NEWS_LIST = "/modulemain/activity/newslist";
@ -111,6 +110,7 @@ public class PathConfig {
public static final String PATH_MODULE_MAIN_CHOOSE_CITY = "/modulemain/activity/choosecity";//选择城市
public static final String PATH_MODULE_MAIN_NEWS_WEB = "/modulemain/activity/newsweb";//连接新闻页
public static final String PATH_MODULE_MAIN_NEWS_DETAIL_INTERFACE = "/modulemain/activity/newsInterface";//新闻详情页面-接口方式
public static final String PATH_MODULE_MAIN_NEWS_SEARCH = "/modulemain/activity/newsSearch";//新闻收搜
//======================Map==================================================
public static final String PATH_MODULE_MAP_NAVIGATION = "/modulemap/activity/navigation";//地图
@ -276,5 +276,4 @@ public class PathConfig {
public static final String PATH_MODULE_SHOP_ACTIVITY_SHOP_MINE_ORDER_DETAIL = "/moduleshop/activity/shopOrderDetail";//我的订单
public static final String PATH_MODULE_SHOP_ACTIVITY_SHOP_ADD_ADDRESS = "/moduleshop/activity/shopAddAddress";//新增收货地
}

View File

@ -53,13 +53,14 @@ public class BaseUrlApi {
public static final String BASE_ACTIVIY_IP = BASE_SYSTEM_IP;/* 活动URL */
public static final String BASE_PLACE_IP = BASE_SYSTEM_IP;/* 场馆 */
public static final String BASE_VOLUNTEER_IP = BASE_SYSTEM_IP;/* 志愿者 */
public static final String BASE_LIVE_IP = BASE_SYSTEM_IP + "live/";
public static final String BASE_LIVE_IP = IP_URL + "live/";
public static final String BASE_BIG_DATA = IP_URL + "module/";//大数据接口
public static final String BASE_LIVE_URL = BASE_SYSTEM_IP;//直播回放视频url
public static final String BASE_CULTURAL_SHARE = BASE_SYSTEM_IP;/* 文化分享 */
public static final String BASE_LEGACY_IP = BASE_SYSTEM_IP;//非遗数据库
public static final String BASE_NEWS_IP = BASE_SYSTEM_IP;//新闻
public static final String BASE_SHOP_IP = IP_URL + "xzshop";//商城
public static final String BASE_BIG_DATA = IP_URL + "module/";//大数据接口
public static final String BASE_SHOP_IP = IP_URL + "xzshop/";//商城
// public static final String BASE_PLACE_IP = TEMP_IP + "venuebooking/";/* 场馆 */
public static final String BASE_PLACE_IMG_IP = BASE_PLACE_IP + "route/file/download/true/";/* 场馆 */
public static final String BASE_CULTURAL_IP = BASE_SYSTEM_IP + "culturalactivity/";/* 文化URL */
@ -69,6 +70,7 @@ public class BaseUrlApi {
public static final String BASE_NEWS_DETAIL = IP_URL;//新闻
// public static final String BASE_NEWS_DETAIL = "http://192.168.0.120:80/";//新闻
// 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;

View File

@ -314,7 +314,6 @@ public interface BaseApiService {
@GET("app/area/getrelease/{areaId}")
Observable<AreaBean> getAreaDetail(@Path("areaId") String pId);
/**
* 大数据-浏览量
* 详情浏览量 (网页|安卓|小程序)[a-zA-Z0-9-]{36}(新闻|活动|非遗|场馆|直播|志愿) 我后台正则是这样的
@ -325,5 +324,4 @@ public interface BaseApiService {
@Headers({"base_url_name:bigdata", "Content-Type:application/json", "Accept:application/json"})
@GET("app/contentcensusrelease/log")
Observable<BaseSuccessBean> bigDataRead(@Query("requestUrl") String id);
}

View File

@ -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,16 +24,7 @@ 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 name = "area" + cityLevel;
String areaCode = UserLgUtils.getCityCode();
// if (TextUtils.isEmpty(areaId)) {
// areaId = PathConfig.CITY_DEFAULT_CODE;
// }
// String cityId = UserLgUtils.getCityId();
//判断是否需要添加
List<String> baseUrlName = originalRequest.headers("need_area");
if (baseUrlName.size() > 0) {

View File

@ -130,6 +130,25 @@ public abstract class BaseActivity extends AppCompatActivity {
mRlNotify.setVisibility(View.GONE);
}
public void setEditTextInhibitInputSpeChat(EditText editText) {
InputFilter inputFilter = new InputFilter() {
Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",
Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
Matcher emojiMatcher = emoji.matcher(source);
if (emojiMatcher.find()) {
// Toast.makeText(MainActivity.this,"不支持输入表情", 0).show();
ToastUtils.showShort("不支持输入表情");
return "";
}
return null;
}
};
editText.setFilters(new InputFilter[]{inputFilter});
}
/**
* 大数据-详情浏览
@ -165,27 +184,6 @@ public abstract class BaseActivity extends AppCompatActivity {
});
}
public void setEditTextInhibitInputSpeChat(EditText editText) {
InputFilter inputFilter = new InputFilter() {
Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",
Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
Matcher emojiMatcher = emoji.matcher(source);
if (emojiMatcher.find()) {
// Toast.makeText(MainActivity.this,"不支持输入表情", 0).show();
ToastUtils.showShort("不支持输入表情");
return "";
}
return null;
}
};
editText.setFilters(new InputFilter[]{inputFilter});
}
/**
* 设置只能输入汉字.字母.数字
*
@ -665,7 +663,7 @@ public abstract class BaseActivity extends AppCompatActivity {
/**
* 是否登录
*
* @return
* @return true 已经登录 false 未登录
*/
protected boolean isLogin() {
return !TextUtils.isEmpty(UserLgUtils.getToken());

View File

@ -80,6 +80,10 @@ public class BottomCancelOrderDialog extends Dialog {
}
DicSelAdapter adapter = new DicSelAdapter(context, list);
rlvReason.setAdapter(adapter);
if (list != null && list.size() > 0) {
list.get(0).setCheck(true);
}
adapter.addOnItemClickListener(baseDictionaryBean -> {
for (BaseDictionaryBean b : list) {
if (b.getDataId().equals(baseDictionaryBean.getDataId())) {

View File

@ -28,10 +28,6 @@ import android.view.MotionEvent;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
import com.sucstepsoft.cm_utils.R;
import java.util.ArrayList;
@ -42,6 +38,11 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
/**
* @date: on 2018-08-24
* @author: cretin
@ -56,8 +57,7 @@ public class ExpandableTextView extends AppCompatTextView {
public static String TEXT_TARGET = "网页链接";
public static final String IMAGE_TARGET = "";
public static final String TARGET = IMAGE_TARGET + TEXT_TARGET;
public static final String DEFAULT_CONTENT = " " +
" ";
public static final String DEFAULT_CONTENT = " ";
private static int retryTime = 0;
@ -65,8 +65,7 @@ public class ExpandableTextView extends AppCompatTextView {
* http?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?
*/
// public static final String regexp = "((http[s]{0,1}|ftp)://[a-zA-Z0-9\\.\\-]+\\.([a-zA-Z]{2,4})(:\\d+)?(/[a-zA-Z0-9\\.\\-~!@#$%^&*+?:_/=<>]*)?)|((www.)|[a-zA-Z0-9\\.\\-]+\\.([a-zA-Z]{2,4})
// (:\\d+)?(/[a-zA-Z0-9\\.\\-~!@#$%^&*+?:_/=<>]*)?)";
// public static final String regexp = "((http[s]{0,1}|ftp)://[a-zA-Z0-9\\.\\-]+\\.([a-zA-Z]{2,4})(:\\d+)?(/[a-zA-Z0-9\\.\\-~!@#$%^&*+?:_/=<>]*)?)|((www.)|[a-zA-Z0-9\\.\\-]+\\.([a-zA-Z]{2,4})(:\\d+)?(/[a-zA-Z0-9\\.\\-~!@#$%^&*+?:_/=<>]*)?)";
// public static final String regexp = "http?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?";
public static final String regexp_mention = "@[\\w\\p{InCJKUnifiedIdeographs}-]{1,26}";

View File

@ -64,6 +64,33 @@ public class UserLgUtils {
return SPUtils.getInstance(SP_USER_INFO).getString("email");
}
//===============地理信息=====================
public static void setCurrentCity(String city) {
SPUtils.getInstance(SP_USER_INFO).put("currentCity", city);
}
public static String getCurrentCity() {
return SPUtils.getInstance(SP_USER_INFO).getString("currentCity");
}
public static String getCurrentCityCode() {
return SPUtils.getInstance(SP_USER_INFO).getString("currentCityCode");
}
public static void setCurrentCityCode(String code) {
SPUtils.getInstance(SP_USER_INFO).put("currentCityCode", code);
}
public static void setCurrentCityId(String city) {
SPUtils.getInstance(SP_USER_INFO).put("currentCityId", city);
}
public static String getCurrentCityId() {
return SPUtils.getInstance(SP_USER_INFO).getString("currentCityId");
}
//==============================
public static void setLoginInfo(String userInfo) {
SPUtils.getInstance(SP_USER_INFO).put("userInfos", userInfo);
@ -146,21 +173,6 @@ public class UserLgUtils {
return SPUtils.getInstance(SP_USER_INFO).getString("city");
}
public static void setCurrentCity(String city) {
SPUtils.getInstance(SP_USER_INFO).put("currentCity", city);
}
public static String getCurrentCity() {
return SPUtils.getInstance(SP_USER_INFO).getString("currentCity");
}
public static String getCurrentCityCode() {
return SPUtils.getInstance(SP_USER_INFO).getString("currentCityCode");
}
public static void setCurrentCityCode(String code) {
SPUtils.getInstance(SP_USER_INFO).put("currentCityCode", code);
}
public static void setLocationAddress(String address) {
SPUtils.getInstance(SP_USER_INFO).put("address", address);
@ -203,22 +215,6 @@ public class UserLgUtils {
return SPUtils.getInstance(SP_USER_INFO).getString("appName");
}
public static String getCityCode() {
return SPUtils.getInstance(SP_USER_INFO).getString("cityCode");
}
public static void setCityCode(String code) {
SPUtils.getInstance(SP_USER_INFO).put("cityCode", code);
}
public static String getCityId() {
return SPUtils.getInstance(SP_USER_INFO).getString("cityId");
}
public static void setCityId(String code) {
SPUtils.getInstance(SP_USER_INFO).put("cityId", code);
}
public static String getShopCar() {
return SPUtils.getInstance(SP_USER_INFO).getString("shopCar");
}
@ -226,4 +222,22 @@ public class UserLgUtils {
public static void setShopCar(String data) {
SPUtils.getInstance(SP_USER_INFO).put("shopCar", data);
}
public static void setCityCode(String code) {
SPUtils.getInstance(SP_USER_INFO).put("cityCode", code);
}
public static String getCityCode() {
return SPUtils.getInstance(SP_USER_INFO).getString("cityCode");
}
public static void setCityId(String code) {
SPUtils.getInstance(SP_USER_INFO).put("cityId", code);
}
public static String getCityId() {
return SPUtils.getInstance(SP_USER_INFO).getString("cityId");
}
}

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<padding
android:bottom="1dp"
/>
<solid android:color="#40CCCCCC" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<padding
android:bottom="1dp"
/>
<solid android:color="#30CCCCCC" />
</shape>
</item>
<item>
<shape>
<solid android:color="#FFFFFF" />
</shape>
</item>
</layer-list>

View File

@ -164,8 +164,8 @@
<ImageView
android:id="@+id/iv_app_into"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/ic_map_icon" />
</LinearLayout>
</RelativeLayout>

0
cm_utils/src/main/res/layout/item_banner_text_all.xml Normal file → Executable file
View File

View File

@ -31,6 +31,7 @@
<string name="android_auto_update_dialog_checking">正在检查版本</string>
<string name="big_data_str">安卓%1$s%2$s%3$s</string>
<string name="social_contract">收起</string>
<string name="social_expend">展开</string>
<string name="social_text_target">网页链接</string>

View File

@ -153,6 +153,9 @@ public class ActivityDetailActivity extends BaseActivity {
} else {
getActivityDetailByIdToken(mId);
}
String read = String.format(getResources().getString(R.string.big_data_str), "", mId, "活动");
LogUtils.e(read);
bigDataRead(read);
}
/**

View File

@ -89,6 +89,9 @@ public class CulturalLiveDetailActivity extends BaseActivity {
getLiveDetail(id);
});
mSrlContent.setEnableLoadMore(false);
String read = String.format(getResources().getString(R.string.big_data_str), "", id, "直播");
LogUtils.e(read);
bigDataRead(read);
}
private void getLiveDetail(String id) {

View File

@ -1,7 +1,6 @@
package com.tengshisoft.modulecultural.activitys;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
@ -19,17 +18,11 @@ 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.GlideRoundTransform;
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.tengshisoft.modulecultural.R;
import com.tengshisoft.modulecultural.R2;
import com.tengshisoft.modulecultural.bean.CulturalLiveDetailBean;
import com.tengshisoft.modulecultural.net.CulturalApi;
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 butterknife.BindView;
import butterknife.ButterKnife;
@ -73,6 +66,9 @@ public class CulturalLiveLookBackActivity extends BaseActivity {
mSrlContent.setEnableRefresh(false);
mSrlContent.setEnableLoadMore(false);
getLiveDetail(id);
String read = String.format(getResources().getString(R.string.big_data_str), "", id, "直播");
LogUtils.e(read);
bigDataRead(read);
}
/**

View File

@ -109,6 +109,9 @@ public class LegacyDetailActivity extends BaseActivity {
.placeholder(R.drawable.ic_img_default_banner)
.transform(roundedCornersTransform);
getLegacyDetail(id);
String read = String.format(getResources().getString(R.string.big_data_str), "", id, "非遗");
LogUtils.e(read);
bigDataRead(read);
}
/**

View File

@ -27,6 +27,7 @@ import com.sucstepsoft.cm_utils.core.widget.base.BaseBannerImageAdapter;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.sucstepsoft.cm_utils.utils.UIUtil;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.sucstepsoft.cm_utils.utils.toast.ToastUtils;
@ -154,6 +155,9 @@ public class VolunteerActivityDetailActivity extends BaseActivity {
.navigation();
}
});
String read = String.format(getResources().getString(R.string.big_data_str), "", mId, "志愿");
LogUtils.e(read);
bigDataRead(read);
}
/**

View File

@ -58,7 +58,7 @@ public class CulturalMainFragment extends BaseFragment {
// 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};

View File

@ -61,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"})
@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);

View File

@ -1,8 +1,6 @@
<?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"
android:background="@color/white">
@ -261,78 +259,6 @@
android:hint="请选择从业状况" />
</LinearLayout>
<LinearLayout style="@style/register_item_container">
<TextView
android:id="@+id/tv_service_area_title"
style="@style/register_text_title"
android:text="服务区域:" />
<TextView
android:id="@+id/tv_service_area_content"
style="@style/register_text_sel"
android:hint="请选择服务区域" />
</LinearLayout>
<LinearLayout style="@style/register_item_container">
<TextView
android:id="@+id/tv_vocation_title"
style="@style/register_text_title"
android:text="职业:" />
<TextView
android:id="@+id/tv_vocation_content"
style="@style/register_text_sel"
android:hint="请选择职业" />
</LinearLayout>
<LinearLayout
style="@style/register_item_container"
android:visibility="visible">
<TextView
android:id="@+id/tv_unit_title"
style="@style/register_text_title"
android:text="工作单位及职务:" />
<EditText
android:id="@+id/et_unit_content"
style="@style/register_input"
android:hint="请输入工作单位及职务" />
</LinearLayout>
<LinearLayout
style="@style/register_item_container"
android:visibility="visible">
<TextView
android:id="@+id/tv_like_title"
style="@style/register_text_title"
android:text="特长爱好:" />
<EditText
android:id="@+id/et_like_content"
style="@style/register_input"
android:hint="请输入特长爱好" />
</LinearLayout>
<LinearLayout
style="@style/register_item_container"
android:visibility="visible">
<TextView
android:id="@+id/tv_resume_title"
style="@style/register_text_title"
android:text="个人简历:" />
<EditText
android:id="@+id/et_resume_content"
style="@style/register_input"
android:hint="请输入个人简历"
android:minLines="3" />
</LinearLayout>
<LinearLayout
style="@style/register_item_container"
android:gravity="center_vertical">
@ -347,7 +273,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
android:gravity="right"
android:orientation="horizontal"
android:paddingRight="20dp">
<RadioButton
android:id="@+id/rb_true"
@ -355,6 +283,7 @@
android:layout_height="wrap_content"
android:button="@drawable/sel_radio_red"
android:checked="true"
android:paddingLeft="10dp"
android:text="是" />
<RadioButton
@ -363,63 +292,189 @@
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:button="@drawable/sel_radio_red"
android:paddingLeft="10dp"
android:text="否" />
</RadioGroup>
</LinearLayout>
<LinearLayout style="@style/register_item_container">
<TextView
android:id="@+id/tv_expert_title"
style="@style/register_text_title"
android:text="服务意向:" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_export_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="90dp"
android:background="@color/gray_line" />
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<TextView
android:id="@+id/tv_expert_area_title"
android:id="@+id/tv_service_area_title"
style="@style/register_text_title"
android:text="服务领域或行业:" />
android:text="服务区域:" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_export_area_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_service_area_content"
style="@style/register_text_sel"
android:drawablePadding="10dp"
android:gravity="right"
android:hint="请选择服务区域" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="90dp"
android:background="@color/gray_line" />
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<TextView
android:id="@+id/tv_vocation_title"
style="@style/register_text_title"
android:text="职业:" />
<TextView
android:id="@+id/tv_vocation_content"
style="@style/register_text_sel"
android:drawablePadding="10dp"
android:gravity="right"
android:hint="请选择职业" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/gray_line_deep" />
<LinearLayout
style="@style/register_item_container"
android:visibility="visible">
<TextView
android:id="@+id/tv_remark_title"
android:id="@+id/tv_unit_title"
style="@style/register_text_title"
android:text="工作单位及职务:" />
<EditText
android:id="@+id/et_unit_content"
style="@style/register_input"
android:background="@null"
android:gravity="right"
android:hint="请输入工作单位及职务" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout
style="@style/register_item_container"
android:visibility="visible">
<TextView
android:id="@+id/tv_like_title"
style="@style/register_text_title"
android:text="特长爱好:" />
<EditText
android:id="@+id/et_like_content"
style="@style/register_input"
android:background="@null"
android:gravity="right"
android:hint="请输入特长爱好" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout
style="@style/register_item_container_ver"
android:visibility="visible">
<TextView
android:id="@+id/tv_resume_title"
style="@style/register_text_title_ver"
android:text="个人简历:" />
<EditText
android:id="@+id/et_resume_content"
style="@style/register_input_ver"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:gravity="left"
android:hint="请输入个人简历"
android:minLines="4" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container_ver">
<TextView
android:id="@+id/tv_expert_title"
style="@style/register_text_title_ver"
android:text="服务意向:" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_export_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container_ver">
<TextView
android:id="@+id/tv_expert_area_title"
style="@style/register_text_title_ver"
android:text="服务领域或行业:" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_export_area_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/gray_line_deep" />
<LinearLayout
style="@style/register_item_container_ver"
android:visibility="visible">
<TextView
android:id="@+id/tv_remark_title"
style="@style/register_text_title_ver"
android:text="备注:" />
<EditText
android:id="@+id/et_remark_content"
style="@style/register_input"
style="@style/register_input_ver"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:gravity="left"
android:hint="请输入备注"
android:minLines="3" />
</LinearLayout>

View File

@ -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"
android:background="@color/white">
@ -21,9 +19,18 @@
<EditText
android:id="@+id/et_team_name"
style="@style/register_input"
android:background="@null"
android:gravity="right"
android:hint="请输入团队名称" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<TextView
@ -34,10 +41,19 @@
<EditText
android:id="@+id/et_team_count"
style="@style/register_input"
android:background="@null"
android:gravity="right"
android:hint="请输入团队限制人数"
android:inputType="number" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout
style="@style/register_item_container"
android:visibility="gone">
@ -53,6 +69,7 @@
android:hint="请选择团队成员" />
</LinearLayout>
<LinearLayout style="@style/register_item_container">
<TextView
@ -63,19 +80,31 @@
<TextView
android:id="@+id/tv_area"
style="@style/register_text_sel"
android:hint="请选择所属区域" />
android:drawablePadding="10dp"
android:gravity="right"
android:hint="请选择所属区域"
android:paddingRight="0dp" />
</LinearLayout>
<LinearLayout style="@style/register_item_container">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container_ver">
<TextView
android:id="@+id/tv_team_desc_title"
style="@style/register_text_title"
style="@style/register_text_title_ver"
android:text="团队介绍:" />
<EditText
android:id="@+id/et_team_desc_content"
style="@style/register_input"
style="@style/register_input_ver"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:gravity="start"
android:hint="请输入团队介绍"
android:minLines="5" />

View File

@ -22,9 +22,19 @@
<TextView
android:id="@+id/tv_choose_area"
style="@style/register_text_sel"
android:hint="请选择活动区域" />
android:drawablePadding="10dp"
android:gravity="right"
android:hint="请选择活动区域"
android:paddingRight="0dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
@ -35,9 +45,18 @@
<EditText
android:id="@+id/et_name"
style="@style/register_input"
android:background="@null"
android:gravity="right"
android:hint="请输入活动名称" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
@ -47,9 +66,18 @@
<EditText
android:id="@+id/et_contact_name"
style="@style/register_input"
android:background="@null"
android:gravity="right"
android:hint="请输入活动联系人姓名" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
@ -59,10 +87,19 @@
<EditText
android:id="@+id/et_phone"
style="@style/register_input"
android:background="@null"
android:gravity="right"
android:hint="请输入联系方式"
android:inputType="number" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
@ -72,38 +109,56 @@
<EditText
android:id="@+id/et_peo_count"
style="@style/register_input"
android:background="@null"
android:gravity="right"
android:hint="请输入活动人数限制"
android:inputType="number" />
</LinearLayout>
<LinearLayout style="@style/register_item_container">
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container_ver">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
style="@style/register_text_title"
style="@style/register_text_title_ver"
android:text="活动简介:" />
<EditText
android:id="@+id/et_desc"
style="@style/register_input"
style="@style/register_input_ver"
android:layout_marginTop="8dp"
android:background="@drawable/shp_rectangle_gray"
android:gravity="left"
android:hint="请输入活动简介"
android:minLines="5" />
</LinearLayout>
<LinearLayout style="@style/register_item_container">
<LinearLayout style="@style/register_item_container_ver">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
style="@style/register_text_title"
style="@style/register_text_title_ver"
android:text="服务内容:" />
<EditText
android:id="@+id/et_service_content"
style="@style/register_input"
style="@style/register_input_ver"
android:layout_marginTop="8dp"
android:background="@drawable/shp_rectangle_gray"
android:gravity="left"
android:hint="请输入服务内容"
android:minLines="5" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
@ -114,10 +169,18 @@
<EditText
android:id="@+id/et_request"
style="@style/register_input"
android:gravity="left"
android:background="@null"
android:gravity="right"
android:hint="请输入活动要求" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
@ -127,10 +190,18 @@
<EditText
android:id="@+id/et_service_awards"
style="@style/register_input"
android:gravity="left"
android:background="@null"
android:gravity="right"
android:hint="请输入活动奖补" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
@ -141,9 +212,19 @@
<TextView
android:id="@+id/tv_start_time_content"
style="@style/register_text_sel"
android:hint="请选择开始时间" />
android:drawablePadding="10dp"
android:gravity="right"
android:hint="请选择开始时间"
android:paddingRight="0dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
@ -153,9 +234,19 @@
<TextView
android:id="@+id/tv_end_time_content"
style="@style/register_text_sel"
android:hint="请选择结束时间" />
android:drawablePadding="10dp"
android:gravity="right"
android:hint="请选择结束时间"
android:paddingRight="0dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
@ -168,7 +259,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
android:gravity="right"
android:orientation="horizontal"
android:paddingRight="10dp">
<RadioButton
android:id="@+id/rb_service_single"
@ -176,17 +269,27 @@
android:layout_height="wrap_content"
android:button="@drawable/sel_radio_red"
android:checked="true"
android:paddingLeft="10dp"
android:text="志愿者" />
<RadioButton
android:id="@+id/rb_service_team"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:button="@drawable/sel_radio_red"
android:paddingLeft="10dp"
android:text="志愿团队" />
</RadioGroup>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout
android:id="@+id/ll_choose_team"
style="@style/register_item_container">
@ -199,22 +302,32 @@
<TextView
android:id="@+id/tv_choose_team"
style="@style/register_text_sel"
android:hint="请选择志愿者团队" />
android:drawablePadding="10dp"
android:gravity="right"
android:hint="请选择志愿者团队"
android:paddingRight="0dp" />
</LinearLayout>
<LinearLayout style="@style/register_item_container">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/register_item_container_ver">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_photos_title"
style="@style/register_text_title"
style="@style/register_text_title_ver"
android:layout_gravity="center_vertical"
android:text="宣传照片:" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_photos"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_marginTop="5dp" />
</LinearLayout>
<LinearLayout

View File

@ -7,7 +7,19 @@
<item name="android:layout_marginLeft">10dp</item>
<item name="android:layout_marginRight">10dp</item>
<item name="android:layout_weight">1</item>
<item name="android:background">@drawable/shape_bottom_line</item>
<item name="android:paddingTop">5dp</item>
<item name="android:paddingBottom">5dp</item>
<item name="android:paddingLeft">5dp</item>
<item name="android:paddingRight">5dp</item>
<item name="android:textSize">13sp</item>
</style>
<style name="register_input_ver">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginLeft">10dp</item>
<item name="android:layout_marginRight">10dp</item>
<item name="android:layout_weight">1</item>
<item name="android:paddingTop">5dp</item>
<item name="android:paddingBottom">5dp</item>
<item name="android:paddingLeft">5dp</item>
@ -23,13 +35,19 @@
<item name="android:textSize">12sp</item>
</style>
<style name="register_text_title_ver">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#242424</item>
<item name="android:textSize">12sp</item>
</style>
<style name="register_text_sel">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginLeft">10dp</item>
<item name="android:layout_marginRight">10dp</item>
<item name="android:layout_weight">1</item>
<item name="android:background">@drawable/shape_bottom_line</item>
<item name="android:clickable">true</item>
<item name="android:focusable">true</item>
<item name="android:drawableRight">@drawable/ic_arrow_yellow_down</item>
@ -67,6 +85,13 @@
<item name="android:padding">8dp</item>
</style>
<style name="register_item_container_ver">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:orientation">vertical</item>
<item name="android:padding">8dp</item>
</style>
<style name="register_item_container_no_padding">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>

View File

@ -0,0 +1,284 @@
package com.tengshisoft.moduleijkplayer.controller;
import static com.tengshisoft.moduleijkplayer.util.PlayerUtils.stringForTime;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.os.Build;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.tengshisoft.moduleijkplayer.R;
import com.tengshisoft.moduleijkplayer.player.VideoView;
import com.tengshisoft.moduleijkplayer.util.PlayerUtils;
/**
* 音频控制
*/
public class AudioControlView extends FrameLayout implements IControlComponent, View.OnClickListener, SeekBar.OnSeekBarChangeListener {
protected ControlWrapper mControlWrapper;
private TextView mTotalTime, mCurrTime;
private LinearLayout mBottomContainer;
private SeekBar mVideoProgress;
private ProgressBar mBottomProgress;
private ImageView mPlayButton;
private boolean mIsDragging;
private boolean isFullScreen = true;
private boolean mIsShowBottomProgress = true;
public AudioControlView(@NonNull Context context) {
super(context);
}
public void setFullScreen(boolean isfull) {
this.isFullScreen = isfull;
}
public AudioControlView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public AudioControlView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
{
setVisibility(GONE);
LayoutInflater.from(getContext()).inflate(getLayoutId(), this, true);
mBottomContainer = findViewById(R.id.bottom_container);
mVideoProgress = findViewById(R.id.seekBar);
mVideoProgress.setOnSeekBarChangeListener(this);
mTotalTime = findViewById(R.id.total_time);
mCurrTime = findViewById(R.id.curr_time);
mPlayButton = findViewById(R.id.iv_play);
mPlayButton.setOnClickListener(this);
mBottomProgress = findViewById(R.id.bottom_progress);
//5.1以下系统SeekBar高度需要设置成WRAP_CONTENT
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
mVideoProgress.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT;
}
}
protected int getLayoutId() {
return R.layout.dkplayer_layout_audio_control_view;
}
/**
* 是否显示底部进度条默认显示
*/
public void showBottomProgress(boolean isShow) {
mIsShowBottomProgress = isShow;
}
@Override
public void attach(@NonNull ControlWrapper controlWrapper) {
mControlWrapper = controlWrapper;
}
@Override
public View getView() {
return this;
}
@Override
public void onVisibilityChanged(boolean isVisible, Animation anim) {
if (isVisible) {
mBottomContainer.setVisibility(VISIBLE);
if (anim != null) {
mBottomContainer.startAnimation(anim);
}
if (mIsShowBottomProgress) {
mBottomProgress.setVisibility(GONE);
}
} else {
mBottomContainer.setVisibility(GONE);
if (anim != null) {
mBottomContainer.startAnimation(anim);
}
if (mIsShowBottomProgress) {
mBottomProgress.setVisibility(VISIBLE);
AlphaAnimation animation = new AlphaAnimation(0f, 1f);
animation.setDuration(300);
mBottomProgress.startAnimation(animation);
}
}
}
@Override
public void onPlayStateChanged(int playState) {
switch (playState) {
case VideoView.STATE_IDLE:
case VideoView.STATE_PLAYBACK_COMPLETED:
setVisibility(GONE);
mBottomProgress.setProgress(0);
mBottomProgress.setSecondaryProgress(0);
mVideoProgress.setProgress(0);
mVideoProgress.setSecondaryProgress(0);
break;
case VideoView.STATE_START_ABORT:
case VideoView.STATE_PREPARING:
case VideoView.STATE_PREPARED:
case VideoView.STATE_ERROR:
setVisibility(GONE);
break;
case VideoView.STATE_PLAYING:
mPlayButton.setSelected(true);
if (mIsShowBottomProgress) {
if (mControlWrapper.isShowing()) {
mBottomProgress.setVisibility(GONE);
mBottomContainer.setVisibility(VISIBLE);
} else {
mBottomContainer.setVisibility(GONE);
mBottomProgress.setVisibility(VISIBLE);
}
} else {
mBottomContainer.setVisibility(GONE);
}
setVisibility(VISIBLE);
//开始刷新进度
mControlWrapper.startProgress();
break;
case VideoView.STATE_PAUSED:
mPlayButton.setSelected(false);
break;
case VideoView.STATE_BUFFERING:
case VideoView.STATE_BUFFERED:
mPlayButton.setSelected(mControlWrapper.isPlaying());
break;
}
}
@Override
public void onPlayerStateChanged(int playerState) {
// switch (playerState) {
// case VideoView.PLAYER_NORMAL:
// mFullScreen.setSelected(false);
// break;
// case VideoView.PLAYER_FULL_SCREEN:
// mFullScreen.setSelected(true);
// break;
// }
Activity activity = PlayerUtils.scanForActivity(getContext());
if (activity != null && mControlWrapper.hasCutout()) {
int orientation = activity.getRequestedOrientation();
int cutoutHeight = mControlWrapper.getCutoutHeight();
if (orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
mBottomContainer.setPadding(0, 0, 0, 0);
mBottomProgress.setPadding(0, 0, 0, 0);
} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
mBottomContainer.setPadding(cutoutHeight, 0, 0, 0);
mBottomProgress.setPadding(cutoutHeight, 0, 0, 0);
} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) {
mBottomContainer.setPadding(0, 0, cutoutHeight, 0);
mBottomProgress.setPadding(0, 0, cutoutHeight, 0);
}
}
}
@Override
public void setProgress(int duration, int position) {
if (mIsDragging) {
return;
}
if (mVideoProgress != null) {
if (duration > 0) {
mVideoProgress.setEnabled(true);
int pos = (int) (position * 1.0 / duration * mVideoProgress.getMax());
mVideoProgress.setProgress(pos);
mBottomProgress.setProgress(pos);
} else {
mVideoProgress.setEnabled(false);
}
int percent = mControlWrapper.getBufferedPercentage();
if (percent >= 95) { //解决缓冲进度不能100%问题
mVideoProgress.setSecondaryProgress(mVideoProgress.getMax());
mBottomProgress.setSecondaryProgress(mBottomProgress.getMax());
} else {
mVideoProgress.setSecondaryProgress(percent * 10);
mBottomProgress.setSecondaryProgress(percent * 10);
}
}
if (mTotalTime != null)
mTotalTime.setText(stringForTime(duration));
if (mCurrTime != null)
mCurrTime.setText(stringForTime(position));
}
@Override
public void onLockStateChanged(boolean isLocked) {
onVisibilityChanged(!isLocked, null);
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.fullscreen) {
if (isFullScreen) {
toggleFullScreen();
}
} else if (id == R.id.iv_play) {
mControlWrapper.togglePlay();
}
}
/**
* 横竖屏切换
*/
private void toggleFullScreen() {
Activity activity = PlayerUtils.scanForActivity(getContext());
mControlWrapper.toggleFullScreen(activity);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
mIsDragging = true;
mControlWrapper.stopProgress();
mControlWrapper.stopFadeOut();
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
long duration = mControlWrapper.getDuration();
long newPosition = (duration * seekBar.getProgress()) / mVideoProgress.getMax();
mControlWrapper.seekTo((int) newPosition);
mIsDragging = false;
mControlWrapper.startProgress();
mControlWrapper.startFadeOut();
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (!fromUser) {
return;
}
long duration = mControlWrapper.getDuration();
long newPosition = (duration * progress) / mVideoProgress.getMax();
if (mCurrTime != null)
mCurrTime.setText(stringForTime((int) newPosition));
}
}

View File

@ -0,0 +1,136 @@
package com.tengshisoft.moduleijkplayer.controller;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.tengshisoft.moduleijkplayer.R;
import com.tengshisoft.moduleijkplayer.player.VideoView;
import com.tengshisoft.moduleijkplayer.player.VideoViewManager;
/**
* 准备播放界面
*/
public class AudioPrepareView extends FrameLayout implements IControlComponent {
private ControlWrapper mControlWrapper;
private ImageView mThumb;
private ImageView mStartPlay;
private ProgressBar mLoading;
private FrameLayout mNetWarning;
private TextView mTvState;
public AudioPrepareView(@NonNull Context context) {
super(context);
}
public AudioPrepareView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public AudioPrepareView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
{
LayoutInflater.from(getContext()).inflate(R.layout.dkplayer_layout_prepare_view, this, true);
mThumb = findViewById(R.id.thumb);
mTvState = findViewById(R.id.tv_state);
mStartPlay = findViewById(R.id.start_play);
mLoading = findViewById(R.id.loading);
mNetWarning = findViewById(R.id.net_warning_layout);
findViewById(R.id.status_btn).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mNetWarning.setVisibility(GONE);
VideoViewManager.instance().setPlayOnMobileNetwork(true);
mControlWrapper.start();
}
});
}
/**
* 设置点击此界面开始播放
*/
public void setClickStart() {
setOnClickListener(v -> mControlWrapper.start());
}
@Override
public void attach(@NonNull ControlWrapper controlWrapper) {
mControlWrapper = controlWrapper;
}
@Override
public View getView() {
return this;
}
@Override
public void onVisibilityChanged(boolean isVisible, Animation anim) {
}
public void setState(String state) {
mTvState.setText(state);
}
@Override
public void onPlayStateChanged(int playState) {
switch (playState) {
case VideoView.STATE_PREPARING:
bringToFront();
setVisibility(VISIBLE);
mStartPlay.setVisibility(View.GONE);
mNetWarning.setVisibility(GONE);
mLoading.setVisibility(View.VISIBLE);
break;
case VideoView.STATE_PLAYING:
case VideoView.STATE_PAUSED:
case VideoView.STATE_ERROR:
case VideoView.STATE_BUFFERING:
case VideoView.STATE_BUFFERED:
case VideoView.STATE_PLAYBACK_COMPLETED:
setVisibility(GONE);
break;
case VideoView.STATE_IDLE:
setVisibility(VISIBLE);
bringToFront();
mLoading.setVisibility(View.GONE);
mNetWarning.setVisibility(GONE);
mStartPlay.setVisibility(View.VISIBLE);
mThumb.setVisibility(View.VISIBLE);
break;
case VideoView.STATE_START_ABORT:
setVisibility(VISIBLE);
mNetWarning.setVisibility(VISIBLE);
mNetWarning.bringToFront();
break;
}
}
@Override
public void onPlayerStateChanged(int playerState) {
}
@Override
public void setProgress(int duration, int position) {
}
@Override
public void onLockStateChanged(boolean isLocked) {
}
}

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:id="@+id/bottom_container"
android:layout_width="match_parent"
android:layout_height="@dimen/dkplayer_controller_height"
android:layout_gravity="bottom"
android:gravity="center_vertical"
android:paddingRight="20dp"
android:background="@drawable/dkplayer_shape_stardard_controller_bottom_bg"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_play"
android:layout_width="@dimen/dkplayer_controller_height"
android:layout_height="@dimen/dkplayer_controller_height"
android:padding="@dimen/dkplayer_controller_icon_padding"
android:src="@drawable/dkplayer_selector_play_button" />
<TextView
android:id="@+id/curr_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dkplayer_controller_time_text_size"
tools:text="00:00" />
<SeekBar
android:id="@+id/seekBar"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:background="@null"
android:max="1000"
android:maxHeight="2dp"
android:minHeight="2dp"
android:paddingEnd="0dp"
android:paddingStart="0dp"
android:progressDrawable="@drawable/dkplayer_layer_progress_bar"
android:thumb="@drawable/dkplayer_seekbar_thumb"
android:thumbOffset="0dp" />
<TextView
android:id="@+id/total_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dkplayer_controller_time_text_size"
tools:text="00:00" />
</LinearLayout>
<ProgressBar
android:id="@+id/bottom_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:max="1000"
android:progressDrawable="@drawable/dkplayer_layer_progress_bar"
android:visibility="gone" />
</FrameLayout>

View File

@ -349,8 +349,12 @@ public class NewsDetailActivity extends BaseActivity {
.navigation();
}
});
String read = String.format(getResources().getString(R.string.big_data_str), "", mNId, "新闻");
LogUtils.e(read);
bigDataRead(read);
}
private void showShareDialog() {
BottomDialogShareView shareView = new BottomDialogShareView.DialogBuilder(mActivity).build();
shareView.addOnChoseListener(new BottomDialogShareView.OnChoseListener() {

View File

@ -37,6 +37,9 @@ import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* 新闻只有一级
*/
@Route(path = PathConfig.PATH_MODULE_MAIN_NEWS_LIST)
public class NewsListActivity extends BaseActivity {
@BindView(R2.id.srl_content)
@ -223,6 +226,8 @@ public class NewsListActivity extends BaseActivity {
mAdapter.setData(mNewsDatas);
}
}
mSrlContent.finishRefresh();
mSrlContent.finishLoadMore();
}
@Override
@ -275,7 +280,7 @@ public class NewsListActivity extends BaseActivity {
url = rowsBean.getTemplateRecordUrl();
}
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL)
.build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL_INTERFACE)
.withString("id", rowsBean.getNewsContentId())
.withString("url", url)
.withString("isComment", rowsBean.getNewsConfigComment())//是否可以评论

View File

@ -40,7 +40,6 @@ import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.sucstepsoft.cm_utils.constant.PathConfig;
import com.sucstepsoft.cm_utils.core.beans.AddPhotoBean;
import com.sucstepsoft.cm_utils.core.beans.BaseImageBean;
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
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.BannerImageTextAllAdapter;
@ -51,18 +50,30 @@ import com.sucstepsoft.cm_utils.core.widget.views.ButtomDialogView;
import com.sucstepsoft.cm_utils.core.widget.views.ItemSplitDivider;
import com.sucstepsoft.cm_utils.core.widget.views.NestedScrollWebView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
import com.sucstepsoft.cm_utils.utils.FileUtils;
import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.sucstepsoft.cm_utils.utils.ProiderUtil;
import com.sucstepsoft.cm_utils.utils.ScreenUtils;
import com.sucstepsoft.cm_utils.utils.TimeUtils;
import com.sucstepsoft.cm_utils.utils.UIUtil;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.sucstepsoft.cm_utils.utils.toast.ToastUtils;
import com.tengshisoft.moduleijkplayer.controller.AudioControlView;
import com.tengshisoft.moduleijkplayer.controller.AudioPrepareView;
import com.tengshisoft.moduleijkplayer.controller.CompleteView;
import com.tengshisoft.moduleijkplayer.controller.ErrorView;
import com.tengshisoft.moduleijkplayer.controller.GestureView;
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.mudulemain.R;
import com.tengshisoft.mudulemain.R2;
import com.tengshisoft.mudulemain.cultural.adapter.CommentAdapter;
import com.tengshisoft.mudulemain.cultural.adapter.NewsCategoryAdapter;
import com.tengshisoft.mudulemain.cultural.beans.BaseUserBean;
import com.tengshisoft.mudulemain.cultural.beans.CollectBean;
import com.tengshisoft.mudulemain.cultural.beans.CommentListBean;
@ -145,8 +156,18 @@ public class NewsLocalDetailActivity extends BaseActivity {
TypeFaceTextView mTvPublishTime;
@BindView(R2.id.ll_title_view)
LinearLayout mLlTitleView;
@BindView(R2.id.ll_audio)//音频
LinearLayout mLlAudio;
@BindView(R2.id.vv_audio)
VideoView mAudio;
@BindView(R2.id.rlv_audio_category)
RecyclerView mRlvAudioCategory;
@BindView(R2.id.tv_audio_txt)
TypeFaceTextView mTvAudioTxt;
@BindView(R2.id.iv_banner_left)
ImageView mIvImgLeft;
@BindView(R2.id.iv_banner_right)
ImageView mIvImgRight;
private AddPhotoBean mCurrentBean;
private String mPicPath;
private Unbinder mBind;
@ -168,6 +189,7 @@ public class NewsLocalDetailActivity extends BaseActivity {
private String mTitle;
private String mPhoto;
private File mDestFile;
private NewsCategoryAdapter mCategoryAdapter;
@Override
protected int setLayoutId() {
@ -296,6 +318,9 @@ public class NewsLocalDetailActivity extends BaseActivity {
}
});
getNewsDetail();
String read = String.format(getResources().getString(R.string.big_data_str), "", mNId, "新闻");
LogUtils.e(read);
bigDataRead(read);
}
@ -352,14 +377,17 @@ public class NewsLocalDetailActivity extends BaseActivity {
createImgView(newsDetailBean);
break;
case "3"://音频
createAudioView(newsDetailBean);
break;
case "4"://视频
createVideoView(newsDetailBean);
break;
case "5"://PDF
break;
case "6"://6链接
createWebView(newsDetailBean);
break;
case "1":
case "1"://文章
default:
mLlTitleView.setVisibility(View.VISIBLE);
mTvTitle.setText(newsDetailBean.getNewsContentTitle());
@ -482,8 +510,13 @@ public class NewsLocalDetailActivity extends BaseActivity {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
if ("6".equals(b.getNewsContentType())) {
mWvContent.loadUrl(b.getNewsContentContent());
} else {
String data = b.getNewsContentContent();
mWvContent.loadData(data, "text/html", "utf-8");
mWvContent.loadDataWithBaseURL(null, getHtmlData(data), "text/html", "utf-8", null);
// mWvContent.loadData(data, "text/html", "utf-8");
}
mWvContent.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
@ -495,7 +528,12 @@ public class NewsLocalDetailActivity extends BaseActivity {
super.onPageFinished(view, url);
mContentSkeleton.hide();
view.getSettings().setBlockNetworkImage(false);//开启页面图片加载
runOnUiThread(() -> mWvContent.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)));
runOnUiThread(() -> {
// imgReset();
// pSection();
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
mWvContent.setLayoutParams(params);
});
}
@Override
@ -506,16 +544,16 @@ public class NewsLocalDetailActivity extends BaseActivity {
@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", mTitle)
.withString("url", url)
.navigation();
} else {
view.loadUrl(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", mTitle)
// .withString("url", url)
// .navigation();
// } else {
// view.loadUrl(url);
// }
return true;
}
});
@ -528,19 +566,188 @@ public class NewsLocalDetailActivity extends BaseActivity {
});
}
// {margin-left:5px;margin-right:5px;margin-top:10px;}
private String getHtmlData(String content) {
String head = "<head>"
+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\">"
+ "<style>img{max-width:100%;width:100%;height:auto;}*</style>"
+ "</head>";
return "<html>" + head + "<body>" + content + "</body></html>";
}
/**
* 对图片进行重置大小宽度就是手机屏幕宽度高度根据宽度比便自动缩放
**/
private void imgReset() {
mWvContent.loadUrl("javascript:(function(){" +
"var objs = document.getElementsByTagName('img'); " +
"for(var i=0;i<objs.length;i++) " +
"{"
+ "var img = objs[i]; " +
" img.style.maxWidth = '100%'; img.style.height = 'auto'; " +
"}" +
"})()");
}
/**
* 为锻炼添加
*/
private void pSection() {
mWvContent.loadUrl("javascript:(function(){" +
"var objs = document.getElementsByTagName('p'); " +
"for(var i=0;i<objs.length;i++) " +
"{"
+ "var p = objs[i]; " +
" p.style.textIndent = '35px';" +
"}" +
"})()");
}
/**
* 加载音频新闻
*/
private void createAudioView() {
private void createAudioView(NewsDetailBean b) {
mLlAudio.setVisibility(View.VISIBLE);
for (int i = 0; i < b.getFileList().size(); i++) {
List<NewsDetailBean.FileListBean> fileList = b.getFileList();
if (i == 0) {
fileList.get(i).setCheck(true);
} else {
fileList.get(i).setCheck(false);
}
}
mCategoryAdapter = new NewsCategoryAdapter(mActivity, b.getFileList());
mRlvAudioCategory.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.HORIZONTAL, false));
mRlvAudioCategory.setAdapter(mCategoryAdapter);
mCategoryAdapter.addOnItemClickListener(fileListBean -> {
for (int i = 0; i < b.getFileList().size(); i++) {
NewsDetailBean.FileListBean fileBean = b.getFileList().get(i);
if (fileBean.getContentFileFileId().equals(fileListBean.getContentFileFileId())) {
fileBean.setCheck(true);
} else {
fileBean.setCheck(false);
}
}
mCategoryAdapter.setData(b.getFileList());
setAudioUrl(fileListBean);
});
StandardVideoController controller = new StandardVideoController(mActivity);
controller.setEnableOrientation(true);
AudioPrepareView prepareView = new AudioPrepareView(this);//准备播放界面
ImageView thumb = prepareView.findViewById(com.tengshisoft.moduleijkplayer.R.id.thumb);//封面图
Glide.with(mActivity).load(com.tengshisoft.moduleijkplayer.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);
//根据是否为直播设置不同的底部控制条
AudioControlView vodControlView = new AudioControlView(this);//点播控制条
controller.addControlComponent(vodControlView);
GestureView gestureControlView = new GestureView(this);//滑动控制视图
controller.addControlComponent(gestureControlView);
controller.setCanChangePosition(false);
//设置标题
titleView.setTitle(mTitle);
mAudio.setVideoController(controller);
mAudio.setUrl(BaseUrlApi.BASE_IMG_URL + b.getFileList().get(0).getContentFileFileId());
mAudio.setLooping(true);
mTvAudioTxt.setText(b.getFileList().get(0).getContentFileText());
}
/**
* 设置音频Url
*/
private void setAudioUrl(NewsDetailBean.FileListBean b) {
if (mAudio == null) {
return;
}
if (mAudio.isPlaying()) {
mAudio.pause();
mAudio.release();
}
mAudio.setUrl(BaseUrlApi.BASE_IMG_URL + b.getContentFileFileId());
mAudio.start();
mTvAudioTxt.setText(b.getContentFileText());
}
/**
* 加载视频新闻
*/
private void createVideoView() {
private void createVideoView(NewsDetailBean b) {
mLlVideo.setVisibility(View.VISIBLE);
for (int i = 0; i < b.getFileList().size(); i++) {
List<NewsDetailBean.FileListBean> fileList = b.getFileList();
if (i == 0) {
fileList.get(i).setCheck(true);
} else {
fileList.get(i).setCheck(false);
}
}
mCategoryAdapter = new NewsCategoryAdapter(mActivity, b.getFileList());
mRlvVideoCategory.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.HORIZONTAL, false));
mRlvVideoCategory.setAdapter(mCategoryAdapter);
mCategoryAdapter.addOnItemClickListener(fileListBean -> {
for (int i = 0; i < b.getFileList().size(); i++) {
NewsDetailBean.FileListBean fileBean = b.getFileList().get(i);
if (fileBean.getContentFileFileId().equals(fileListBean.getContentFileFileId())) {
fileBean.setCheck(true);
} else {
fileBean.setCheck(false);
}
}
mCategoryAdapter.setData(b.getFileList());
setVideoUrl(fileListBean);
});
StandardVideoController controller = new StandardVideoController(mActivity);
controller.setEnableOrientation(true);
PrepareView prepareView = new PrepareView(this);//准备播放界面
ImageView thumb = prepareView.findViewById(com.tengshisoft.moduleijkplayer.R.id.thumb);//封面图
Glide.with(mActivity).load(com.tengshisoft.moduleijkplayer.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);
//根据是否为直播设置不同的底部控制条
VodControlView vodControlView = new VodControlView(this);//点播控制条
controller.addControlComponent(vodControlView);
GestureView gestureControlView = new GestureView(this);//滑动控制视图
controller.addControlComponent(gestureControlView);
controller.setCanChangePosition(false);
//设置标题
titleView.setTitle(mTitle);
mVideo.setVideoController(controller);
mVideo.setUrl(BaseUrlApi.BASE_IMG_URL + b.getFileList().get(0).getContentFileFileId());
mTvVideoTxt.setText(b.getFileList().get(0).getContentFileText());
// mVideo.addOnStateChangeListener(mOnStateChangeListener);
// mVideo.start();
}
/**
* 设置视频URL
*/
private void setVideoUrl(NewsDetailBean.FileListBean b) {
if (mVideo == null) {
return;
}
if (mVideo.isPlaying()) {
mVideo.pause();
mVideo.release();
}
mVideo.setUrl(BaseUrlApi.BASE_IMG_URL + b.getContentFileFileId());
mVideo.start();
mTvVideoTxt.setText(b.getContentFileText());
}
/**
* 加载图片新闻
@ -548,24 +755,26 @@ public class NewsLocalDetailActivity extends BaseActivity {
private void createImgView(NewsDetailBean b) {
mRlImg.setVisibility(View.VISIBLE);
List<BaseImageBean> mBannerList = new ArrayList<>();
int screenHeight = ScreenUtils.getScreenHeight();
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(mBnImg.getLayoutParams());
LogUtils.e(screenHeight);
params.height = screenHeight - ConvertUtils.dp2px(96) - 50;
mBnImg.setLayoutParams(params);
for (int i = 0; i < b.getFileList().size(); i++) {
NewsDetailBean.FileListBean fileListBean = b.getFileList().get(i);
BaseImageBean bannerBean = new BaseImageBean();
// bannerBean.setPhoto(BaseUrlApi.BASE_NEWS_IMG_URL + fileListBean.getContentFileFileId());
if (i / 2 == 0) {
// bannerBean.setPhoto(BaseUrlApi.BASE_NEWS_IMG_URL + fileListBean.getContentFileFileId());
bannerBean.setImgUrl("https://lmg.jj20.com/up/allimg/tp08/46042223542701-lp.jpg");
} else {
bannerBean.setImgUrl("https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg");
}
bannerBean.setImgUrl(BaseUrlApi.BASE_NEWS_IMG_URL + fileListBean.getContentFileFileId());
bannerBean.setName(fileListBean.getContentFileText());
mBannerList.add(bannerBean);
}
BannerImageTextAllAdapter mBannerImageAdapter = new BannerImageTextAllAdapter(mBannerList);
mBnImg.setAdapter(mBannerImageAdapter);
mBnImg.setPageTransformer(new ScaleInTransformer());
mBnImg.setDelayTime(10000L);
mBnImg.setDelayTime(12000L);
mBnImg.start();
mIvImgLeft.setOnClickListener(v -> mBnImg.setCurrentItem(mBnImg.getCurrentItem() - 1));
mIvImgRight.setOnClickListener(v -> mBnImg.setCurrentItem(mBnImg.getCurrentItem() + 1));
}
/**
@ -1201,9 +1410,48 @@ public class NewsLocalDetailActivity extends BaseActivity {
buttomDialogView.show();
}
@Override
protected void onResume() {
super.onResume();
if (mLlAudio.getVisibility() == View.VISIBLE) {
if (mAudio != null) {
mAudio.pause();
}
}
if (mLlVideo.getVisibility() == View.VISIBLE) {
if (mVideo != null) {
mVideo.pause();
}
}
}
@Override
protected void onPause() {
super.onPause();
if (mLlAudio.getVisibility() == View.VISIBLE) {
if (mAudio != null) {
mAudio.pause();
}
}
if (mLlVideo.getVisibility() == View.VISIBLE) {
if (mVideo != null) {
mVideo.pause();
}
}
}
@Override
protected void onDestroy() {
mContentView = null;
if (mAudio != null) {
mAudio.pause();
mAudio.release();
}
if (mVideo != null) {
mVideo.pause();
mVideo.release();
}
if (mBind != null) {
mBind.unbind();
}

View File

@ -70,7 +70,6 @@ public class NewsMainActivity extends BaseActivity {
.withString("id", mId)
.withBoolean("isTab", true)
.navigation());
getNewsTabs();
}
@ -95,16 +94,17 @@ public class NewsMainActivity extends BaseActivity {
if (newsTabBeans != null && newsTabBeans.size() > 0) {
NewsTabBean allBean = new NewsTabBean();
allBean.setDirectoriesName("全部");
allBean.setNewsDirectoriesId(mId);
allBean.setDirectoriesParentId(mId);
allBean.setNewsDirectoriesId(mPId);
allBean.setDirectoriesParentId(mPId);
allBean.setDirectoriesView("2");
newsTabBeans.add(0, allBean);
mTabs = newsTabBeans;
for (int i = 0; i < newsTabBeans.size(); i++) {
Bundle bundle = new Bundle();
bundle.putString("type", newsTabBeans.get(i).getNewsDirectoriesId());
bundle.putString("pId", "");
bundle.putBoolean("isAll","全部".equals(newsTabBeans.get(i).getDirectoriesName()));
bundle.putString("pId", "");
BaseFragment fragment = null;
//0 外部链接 1存在子集 2没有子集
if ("0".equals(newsTabBeans.get(i).getDirectoriesView())) {

View File

@ -142,45 +142,46 @@ public class NewsSearchActivity extends BaseActivity {
* @param type
*/
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("title", rowsBean.getNewsContentTitle())
.withString("url", rowsBean.getNewsContentContent())
.navigation();
} else {
int newsType = 0;
if (type == 1) {
//1自定义列表
//3列表详情
if ("1".equals(rowsBean.getNewsConfigWebSwitch())) {
//列表
url = rowsBean.getTemplateRecordUrl();
newsType = 0;
} else {
//内容
url = rowsBean.getNewsConfigDescriptionText();
newsType = 1;
}
} else {
newsType = 0;
url = rowsBean.getTemplateRecordUrl();
}
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL) //TODO 连接
// .build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL_INTERFACE)//TODO 接口方式
// .build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL) //TODO 连接
.build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL_INTERFACE)//TODO 接口方式
.withString("id", rowsBean.getNewsContentId())
.withString("url", url)
.withString("url", "")
.withString("isComment", rowsBean.getNewsConfigComment())//是否可以评论
.withString("isCommentImg", rowsBean.getNewsConfigCommentImage())//评论是否可以上传图片
.withString("isCollect", rowsBean.getNewsContentCollectStatus())
.withString("photo",
BaseUrlApi.BASE_NEWS_IMG_URL + rowsBean.getNewsContentCoverList().get(0).getContentCoverId())
.withString("title", rowsBean.getNewsContentTitle())
.withInt("type", newsType)
.withInt("type", 2)
.navigation();
}
// String url = "";
// if ("6".equals(rowsBean.getNewsContentType())) {
// ARouter.getInstance()
// .build(PathConfig.PATH_MODULE_MAIN_NEWS_WEB)
// .withString("title", rowsBean.getNewsContentTitle())
// .withString("url", rowsBean.getNewsContentContent())
// .navigation();
// } else {
// int newsType = 0;
// if (type == 1) {
// //1自定义列表
// //3列表详情
// if ("1".equals(rowsBean.getNewsConfigWebSwitch())) {
// //列表
// url = rowsBean.getTemplateRecordUrl();
// newsType = 0;
// } else {
// //内容
// url = rowsBean.getNewsConfigDescriptionText();
// newsType = 1;
// }
// } else {
// newsType = 0;
// url = rowsBean.getTemplateRecordUrl();
// }
// }
}
/**

View File

@ -1,28 +1,24 @@
package com.tengshisoft.mudulemain.cultural.adapter;
import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.net.http.SslError;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.MultiTransformation;
import com.bumptech.glide.load.resource.bitmap.FitCenter;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.sucstepsoft.cm_utils.constant.PathConfig;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.sucstepsoft.cm_utils.core.widget.base.GlideRoundTransform;
import com.sucstepsoft.cm_utils.core.widget.base.RoundedCornersTransform;
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
import com.sucstepsoft.cm_utils.utils.LogUtils;
@ -54,6 +50,7 @@ public class NewsAdapter extends BaseRecyclerAdapter<NewsItemBean.RowsBean, Recy
roundedCornersTransform.setNeedCorner(true, true, true, true);
mPicOptions = new RequestOptions()
.transform(roundedCornersTransform)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.error(R.drawable.ic_img_default)
.placeholder(R.drawable.ic_img_default);

View File

@ -0,0 +1,51 @@
package com.tengshisoft.mudulemain.cultural.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.mudulemain.R;
import com.tengshisoft.mudulemain.cultural.beans.NewsDetailBean;
import com.tengshisoft.mudulemain.cultural.holder.NewsCategoryHolder;
import java.util.List;
/**
* 作者: adam
* 日期: 2020/5/15 - 10:00 AM
* 邮箱: itgaojian@163.com
* 描述:
*/
public class NewsCategoryAdapter extends BaseRecyclerAdapter<NewsDetailBean.FileListBean, NewsCategoryHolder> {
public NewsCategoryAdapter(Context ctx, List<NewsDetailBean.FileListBean> list) {
super(ctx, list);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public NewsCategoryHolder createHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_news_category, parent, false);
return new NewsCategoryHolder(itemView);
}
@Override
public void bindHolder(NewsCategoryHolder h, int i) {
NewsDetailBean.FileListBean b = mData.get(i);
if (b.isCheck()) {
h.mTvName.setBackgroundResource(R.drawable.shape_red_line_ra_2);
} else {
h.mTvName.setBackgroundResource(0);
}
h.mTvName.setText(String.valueOf(i + 1));
}
}

View File

@ -338,6 +338,15 @@ public class NewsDetailBean {
private String contentFileText;
private String newsContentFileId;
private String newsContentId;
private boolean isCheck;
public boolean isCheck() {
return isCheck;
}
public void setCheck(boolean check) {
isCheck = check;
}
public String getContentFileFileId() {
return contentFileFileId;

View File

@ -59,8 +59,8 @@ public class NewsFragment extends BaseFragment {
private NewsAdapter mAdapter;
private int mTotalPage = 0;
private int mCurrentPage = 1;
private String mType;//newsID
private String mPId;//newsPid
private String mType;//newsId
private String mPid;//newsPid
private RecyclerViewSkeletonScreen mNewsSkeleton;
private Disposable mD1;
private Disposable mD2;
@ -73,8 +73,8 @@ public class NewsFragment extends BaseFragment {
setStateView(STATE_SUCCESS);
mAdapter = new NewsAdapter(mActivity, mNewsDatas);
mType = getArguments().getString("type");
mPId = getArguments().getString("pId");
mIsAll = getArguments().getBoolean("isAll", false);
mPid = getArguments().getString("pId");
mIsAll = getArguments().getBoolean("isAll");
mCurrentPage = 1;
mTotalPage = 0;
mNewsDatas.clear();
@ -114,45 +114,45 @@ 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_DETAIL_INTERFACE)
.build(PathConfig.PATH_MODULE_MAIN_NEWS_WEB)
.withString("url", rowsBean.getNewsContentContent())
.withString("title", rowsBean.getNewsContentTitle())
.navigation();
} else {
int newsType = 0;
if (type == 1) {
//1自定义列表
//3列表详情
if ("1".equals(rowsBean.getNewsConfigWebSwitch())) {
//列表
url = rowsBean.getTemplateRecordUrl();
newsType = 0;
} else {
//内容
url = rowsBean.getNewsConfigDescriptionText();
newsType = 1;
}
} else {
newsType = 0;
url = rowsBean.getTemplateRecordUrl();
}
ARouter.getInstance()
// .build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL)//TODO 详情模板
.build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL_INTERFACE)//TODO 接口方式
.withString("id", rowsBean.getNewsContentId())
.withString("url", "")
.withString("url", url)
.withString("isComment", rowsBean.getNewsConfigComment())//是否可以评论
.withString("isCommentImg", rowsBean.getNewsConfigCommentImage())//评论是否可以上传图片
.withString("isCollect", rowsBean.getNewsContentCollectStatus())
.withString("photo", BaseUrlApi.BASE_NEWS_IMG_URL + rowsBean.getNewsContentCoverList().get(0).getContentCoverId())
.withString("title", rowsBean.getNewsContentTitle())
.withInt("type", -1)
.withInt("type", newsType)
.navigation();
// String url = "";
// if ("6".equals(rowsBean.getNewsContentType())) {
// //链接新闻
// ARouter.getInstance()
// .build(PathConfig.PATH_MODULE_MAIN_NEWS_WEB)
// .withString("url", rowsBean.getNewsContentContent())
// .withString("title", rowsBean.getNewsContentTitle())
// .navigation();
// } else {
// int newsType = 0;
// if (type == 1) {
// //1自定义列表
// //3列表详情
// if ("1".equals(rowsBean.getNewsConfigWebSwitch())) {
// //列表
// url = rowsBean.getTemplateRecordUrl();
// newsType = 0;
// } else {
// //内容
// url = rowsBean.getNewsConfigDescriptionText();
// newsType = 1;
// }
// } else {
// newsType = 0;
// url = rowsBean.getTemplateRecordUrl();
// }
//
// }
}
}
private void getNewsListByTypeToken(int page) {
@ -176,24 +176,24 @@ public class NewsFragment extends BaseFragment {
if (newsItemBean != null && newsItemBean.getRows().size() > 0) {
mTotalPage = newsItemBean.getTotal();
getCommentCount(1, newsItemBean);
// mNewsDatas = newsItemBean.getRows();
// mNewsDatas.addAll(newsItemBean.getRows());
// mAdapter.setData(mNewsDatas);
// setStateView(STATE_SUCCESS);
setStateView(STATE_SUCCESS);
} else {
setStateView(STATE_EMPTY);
}
mSrlView.finishRefresh();
} else {
if (newsItemBean != null) {
// mNewsDatas.addAll(newsItemBean.getRows());
// mAdapter.setData(mNewsDatas);
getCommentCount(2, newsItemBean);
mSrlView.finishLoadMore();
} else {
mSrlView.setNoMoreData(true);
}
}
mSrlView.finishLoadMore();
mSrlView.finishRefresh();
}
@Override
@ -222,7 +222,6 @@ public class NewsFragment extends BaseFragment {
* @param id
*/
private void getNewsSubMenu(String id) {
RetrofitManager.getInstance()
.create(HomeApi.class)
.getNewsTabListByPid(id)

View File

@ -0,0 +1,24 @@
package com.tengshisoft.mudulemain.cultural.holder;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.tengshisoft.mudulemain.R;
/**
* 作者: adam
* 日期: 2020/5/28 - 10:18 AM
* 邮箱: itgaojian@163.com
* 描述:
*/
public class NewsCategoryHolder extends RecyclerView.ViewHolder {
public TypeFaceTextView mTvName;
public NewsCategoryHolder(@NonNull View itemView) {
super(itemView);
mTvName = itemView.findViewById(R.id.tv_category);
}
}

View File

@ -8,6 +8,12 @@ import androidx.recyclerview.widget.RecyclerView;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.tengshisoft.mudulemain.R;
/**
* 作者: adam
* 日期: 2020/5/28 - 10:18 AM
* 邮箱: itgaojian@163.com
* 描述:
*/
public class NewsTabHolder extends RecyclerView.ViewHolder {
public View mVLine;
public TypeFaceTextView mTvName;
@ -18,4 +24,3 @@ public class NewsTabHolder extends RecyclerView.ViewHolder {
mTvName = itemView.findViewById(R.id.tv_name);
}
}

View File

@ -57,7 +57,7 @@ public interface HomeApi {
* @param user
* @return
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@Headers({"Content-Type: application/json", "Accept: application/json", "is_need_area:false"})
@POST("app/sign/default")
Observable<BaseUserBean> doLogin(@Body RequestBody user);
@ -82,7 +82,7 @@ public interface HomeApi {
/**
* 获取非遗列表
*/
@Headers({"base_url_name:legacy", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:legacy", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
@GET("app/intangiblelibrary/listpageintangiblelibraryrelease")
Observable<LegacyListBean> getLegacyList(@Query("page") String page, @Query("rows") String row);
@ -101,7 +101,7 @@ public interface HomeApi {
*
* @return
*/
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "is_need_area:true"})
@GET("app/newsdirectories/listnewsdirectoriesrelease")
Observable<List<NewsTabBean>> getNewsTabList();
@ -136,15 +136,18 @@ public interface HomeApi {
*/
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json", "need_area:true"})
@GET("app/newscontent/listpagenewscontentrelease")
Observable<NewsItemBean> getNewsTabListByPid(@Query("newsDirectoriesId") String id, @Query("newsDirectoriesParentId") 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);
// Observable<NewsItemBean> getNewsTabListByPid(@Query("newsDirectoriesId") String pid, @Query("rows") String rows, @Query("page") String page);
Observable<NewsItemBean> getNewsTabListByPid(@Query("newsDirectoriesId") String pid, @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", "need_area:true"})
@GET("app/newscontent/listpagenewscontentrelease")
Observable<NewsItemBean> getNewsList(@Query("newsDirectoriesId") String newsDirectoriesId, @Query("newsDirectoriesParentId") String pId, @Query("page") String page);
Observable<NewsItemBean> getNewsList(@Query("newsDirectoriesId") String newsDirectoriesId,
@Query("newsDirectoriesParentId") String pId,
@Query("page") String page);
/**
* 获取新闻列表-不需要token
@ -169,23 +172,26 @@ public interface HomeApi {
*/
@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("newsDirectoriesParentId") String pId, @Query("rows") String rows,
@Query("page") String page);
Observable<NewsItemBean> getMainNewsList(@Query("newsDirectoriesId") String newsDirectoriesId,
@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", "need_area:true"})
@GET("app/newscontent/listpagenewscontent")
Observable<NewsItemBean> getNewsListByToken(@Query("newsDirectoriesId") String newsDirectoriesId, @Query("newsDirectoriesParentId") String pId, @Query("page") String page,
@Header("token") String token);
Observable<NewsItemBean> getNewsListByToken(@Query("newsDirectoriesId") String newsDirectoriesId,
@Query("newsDirectoriesParentId") String pId,
@Query("page") String page, @Header("token") String token);
/**
* 获取新闻列表-需要token
*/
@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);
Observable<NewsItemBean> getNewsMainListByToken(@Query("newsDirectoriesId") String newsDirectoriesId, @Query(
"rows") String rows, @Query("page") String page, @Header("token") String token);
/**
* 获取新闻详情
@ -194,7 +200,6 @@ public interface HomeApi {
@GET("app/newscontent/getnewscontentbyidrelease/{id}")
Observable<NewsDetailBean> getNewsDetail(@Path("id") String id);
/**
* 获取评论列表
*/
@ -208,7 +213,8 @@ public interface HomeApi {
*/
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json"})
@GET("app/newscomment/listpagenewscomment")
Observable<CommentListBean> getCommentListByLogin(@Query("page") String page, @Query("newsContentId") String nId, @Header("token") String token);
Observable<CommentListBean> getCommentListByLogin(@Query("page") String page, @Query("newsContentId") String nId,
@Header("token") String token);
/**
@ -216,7 +222,8 @@ public interface HomeApi {
*/
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json"})
@GET("app/newscomment/listpagenewscommentrelease")
Observable<CommentListBean> getCommentListByPId(@Query("page") String page, @Query("commentParentId") String pId, @Query("newsContentId") String nId);
Observable<CommentListBean> getCommentListByPId(@Query("page") String page, @Query("commentParentId") String pId,
@Query("newsContentId") String nId);
/**
* 获取评论列表
@ -224,7 +231,10 @@ public interface HomeApi {
*/
@Headers({"base_url_name:news", "Content-Type:application/json", "Accept:application/json"})
@GET("app/newscomment/listpagenewscomment")
Observable<CommentListBean> getCommentListByLoginByPid(@Query("page") String page, @Query("newsContentId") String nId, @Query("commentParentId") String pId, @Header("token") String token);
Observable<CommentListBean> getCommentListByLoginByPid(@Query("page") String page,
@Query("newsContentId") String nId, @Query(
"commentParentId") String pId,
@Header("token") String token);
/**
* 保存评论
@ -276,7 +286,8 @@ public interface HomeApi {
*/
@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);
Observable<PlaceListBean> getPlaceByOrder(@Query("latitude") String lat, @Query("longitude") String lng, @Query(
"orderKey") String order, @Query("page") String page, @Query("rows") String rows);
/**
* 直播回放列表
@ -304,5 +315,6 @@ public interface HomeApi {
*/
@Headers({"Content-Type:application/json", "Accept:application/json"})
@GET("app/area/listpagearea")
Observable<SearchBean> doSearchByKeyword(@Query("page") int page, @Query("keywords") String key, @Header("token") String token);
Observable<SearchBean> doSearchByKeyword(@Query("page") int page, @Query("keywords") String key,
@Header("token") String token);
}

View File

@ -141,6 +141,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/iv_banner_left"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_img_arrow_left" />
<ImageView
android:id="@+id/iv_banner_right"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_img_arrow_right" />
</RelativeLayout>
<!--====================音频===========================-->
<LinearLayout

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content">
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
android:id="@+id/tv_category"
android:layout_width="wrap_content"
tools:text="1"
android:padding="10dp"
android:layout_height="wrap_content"/>
</LinearLayout>

View File

@ -92,7 +92,7 @@ public class CollectActivity extends BaseActivity {
url = rowsBean.getTemplateRecordUrl();
}
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL)
.build(PathConfig.PATH_MODULE_MAIN_NEWS_DETAIL_INTERFACE)
.withString("id", rowsBean.getNewsContentId())
.withString("url", url)
.withString("isComment", rowsBean.getNewsConfigComment())//是否可以评论

View File

@ -207,7 +207,6 @@
android:layout_marginRight="10dp"
android:background="@color/gray_line_deep" />
<LinearLayout style="@style/item_hor_content">
<TextView

View File

@ -375,7 +375,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="5dp"
android:layout_marginTop="8dp"
android:background="@drawable/shp_rectangle_gray_df"
android:gravity="left"
android:hint="未录入"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="wrap_content"
@ -17,7 +18,6 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_change_phone"
android:layout_width="match_parent"
@ -44,8 +44,8 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@color/gray_line_deep" />
<LinearLayout
@ -74,10 +74,17 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@color/gray_line_deep" />
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:visibility="gone"
app:cardCornerRadius="5dp"
app:cardElevation="3dp">
<LinearLayout
android:id="@+id/ll_change_pwd"
@ -86,8 +93,7 @@
android:layout_margin="5dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="8dp"
android:visibility="gone">
android:padding="8dp">
<ImageView
android:layout_width="wrap_content"
@ -101,6 +107,7 @@
android:text="修改密码"
android:textSize="15sp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
@ -126,7 +133,6 @@
android:textSize="15sp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/ll_check_update"
android:layout_width="match_parent"
@ -167,7 +173,9 @@
android:id="@+id/tv_login_out"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:layout_marginRight="20dp"
android:background="@drawable/sel_btn_activity_sign_up"
android:clickable="true"
android:focusable="true"

View File

@ -18,6 +18,7 @@ import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
import com.sucstepsoft.cm_utils.core.widget.base.BaseBannerImageAdapter;
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.tengshisoft.moduleplace.R;
import com.tengshisoft.moduleplace.R2;
@ -93,6 +94,9 @@ public class PlaceDetailActivity extends BaseActivity {
getPlaceDetailData(mId);
mTvPlaceDetail.setOnClickListener(v -> showPlaceDetail());
mMrbLevel.setIsIndicator(true);
String read = String.format(getResources().getString(R.string.big_data_str), "", mId, "场馆");
LogUtils.e(read);
bigDataRead(read);
}
/**

View File

@ -6,6 +6,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.moduleplace.R;
@ -36,6 +37,7 @@ public class PlaceFuncAdapter extends BaseRecyclerAdapter<PlaceFuncBean.DataBean
placeFuncHolder.mTvName.setText(mData.get(i).getDictionaryName());
Glide.with(mContext)
.asBitmap()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.load(BaseUrlApi.BASE_PLACE_IMG_IP + mData.get(i).getDictionaryIcon())
.apply(options)
.into(placeFuncHolder.mIvIcon);

View File

@ -7,6 +7,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
import com.tengshisoft.moduleplace.R;
@ -55,6 +56,7 @@ public class PlaceListAdapter extends BaseRecyclerAdapter<PlaceListBean.RowsBean
String[] split = rowsBean.getVenuePanorama().split(",");
Glide.with(mContext)
.asBitmap()
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.load(BaseUrlApi.BASE_PLACE_IMG_IP + split[0])
.apply(options)
.into(holder.mIvCover);

View File

@ -37,7 +37,8 @@ public interface ApiPlace {
*/
@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);
Observable<PlaceListBean> getPlaceByOrder(@Query("latitude") String lat, @Query("longitude") String lng, @Query(
"orderKey") String order, @Query("page") String page, @Query("rows") String rows);
/**
* 获取场馆列表-根据类型
@ -54,7 +55,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", "is_need_area:true"})
@GET("app/venuedictionary/listvenuedictionarybyparentidrelease/{dictionaryParentId}")
Observable<PlaceFuncBean> getPlaceTypeList(@Path("dictionaryParentId") String pId);
@ -139,7 +140,8 @@ public interface ApiPlace {
*/
@Headers({"base_url_name:place", "Content-Type:application/json", "Accept:application/json"})
@DELETE("app/booking/removemyticketitem/{groundBookingId}/{bookingItemId}")
Observable<BaseSuccessBean> deleteBookingItem(@Path("groundBookingId") String gId, @Path("bookingItemId") String id, @Header("token") String token);
Observable<BaseSuccessBean> deleteBookingItem(@Path("groundBookingId") String gId,
@Path("bookingItemId") String id, @Header("token") String token);
/**
* 取消订单

View File

@ -26,8 +26,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:padding="5dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:padding="5dp">
<RadioButton
android:id="@+id/rb_default"
@ -125,11 +125,17 @@
tools:text="加载数据失败" />
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_place_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/item_place_list" />
</androidx.core.widget.NestedScrollView>
</FrameLayout>

View File

@ -154,10 +154,26 @@ public class GoodsDetailActivity extends BaseActivity {
mTvGoodsStock.setText("库存:" + b.getGoodsItemTotal());
mStandardAdapter.setSelPos(p);
});
mTvAddCar.setOnClickListener(v -> addToCar(mCurrentBean));
mLlCar.setOnClickListener(v -> ARouter.getInstance()
mTvAddCar.setOnClickListener(v -> {
if (isLogin()) {
addToCar(mCurrentBean);
} else {
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_MAIN_LOGIN)
.navigation();
}
});
mLlCar.setOnClickListener(v -> {
if (isLogin()) {
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_CAR)
.navigation());
.navigation();
} else {
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_MAIN_LOGIN)
.navigation();
}
});
}
private void parserShopCar() {

View File

@ -174,7 +174,7 @@ public class OrderConfirmActivity extends BaseActivity {
for (int i = 0; i < mDatas.size(); i++) {
price += (mDatas.get(i).getCarAmount() * mDatas.get(i).getGoodsPrice());
}
mTvPrice.setText(price + "");
mTvPrice.setText("¥ " + price + "");
}
@Override

View File

@ -29,7 +29,7 @@ import butterknife.Unbinder;
import io.reactivex.disposables.Disposable;
/**
* 我的订单
* 我的商城订单
*/
@Route(path = PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_MINE_ORDER)
public class OrderListActivity extends BaseActivity {

View File

@ -26,13 +26,13 @@ import retrofit2.http.Query;
public interface ShopApi {
//获取商品分类
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/category/listztreerelease")
Observable<List<ShopSortListBean>> getShopCategoryList();
//根据分类ID商品检索
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/shopgoods/solrrelease")
Observable<GoodsListBean> getGoodsList(@Query("page") String page,
@Query("rows") String rows,
@ -50,7 +50,7 @@ public interface ShopApi {
* @param uE 商品评分
* @return
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/shopgoods/solrrelease")
Observable<GoodsListBean> getGoodsList(@Query("page") String page,
@Query("rows") String rows,
@ -63,14 +63,14 @@ public interface ShopApi {
/**
* 获取商品详情
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/shopgoods/getrelease/{goodsId}")
Observable<ShopGoodsDetailBean> getGoodsDetailById(@Path("goodsId") String goodsId);
/**
* 获取商品规格
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/shopgoodsitem/listrelease/{goodsId}")
Observable<List<GoodsStandardBean>> getStandardListByGoodsId(@Path("goodsId") String goodsId);
@ -78,21 +78,21 @@ public interface ShopApi {
/**
* 提交订单
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@POST("app/order/savebycart")
Observable<OrderSuccessBean> doSaveOrder(@Body RequestBody goods, @Header("token") String token);
/**
* 新增收货地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@POST("app/shopaddress/save")
Observable<BaseSuccessBean> doSaveAddress(@Body RequestBody goods, @Header("token") String token);
/**
* 修改收货地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@PUT("app/shopaddress/update/{shopAddressId}")
Observable<BaseSuccessBean> doEditAddress(@Body RequestBody goods,
@Path("shopAddressId") String addressId,
@ -101,35 +101,35 @@ public interface ShopApi {
/**
* 设置默认收货地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@PUT("app/shopaddress/updatedefault/{shopAddressId}")
Observable<BaseSuccessBean> doSetDefaultAddress(@Path("shopAddressId") String id, @Header("token") String token);
/**
* 获取默认地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/shopaddress/getdefault")
Observable<ShippingAddressBean> getDefaultAddress(@Header("token") String token);
/**
* 删除收货地址
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@DELETE("app/shopaddress/remove/{ids}")
Observable<BaseSuccessBean> doDelShippingAddress(@Path("ids") String id, @Header("token") String token);
/**
* 收货地址列表
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/shopaddress/list")
Observable<List<ShippingAddressBean>> getShippingAddressList(@Header("token") String token);
/**
* 我的订单
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/order/listpage")
Observable<OrderListBean> getMineShopOrderList(@Query("orderStatus") String status,
@Query("page") String page,
@ -140,14 +140,14 @@ public interface ShopApi {
/**
* 删除订单
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@DELETE("app/order/delete/{orderId}")
Observable<BaseSuccessBean> doDelOrder(@Path("orderId") String id, @Header("token") String token);
/**
* 取消订单
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@PUT("app/order/updatebuyersclose/{orderId}")
Observable<BaseSuccessBean> doCancelOrder(@Path("orderId") String id,
@Body RequestBody body,
@ -156,7 +156,7 @@ public interface ShopApi {
/**
* 获取取消原因
*/
@Headers({"base_url_name:shop", "Content-Type:application/json", "Accept:application/json"})
@Headers({"base_url_name:shop", "is_need_area:false", "Content-Type:application/json", "Accept:application/json"})
@GET("app/data/listbyparentid/{id}")
Observable<List<BaseDictionaryBean>> getCancelData(@Path("id") String id,
@Header("token") String token);