页面
@ -44,4 +44,10 @@ dependencies {
|
||||
implementation project(':modulemap')//地图
|
||||
}
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation 'com.github.jarryleo:MagicScreenAdapter:v2.1'
|
||||
//glide
|
||||
implementation "com.github.bumptech.glide:glide:${rootProject.ext.supportGlide}"
|
||||
annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.ext.supportGlide}"
|
||||
//状态栏
|
||||
implementation 'com.gyf.immersionbar:immersionbar:2.3.3'
|
||||
}
|
||||
|
@ -10,14 +10,27 @@
|
||||
android:networkSecurityConfig="@xml/network_config"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="appKey"-->
|
||||
<!-- android:value="com.sucstepsoft.hs.supervision" />-->
|
||||
android:maxAspectRatio="2.4"
|
||||
android:resizeableActivity="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="appKey"-->
|
||||
<!-- android:value="com.sucstepsoft.hs.supervision" />-->
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="sdX2qpmzj85dEUGLS74982Gt1fFBjvS7" />
|
||||
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="2.4" />
|
||||
<!--适配华为(huawei)刘海屏-->
|
||||
<meta-data
|
||||
android:name="android.notch_support"
|
||||
android:value="true" />
|
||||
<!--适配小米(xiaomi)刘海屏-->
|
||||
<meta-data
|
||||
android:name="notch.config"
|
||||
android:value="portrait|landscape" />
|
||||
<service
|
||||
android:name="com.baidu.location.f"
|
||||
android:enabled="true"
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.tengshisoft;
|
||||
|
||||
import android.app.Application;
|
||||
import android.os.Process;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.baidu.location.BDLocation;
|
||||
@ -10,11 +9,10 @@ import com.baidu.mapapi.SDKInitializer;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.refresh.CustomRefreshHeader;
|
||||
import com.sucstepsoft.cm_utils.interfaces.IComponentApplication;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.tencent.smtt.sdk.QbSdk;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
import cn.leo.magic.screen.MagicScreenAdapter;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
@ -38,6 +36,7 @@ public class BaseMyApplication extends Application {
|
||||
super.onCreate();
|
||||
MultiDex.install(this);
|
||||
ARouter.openDebug();
|
||||
MagicScreenAdapter.initDesignWidthInDp(1024, true);
|
||||
ARouter.init(BaseMyApplication.this);
|
||||
QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
|
18
app/src/main/java/com/tengshisoft/MyAppGlideModule.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.tengshisoft;
|
||||
|
||||
import com.bumptech.glide.annotation.GlideModule;
|
||||
import com.bumptech.glide.module.AppGlideModule;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/3 - 3:50 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
@GlideModule
|
||||
public class MyAppGlideModule extends AppGlideModule {
|
||||
@Override
|
||||
public boolean isManifestParsingEnabled() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -5,13 +5,14 @@ buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.6.3'
|
||||
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.1'
|
||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
|
||||
classpath "com.alibaba:arouter-register:1.0.2"
|
||||
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.6'
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
@ -91,6 +92,7 @@ ext {
|
||||
//rxview
|
||||
gRxjavaBindingVersion = '2.1.1'
|
||||
gPickerViewVersion = '4.1.6'
|
||||
wheelVersion = '4.1.0'
|
||||
gBoomMenu = '2.1.1'
|
||||
gFilePicker = '1.8.0'
|
||||
pickerViewVersion = '4.1.9'
|
||||
|
@ -1,6 +1,7 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
apply plugin: 'com.jakewharton.butterknife'
|
||||
apply plugin: 'android-aspectjx'
|
||||
//apply plugin: 'com.jfrog.bintray'
|
||||
|
||||
//version = "1.1.8"
|
||||
@ -39,14 +40,26 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation('androidx.appcompat:appcompat:1.0.0') { exclude module: 'support-v4' }
|
||||
implementation('androidx.appcompat:appcompat:1.1.0') { exclude module: 'support-v4' }
|
||||
implementation project(':cm_utils')
|
||||
implementation 'com.isseiaoki:simplecropview:1.1.8'
|
||||
//glide
|
||||
implementation "com.github.bumptech.glide:glide:${rootProject.ext.supportGlide}"
|
||||
annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.ext.supportGlide}"
|
||||
//Arouter
|
||||
annotationProcessor "com.alibaba:arouter-compiler:$rootProject.ext.gRouterCompileVersion"
|
||||
//butterknife
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.gButterKnifeVersion"
|
||||
//Rxjava
|
||||
implementation "io.reactivex.rxjava2:rxjava:${rootProject.ext.gRxJavaVersion}"
|
||||
implementation "io.reactivex.rxjava2:rxandroid:${rootProject.ext.gRxAndroid}"
|
||||
//RxJava
|
||||
implementation "com.squareup.retrofit2:retrofit:${rootProject.ext.gRetrofitVersion}"
|
||||
//屏幕适配
|
||||
implementation 'com.github.jarryleo:MagicScreenAdapter:v2.1'
|
||||
}
|
||||
//def siteUrl = 'https://github.com/CJT2325/CameraView' // 项目的主页
|
||||
//def gitUrl = 'https://github.com/CJT2325/CameraView.git' // Git仓库的url
|
||||
|
@ -1,11 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.cjt2325.cameralibrary">
|
||||
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true">
|
||||
<activity android:name=".activitys.TextureVideoActivity" />
|
||||
<activity android:name=".activitys.CropImgActivity" />
|
||||
<activity android:name="com.cjt2325.cameralibrary.activitys.PhotoActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -536,7 +536,7 @@ public class CameraInterface implements Camera.PreviewCallback {
|
||||
|
||||
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
|
||||
|
||||
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
|
||||
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_2_TS);
|
||||
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
|
||||
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
|
||||
|
||||
|
@ -274,7 +274,7 @@ public class CaptureLayout extends FrameLayout {
|
||||
LayoutParams txt_param = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
|
||||
txt_param.gravity = Gravity.CENTER_HORIZONTAL;
|
||||
txt_param.setMargins(0, 0, 0, 0);
|
||||
txt_tip.setText("轻触拍照,长按摄像");
|
||||
txt_tip.setText("长按摄像");
|
||||
txt_tip.setTextColor(0xFFFFFFFF);
|
||||
txt_tip.setGravity(Gravity.CENTER);
|
||||
txt_tip.setLayoutParams(txt_param);
|
||||
|
195
camera/src/main/java/com/cjt2325/cameralibrary/activitys/PhotoActivity.java
Executable file
@ -0,0 +1,195 @@
|
||||
package com.cjt2325.cameralibrary.activitys;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.cjt2325.cameralibrary.R;
|
||||
import com.cjt2325.cameralibrary.R2;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.photoview.adapter.ImageAdapter;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 相片浏览
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_CAMERA_SHOW_IMG)
|
||||
public class PhotoActivity extends BaseActivity {
|
||||
@BindView(R2.id.vp_images)
|
||||
ViewPager mVpImages;
|
||||
@BindView(R2.id.tv_count)
|
||||
TextView mTvCount;
|
||||
@BindView(R2.id.tv_save)
|
||||
TextView mTvSave;
|
||||
@BindView(R2.id.iv_back)
|
||||
ImageView mIvPBack;
|
||||
public static final String TAG_IMGURL = "imgUrls";
|
||||
private Unbinder mUnbinder;
|
||||
private int mPosition = 0;
|
||||
private ArrayList<String> mImgUrls;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_photo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mUnbinder = ButterKnife.bind(this);
|
||||
mRlTitleBar1.setVisibility(View.GONE);
|
||||
mRlTitleBar.setVisibility(View.GONE);
|
||||
// mIbBack.setVisibility(View.VISIBLE);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
String isSave = getIntent().getStringExtra("isSave");
|
||||
if (!TextUtils.isEmpty(isSave)) {
|
||||
mTvSave.setVisibility(View.GONE);
|
||||
} else {
|
||||
mTvSave.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mTvSave.setOnClickListener(v -> downloadImg());
|
||||
mIvPBack.setOnClickListener(v -> finish());
|
||||
mImgUrls = getIntent().getStringArrayListExtra(TAG_IMGURL);
|
||||
if (mImgUrls == null) {
|
||||
ToastUtils.showShort(R.string.check_imgurl);
|
||||
finish();
|
||||
} else {
|
||||
ImageAdapter imageAdapter = new ImageAdapter(this, mImgUrls);
|
||||
imageAdapter.addImgClick(() -> finish());
|
||||
mVpImages.setAdapter(imageAdapter);
|
||||
mTvCount.setText(String.format(getResources().getString(R.string.img_position), 1, mImgUrls.size()));
|
||||
mVpImages.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
mTvCount.setText(String.format(getResources().getString(R.string.img_position), ++position, mImgUrls.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void downloadImg() {
|
||||
int currentItem = mVpImages.getCurrentItem();
|
||||
if (mImgUrls != null && mImgUrls.size() > 0) {
|
||||
String s = mImgUrls.get(currentItem);
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
|
||||
dialog.show();
|
||||
Observable.create((ObservableOnSubscribe<File>) e -> {
|
||||
//通过gilde下载得到file文件,这里需要注意android.permission.INTERNET权限
|
||||
e.onNext(Glide.with(mActivity)
|
||||
.load(s)
|
||||
.downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
|
||||
.get());
|
||||
e.onComplete();
|
||||
}).subscribeOn(Schedulers.io())
|
||||
.observeOn(Schedulers.newThread())
|
||||
.subscribe(new Observer<File>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(File file) {
|
||||
dialog.dismiss();
|
||||
File appDir = new File(PathConfig.CATCH_PATH);
|
||||
if (!appDir.exists()) {
|
||||
appDir.mkdirs();
|
||||
}
|
||||
String fileName = System.currentTimeMillis() + ".jpg";
|
||||
File destFile = new File(appDir, fileName);
|
||||
//把gilde下载得到图片复制到定义好的目录中去
|
||||
copy(file, destFile);
|
||||
// 最后通知图库更新
|
||||
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
|
||||
Uri.fromFile(new File(destFile.getPath()))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showShort("保存失败,稍后重试.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ToastUtils.showShort("图片地址有误,请稍后重试.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制文件
|
||||
*
|
||||
* @param source 输入文件
|
||||
* @param target 输出文件
|
||||
*/
|
||||
public void copy(File source, File target) {
|
||||
FileInputStream fileInputStream = null;
|
||||
FileOutputStream fileOutputStream = null;
|
||||
try {
|
||||
fileInputStream = new FileInputStream(source);
|
||||
fileOutputStream = new FileOutputStream(target);
|
||||
byte[] buffer = new byte[1024];
|
||||
while (fileInputStream.read(buffer) > 0) {
|
||||
fileOutputStream.write(buffer);
|
||||
}
|
||||
ToastUtils.showLong("保存成功,前往SD卡下" + PathConfig.PROJECT_NAME + "文件夹下查看");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ToastUtils.showShort("保存失败,请稍后重试");
|
||||
} finally {
|
||||
try {
|
||||
fileInputStream.close();
|
||||
fileOutputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
mUnbinder.unbind();
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.cjt2325.cameralibrary.activitys;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.cjt2325.cameralibrary.JCameraView;
|
||||
import com.cjt2325.cameralibrary.R;
|
||||
import com.cjt2325.cameralibrary.R2;
|
||||
import com.cjt2325.cameralibrary.listener.ErrorListener;
|
||||
import com.cjt2325.cameralibrary.listener.JCameraListener;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* 录制视屏
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_CAMERA_RECORD)
|
||||
public class TextureVideoActivity extends BaseActivity {
|
||||
@BindView(R2.id.jv_camera)
|
||||
JCameraView mCameraView;
|
||||
private Unbinder mBind;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_texture_video;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mRlTitleBar.setVisibility(View.GONE);
|
||||
mRlTitleBar1.setVisibility(View.GONE);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvBaseTitle.setText("视频录制");
|
||||
String savePath = getIntent().getStringExtra("savePath");
|
||||
if (TextUtils.isEmpty(savePath)) {
|
||||
ToastUtils.showShort("视频保存路径有误.");
|
||||
finish();
|
||||
} else {
|
||||
recordVideo(savePath);
|
||||
}
|
||||
}
|
||||
|
||||
private void recordVideo(String path) {
|
||||
mCameraView.setSaveVideoPath(path);
|
||||
//设置只能录像或只能拍照或两种都可以(默认两种都可以)
|
||||
mCameraView.setFeatures(JCameraView.BUTTON_STATE_ONLY_RECORDER);
|
||||
//设置视频质量
|
||||
mCameraView.setMediaQuality(JCameraView.MEDIA_QUALITY_MIDDLE);
|
||||
mCameraView.setErrorLisenter(new ErrorListener() {
|
||||
@Override
|
||||
public void onError() {
|
||||
//打开Camera失败回调
|
||||
Log.i("CJT", "open camera error");
|
||||
ToastUtils.showShort("打开摄像头失败.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void AudioPermissionError() {
|
||||
//没有录取权限回调
|
||||
Log.i("CJT", "AudioPermissionError");
|
||||
ToastUtils.showShort("摄像头未授权.");
|
||||
}
|
||||
});
|
||||
|
||||
mCameraView.setJCameraLisenter(new JCameraListener() {
|
||||
|
||||
@Override
|
||||
public void captureSuccess(Bitmap bitmap) {
|
||||
//获取图片bitmap
|
||||
Log.i("JCameraView", "bitmap = " + bitmap.getWidth());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordSuccess(String s, Bitmap bitmap) {
|
||||
//获取视频路径
|
||||
Log.i("CJT", "url = " + s);
|
||||
//重新命名
|
||||
if (!TextUtils.isEmpty(s)) {
|
||||
File file = new File(s);
|
||||
File newFile = new File(path + File.separator + System.currentTimeMillis() + ".mp4");
|
||||
if (file.exists()) {
|
||||
boolean b = file.renameTo(newFile);
|
||||
Log.e("TextureVideoActivity", "recordSuccess: " + b);
|
||||
if (b) {
|
||||
Intent intent = getIntent();
|
||||
intent.putExtra("name", newFile.getAbsolutePath());
|
||||
setResult(Activity.RESULT_OK, intent);
|
||||
ToastUtils.showShort("视频录制成功.");
|
||||
finish();
|
||||
} else {
|
||||
ToastUtils.showShort("视频录制失败,请重新录制.");
|
||||
}
|
||||
} else {
|
||||
Log.e("TextureVideoActivity", "recordSuccess: 不存在");
|
||||
ToastUtils.showShort("视频录制失败,请重新录制.");
|
||||
}
|
||||
} else {
|
||||
Log.e("TextureVideoActivity", "recordSuccess:路径未空 ");
|
||||
ToastUtils.showShort("视频录制失败,请重新录制.");
|
||||
}
|
||||
}
|
||||
});
|
||||
//左边按钮点击事件
|
||||
mCameraView.setLeftClickListener(this::finish);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
}
|
53
camera/src/main/res/layout/activity_photo.xml
Executable file
@ -0,0 +1,53 @@
|
||||
<?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/black">
|
||||
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/vp_images"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.viewpager.widget.ViewPager>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_margin="10dp"
|
||||
android:src="@drawable/ic_back_white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="10dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="5dp"
|
||||
android:text="保存"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
tools:text="1 / 2" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
17
camera/src/main/res/layout/activity_texture_video.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?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"
|
||||
tools:context=".activitys.TextureVideoActivity">
|
||||
|
||||
<com.cjt2325.cameralibrary.JCameraView
|
||||
android:id="@+id/jv_camera"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:duration_max="60000"
|
||||
app:iconMargin="20dp"
|
||||
app:iconSize="30dp"
|
||||
app:iconSrc="@drawable/ic_camera" />
|
||||
</RelativeLayout>
|
@ -58,14 +58,20 @@ dependencies {
|
||||
implementation "io.reactivex.rxjava2:rxjava:$rootProject.ext.gRxJavaVersion"
|
||||
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.ext.gRxAndroid"
|
||||
//Glide
|
||||
implementation "com.github.bumptech.glide:glide:$rootProject.ext.gGlideVersion"
|
||||
implementation "com.github.bumptech.glide:glide:${rootProject.ext.supportGlide}"
|
||||
annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.ext.supportGlide}"
|
||||
//butterknife
|
||||
api "com.jakewharton:butterknife:$rootProject.ext.gButterKnifeVersion"
|
||||
|
||||
////选择器
|
||||
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
|
||||
implementation "com.contrarywind:wheelview:${rootProject.ext.wheelVersion}"
|
||||
//recyclerview
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
//选择器
|
||||
implementation "com.contrarywind:Android-PickerView:$rootProject.ext.gPickerViewVersion"
|
||||
implementation "com.nightonke:boommenu:$rootProject.ext.gBoomMenu"
|
||||
// 基础依赖包,必须要依赖
|
||||
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
||||
// fragment快速实现(可选)
|
||||
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,21 @@
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_HISTORY_BOOKMARKS" />
|
||||
|
||||
<application>
|
||||
<application
|
||||
android:maxAspectRatio="2.4"
|
||||
android:resizeableActivity="true">
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="2.4" />
|
||||
<!--适配华为(huawei)刘海屏-->
|
||||
<meta-data
|
||||
android:name="android.notch_support"
|
||||
android:value="true" />
|
||||
<!--适配小米(xiaomi)刘海屏-->
|
||||
<meta-data
|
||||
android:name="notch.config"
|
||||
android:value="portrait|landscape" />
|
||||
|
||||
<activity android:name=".core.widget.base.ConditionActivity" />
|
||||
<activity android:name=".utils.PermissionUtils$PermissionActivity" />
|
||||
|
||||
|
BIN
cm_utils/src/main/assets/fonts/zhangti.TTF
Executable file
@ -44,6 +44,7 @@ public class PathConfig {
|
||||
public static final String USER_TYPE_X = "25affe67-134c-4a32-ba41-64b0cfedc782";
|
||||
public static final String APP_VERSION_ID = "402e60d8-8270-4bb9-8850-83d30a39a53f";
|
||||
|
||||
public static final String PLACE_TYPE_ID = "df8b758c-f6d8-465a-9aa8-c451fde47076";//场馆类型字典
|
||||
//新闻类型
|
||||
public static final int NEWS_TYPE_MULTI_PIC = 2332;//key_1 三图; key_2 一图左;key_3 一图右;key_4 一图下;key_5 纯文字;key_6 视频;key_7 音频;
|
||||
public static final int NEWS_TYPE_SINGLE_PIC_LEFT = 2333;//一图左
|
||||
@ -87,20 +88,59 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_PLACE_FRAGMENT_MAIN = "/moduleplace/fragment/main";//场馆fragment
|
||||
public static final String PATH_MODULE_PLACE_ACTIVITY_PLACE_SUBJECT_DETAIL = "/moduleplace/activity/subjectdetail";//场馆详情
|
||||
|
||||
public static final String PATH_MODULE_PLACE_TICKET_DISTINE = "/moduleplace/activity/distineticket";//门票预定
|
||||
public static final String PATH_MODULE_PLACE_DISTINE_BOOKING = "/moduleplace/activity/distinebooking";//场次预定
|
||||
|
||||
//===========================ModuleCultural=========文化=========================
|
||||
public static final String PATH_MODULE_CULTURAL_FRAGMENT_MAIN = "/modulecultural/fragment/main";//文化主页fragment
|
||||
public static final String PATH_MODULE_CULTURAL_ACTIVITY_LEGACY = "/modulecultural/activity/legacy";//非遗数据库
|
||||
public static final String PATH_MODULE_CULTURAL_ACTIVITY_LEGACY_DETAIL = "/modulecultural/activity/legacy/detail";
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_PUBLISH = "/modulecultural/activity/vounteerpublish";//发布自愿者活动
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_REGISTER_SINGLE = "/modulecultural/activity/vounteerregistersingle";//注册志愿者
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_REGISTER_TEAM = "/modulecultural/activity/vounteerregisterteam";//注册志愿者团队
|
||||
public static final String PATH_MODULE_CULTURAL_CHOOSE_MEMBER = "/modulecultural/activity/choosemember";//选择成员
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MAIN = "/modulecultural/activity/vounteermain";//志愿者主页
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MANAGE = "/modulecultural/activity/vounteermanage";//志愿团队
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MANAGE_LIST = "/modulecultural/activity/vounteermanagelsit";//我创建的自愿者团队
|
||||
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_TEAM = "/modulecultural/activity/vounteermember";//志愿者列表
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MEMBER_DETAIL = "/modulecultural/activity/vounteermemberdetail";//志愿者详情
|
||||
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MANAGE_MEMBER = "/modulecultural/activity/vounteermemberedit";//审批团队成员
|
||||
|
||||
public static final String PATH_MODULE_CULTURAL_LIVE_DETAIL = "/modulecultural/activity/livedetail";//点播直播详情
|
||||
public static final String PATH_MODULE_CULTURAL_LIVE = "/modulecultural/activity/live";//点播直播
|
||||
public static final String PATH_MODULE_CULTURAL_LIVE_LOCKBACK = "/modulecultural/activity/livelookback";//直播回看
|
||||
public static final String PATH_MODULE_CULTURAL_LIVE_LIST = "/modulecultural/activity/livelookbacklist";//直播回看播放列表
|
||||
|
||||
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MINE_TEAM_DETAIL = "/modulecultural/activity/vounteer/detail";//我创建的团队详情
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_MINE_TEAM_EDIT = "/modulecultural/activity/vounteer/edit";//编辑我创建的团队
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_DETAIL = "/modulecultural/activity/vounteer/activitydetail";//志愿者活动详情
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_SIGN_IN_TEAM = "/modulecultural/activity/vounteer/actviitysignteam";//志愿活动报名-团队
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_SIGN_IN_SINGLE = "/modulecultural/activity/vounteer/actviitysignsingle";//志愿活动报名-个人
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_LOG = "/modulecultural/activity/vounteer/actviitylog";//活动日志
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_EDIT = "/modulecultural/activity/vounteer/actviityedit";//修改我发起的活动
|
||||
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_ACTIVITY_MINE = "/modulecultural/activity/vounteer/activitymine";//我的志愿活动
|
||||
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_CHOOSE_TEAM = "/modulecultural/activity/vounteer/activitychooseteam";//活动报名选择我的团队
|
||||
public static final String PATH_MODULE_CULTURAL_VOUNTEER_FRAGMENT_TEAM = "/modulecultural/fragment/vounteerteam";//rlv_teams
|
||||
//===========================ModuleMine=========我的=========================
|
||||
public static final String PATH_MODULE_MINE_COLLECT = "/modulemine/activity/collectlist";//我的收藏列表
|
||||
public static final String PATH_MODULE_MINE_FRAGMENT_MAIN = "/modulemine/fragment/main";//我的主页fragment
|
||||
public static final String PATH_MODULE_MINE_ORDER = "/modulemine/activity/order";//我的订单
|
||||
public static final String PATH_MODULE_CULTURAL_MINE_SETTING = "/modulemine/activity/setting";//设置
|
||||
public static final String PATH_MODULE_MINE_MINEINFO_EDIT = "/modulemine/activity/mineinfoedit";//个人信息编辑
|
||||
public static final String PATH_MODULE_MINE_MINEINFO_DETAIL = "/modulemine/activity/mineinfodetail";//个人信息详情
|
||||
|
||||
//===========================ModuleActivity=========活动=========================
|
||||
public static final String PATH_MODULEACTIVITY_ACTIVITY_MAIN = "/moduleactivity/activity/main";//活动主页
|
||||
public static final String PATH_MODULEACTIVITY_ACTIVITY_DETAIL = "/moduleactivity/activity/detail";//活动详情
|
||||
public static final String PATH_MODULEACTIVITY_FRAGMENT_MAIN = "/moduleactivity/fragment/main";
|
||||
public static final String PATH_MODULEACTIVITY_ACTIVITY_SING_UP = "/moduleactivity/activity/signup";//活动报名
|
||||
|
||||
|
||||
//=========================================党建模块============================================
|
||||
public static final String PATH_MODULE_PARTY_HOME = "/modulelearn/activity/partyHome";//党建主页面
|
||||
//========================================电子巡更========================================
|
||||
@ -113,6 +153,8 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_CHECK_HOME = "/modulecheck/activity/checkHome";//进出登记主页面
|
||||
//============================================公共=================================================
|
||||
public static final String PATH_MODULE_CAMERA_CROPIMG = "/modulecamera/activity/cropimg";//裁剪图片
|
||||
public static final String PATH_MODULE_CAMERA_RECORD = "/modulecamera/activity/record";//录制视频
|
||||
public static final String PATH_MODULE_CAMERA_SHOW_IMG = "/modulecamera/activity/showimg";
|
||||
//===================ModuleMain===================
|
||||
public static final String PATH_MODULEMAIN_SPLASH = "/modulemain/activity/splash";
|
||||
public static final String PATH_MODULEMAIN_GUIDE = "/modulemain/activity/guide"; //引导页
|
||||
@ -138,5 +180,18 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_CHECK_FRAGMENT_CONDITION = "/modulecheck/fragment/condition";//条件fragment
|
||||
public static final String PATH_MODULE_CMUTILS_CONDITION = "/modulecmutils/activity/condition";//条件查询activ
|
||||
|
||||
//=====================字典ID==========================
|
||||
public static final String DID_WORK = "";//工作状态
|
||||
public static final String DID_PI = "";//
|
||||
public static final String DID_EDU = "";//学历
|
||||
public static final String DID_NATIVE = "";//籍贯
|
||||
public static final String DID_NATION = "";//民族
|
||||
public static final String DID_ADDRESS = "";//地址
|
||||
public static final String DID_SERVICE_AREA = "761d8633-3c2f-4e92-b32d-fb50d3dc07b7";//服务区域
|
||||
public static final String DID_SERVICE_TYPE = "a223b308-014a-4e89-93fa-035a564e7fda";//服务类别
|
||||
public static final String DID_SERVICE_DOMAIN = "7b213c37-8575-4db3-bda1-86c4e38589f7";//服务领域或行业
|
||||
|
||||
//====================Player=======================
|
||||
public static final String PATH_MODULE_PLAYER_SIMPLE_VIDEO = "/moduleplayer/activity/simpleplayer";//单纯播放器
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,115 @@
|
||||
package com.sucstepsoft.cm_utils.core.beans;
|
||||
|
||||
|
||||
import com.contrarywind.interfaces.IPickerViewData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/5/30 - 11:01 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 基础字典Bean
|
||||
*/
|
||||
public class BaseDictionaryBean implements IPickerViewData {
|
||||
/**
|
||||
* dictionaryCode : string
|
||||
* dictionaryId : string
|
||||
* dictionaryName : string
|
||||
* dictionaryParentId : string
|
||||
* dictionaryParentName : string
|
||||
* dictionarySort : string
|
||||
* dictionarySummary : string
|
||||
* parent : true
|
||||
* subDictionary : [{}]
|
||||
*/
|
||||
|
||||
private String dictionaryCode;
|
||||
private String dictionaryId;
|
||||
private String dictionaryName;
|
||||
private String dictionaryParentId;
|
||||
private String dictionaryParentName;
|
||||
private String dictionarySort;
|
||||
private String dictionarySummary;
|
||||
private boolean parent;
|
||||
private List<SubDictionaryBean> subDictionary;
|
||||
public String getDictionaryCode() {
|
||||
return dictionaryCode;
|
||||
}
|
||||
|
||||
public void setDictionaryCode(String dictionaryCode) {
|
||||
this.dictionaryCode = dictionaryCode;
|
||||
}
|
||||
|
||||
public String getDictionaryId() {
|
||||
return dictionaryId;
|
||||
}
|
||||
|
||||
public void setDictionaryId(String dictionaryId) {
|
||||
this.dictionaryId = dictionaryId;
|
||||
}
|
||||
|
||||
public String getDictionaryName() {
|
||||
return dictionaryName;
|
||||
}
|
||||
|
||||
public void setDictionaryName(String dictionaryName) {
|
||||
this.dictionaryName = dictionaryName;
|
||||
}
|
||||
|
||||
public String getDictionaryParentId() {
|
||||
return dictionaryParentId;
|
||||
}
|
||||
|
||||
public void setDictionaryParentId(String dictionaryParentId) {
|
||||
this.dictionaryParentId = dictionaryParentId;
|
||||
}
|
||||
|
||||
public String getDictionaryParentName() {
|
||||
return dictionaryParentName;
|
||||
}
|
||||
|
||||
public void setDictionaryParentName(String dictionaryParentName) {
|
||||
this.dictionaryParentName = dictionaryParentName;
|
||||
}
|
||||
|
||||
public String getDictionarySort() {
|
||||
return dictionarySort;
|
||||
}
|
||||
|
||||
public void setDictionarySort(String dictionarySort) {
|
||||
this.dictionarySort = dictionarySort;
|
||||
}
|
||||
|
||||
public String getDictionarySummary() {
|
||||
return dictionarySummary;
|
||||
}
|
||||
|
||||
public void setDictionarySummary(String dictionarySummary) {
|
||||
this.dictionarySummary = dictionarySummary;
|
||||
}
|
||||
|
||||
public boolean isParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(boolean parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public List<SubDictionaryBean> getSubDictionary() {
|
||||
return subDictionary;
|
||||
}
|
||||
|
||||
public void setSubDictionary(List<SubDictionaryBean> subDictionary) {
|
||||
this.subDictionary = subDictionary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPickerViewText() {
|
||||
return getDictionaryName();
|
||||
}
|
||||
|
||||
public static class SubDictionaryBean {
|
||||
}
|
||||
}
|
@ -10,6 +10,16 @@ public class BaseImageBean {
|
||||
private String imgUrl;
|
||||
private String id;
|
||||
private String linkUrl;
|
||||
private int type;
|
||||
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
|
@ -0,0 +1,54 @@
|
||||
package com.sucstepsoft.cm_utils.core.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/6 - 9:24 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class BaseUserInfoUpdateBean {
|
||||
|
||||
/**
|
||||
* avatar : string
|
||||
* email : string
|
||||
* name : string
|
||||
* phone : string
|
||||
*/
|
||||
|
||||
private String avatar;
|
||||
private String email;
|
||||
private String name;
|
||||
private String phone;
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.sucstepsoft.cm_utils.core.beans;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/4 - 3:01 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class EditUserInfo {
|
||||
|
||||
/**
|
||||
* avatar : string
|
||||
* email : string
|
||||
* name : string
|
||||
* phone : string
|
||||
* userInfos : [{"key":"string","value":"string"}]
|
||||
*/
|
||||
|
||||
private String avatar;
|
||||
private String email;
|
||||
private String name;
|
||||
private String phone;
|
||||
private List<UserInfosBean> userInfos;
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public List<UserInfosBean> getUserInfos() {
|
||||
return userInfos;
|
||||
}
|
||||
|
||||
public void setUserInfos(List<UserInfosBean> userInfos) {
|
||||
this.userInfos = userInfos;
|
||||
}
|
||||
|
||||
public static class UserInfosBean {
|
||||
/**
|
||||
* key : string
|
||||
* value : string
|
||||
*/
|
||||
|
||||
private String key;
|
||||
private String value;
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,208 @@
|
||||
package com.sucstepsoft.cm_utils.core.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/3 - 7:24 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
/**
|
||||
* 文本
|
||||
*/
|
||||
// STRING("string"),
|
||||
// /**
|
||||
// * 时间戳
|
||||
// */
|
||||
// DATETIME("datetime"),
|
||||
// /**
|
||||
// * 日期
|
||||
// */
|
||||
// DATE("date"),
|
||||
// /**
|
||||
// * 整形
|
||||
// */
|
||||
// NUMBER("number"),
|
||||
// /**
|
||||
// * 双精度
|
||||
// */
|
||||
// DOUBLE("double"),
|
||||
// /**
|
||||
// * 文本域
|
||||
// */
|
||||
// TEXTAREA("textarea"),
|
||||
// /**
|
||||
// * 富文本
|
||||
// */
|
||||
// RICH_TEXT("richText"),
|
||||
// /**
|
||||
// * 下拉选择
|
||||
// */
|
||||
// SELECT("select"),
|
||||
// /**
|
||||
// * 复选
|
||||
// */
|
||||
// CHECKBOX("checkbox"),
|
||||
// /**
|
||||
// * 单选
|
||||
// */
|
||||
// RADIO("radio"),
|
||||
// /**
|
||||
// * 选择人员
|
||||
// */
|
||||
// SELECT_USER("selectUser"),
|
||||
// /**
|
||||
// * 选择部门
|
||||
// */
|
||||
// SELECT_DEPARTMENT("selectDepartment"),
|
||||
// /**
|
||||
// * 文件
|
||||
// */
|
||||
// FILE("file"),
|
||||
// /**
|
||||
// * 图片
|
||||
// */
|
||||
// IMAGE("image"),
|
||||
// /**
|
||||
// * 视频
|
||||
// */
|
||||
// VIDEO("video"),
|
||||
// /**
|
||||
// * 音频
|
||||
// */
|
||||
// AUDIO("audio"),
|
||||
// /**
|
||||
// * 外联
|
||||
// */
|
||||
// JOIN("join"),
|
||||
// /**
|
||||
// * 内联
|
||||
// */
|
||||
// INNER_JOIN("innerJoin"),
|
||||
// /**
|
||||
// * 左联
|
||||
// */
|
||||
// LEFT_JOIN("leftJoin"),
|
||||
// /**
|
||||
// * 右联
|
||||
// */
|
||||
// RIGHT_JOIN("rightJoin"),
|
||||
// /**
|
||||
// * 当前用户
|
||||
// */
|
||||
// CURRENT_USER("currentUser"),
|
||||
// /**
|
||||
// * 当前部门
|
||||
// */
|
||||
// CURRENT_DEPARTMENT("currentDepartment"),
|
||||
// /**
|
||||
// * 当前角色
|
||||
// */
|
||||
// CURRENT_ROLE("currentRole"),
|
||||
// /**
|
||||
// * 当前组
|
||||
// */
|
||||
// CURRENT_GROUP("currentGroup"),
|
||||
// /**
|
||||
// * 当前职位
|
||||
// */
|
||||
// CURRENT_POSITION("currentPosition");
|
||||
public class UserInfoFieldBean {
|
||||
|
||||
/**
|
||||
* dictionaryId : string
|
||||
* dictionaryName : string
|
||||
* fieldDefault : string
|
||||
* fieldExplain : string
|
||||
* fieldName : string
|
||||
* fieldType : string
|
||||
* verifyRegular : string
|
||||
* verifyType : string
|
||||
*/
|
||||
|
||||
private String dictionaryId;
|
||||
private String dictionaryName;
|
||||
private String fieldDefault;
|
||||
private String fieldExplain;
|
||||
private String fieldName;
|
||||
private String fieldType;
|
||||
private String verifyRegular;
|
||||
private String verifyType;
|
||||
|
||||
public String getDictionaryId() {
|
||||
return dictionaryId;
|
||||
}
|
||||
|
||||
public void setDictionaryId(String dictionaryId) {
|
||||
this.dictionaryId = dictionaryId;
|
||||
}
|
||||
|
||||
public String getDictionaryName() {
|
||||
return dictionaryName;
|
||||
}
|
||||
|
||||
public void setDictionaryName(String dictionaryName) {
|
||||
this.dictionaryName = dictionaryName;
|
||||
}
|
||||
|
||||
public String getFieldDefault() {
|
||||
return fieldDefault;
|
||||
}
|
||||
|
||||
public void setFieldDefault(String fieldDefault) {
|
||||
this.fieldDefault = fieldDefault;
|
||||
}
|
||||
|
||||
public String getFieldExplain() {
|
||||
return fieldExplain;
|
||||
}
|
||||
|
||||
public void setFieldExplain(String fieldExplain) {
|
||||
this.fieldExplain = fieldExplain;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
public String getFieldType() {
|
||||
return fieldType;
|
||||
}
|
||||
|
||||
public void setFieldType(String fieldType) {
|
||||
this.fieldType = fieldType;
|
||||
}
|
||||
|
||||
public String getVerifyRegular() {
|
||||
return verifyRegular;
|
||||
}
|
||||
|
||||
public void setVerifyRegular(String verifyRegular) {
|
||||
this.verifyRegular = verifyRegular;
|
||||
}
|
||||
|
||||
public String getVerifyType() {
|
||||
return verifyType;
|
||||
}
|
||||
|
||||
public void setVerifyType(String verifyType) {
|
||||
this.verifyType = verifyType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserInfoFieldBean{" +
|
||||
"dictionaryId='" + dictionaryId + '\'' +
|
||||
", dictionaryName='" + dictionaryName + '\'' +
|
||||
", fieldDefault='" + fieldDefault + '\'' +
|
||||
", fieldExplain='" + fieldExplain + '\'' +
|
||||
", fieldName='" + fieldName + '\'' +
|
||||
", fieldType='" + fieldType + '\'' +
|
||||
", verifyRegular='" + verifyRegular + '\'' +
|
||||
", verifyType='" + verifyType + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.sucstepsoft.cm_utils.core.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/3 - 5:43 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class UserRegisterPostBean {
|
||||
private String phone;
|
||||
private String verificationCode;
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getVerificationCode() {
|
||||
return verificationCode;
|
||||
}
|
||||
|
||||
public void setVerificationCode(String verificationCode) {
|
||||
this.verificationCode = verificationCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.sucstepsoft.cm_utils.core.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/3 - 5:49 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class VerifyCodeBean {
|
||||
|
||||
}
|
@ -10,16 +10,26 @@ import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
public class BaseUrlApi {
|
||||
|
||||
// public static final String IP = "http://219.147.99.164:8081/";/* 正式IP */
|
||||
public static final String IP = "https://www.wgink.ink/usercenter/";/* 测试IP */
|
||||
// public static final String IP = "https://www.wgink.ink/usercenter/";/* 测试IP */
|
||||
public static final String IP = "http://192.168.0.113:7001/usercenter/";/* 测试IP */
|
||||
public static final String PROJECT_NAME = "app/";
|
||||
public static final String BASE_URL = IP;
|
||||
public static final int PHOTO_REQUEST = 233;
|
||||
public static final int VIDEO_REQUEST_ALBUM = 77;
|
||||
public static final int VIDEO_REQUEST_CAMERA = 88;
|
||||
public static final int CAMERA_REQUEST = 123;
|
||||
public static final int PHOTO_REQUEST_DIALOG = 333;
|
||||
public static final int CAMERA_REQUEST_DIALOG = 433;
|
||||
//地图页面展示类型
|
||||
public static final String TYPE_SHOW_MARKER = "442";//显示marker
|
||||
public static final String TYPE_NAVIGATION = "456";//显示导航
|
||||
public static final String TYPE_DEFAULT = "333";//默认
|
||||
public static final String BASE_ACTIVIY_IP = "http://192.168.0.111:8080/culturalactivity/";/* 活动URL */
|
||||
public static final String BASE_VOLUNTEER_IP = "http://192.168.0.111:8888/volunteer/";/* 志愿者 */
|
||||
public static final String BASE_LIVE_IP = "http://192.168.0.104:8084/live/";
|
||||
public static final String BASE_LIVE_URL = "http://192.168.0.104:8085/";//直播回放视频url
|
||||
public static final String BASE_PLACE_IP = "http://192.168.0.109:8082/venuebooking/";/* 场馆 */
|
||||
public static final String BASE_PLACE_IMG_IP = "http://192.168.0.109:8082/venuebooking/route/file/downloadfile/true/";/* 场馆 */
|
||||
public static final String BASE_PLACE_IMG_IP = BASE_PLACE_IP + "route/file/downloadfile/true/";/* 场馆 */
|
||||
public static final String BASE_CULTURAL_IP = "http://192.168.0.108:8080/culturalactivity/";/* 文化URL */
|
||||
public static final String BASE_MINE = "http://192.168.0.108:8080/culturalactivity/";/* 我的URL */
|
||||
public static final String BASE_NEWS_IP = "http://192.168.0.104:8082/news/";//新闻
|
||||
@ -29,5 +39,8 @@ public class BaseUrlApi {
|
||||
public static final String APP_DOWNLOAD_URL = BASE_URL + "appversion/downloadapp/" + PathConfig.APP_VERSION_ID;
|
||||
|
||||
public static final String BASE_ACTIVITY_IMG_URL = BASE_ACTIVIY_IP + "route/file/downloadfile/true/";
|
||||
public static final String BASE_VOLUNTEER_IMG_URL = BASE_VOLUNTEER_IP + "route/file/downloadfile/true/";
|
||||
public static final String BASE_NEWS_IMG_URL = BASE_NEWS_IP + "route/file/downloadfile/true/";
|
||||
public static final String BASE_LIVE_IMG_IP = BASE_LIVE_IP + "route/file/downloadfile/true/";
|
||||
public static final String BASE_IMG_URL = "http://192.168.0.113:7001/usercenter/route/file/downloadfile/true/";
|
||||
}
|
||||
|
@ -1,12 +1,18 @@
|
||||
package com.sucstepsoft.cm_utils.core.retrofit_net.api;
|
||||
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseDictionaryBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseSuccessBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.DictionaryBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.UploadBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.UserInfoFieldBean;
|
||||
import com.sucstepsoft.cm_utils.core.beans.UserLoginBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.bean.BaseResponseBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.bean.VersionBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
@ -18,8 +24,10 @@ import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* 作者 : Adam on 2018/12/7.
|
||||
@ -63,4 +71,107 @@ public interface BaseApiService {
|
||||
@Headers({"Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("appversion/getappversionnumber/{appVersionId}")
|
||||
Observable<VersionBean> doCheckAppVersion(@Path("appVersionId") String appVersionId, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 上传图片文件
|
||||
* image
|
||||
*
|
||||
* @param file
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:volunteer"})
|
||||
@Multipart
|
||||
@POST("app/file/uploadimage")
|
||||
Observable<BaseSuccessBean> uploadImage(@Part MultipartBody.Part file, @Header("token") String token);
|
||||
/**
|
||||
* 上传图片文件
|
||||
* image
|
||||
*
|
||||
* @param file
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:dict"})
|
||||
@Multipart
|
||||
@POST("app/file/uploadimage")
|
||||
Observable<BaseSuccessBean> uploadImgToUserCenter(@Part MultipartBody.Part file, @Header("token") String token);
|
||||
/**
|
||||
* 修改用户头像-返回token
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type: application/json", "Accept: application/json"})
|
||||
@PUT("app/user/updateuseravatar")
|
||||
Observable<BaseSuccessBean> doUpdateUserAvatar(@Body RequestBody body, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 上传视频
|
||||
* video
|
||||
*
|
||||
* @param file
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:volunteer"})
|
||||
@Multipart
|
||||
@POST("app/file/uploadvideo")
|
||||
Observable<BaseSuccessBean> uploadVideo(@Part MultipartBody.Part file, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 获取字典
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Headers({"base_url_name:volunteer", "Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/datadictionary/listdictionarybyparentid/{dictionaryParentId}")
|
||||
Observable<List<BaseDictionaryBean>> getDicList(@Path("dictionaryParentId") String id, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 获取字典
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/datadictionary/listdictionarybyparentid/{dictionaryParentId}")
|
||||
Observable<List<BaseDictionaryBean>> getSystemDictionary(@Path("dictionaryParentId") String id, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 用户注册
|
||||
* 通过手机号验证码
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@POST("app/register/saveregisteruser")
|
||||
Observable<BaseSuccessBean> doRegisterUser(@Body RequestBody body);
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("api/sms/getverificationcode/{phone}")
|
||||
Observable<BaseSuccessBean> getVerifyCodeBean(@Path("phone") String phone);
|
||||
|
||||
/**
|
||||
* 获取个人字段信息列表
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/user/listdynamicuserformfield")
|
||||
Observable<List<UserInfoFieldBean>> getUserInfoFieldList(@Header("token") String token);
|
||||
|
||||
/**
|
||||
* 更新用户基本信息
|
||||
*/
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@PUT("app/user/updateuserinfo")
|
||||
Observable<BaseSuccessBean> editUserInfo(@Body RequestBody body, @Header("token") String token);
|
||||
|
||||
/**
|
||||
* 获取用户基本信息
|
||||
*/
|
||||
// getInfoField();
|
||||
@Headers({"Content-Type:application/json", "Accept:application/json"})
|
||||
@GET("app/user/getuserinfo")
|
||||
Observable<JsonObject> getBaseUserInfo(@Header("token") String token);
|
||||
}
|
||||
|
@ -42,6 +42,10 @@ public class BaseUrlInterceptor implements Interceptor {
|
||||
newBaseUrl = HttpUrl.parse(BaseUrlApi.BASE_NEWS_IP);
|
||||
} else if ("legacy".equals(headerValue)) {
|
||||
newBaseUrl = HttpUrl.parse(BaseUrlApi.BASE_LEGACY_IP);
|
||||
} else if ("volunteer".equals(headerValue)) {
|
||||
newBaseUrl = HttpUrl.parse(BaseUrlApi.BASE_VOLUNTEER_IP);
|
||||
} else if ("live".equals(headerValue)) {
|
||||
newBaseUrl = HttpUrl.parse(BaseUrlApi.BASE_LIVE_IP);
|
||||
} else {
|
||||
newBaseUrl = oldHttpUrl;
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PathDashPathEffect;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputFilter;
|
||||
@ -29,11 +31,14 @@ import android.widget.TextView;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.sucstepsoft.cm_utils.R;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.beans.UserLoginBean;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.BaseAreaListDialog;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.DoubleAndOneClicklistener;
|
||||
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.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserInfoSPUtils;
|
||||
@ -64,7 +69,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
|
||||
protected int mWidth = 0;
|
||||
protected Button mIbBack;
|
||||
protected TextView mTvBaseTitle;//标题
|
||||
protected TypeFaceTextView mTvBaseTitle;//标题
|
||||
protected TextView mTvPublish;//右边文字
|
||||
protected ImageView mIvImg;//右边头像
|
||||
protected ImageView mIvInto;//右边图标
|
||||
@ -79,6 +84,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
protected ImageView mIvNotify;
|
||||
protected TextView mTvNotify;
|
||||
protected RelativeLayout mRlTitleBar1;
|
||||
private RelativeLayout mRlTrTitleBar;
|
||||
private Button mBtnTrBack;
|
||||
private TextView mTvTrTitle;
|
||||
// protected BoomMenuButton mBbMenu;
|
||||
|
||||
@Override
|
||||
@ -103,6 +111,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
mRlTitleBar1 = findViewById(R.id.rl_title_bar);
|
||||
mContentView = LayoutInflater.from(this).inflate(setLayoutId(), null);
|
||||
flBaseActivityContent.addView(mContentView);
|
||||
mRlTrTitleBar.setVisibility(View.GONE);
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
initData();
|
||||
initMapView(savedInstanceState);//初始化MapView
|
||||
@ -148,6 +157,16 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
editText.setFilters(new InputFilter[]{filter});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置透明状态栏
|
||||
*/
|
||||
protected void setStatusTr(String title) {
|
||||
mRlTitleBar.setVisibility(View.GONE);
|
||||
mRlTitleBar1.setVisibility(View.GONE);
|
||||
mRlTrTitleBar.setVisibility(View.VISIBLE);
|
||||
mTvTrTitle.setText(title);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
@ -214,6 +233,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
* 初始化标题布局
|
||||
*/
|
||||
private void baseActivityInitViews() {
|
||||
mRlTrTitleBar = findViewById(R.id.rl_tr_app_title);
|
||||
mBtnTrBack = findViewById(R.id.ib_tr_app_back);
|
||||
mTvTrTitle = findViewById(R.id.tv_app_tr_title);
|
||||
mRlTitleBar = findViewById(R.id.rl_base_app_activity_title_back);
|
||||
flBaseActivityContent = findViewById(R.id.fl_app_content);
|
||||
mIbBack = findViewById(R.id.ib_app_back);
|
||||
@ -229,7 +251,10 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
mRlBack = findViewById(R.id.rl_app_back);
|
||||
mRlNotify = findViewById(R.id.rl_notify);
|
||||
mIvNotify = findViewById(R.id.iv_nootify_point);
|
||||
|
||||
mBtnTrBack.setOnClickListener(v -> {
|
||||
hideSoftKeyboard();
|
||||
finish();
|
||||
});
|
||||
// mBbMenu = findViewById(R.id.bb_menu);
|
||||
mTvNotify = findViewById(R.id.tv_notify);
|
||||
// mBbMenu.setButtonEnum(ButtonEnum.TextOutsideCircle);
|
||||
|
@ -4,7 +4,11 @@ import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.sucstepsoft.cm_utils.R;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseImageBean;
|
||||
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
|
||||
import com.youth.banner.adapter.BannerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
@ -34,9 +38,19 @@ public class BaseBannerImageAdapter extends BannerAdapter<BaseImageBean, BannerH
|
||||
|
||||
@Override
|
||||
public void onBindView(BannerHolder holder, BaseImageBean data, int position, int size) {
|
||||
RoundedCornersTransform roundedCornersTransform = new RoundedCornersTransform(holder.itemView.getContext(), ConvertUtils.dp2px(2));
|
||||
roundedCornersTransform.setNeedCorner(true, true, false, false);
|
||||
RequestOptions options = new RequestOptions()
|
||||
.override(500, 500)
|
||||
.error(R.drawable.ic_img_default)
|
||||
.placeholder(R.drawable.ic_loading)
|
||||
.transform(roundedCornersTransform)
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE);
|
||||
ImageView image = (ImageView) holder.itemView;
|
||||
Glide.with(holder.itemView.getContext())
|
||||
.asBitmap()
|
||||
.load(data.getImgUrl())
|
||||
.apply(options)
|
||||
.into(image);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.base;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.sucstepsoft.cm_utils.R;
|
||||
import com.sucstepsoft.cm_utils.core.beans.FuncBean;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.BaseFunctionHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/4 - 9:27 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class BaseFuncAdapter extends BaseRecyclerAdapter<FuncBean, BaseFunctionHolder> {
|
||||
public BaseFuncAdapter(Context ctx, List<FuncBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseFunctionHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_base_func_layout, parent, false);
|
||||
return new BaseFunctionHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(BaseFunctionHolder baseFunctionHolder, int i) {
|
||||
Glide.with(mContext)
|
||||
.load(mData.get(i).getIconRes())
|
||||
.into(baseFunctionHolder.mIvButton);
|
||||
baseFunctionHolder.mTvName.setText(mData.get(i).getText());
|
||||
}
|
||||
}
|
@ -6,8 +6,10 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.sucstepsoft.cm_utils.R;
|
||||
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -22,12 +24,20 @@ public abstract class BaseRecyclerAdapter<T, H extends RecyclerView.ViewHolder>
|
||||
protected List<T> mData;
|
||||
protected OnItemClicklistener<T> mListener;
|
||||
protected List<Boolean> mChoose = new ArrayList<>();
|
||||
protected RequestOptions options = new RequestOptions().error(R.drawable.ic_img_default).placeholder(R.drawable.ic_loading).transform(new GlideRoundTransform(mContext, 5));
|
||||
protected RequestOptions options;
|
||||
|
||||
|
||||
public BaseRecyclerAdapter(Context ctx, List<T> list) {
|
||||
this.mData = list;
|
||||
this.mContext = ctx;
|
||||
RoundedCornersTransform roundedCornersTransform = new RoundedCornersTransform(mContext, ConvertUtils.dp2px(5));
|
||||
roundedCornersTransform.setNeedCorner(true, true, false, false);
|
||||
options = new RequestOptions()
|
||||
.override(500, 500)
|
||||
.error(R.drawable.ic_img_default)
|
||||
.placeholder(R.drawable.ic_loading)
|
||||
.transform(roundedCornersTransform)
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE);
|
||||
for (int i = 0; i < mData.size(); i++) {
|
||||
mChoose.add(i, false);
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.base;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
|
||||
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.TransformationUtils;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/3 - 3:31 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class CenterCropRoundCornerTransform extends CenterCrop {
|
||||
private static float radius = 0f;
|
||||
|
||||
public CenterCropRoundCornerTransform(int px) {
|
||||
this.radius = px;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {
|
||||
Bitmap bitmap = TransformationUtils.centerCrop(pool, toTransform, outWidth, outHeight);
|
||||
return roundCrop(pool, bitmap);
|
||||
}
|
||||
|
||||
private static Bitmap roundCrop(BitmapPool pool, Bitmap source) {
|
||||
if (source == null) return null;
|
||||
|
||||
Bitmap result = pool.get(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_4444);
|
||||
if (result == null) {
|
||||
result = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_4444);
|
||||
}
|
||||
|
||||
Canvas canvas = new Canvas(result);
|
||||
Paint paint = new Paint();
|
||||
paint.setShader(new BitmapShader(source, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP));
|
||||
paint.setAntiAlias(true);
|
||||
RectF rectF = new RectF(0f, 0f, source.getWidth(), source.getHeight());
|
||||
canvas.drawRoundRect(rectF, radius, radius, paint);
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return getClass().getName() + Math.round(radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDiskCacheKey(MessageDigest messageDigest) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.base;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Shader;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.Transformation;
|
||||
import com.bumptech.glide.load.engine.Resource;
|
||||
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
||||
import com.bumptech.glide.load.resource.bitmap.BitmapResource;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/3 - 3:57 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class RoundedCornersTransform implements Transformation<Bitmap> {
|
||||
private BitmapPool mBitmapPool;
|
||||
|
||||
private float radius;
|
||||
|
||||
private boolean isLeftTop = true, isRightTop = true, isLeftBottom = true, isRightBotoom = true;
|
||||
|
||||
/**
|
||||
* @param context 上下文
|
||||
* @param radius 圆角幅度
|
||||
*/
|
||||
public RoundedCornersTransform(Context context, float radius) {
|
||||
this.mBitmapPool = Glide.get(context).getBitmapPool();
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Resource<Bitmap> transform(@NonNull Context context, @NonNull Resource<Bitmap> resource, int outWidth, int outHeight) {
|
||||
/**
|
||||
* @param context 上下文
|
||||
* @param radius 圆角幅度
|
||||
*/
|
||||
|
||||
|
||||
Bitmap source = resource.get();
|
||||
int finalWidth, finalHeight;
|
||||
//输出目标的宽高或高宽比例
|
||||
float scale;
|
||||
if (outWidth > outHeight) {
|
||||
//如果 输出宽度 > 输出高度 求高宽比
|
||||
|
||||
scale = (float) outHeight / (float) outWidth;
|
||||
finalWidth = source.getWidth();
|
||||
//固定原图宽度,求最终高度
|
||||
finalHeight = (int) ((float) source.getWidth() * scale);
|
||||
if (finalHeight > source.getHeight()) {
|
||||
//如果 求出的最终高度 > 原图高度 求宽高比
|
||||
|
||||
scale = (float) outWidth / (float) outHeight;
|
||||
finalHeight = source.getHeight();
|
||||
//固定原图高度,求最终宽度
|
||||
finalWidth = (int) ((float) source.getHeight() * scale);
|
||||
}
|
||||
} else if (outWidth < outHeight) {
|
||||
//如果 输出宽度 < 输出高度 求宽高比
|
||||
|
||||
scale = (float) outWidth / (float) outHeight;
|
||||
finalHeight = source.getHeight();
|
||||
//固定原图高度,求最终宽度
|
||||
finalWidth = (int) ((float) source.getHeight() * scale);
|
||||
if (finalWidth > source.getWidth()) {
|
||||
//如果 求出的最终宽度 > 原图宽度 求高宽比
|
||||
|
||||
scale = (float) outHeight / (float) outWidth;
|
||||
finalWidth = source.getWidth();
|
||||
finalHeight = (int) ((float) source.getWidth() * scale);
|
||||
}
|
||||
} else {
|
||||
//如果 输出宽度=输出高度
|
||||
finalHeight = source.getHeight();
|
||||
finalWidth = finalHeight;
|
||||
}
|
||||
|
||||
//修正圆角
|
||||
this.radius *= (float) finalHeight / (float) outHeight;
|
||||
Bitmap outBitmap = this.mBitmapPool.get(finalWidth, finalHeight, Bitmap.Config.ARGB_8888);
|
||||
if (outBitmap == null) {
|
||||
outBitmap = Bitmap.createBitmap(finalWidth, finalHeight, Bitmap.Config.ARGB_8888);
|
||||
}
|
||||
|
||||
Canvas canvas = new Canvas(outBitmap);
|
||||
Paint paint = new Paint();
|
||||
//关联画笔绘制的原图bitmap
|
||||
BitmapShader shader = new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
|
||||
//计算中心位置,进行偏移
|
||||
int width = (source.getWidth() - finalWidth) / 2;
|
||||
int height = (source.getHeight() - finalHeight) / 2;
|
||||
if (width != 0 || height != 0) {
|
||||
Matrix matrix = new Matrix();
|
||||
matrix.setTranslate((float) (-width), (float) (-height));
|
||||
shader.setLocalMatrix(matrix);
|
||||
}
|
||||
|
||||
paint.setShader(shader);
|
||||
paint.setAntiAlias(true);
|
||||
RectF rectF = new RectF(0.0F, 0.0F, (float) canvas.getWidth(), (float) canvas.getHeight());
|
||||
//先绘制圆角矩形
|
||||
canvas.drawRoundRect(rectF, this.radius, this.radius, paint);
|
||||
|
||||
//左上角圆角
|
||||
if (!isLeftTop) {
|
||||
canvas.drawRect(0, 0, radius, radius, paint);
|
||||
}
|
||||
//右上角圆角
|
||||
if (!isRightTop) {
|
||||
canvas.drawRect(canvas.getWidth() - radius, 0, canvas.getWidth(), radius, paint);
|
||||
}
|
||||
//左下角圆角
|
||||
if (!isLeftBottom) {
|
||||
canvas.drawRect(0, canvas.getHeight() - radius, radius, canvas.getHeight(), paint);
|
||||
}
|
||||
//右下角圆角
|
||||
if (!isRightBotoom) {
|
||||
canvas.drawRect(canvas.getWidth() - radius, canvas.getHeight() - radius, canvas.getWidth(), canvas.getHeight(), paint);
|
||||
}
|
||||
|
||||
return BitmapResource.obtain(outBitmap, this.mBitmapPool);
|
||||
}
|
||||
|
||||
|
||||
public void setNeedCorner(boolean leftTop, boolean rightTop, boolean leftBottom, boolean rightBottom) {
|
||||
isLeftTop = leftTop;
|
||||
isRightTop = rightTop;
|
||||
isLeftBottom = leftBottom;
|
||||
isRightBotoom = rightBottom;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
|
||||
|
||||
}
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.photoview.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -46,9 +48,20 @@ public class ImageAdapter extends PagerAdapter {
|
||||
.apply(options)
|
||||
.into(photoView);
|
||||
container.addView(view);
|
||||
photoView.setOnClickListener(v->mOnImgClick.imgClick());
|
||||
return view;
|
||||
}
|
||||
|
||||
private OnImgClick mOnImgClick;
|
||||
|
||||
public void addImgClick(OnImgClick onImgClick) {
|
||||
this.mOnImgClick = onImgClick;
|
||||
}
|
||||
|
||||
public interface OnImgClick {
|
||||
void imgClick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
|
||||
return view == object;
|
||||
|
@ -0,0 +1,37 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/3 - 4:58 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class TypeFaceTextView extends androidx.appcompat.widget.AppCompatTextView {
|
||||
public TypeFaceTextView(Context context) {
|
||||
super(context);
|
||||
initTypeFace();
|
||||
}
|
||||
|
||||
public TypeFaceTextView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initTypeFace();
|
||||
}
|
||||
|
||||
public TypeFaceTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
|
||||
super(context, attrs, defStyleAttr);
|
||||
initTypeFace();
|
||||
}
|
||||
|
||||
private void initTypeFace() {
|
||||
Typeface typeface = Typeface.createFromAsset(getContext().getAssets(), "fonts/zhangti.TTF");
|
||||
setTypeface(typeface);
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.views;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.request.target.ImageViewTarget;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/2 - 8:56 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class UniformScaleTransformation extends ImageViewTarget<Bitmap> {
|
||||
|
||||
private ImageView target;
|
||||
|
||||
public UniformScaleTransformation(ImageView target) {
|
||||
super(target);
|
||||
this.target = target;
|
||||
}
|
||||
@Override
|
||||
protected void setResource(@Nullable Bitmap resource) {
|
||||
if (resource == null) {
|
||||
return;
|
||||
}
|
||||
view.setImageBitmap(resource);
|
||||
int width = resource.getWidth();
|
||||
int height = resource.getHeight();
|
||||
|
||||
//获取imageView的宽
|
||||
int imageViewWidth = view.getWidth();
|
||||
ViewGroup.LayoutParams params = view.getLayoutParams();
|
||||
if (imageViewWidth <=0){//修复等比例缩放bug
|
||||
imageViewWidth = params.width;
|
||||
}
|
||||
//计算缩放比例
|
||||
float sy = (float) (imageViewWidth * 0.2) / (float) (width * 0.2);
|
||||
//计算图片等比例放大后的高
|
||||
int imageViewHeight = (int) (height * sy);
|
||||
params.height = imageViewHeight;
|
||||
view.setLayoutParams(params);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.sucstepsoft.cm_utils.utils;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/6/6 - 2:15 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class MediaUtils {
|
||||
/**
|
||||
* 获取网络视频第一帧
|
||||
*
|
||||
* @param videoUrl
|
||||
* @return
|
||||
*/
|
||||
public static Bitmap getNetVideoBitmap(String videoUrl) {
|
||||
Bitmap bitmap = null;
|
||||
|
||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||
try {
|
||||
//根据url获取缩略图
|
||||
retriever.setDataSource(videoUrl, new HashMap());
|
||||
//获得第一帧图片
|
||||
bitmap = retriever.getFrameAtTime();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
retriever.release();
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地视频的第一帧
|
||||
*
|
||||
* @param localPath
|
||||
* @return
|
||||
*/
|
||||
public static Bitmap getLocalVideoBitmap(String localPath) {
|
||||
Bitmap bitmap = null;
|
||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||
try {
|
||||
//根据文件路径获取缩略图
|
||||
retriever.setDataSource(localPath);
|
||||
//获得第一帧图片
|
||||
bitmap = retriever.getFrameAtTime();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
retriever.release();
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package com.sucstepsoft.cm_utils.utils;
|
||||
|
||||
import android.provider.ContactsContract;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.sucstepsoft.cm_utils.constant.TimeConstants;
|
||||
@ -621,6 +623,23 @@ public final class TimeUtils {
|
||||
return format;
|
||||
}
|
||||
|
||||
public static String getNowYearMS() {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String format = dateFormat.format(new Date());
|
||||
return format;
|
||||
}
|
||||
|
||||
public static String getDayAfter(int after) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
Date date = new Date();
|
||||
c.setTime(date);
|
||||
int day1 = c.get(Calendar.DATE);
|
||||
c.set(Calendar.DATE, day1 + after);
|
||||
String dayAfter = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
|
||||
LogUtils.e(dayAfter);
|
||||
return dayAfter;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断某一时间是否在一个区间内
|
||||
*
|
||||
@ -670,6 +689,18 @@ public final class TimeUtils {
|
||||
return df.format(date);
|
||||
}
|
||||
|
||||
public static String getHourMm(String time) {
|
||||
DateFormat dateInstance = DateFormat.getDateInstance();
|
||||
try {
|
||||
Date parse1 = dateInstance.parse(time);
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH:mm");
|
||||
return df.format(parse1);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
return "00:00";
|
||||
}
|
||||
}
|
||||
|
||||
public static int getNowBetween(int s, int e) {
|
||||
Date date = new Date();
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH");
|
||||
@ -1502,15 +1533,43 @@ public final class TimeUtils {
|
||||
return new SimpleDateFormat("EEEE", Locale.CHINA).format(date);
|
||||
}
|
||||
|
||||
public static String getDayOfWeek() {
|
||||
Date date = new Date();
|
||||
String[] weekDays = {"日", "一", "二", "三", "四", "五", "六"};
|
||||
public static String getDayOfWeek(String dateStr) {
|
||||
Date date = null;
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
date = format.parse(dateStr);
|
||||
String[] weekDays = {"日", "一", "二", "三", "四", "五", "六"};
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
|
||||
if (w < 0)
|
||||
w = 0;
|
||||
return weekDays[w];
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private int getDayofWeek(String dateTime) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
|
||||
if (w < 0)
|
||||
w = 0;
|
||||
return weekDays[w];
|
||||
if (dateTime.equals("")) {
|
||||
cal.setTime(new Date(System.currentTimeMillis()));
|
||||
} else {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
||||
Date date;
|
||||
try {
|
||||
date = sdf.parse(dateTime);
|
||||
} catch (ParseException e) {
|
||||
date = null;
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (date != null) {
|
||||
cal.setTime(new Date(date.getTime()));
|
||||
}
|
||||
}
|
||||
return cal.get(Calendar.DAY_OF_WEEK);
|
||||
}
|
||||
|
||||
/**
|
||||
|
5
cm_utils/src/main/res/color/col_white_gray.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/black" android:state_checked="false" />
|
||||
<item android:color="@color/white" android:state_checked="true" />
|
||||
</selector>
|
BIN
cm_utils/src/main/res/drawable-mdpi/ic_tab_icon_left.png
Normal file
After Width: | Height: | Size: 244 B |
BIN
cm_utils/src/main/res/drawable-mdpi/ic_tab_icon_right.png
Normal file
After Width: | Height: | Size: 258 B |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_add_photo.png
Executable file → Normal file
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_add_video.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_arrow_cir.png
Normal file
After Width: | Height: | Size: 416 B |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_arrow_yellow_down.png
Normal file
After Width: | Height: | Size: 534 B |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_back_white.png
Normal file
After Width: | Height: | Size: 490 B |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_clear_edit.png
Executable file
After Width: | Height: | Size: 351 B |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_del_tong.png
Normal file
After Width: | Height: | Size: 286 B |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_eye.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_icon_clock.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_icon_location.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_icon_people.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_img_default.png
Executable file → Normal file
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 17 KiB |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_tab_icon_left.png
Normal file
After Width: | Height: | Size: 244 B |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_tab_icon_right.png
Normal file
After Width: | Height: | Size: 258 B |
BIN
cm_utils/src/main/res/drawable-xhdpi/ic_user_default.png
Executable file
After Width: | Height: | Size: 5.1 KiB |
9
cm_utils/src/main/res/drawable/sel_btn_submit_no_size.xml
Executable file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/shape_btn_nomal_gray_no_size" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/shape_btn_nomal_gray_no_size" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/shape_btn_nomal_gray_no_size" android:state_enabled="false" />
|
||||
<item android:drawable="@drawable/shape_btn_green_sel_no_size" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/shape_btn_green_sel_no_size" android:state_pressed="false" />
|
||||
<item android:drawable="@drawable/shape_btn_green_sel_no_size" android:state_enabled="true" />
|
||||
</selector>
|
@ -2,4 +2,5 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/gray_f1" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
6
cm_utils/src/main/res/drawable/shape_btn_green_sel_no_size.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/text_blue" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
6
cm_utils/src/main/res/drawable/shape_btn_nomal_gray_no_size.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/gray_df" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
@ -2,5 +2,5 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/app_title" />
|
||||
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/yellow1" />
|
||||
<corners android:radius="3dp" />
|
||||
</shape>
|
8
cm_utils/src/main/res/drawable/shape_re_bottom.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:bottomLeftRadius="5dp"
|
||||
android:bottomRightRadius="5dp" />
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
6
cm_utils/src/main/res/drawable/shape_re_red.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#339f1512" />
|
||||
<corners android:radius="1dp" />
|
||||
</shape>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/gray_bg" />
|
||||
<solid android:color="#EDEDED" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
8
cm_utils/src/main/res/drawable/shape_rectangle_gray_top_5.xml
Executable file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<corners
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp" />
|
||||
</shape>
|
6
cm_utils/src/main/res/drawable/shape_search_box.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#ffffffff" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
@ -2,8 +2,5 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/gray_f1" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/gray_f1" />
|
||||
<corners android:radius="80dp" />
|
||||
</shape>
|
6
cm_utils/src/main/res/drawable/shape_status_black.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#99000000" />
|
||||
<corners android:radius="1dp" />
|
||||
</shape>
|
6
cm_utils/src/main/res/drawable/shp_rectangle_white.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<corners android:radius="3dp" />
|
||||
</shape>
|
6
cm_utils/src/main/res/drawable/shp_status_red_no_size.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#de0e0e" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
@ -1,28 +0,0 @@
|
||||
<?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="#aa000000"
|
||||
>
|
||||
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/vp_images"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.viewpager.widget.ViewPager>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
tools:text="1 / 2" />
|
||||
</RelativeLayout>
|
@ -4,67 +4,15 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_bg"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
<!-- ===========标题============= -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp">
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/transparent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_base_title_bar_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/titleBar"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_app_searc_back"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<Button
|
||||
android:id="@+id/ib_app_searc_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/ic_back_white"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_app_searc_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitXY" />
|
||||
</RelativeLayout>
|
||||
|
||||
<EditText
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toRightOf="@id/rl_app_searc_back"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/search_bg_color" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_app_search"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:visibility="visible"
|
||||
tools:text="搜索" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_base_app_activity_title_back"
|
||||
@ -84,10 +32,10 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/ib_app_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/ic_back_black"
|
||||
android:background="@drawable/ic_back_white"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
<ImageView
|
||||
@ -107,7 +55,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_app_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -116,8 +64,8 @@
|
||||
android:ellipsize="end"
|
||||
android:maxEms="15"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
tools:text="内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙" />
|
||||
</LinearLayout>
|
||||
|
||||
@ -132,7 +80,7 @@
|
||||
android:clickable="true"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/app_name" />
|
||||
|
||||
@ -163,6 +111,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- ===========内容============= -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -176,7 +125,8 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_notify"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_nootify_point"
|
||||
@ -199,29 +149,53 @@
|
||||
android:textSize="@dimen/text_18" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_app_content"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
tools:background="@color/app_title">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_app_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_tr_app_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@color/transparent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/ib_tr_app_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:background="@drawable/ic_back_white"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_app_tr_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:clickable="true"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="15"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
tools:text="内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙内蒙" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--<com.nightonke.boommenu.BoomMenuButton-->
|
||||
<!--android:id="@+id/bb_menu"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_alignParentRight="true"-->
|
||||
<!--android:layout_alignParentBottom="true"-->
|
||||
<!--android:layout_marginRight="10dp"-->
|
||||
<!--android:layout_marginBottom="10dp"-->
|
||||
<!--app:bmb_dimColor="@color/fab_bg_color"-->
|
||||
<!--app:bmb_highlightedColor="@android:color/holo_blue_bright"-->
|
||||
<!--app:bmb_normalColor="@android:color/holo_blue_dark" />-->
|
||||
<!-- ===========提示============= -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -230,10 +204,10 @@
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_app_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading" />
|
||||
android:indeterminateDrawable="@drawable/anim_loading_pic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_app_empty_data"
|
||||
|
29
cm_utils/src/main/res/layout/item_base_func_layout.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_button"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:background="@drawable/ic_issue_report" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/iv_button"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center"
|
||||
android:textColor="#242424"
|
||||
android:textSize="12sp"
|
||||
tools:text="标题标题标题标题标题标题标题标题标题标题标题标题标题" />
|
||||
</RelativeLayout>
|
28
cm_utils/src/main/res/layout/item_bottom_input_text.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_comment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sel_rectangle_input_white_gray"
|
||||
android:clickable="true"
|
||||
android:drawableLeft="@drawable/ic_input"
|
||||
android:drawablePadding="10dp"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="发表日志..."
|
||||
android:textColor="@color/gray_text"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
31
cm_utils/src/main/res/layout/item_tab_custom_view.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="3dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_Left"
|
||||
android:layout_width="wrap_content"
|
||||
android:visibility="invisible"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_tab_icon_left" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_tab_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
tools:text="新闻" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:visibility="invisible"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_tab_icon_right" />
|
||||
</LinearLayout>
|
@ -14,23 +14,26 @@
|
||||
<color name="partTranslucent">#39000000</color>
|
||||
|
||||
<color name="app_title">#D70715</color>
|
||||
<color name="app_title_tr">#77D70715</color>
|
||||
<color name="home_tab_title_color">#D5061A</color>
|
||||
<color name="trans_black">#88000000</color>
|
||||
<color name="trans_white">#88FFFFFF</color>
|
||||
<color name="yellow">#E8CF6B</color>
|
||||
<color name="yellow">#FADBC4</color>
|
||||
<color name="yellow1">#F3BB44</color>
|
||||
<color name="black_70">#9B9B9B</color>
|
||||
<color name="black_80">#55000000</color>
|
||||
<color name="telephone_contacts">#e7e6e6</color>
|
||||
<color name="telephone_name">#000</color>
|
||||
<color name="cardview_dark_background">#FF202020</color>
|
||||
<!--textColor-->
|
||||
<color name="text_yellow">#FF7816</color>
|
||||
<color name="text_yellow">#CA5500</color>
|
||||
<color name="text_green">#27BA0D</color>
|
||||
<color name="text_gray">#8E8E8E</color>
|
||||
<color name="text_gray_tr">#bb8E8E8E</color>
|
||||
<color name="text_gray01">#535353</color>
|
||||
<color name="text_gray02">#7C7C7C</color>
|
||||
<color name="text_blue">#00A6FE</color>
|
||||
<color name="text_blue_tr">#3300A6FE</color>
|
||||
<color name="text_80_gray">#808080</color>
|
||||
<color name="notify_text_color">#FF8B00</color>
|
||||
<!--及时通讯颜色-->
|
||||
@ -47,7 +50,7 @@
|
||||
<!-- 黑色 -->
|
||||
<color name="black">#000000</color>
|
||||
<!--考勤详情表格颜色-->
|
||||
<color name="gray_line">#F2F2F2</color>
|
||||
<color name="gray_line">#FBFBFB</color>
|
||||
<color name="gray_line_shallow">#F3F1F1</color>
|
||||
<!-- 透明颜色 -->
|
||||
<!-- 对话框按钮按下颜色 -->
|
||||
@ -85,7 +88,8 @@
|
||||
<color name="file_len_text_color">#686767</color>
|
||||
<color name="diyishuji_text_color">#535353</color>
|
||||
<color name="transparent">#00000000</color>
|
||||
<color name="titleBar">#ffffff</color>
|
||||
<color name="titleBar">#9F1512</color>
|
||||
<color name="titleBarDeep">#9F1512</color>
|
||||
<!--我的页面灰色背景-->
|
||||
<color name="bg_gray">#FCF9F2</color>
|
||||
<color name="gray_bg">#F1F1F6</color>
|
||||
|
6
cm_utils/src/main/res/values/ids.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<item name="tag_sel_id" type="id" />
|
||||
<item name="tag_bean" type="id" />
|
||||
<item name="tag_layout_type" type="id" />
|
||||
</resources>
|
@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<!-- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
|
||||
<!-- <!– Customize your theme here. –>-->
|
||||
<!-- <item name="colorPrimary">@color/black</item>-->
|
||||
<!-- <item name="colorPrimaryDark">@color/black</item>-->
|
||||
<!-- <item name="colorAccent">@color/black</item>-->
|
||||
<!-- <item name="android:windowContentOverlay">@null</item>-->
|
||||
<!-- <item name="android:windowAnimationStyle">@style/AnimationActivity</item>-->
|
||||
<!-- </style>-->
|
||||
<!-- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
|
||||
<!-- <!– Customize your theme here. –>-->
|
||||
<!-- <item name="colorPrimary">@color/black</item>-->
|
||||
<!-- <item name="colorPrimaryDark">@color/black</item>-->
|
||||
<!-- <item name="colorAccent">@color/black</item>-->
|
||||
<!-- <item name="android:windowContentOverlay">@null</item>-->
|
||||
<!-- <item name="android:windowAnimationStyle">@style/AnimationActivity</item>-->
|
||||
<!-- </style>-->
|
||||
<!--Activity进场。出场动画-->
|
||||
<style name="AnimationActivity" parent="@android:style/Animation.Activity">
|
||||
<!--用于设置打开新的Activity并进入新的Activity展示的动画-->
|
||||
@ -102,6 +102,14 @@
|
||||
<item name="android:windowExitAnimation">@anim/anim_dialog_exit</item>
|
||||
</style>
|
||||
|
||||
<style name="TabLayoutTextStyle">
|
||||
<item name="android:textSize">18dp</item>
|
||||
</style>
|
||||
|
||||
<style name="TabLayoutTextStyle.small">
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
|
||||
<style name="dialog_full_screen" parent="@android:style/Theme.Dialog">
|
||||
<!-- 是否有边框 -->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
@ -138,4 +146,68 @@
|
||||
<style name="buttonDialog" parent="@style/Theme.AppCompat.Light.Dialog.Alert">
|
||||
<item name="colorAccent">#000000</item>
|
||||
</style>
|
||||
|
||||
<style name="register_input">
|
||||
<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_input_yellow_white_re</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">12sp</item>
|
||||
</style>
|
||||
|
||||
<style name="register_text_title">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">0.3</item>
|
||||
<item name="android:layout_marginLeft">10dp</item>
|
||||
<item name="android:layout_marginRight">10dp</item>
|
||||
<item name="android:paddingLeft">0dp</item>
|
||||
<item name="android:paddingRight">0dp</item>
|
||||
<item name="android:paddingTop">5dp</item>
|
||||
<item name="android:paddingBottom">5dp</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_input_yellow_white_re</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:focusable">true</item>
|
||||
<item name="android:drawableRight">@drawable/ic_arrow_yellow_down</item>
|
||||
<item name="android:paddingLeft">5dp</item>
|
||||
<item name="android:paddingTop">5dp</item>
|
||||
<item name="android:paddingRight">10dp</item>
|
||||
<item name="android:paddingBottom">5dp</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="hintTextColor">@color/gray_text</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="register_text_sel_no_arrow">
|
||||
<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_input_yellow_white_re</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:focusable">true</item>
|
||||
<item name="android:paddingLeft">5dp</item>
|
||||
<item name="android:paddingTop">5dp</item>
|
||||
<item name="android:paddingRight">10dp</item>
|
||||
<item name="android:paddingBottom">5dp</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="hintTextColor">@color/gray_text</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -5,7 +5,7 @@ if (!IsModuleDev.toBoolean()) {
|
||||
}
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
apply plugin: 'com.jakewharton.butterknife'
|
||||
|
||||
apply plugin: 'android-aspectjx'
|
||||
android {
|
||||
buildToolsVersion rootProject.ext.gBuildToolsVersion
|
||||
compileSdkVersion rootProject.ext.gCompileSdkVersion
|
||||
@ -86,5 +86,11 @@ dependencies {
|
||||
//骨架
|
||||
implementation 'com.ethanhua:skeleton:1.1.2'
|
||||
implementation 'io.supercharge:shimmerlayout:2.1.0'
|
||||
//屏幕适配
|
||||
implementation 'com.github.jarryleo:MagicScreenAdapter:v2.1'
|
||||
// 基础依赖包,必须要依赖
|
||||
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
||||
// fragment快速实现(可选)
|
||||
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,21 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.tengshisoft.moduleactivity">
|
||||
|
||||
<application>
|
||||
<application
|
||||
android:maxAspectRatio="2.4"
|
||||
android:resizeableActivity="true">
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="2.4" />
|
||||
<!--适配华为(huawei)刘海屏-->
|
||||
<meta-data
|
||||
android:name="android.notch_support"
|
||||
android:value="true" />
|
||||
<!--适配小米(xiaomi)刘海屏-->
|
||||
<meta-data
|
||||
android:name="notch.config"
|
||||
android:value="portrait|landscape" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.ActivitySignUpActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
|
@ -2,18 +2,22 @@ package com.tengshisoft.moduleactivity.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.PaintDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.beans.BaseImageBean;
|
||||
@ -21,8 +25,10 @@ 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.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.ExceptionHandler;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.tencent.smtt.sdk.WebSettings;
|
||||
import com.tencent.smtt.sdk.WebView;
|
||||
@ -88,9 +94,12 @@ public class ActivityDetailActivity extends BaseActivity {
|
||||
@BindView(R2.id.tv_apply_detail)
|
||||
TextView mTvApplyDetail;
|
||||
@BindView(R2.id.btn_sign_up)
|
||||
Button mBtnSignUp;
|
||||
@BindView(R2.id.srl_content)
|
||||
SmartRefreshLayout mSrlContent;
|
||||
TypeFaceTextView mBtnSignUp;
|
||||
@BindView(R2.id.rl_content)
|
||||
RelativeLayout mRlContent;
|
||||
@BindView(R2.id.ll_btn_content)
|
||||
LinearLayout mLlBtnContent;
|
||||
|
||||
private Unbinder mBind;
|
||||
private String mId;
|
||||
private ActivityDetail mMDetalBean;
|
||||
@ -104,11 +113,10 @@ public class ActivityDetailActivity extends BaseActivity {
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("活动详情");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
ImmersionBar.with(this).init();
|
||||
setStatusTr("详情");
|
||||
mId = getIntent().getStringExtra("id");
|
||||
mSrlContent.setEnableRefresh(false);
|
||||
mSrlContent.setEnableLoadMore(false);
|
||||
mBtnSignUp.setOnClickListener(v -> {
|
||||
if (!TextUtils.isEmpty(UserLgUtils.getToken())) {
|
||||
openView(PathConfig.PATH_MODULEACTIVITY_ACTIVITY_SING_UP, 2);
|
||||
@ -116,12 +124,19 @@ public class ActivityDetailActivity extends BaseActivity {
|
||||
openView(PathConfig.PATH_MODULE_MAIN_LOGIN, 1);
|
||||
}
|
||||
});
|
||||
mTvAddress.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAP_NAVIGATION)
|
||||
.withString("lat", mMDetalBean.getActivityAddressX())
|
||||
.withString("lng", mMDetalBean.getActivityAddressY())
|
||||
.withString("address", mMDetalBean.getActivityAddress())
|
||||
.navigation());
|
||||
mTvAddress.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(mMDetalBean.getActivityAddressX()) || TextUtils.isEmpty(mMDetalBean.getActivityAddressY())) {
|
||||
ToastUtils.showShort("活动地点坐标未知");
|
||||
} else {
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAP_NAVIGATION)
|
||||
.withString("lat", mMDetalBean.getActivityAddressY())
|
||||
.withString("lng", mMDetalBean.getActivityAddressX())
|
||||
.withString("address", mMDetalBean.getActivityAddress())
|
||||
.withString("type", BaseUrlApi.TYPE_NAVIGATION)
|
||||
.navigation();
|
||||
}
|
||||
});
|
||||
getActivityDetailById(mId);
|
||||
}
|
||||
|
||||
@ -301,9 +316,9 @@ public class ActivityDetailActivity extends BaseActivity {
|
||||
mBanner.start();
|
||||
}
|
||||
if (bean.getEnrollCount() < bean.getActivityUserNum()) {
|
||||
mBtnSignUp.setVisibility(View.VISIBLE);
|
||||
mLlBtnContent.setVisibility(View.VISIBLE);
|
||||
if ("3".equals(bean.getActivityState())) {
|
||||
mBtnSignUp.setVisibility(View.VISIBLE);
|
||||
mLlBtnContent.setVisibility(View.VISIBLE);
|
||||
if (TextUtils.isEmpty(bean.getIsEnroll())) {
|
||||
mBtnSignUp.setText("报名");
|
||||
mBtnSignUp.setEnabled(true);
|
||||
@ -312,10 +327,16 @@ public class ActivityDetailActivity extends BaseActivity {
|
||||
mBtnSignUp.setEnabled(false);
|
||||
}
|
||||
} else {
|
||||
mBtnSignUp.setVisibility(View.GONE);
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mRlContent.getLayoutParams();
|
||||
params.bottomMargin = 10;
|
||||
mRlContent.setLayoutParams(params);
|
||||
mLlBtnContent.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
mBtnSignUp.setVisibility(View.GONE);
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mRlContent.getLayoutParams();
|
||||
params.bottomMargin = 10;
|
||||
mRlContent.setLayoutParams(params);
|
||||
mLlBtnContent.setVisibility(View.GONE);
|
||||
}
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
}
|
||||
|
@ -13,13 +13,18 @@ import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
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.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.RoundedCornersTransform;
|
||||
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.RegexUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
@ -62,12 +67,12 @@ public class ActivitySignUpActivity extends BaseActivity {
|
||||
Button mBtnConfirm;
|
||||
@BindView(R2.id.tv_title)
|
||||
TextView mTvTitle;
|
||||
@BindView(R2.id.tv_time)
|
||||
TextView mTvTime;
|
||||
@BindView(R2.id.tv_address)
|
||||
TextView mTvAddress;
|
||||
@BindView(R2.id.tv_end_time)
|
||||
TextView mTvSignEndTime;
|
||||
@BindView(R2.id.tv_peo_num)
|
||||
TextView mTvPepNum;
|
||||
private Unbinder mBind;
|
||||
private int mTervalNum = 20;
|
||||
private String mId;
|
||||
@ -80,28 +85,34 @@ public class ActivitySignUpActivity extends BaseActivity {
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("订单确认");
|
||||
mTvBaseTitle.setText("确认");
|
||||
mId = getIntent().getStringExtra("id");
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
Intent intent = getIntent();
|
||||
String title = intent.getStringExtra("title");
|
||||
String startTime = intent.getStringExtra("startTime");
|
||||
String endTime = intent.getStringExtra("endTime");
|
||||
String signEnd = intent.getStringExtra("signEnd");
|
||||
String address = intent.getStringExtra("address");
|
||||
String photo = intent.getStringExtra("photo");
|
||||
mTvSignEndTime.setText("" + signEnd);
|
||||
mTvTime.setText("" + startTime + "\r\n" + endTime);
|
||||
LogUtils.e(photo);
|
||||
mTvSignEndTime.setText(startTime + "至\r\n" + endTime);
|
||||
mTvAddress.setText("" + address);
|
||||
mTvPepNum.setText("200人");
|
||||
RoundedCornersTransform roundedCornersTransform = new RoundedCornersTransform(mActivity, ConvertUtils.dp2px(5));
|
||||
roundedCornersTransform.setNeedCorner(true, true, false, false);
|
||||
RequestOptions options = new RequestOptions()
|
||||
.override(500, 500)
|
||||
.error(com.sucstepsoft.cm_utils.R.drawable.ic_img_default)
|
||||
.placeholder(com.sucstepsoft.cm_utils.R.drawable.ic_loading)
|
||||
.transform(roundedCornersTransform)
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE);
|
||||
mTvTitle.setText(title);
|
||||
if (!TextUtils.isEmpty(photo)) {
|
||||
String[] split = photo.split(",");
|
||||
Glide.with(mActivity)
|
||||
.load(BaseUrlApi.BASE_NEWS_IMG_URL + split[0])
|
||||
.into(mIvActivityImg);
|
||||
} else {
|
||||
//TODO 设置个默认图片
|
||||
}
|
||||
String[] split = photo.split(",");
|
||||
LogUtils.e(split[0]);
|
||||
Glide.with(mActivity)
|
||||
.load(BaseUrlApi.BASE_ACTIVITY_IMG_URL + split[0])
|
||||
.apply(options)
|
||||
.into(mIvActivityImg);
|
||||
setEditTextInputSpeChar(mEtPhone);
|
||||
setEditTextInputSpeChar(mEtName);
|
||||
setEditTextInputSpeChar(mEtVerifyCode);
|
||||
@ -257,10 +268,4 @@ public class ActivitySignUpActivity extends BaseActivity {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// TODO: add setContentView(...) invocation
|
||||
ButterKnife.bind(this);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ public class ActivityAdapter extends BaseRecyclerAdapter<ActivityListBeans.RowsB
|
||||
@Override
|
||||
public void bindHolder(ActivityHolder activityHolder, int i) {
|
||||
activityHolder.mTvTitle.setText(mData.get(i).getActivityTitle());
|
||||
activityHolder.mTvAddress.setText(mData.get(i).getActivityAddress());
|
||||
activityHolder.mTvSee.setText(mData.get(i).getActivityViewNum());
|
||||
if ("1".equals(mData.get(i).getActivityFormType())) {
|
||||
activityHolder.mTvType.setText("需报名");
|
||||
|
@ -64,7 +64,7 @@ public class ActivityMainFragment extends BaseFragment {
|
||||
mAdapter = new ActivityAdapter(mActivity, mDatas);
|
||||
mRlvContent.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
|
||||
mRlvContent.setAdapter(mAdapter);
|
||||
mRlvContent.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#F2F2F2")));
|
||||
// mRlvContent.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#F2F2F2")));
|
||||
mAdapter.addOnItemClickListener(this::showDetail);
|
||||
setStateView(STATE_LOAD);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView;
|
||||
import com.tengshisoft.moduleactivity.R;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@ -16,10 +17,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
* 描述: 活动列表
|
||||
*/
|
||||
public class ActivityHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mTvTitle;//标题
|
||||
public TextView mTvAddress;//地址
|
||||
public TypeFaceTextView mTvTitle;//标题
|
||||
public TextView mTvTime;//开始结束时间
|
||||
public TextView mTvDistance;//距离
|
||||
public ImageView mIvCover;//封面
|
||||
public TextView mTvSee;//浏览量
|
||||
public TextView mTvState;//是否结束
|
||||
@ -29,11 +28,9 @@ public class ActivityHolder extends RecyclerView.ViewHolder {
|
||||
super(itemView);
|
||||
mTvTime = itemView.findViewById(R.id.tv_time);
|
||||
mTvTitle = itemView.findViewById(R.id.tv_title);
|
||||
mTvAddress = itemView.findViewById(R.id.tv_address);
|
||||
mTvDistance = itemView.findViewById(R.id.tv_distance);
|
||||
mIvCover = itemView.findViewById(R.id.iv_cover);
|
||||
mTvSee = itemView.findViewById(R.id.tv_see);
|
||||
mTvState = itemView.findViewById(R.id.tv_state);
|
||||
mTvType = itemView.findViewById(R.id.tv_oriented);
|
||||
mTvType = itemView.findViewById(R.id.tv_type);
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,8 @@ public interface ApiActivity {
|
||||
@GET("app/activitylibrary/listpageactivitylibraryrelease")
|
||||
Observable<ActivityListBeans> getActivityList(@Query("page") String page);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取活动详情
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/red" />
|
||||
<solid android:color="@color/app_title" />
|
||||
|
||||
</shape>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<corners
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
</shape>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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:id="@+id/srl_content"
|
||||
@ -8,52 +8,54 @@
|
||||
android:background="@color/white"
|
||||
tools:context=".activity.ActivityDetailActivity">
|
||||
|
||||
<RelativeLayout
|
||||
<com.youth.banner.Banner
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="270dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/banner"
|
||||
android:layout_marginTop="-8dp"
|
||||
android:layout_marginBottom="70dp"
|
||||
android:background="@drawable/shape_topright_topleft">
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:textColor="#242424"
|
||||
android:textSize="18sp"
|
||||
tools:text="活动标题活动标题活动标题活动标题活动标题" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:layout_below="@id/tv_title"
|
||||
android:scrollbars="none">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.youth.banner.Banner
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
tools:text="活动名称活动名称活动名称活动名称活动名称活动名称活动名称活动名称" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/gray_line" />
|
||||
android:layout_height="4dp"
|
||||
android:background="#FBFBFB" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_peo_num"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_people"
|
||||
android:drawableLeft="@drawable/ic_icon_people"
|
||||
android:drawablePadding="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textSize="10sp"
|
||||
tools:text="活动人数:12/23" />
|
||||
@ -63,11 +65,10 @@
|
||||
android:id="@+id/tv_activity_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_clock"
|
||||
android:drawableLeft="@drawable/ic_icon_clock"
|
||||
android:drawablePadding="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textSize="10sp"
|
||||
tools:text="活动开始:2015-07-12至203234234" />
|
||||
@ -77,7 +78,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
android:paddingLeft="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
@ -85,15 +86,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:drawableLeft="@drawable/ic_location"
|
||||
android:drawableLeft="@drawable/ic_icon_location"
|
||||
android:drawablePadding="10dp"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingRight="5dp"
|
||||
android:textSize="10sp"
|
||||
tools:text="地点:西藏自治区群艺馆" />
|
||||
tools:text="地点:西藏自治区群艺馆西藏自治区群艺馆西藏自治区群艺馆西藏自治区群艺馆西藏自治区群艺馆西藏自治区群艺馆" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:src="@drawable/ic_arrow_right" />
|
||||
</LinearLayout>
|
||||
|
||||
@ -101,16 +105,34 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:background="@color/gray_line" />
|
||||
android:background="#FBFBFB" />
|
||||
|
||||
<TextView
|
||||
style="@style/detail_title"
|
||||
android:text="活动详情" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<View
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="14dp"
|
||||
android:background="@color/app_title" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_weight="1"
|
||||
android:text="活动详情"
|
||||
android:textColor="#242424"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/gray_line" />
|
||||
android:background="#FBFBFB" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_activity_content"
|
||||
@ -136,11 +158,30 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/gray_line" />
|
||||
android:background="#FBFBFB" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<View
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="14dp"
|
||||
android:background="@color/app_title" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_weight="1"
|
||||
android:text="活动单位"
|
||||
android:textColor="#242424"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
style="@style/detail_title"
|
||||
android:text="活动单位" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sponsor"
|
||||
@ -179,12 +220,30 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/gray_line" />
|
||||
android:background="#FBFBFB" />
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<View
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="14dp"
|
||||
android:background="@color/app_title" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_weight="1"
|
||||
android:text="活动须知"
|
||||
android:textColor="#242424"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
style="@style/detail_title"
|
||||
android:text="活动须知" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_apply_detail"
|
||||
@ -200,16 +259,29 @@
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</RelativeLayout>
|
||||
|
||||
<Button
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_btn_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/white"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/btn_sign_up"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@drawable/sel_btn_activity_sign_up"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:padding="10dp"
|
||||
android:text="报名"
|
||||
android:textColor="@color/col_verify_text" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
@ -4,6 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#EDEDED"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.ActivitySignUpActivity">
|
||||
|
||||
@ -11,27 +12,29 @@
|
||||
android:id="@+id/ll_activity_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_activity_img"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="match_parent"
|
||||
tools:src="@drawable/ic_add_photo" />
|
||||
android:layout_width="139dp"
|
||||
android:layout_height="97dp"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@drawable/ic_img_default" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
tools:text="活动名称活动名称活动名称活动名称活动名称活动名称活动名称活动名称" />
|
||||
@ -43,27 +46,29 @@
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_clock"
|
||||
android:id="@+id/iv_people_count"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:src="@drawable/ic_clock" />
|
||||
android:src="@drawable/ic_icon_people" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time_tile"
|
||||
android:id="@+id/tv_people_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_toRightOf="@id/iv_clock"
|
||||
android:text="活动时间:"
|
||||
android:layout_toRightOf="@id/iv_people_count"
|
||||
android:text="活动人数:"
|
||||
android:textColor="#BBBBBB"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:id="@+id/tv_peo_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/tv_time_tile"
|
||||
android:layout_toRightOf="@id/tv_people_title"
|
||||
android:textColor="#242424"
|
||||
android:textSize="10sp"
|
||||
tools:text="2017-23-23 000000000000000000000000:00:00~2018-23-23 00:00:00" />
|
||||
tools:text="100人" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
@ -76,7 +81,7 @@
|
||||
android:id="@+id/iv_end_clock"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:src="@drawable/ic_clock" />
|
||||
android:src="@drawable/ic_icon_clock" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_end_time_tile"
|
||||
@ -84,7 +89,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_toRightOf="@id/iv_end_clock"
|
||||
android:text="报名截止:"
|
||||
android:text="活动时间:"
|
||||
android:textColor="#BBBBBB"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
@ -92,8 +98,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/tv_end_time_tile"
|
||||
android:textColor="#242424"
|
||||
android:textSize="10sp"
|
||||
tools:text="2017-23-23 000000000000000000000000:00:00~2018-23-23 00:00:00" />
|
||||
tools:text="2017-23-23 :00:00~2018-23-23 00:00:00" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
@ -106,7 +113,7 @@
|
||||
android:id="@+id/iv_address"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:src="@drawable/ic_location" />
|
||||
android:src="@drawable/ic_icon_location" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address_tile"
|
||||
@ -115,6 +122,7 @@
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_toRightOf="@id/iv_address"
|
||||
android:text="活动地点:"
|
||||
android:textColor="#BBBBBB"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
@ -122,28 +130,47 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/tv_address_tile"
|
||||
android:textColor="#242424"
|
||||
android:textSize="10sp"
|
||||
tools:text="2017-23-23 000000000000000000000000:00:00~2018-23-23 00:00:00" />
|
||||
tools:text="内蒙古呼和浩特市赛罕区乌兰察布市乌兰差不乌兰不乌兰不乌兰不乌兰不乌兰" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:layout_below="@id/ll_activity_info"
|
||||
android:background="@color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/ll_activity_info"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@color/white"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:text="填写信息"
|
||||
android:textColor="@color/gray_text"
|
||||
android:textSize="15sp" />
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="14dp"
|
||||
android:background="@color/app_title" />
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:text="填写信息"
|
||||
android:textColor="#242424"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -272,12 +299,19 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="15dp"
|
||||
android:background="@drawable/sel_btn_activity_sign_up"
|
||||
android:text="立即预约"
|
||||
android:text="报名"
|
||||
android:textColor="@color/col_verify_text" />
|
||||
</RelativeLayout>
|
@ -1,111 +1,116 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.cardview.widget.CardView 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"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@drawable/bg_splash" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/shape_rectangle_white"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:textColor="@color/gray_text"
|
||||
android:textSize="10sp"
|
||||
tools:text="进行中" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_see"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_toLeftOf="@id/tv_state"
|
||||
android:background="@drawable/shape_rectangle_transparence"
|
||||
android:drawableLeft="@drawable/ic_eye"
|
||||
android:drawablePadding="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
tools:text="234234" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="标题" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="wrap_content"
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@drawable/bg_splash" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/shape_status_black"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
tools:text="进行中" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toLeftOf="@id/tv_state"
|
||||
android:background="@drawable/shape_status_black"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="4dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:src="@drawable/ic_eye" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_see"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
tools:text="234234" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tv_title"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textColor="@color/gray_text"
|
||||
android:textSize="10sp"
|
||||
tools:text="地址" />
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="23dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
tools:text="标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_re_red"
|
||||
android:padding="4dp"
|
||||
android:textColor="#9F1512"
|
||||
tools:text="直接进入" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tv_address"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textColor="@color/gray_text"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:textColor="#242424"
|
||||
android:textSize="10sp"
|
||||
tools:text="开始时间结束时间" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/gray_text"
|
||||
android:textSize="10sp"
|
||||
tools:text="距离1000234" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_oriented"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="10sp"
|
||||
tools:text="参与人群" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
tools:text="2020-02-02 12:00:00至2020-02-02 12:00:00" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
@ -4,7 +4,7 @@ if (!IsModuleDev.toBoolean()) {
|
||||
apply plugin: 'com.android.library'
|
||||
}
|
||||
apply plugin: 'com.jakewharton.butterknife'
|
||||
|
||||
apply plugin: 'android-aspectjx'
|
||||
android {
|
||||
buildToolsVersion rootProject.ext.gBuildToolsVersion
|
||||
compileSdkVersion rootProject.ext.gCompileSdkVersion
|
||||
@ -34,9 +34,10 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation files('libs/tbs.jar')
|
||||
implementation files('libs/BaiduLBS_Android.jar')
|
||||
implementation project(':cm_utils')
|
||||
implementation project(':moduleijkplayer')
|
||||
implementation project(':camera')
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
@ -53,6 +54,8 @@ dependencies {
|
||||
implementation "com.scwang.smartrefresh:SmartRefreshLayout:${rootProject.ext.gSmartRefreshLayoutVersion}"
|
||||
//角标
|
||||
implementation 'q.rorbin:badgeview:1.1.3'
|
||||
//流布局
|
||||
implementation 'com.beloo.widget:ChipsLayoutManager:0.3.7@aar'
|
||||
//Rxjava
|
||||
implementation "io.reactivex.rxjava2:rxjava:${rootProject.ext.gRxJavaVersion}"
|
||||
implementation "io.reactivex.rxjava2:rxandroid:${rootProject.ext.gRxAndroid}"
|
||||
@ -64,6 +67,7 @@ dependencies {
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.gButterKnifeVersion}"
|
||||
//选择器
|
||||
implementation "com.contrarywind:Android-PickerView:${rootProject.ext.pickerViewVersion}"
|
||||
implementation "com.contrarywind:wheelview:${rootProject.ext.wheelVersion}"
|
||||
//gson
|
||||
implementation "com.google.code.gson:gson:${rootProject.ext.supportGson}"
|
||||
//glide
|
||||
@ -79,4 +83,20 @@ dependencies {
|
||||
implementation "top.zibin:Luban:$rootProject.ext.lubanVersio"
|
||||
//动画
|
||||
implementation "com.plattysoft.leonids:LeonidsLib:${rootProject.ext.leonidslibVersion}"
|
||||
//banner
|
||||
implementation "com.youth.banner:banner:${rootProject.ext.bannerVersion}"
|
||||
//屏幕适配
|
||||
implementation 'com.github.jarryleo:MagicScreenAdapter:v2.1'
|
||||
//骨架
|
||||
implementation 'com.ethanhua:skeleton:1.1.2'
|
||||
implementation 'io.supercharge:shimmerlayout:2.1.0'
|
||||
//滑动删除的recyclerview
|
||||
implementation 'com.yanzhenjie.recyclerview:x:1.3.2'
|
||||
//slidinguppane
|
||||
implementation 'com.sothree.slidinguppanel:library:3.4.0'
|
||||
// 基础依赖包,必须要依赖
|
||||
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
||||
// fragment快速实现(可选)
|
||||
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
||||
|
||||
}
|
||||
|
@ -2,9 +2,121 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.tengshisoft.modulecultural">
|
||||
|
||||
<application>
|
||||
<activity android:name=".activitys.LegacyDetailActivity" />
|
||||
<activity android:name=".activitys.CulturalLegacyActivity" />
|
||||
<application
|
||||
android:maxAspectRatio="2.4"
|
||||
android:resizeableActivity="true">
|
||||
<activity android:name=".activitys.EditMineVolunteerActivityActivity"></activity>
|
||||
<activity android:name=".activitys.MineVolunteerActivityActivity" />
|
||||
<activity android:name=".activitys.VolunteerActivityLogActivity" />
|
||||
<activity android:name=".activitys.ChooseMineTeamActivity" />
|
||||
<activity android:name=".activitys.VolunteerActivitySignSingleActivity" />
|
||||
<activity android:name=".activitys.VolunteerActivitySignTeamActivity" />
|
||||
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="2.4" /> <!-- 适配华为(huawei)刘海屏 -->
|
||||
<meta-data
|
||||
android:name="android.notch_support"
|
||||
android:value="true" /> <!-- 适配小米(xiaomi)刘海屏 -->
|
||||
<meta-data
|
||||
android:name="notch.config"
|
||||
android:value="portrait|landscape" />
|
||||
|
||||
<activity
|
||||
android:name=".activitys.LookBackListActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.CulturalLiveLookBackActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.VolunteerActivityDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.MemberManageActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.TeamDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.TeamEditActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.VolunteerMineTeamActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.TeamMemberDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.MemberActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.ChooseMemberActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.CulturalLiveDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.VolunteerManageActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.VolunteerPublishActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.RegisterVolunteerTeamActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.RegisterVolunteerSingleActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.VolunteerActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.CulturalLiveActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.LegacyDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
android:name=".activitys.CulturalLegacyActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,181 @@
|
||||
package com.tengshisoft.modulecultural.activitys;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.tengshisoft.modulecultural.R;
|
||||
import com.tengshisoft.modulecultural.R2;
|
||||
import com.tengshisoft.modulecultural.adapter.MemberChooseAdapter;
|
||||
import com.tengshisoft.modulecultural.bean.MemberBean;
|
||||
import com.tengshisoft.modulecultural.net.CulturalApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
@Route(path = PathConfig.PATH_MODULE_CULTURAL_CHOOSE_MEMBER)
|
||||
public class ChooseMemberActivity extends BaseActivity {
|
||||
|
||||
@BindView(R2.id.btn_search)
|
||||
Button mBtnSearch;
|
||||
@BindView(R2.id.rlv_member)
|
||||
RecyclerView mRlvMember;
|
||||
@BindView(R2.id.srl_member)
|
||||
SmartRefreshLayout mSrlMember;
|
||||
@BindView(R2.id.et_company_name)
|
||||
EditText mEtName;
|
||||
@BindView(R2.id.iv_clear)
|
||||
ImageView mIvClear;
|
||||
private Unbinder mBind;
|
||||
private int mCurrentPage = 1;
|
||||
private int mTotalSize = 0;
|
||||
private List<MemberBean.RowsBean> mMemberBeans = new ArrayList<>();
|
||||
private MemberChooseAdapter mAdapter;
|
||||
private ArrayList<String> mChooseMembers;
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("选择成员");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("确定");
|
||||
mTvPublish.setTextColor(Color.BLACK);
|
||||
mChooseMembers = (ArrayList<String>) getIntent().getSerializableExtra("beans");
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
List<MemberBean.RowsBean> data = mAdapter.getData();
|
||||
ArrayList<MemberBean.RowsBean> chooseBeans = new ArrayList<>();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
if (data.get(i).isCheckEd()) {
|
||||
chooseBeans.add(data.get(i));
|
||||
}
|
||||
}
|
||||
if (chooseBeans.size() <= 0) {
|
||||
ToastUtils.showShort("请最少选择一个成员");
|
||||
} else {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("beans", chooseBeans);
|
||||
setResult(10, intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
mSrlMember.setEnableRefresh(false);
|
||||
mSrlMember.setOnLoadMoreListener(refreshLayout -> loadMoreData());
|
||||
mAdapter = new MemberChooseAdapter(mActivity, mMemberBeans, true);
|
||||
mRlvMember.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
|
||||
mRlvMember.setAdapter(mAdapter);
|
||||
getMemberList(mCurrentPage);
|
||||
}
|
||||
|
||||
private void getMemberList(int currentPage) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(CulturalApi.class)
|
||||
.getMemberList(currentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<MemberBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(MemberBean memberBean) {
|
||||
if (currentPage == 1) {
|
||||
if (memberBean != null && memberBean.getRows().size() > 0) {
|
||||
mTotalSize = memberBean.getTotal();
|
||||
mMemberBeans = memberBean.getRows();
|
||||
if (mChooseMembers != null && mChooseMembers.size() > 0) {
|
||||
for (int i = 0; i < mChooseMembers.size(); i++) {
|
||||
for (int j = 0; j < mMemberBeans.size(); j++) {
|
||||
if (mMemberBeans.get(j).getUserId().equals(mChooseMembers.get(i))) {
|
||||
LogUtils.e("存在");
|
||||
mMemberBeans.get(j).setCheckEd(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mAdapter.setData(mMemberBeans);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
ToastUtils.showShort("暂无志愿者数据");
|
||||
}
|
||||
} else {
|
||||
if (memberBean != null) {
|
||||
List<MemberBean.RowsBean> rows = memberBean.getRows();
|
||||
if (mChooseMembers != null && mChooseMembers.size() > 0) {
|
||||
for (int i = 0; i < mChooseMembers.size(); i++) {
|
||||
for (int j = 0; j < rows.size(); j++) {
|
||||
if (rows.get(j).getUserId().equals(mChooseMembers.get(i))) {
|
||||
rows.get(j).setCheckEd(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mMemberBeans.addAll(rows);
|
||||
mAdapter.setData(mMemberBeans);
|
||||
mSrlMember.finishLoadMore();
|
||||
} else {
|
||||
mSrlMember.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void loadMoreData() {
|
||||
if (mMemberBeans.size() < mTotalSize) {
|
||||
++mCurrentPage;
|
||||
getMemberList(mCurrentPage);
|
||||
mSrlMember.setNoMoreData(false);
|
||||
} else {
|
||||
mSrlMember.finishLoadMore();
|
||||
mSrlMember.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_choose_member;
|
||||
}
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
package com.tengshisoft.modulecultural.activitys;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.tengshisoft.modulecultural.R;
|
||||
import com.tengshisoft.modulecultural.R2;
|
||||
import com.tengshisoft.modulecultural.adapter.ChooseTeamAdapter;
|
||||
import com.tengshisoft.modulecultural.bean.TeamBean;
|
||||
import com.tengshisoft.modulecultural.net.CulturalApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 选择我的团队
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_CULTURAL_VOUNTEER_CHOOSE_TEAM)
|
||||
public class ChooseMineTeamActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R2.id.rlv_teams)
|
||||
RecyclerView mRlvTeams;
|
||||
@BindView(R2.id.srl_content)
|
||||
SmartRefreshLayout mSrlView;
|
||||
private Unbinder mBind;
|
||||
private List<TeamBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private int mTotalSize = 0;
|
||||
private int mCurrentPage = 1;
|
||||
private ChooseTeamAdapter mAdapter;
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("选择团队");
|
||||
mTvPublish.setText("确定");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
if (mAdapter.getChooseBean() == null) {
|
||||
ToastUtils.showShort("请选择一个团队");
|
||||
} else {
|
||||
TeamBean.RowsBean chooseBean = mAdapter.getChooseBean();
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("id", chooseBean.getTeamId());
|
||||
intent.putExtra("name", chooseBean.getTeamName());
|
||||
setResult(333, intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
mAdapter = new ChooseTeamAdapter(mActivity, mDatas);
|
||||
mRlvTeams.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
|
||||
mRlvTeams.setAdapter(mAdapter);
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
getMineTeamList(mCurrentPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的团队列表
|
||||
*
|
||||
* @param currentPage
|
||||
*/
|
||||
private void getMineTeamList(int currentPage) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(CulturalApi.class)
|
||||
.getTeamListMine(currentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<TeamBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(TeamBean teamBean) {
|
||||
if (currentPage == 1) {
|
||||
if (teamBean != null && teamBean.getRows().size() > 0) {
|
||||
mTotalSize = teamBean.getTotal();
|
||||
mDatas = teamBean.getRows();
|
||||
mAdapter.setData(mDatas);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
mSrlView.finishRefresh();
|
||||
} else {
|
||||
if (teamBean != null) {
|
||||
mDatas.addAll(teamBean.getRows());
|
||||
mAdapter.setData(mDatas);
|
||||
mSrlView.finishLoadMore();
|
||||
} else {
|
||||
mSrlView.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (currentPage == 1) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
mSrlView.finishRefresh();
|
||||
mSrlView.finishLoadMore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
|
||||
protected void refreshView() {
|
||||
mDatas.clear();
|
||||
mCurrentPage = 1;
|
||||
//我的团队
|
||||
getMineTeamList(mCurrentPage);
|
||||
}
|
||||
|
||||
protected void loadMoreData() {
|
||||
if (mDatas.size() < mTotalSize) {
|
||||
++mCurrentPage;
|
||||
//我的团队
|
||||
getMineTeamList(mCurrentPage);
|
||||
mSrlView.setNoMoreData(false);
|
||||
} else {
|
||||
mSrlView.finishLoadMore();
|
||||
mSrlView.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_choose_mine_team;
|
||||
}
|
||||
|
||||
}
|
@ -40,6 +40,7 @@ public class CulturalLegacyActivity extends BaseActivity {
|
||||
private int mTotalPage = 0;
|
||||
private List<LegacyListBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private LegacyListAdapter mAdapter;
|
||||
private Disposable mD1;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -100,7 +101,7 @@ public class CulturalLegacyActivity extends BaseActivity {
|
||||
.subscribe(new Observer<LegacyListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mD1 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -145,9 +146,12 @@ public class CulturalLegacyActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mD1 != null && !mD1.isDisposed()) {
|
||||
mD1.dispose();
|
||||
}
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,198 @@
|
||||
package com.tengshisoft.modulecultural.activitys;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.ItemSplitDivider;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.tengshisoft.modulecultural.R;
|
||||
import com.tengshisoft.modulecultural.R2;
|
||||
import com.tengshisoft.modulecultural.adapter.ShareLiveAdapter;
|
||||
import com.tengshisoft.modulecultural.bean.CulturalLiveBean;
|
||||
import com.tengshisoft.modulecultural.net.CulturalApi;
|
||||
|
||||
import java.nio.channels.ShutdownChannelGroupException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 直播页面
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_CULTURAL_LIVE)
|
||||
public class CulturalLiveActivity extends BaseActivity {
|
||||
|
||||
@BindView(R2.id.rlv_lives)
|
||||
RecyclerView mRlvLives;
|
||||
@BindView(R2.id.srl_live_content)
|
||||
SmartRefreshLayout mSrlLivs;
|
||||
private Unbinder mBind;
|
||||
private int mCurrentPage = 1;
|
||||
private int mTotalSize = 0;
|
||||
private List<CulturalLiveBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private ShareLiveAdapter mAdapter;
|
||||
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_cultural_l_ive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("共享直播");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mRlvLives.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
|
||||
mAdapter = new ShareLiveAdapter(mActivity, mDatas);
|
||||
mRlvLives.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#F2F2F2")));
|
||||
mRlvLives.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::showLiveDetail);
|
||||
mSrlLivs.setOnRefreshListener(refreshLayout -> refreshData());
|
||||
mSrlLivs.setOnLoadMoreListener(refreshLayout -> loadMoreData());
|
||||
getLiveList(mCurrentPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示直播详情
|
||||
*
|
||||
* @param rowsBean
|
||||
*/
|
||||
private void showLiveDetail(CulturalLiveBean.RowsBean rowsBean) {
|
||||
|
||||
if ("0".equals(rowsBean.getLiveStatus())) {
|
||||
//已经结束
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_CULTURAL_LIVE_LOCKBACK)
|
||||
.withString("id", rowsBean.getLivePlanId())
|
||||
.navigation();
|
||||
} else if ("1".equals(rowsBean.getLiveStatus())) {
|
||||
//未开始
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_CULTURAL_LIVE_DETAIL)
|
||||
.withString("id", rowsBean.getLivePlanId())
|
||||
.withString("type", "1")
|
||||
.navigation();
|
||||
} else if ("2".equals(rowsBean.getLiveStatus())) {
|
||||
//直播中
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_CULTURAL_LIVE_DETAIL)
|
||||
.withString("id", rowsBean.getLivePlanId())
|
||||
.withString("type", "2")
|
||||
.navigation();
|
||||
} else {
|
||||
ToastUtils.showShort("数据错误");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载更多
|
||||
*/
|
||||
private void loadMoreData() {
|
||||
if (mDatas.size() < mTotalSize) {
|
||||
++mCurrentPage;
|
||||
getLiveList(mCurrentPage);
|
||||
mSrlLivs.setNoMoreData(false);
|
||||
} else {
|
||||
mSrlLivs.finishLoadMore();
|
||||
mSrlLivs.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*/
|
||||
private void refreshData() {
|
||||
mDatas.clear();
|
||||
mCurrentPage = 1;
|
||||
getLiveList(mCurrentPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取直播列表
|
||||
*
|
||||
* @param page
|
||||
*/
|
||||
private void getLiveList(int page) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(CulturalApi.class)
|
||||
.getLiveRecord(page + "")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CulturalLiveBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CulturalLiveBean culturalLiveBean) {
|
||||
if (page == 1) {
|
||||
if (culturalLiveBean != null && culturalLiveBean.getRows().size() > 0) {
|
||||
mTotalSize = culturalLiveBean.getTotal();
|
||||
mDatas = culturalLiveBean.getRows();
|
||||
mAdapter.setData(mDatas);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
mSrlLivs.finishRefresh();
|
||||
} else {
|
||||
if (culturalLiveBean != null) {
|
||||
mDatas.addAll(culturalLiveBean.getRows());
|
||||
mAdapter.setData(mDatas);
|
||||
mSrlLivs.finishLoadMore();
|
||||
} else {
|
||||
mSrlLivs.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (page == 1) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
ExceptionHandler.handleException(e);
|
||||
mSrlLivs.finishRefresh();
|
||||
mSrlLivs.finishLoadMore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,241 @@
|
||||
package com.tengshisoft.modulecultural.activitys;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.ExceptionHandler;
|
||||
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 com.tengshisoft.moduleijkplayer.controller.VodControlView;
|
||||
import com.tengshisoft.moduleijkplayer.player.VideoView;
|
||||
import com.tengshisoft.moduleijkplayer.util.L;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Route(path = PathConfig.PATH_MODULE_CULTURAL_LIVE_DETAIL)
|
||||
public class CulturalLiveDetailActivity extends BaseActivity {
|
||||
@BindView(R2.id.srl_content)
|
||||
SmartRefreshLayout mSrlContent;
|
||||
@BindView(R2.id.vv_player)
|
||||
VideoView mVvPlayer;
|
||||
@BindView(R2.id.ll_content)
|
||||
LinearLayout mLlContent;
|
||||
@BindView(R2.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R2.id.tv_time)
|
||||
TextView mTvTime;
|
||||
@BindView(R2.id.tv_time_end)
|
||||
TextView mTvTimeEnd;
|
||||
@BindView(R2.id.tv_desc)
|
||||
TextView mTvDesc;
|
||||
private Unbinder mBind;
|
||||
private String mType;
|
||||
// private static final String THUMB = "https://cms-bucket.nosdn.127.net/eb411c2810f04ffa8aaafc42052b233820180418095416.jpeg";
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_share_live_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("共享直播");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
String id = getIntent().getStringExtra("id");
|
||||
getLiveDetail(id);
|
||||
mSrlContent.setOnRefreshListener(refreshLayout -> {
|
||||
if (mVvPlayer != null) {
|
||||
mVvPlayer.release();
|
||||
}
|
||||
getLiveDetail(id);
|
||||
});
|
||||
mSrlContent.setEnableLoadMore(false);
|
||||
}
|
||||
|
||||
private void getLiveDetail(String id) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(CulturalApi.class)
|
||||
.getLiveDetail(id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CulturalLiveDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CulturalLiveDetailBean culturalLiveDetailBean) {
|
||||
if (culturalLiveDetailBean != null) {
|
||||
setDataToView(culturalLiveDetailBean);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
mSrlContent.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
mSrlContent.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void setDataToView(CulturalLiveDetailBean bean) {
|
||||
StandardVideoController controller = new StandardVideoController(mActivity);
|
||||
controller.setEnableOrientation(true);
|
||||
PrepareView prepareView = new PrepareView(this);//准备播放界面
|
||||
ImageView thumb = prepareView.findViewById(R.id.thumb);//封面图
|
||||
|
||||
Glide.with(mActivity).load(BaseUrlApi.BASE_LIVE_IMG_IP + bean.getLivePlanPhoto()).into(thumb);
|
||||
controller.addControlComponent(prepareView);
|
||||
mType = bean.getLiveStatus();
|
||||
|
||||
if ("2".equals(mType)) {
|
||||
//直播中
|
||||
prepareView.setClickStart();
|
||||
prepareView.setState("直播中");
|
||||
CompleteView completeView = new CompleteView(this);
|
||||
controller.addControlComponent(completeView);//自动完成播放界面
|
||||
ErrorView errorView = new ErrorView(this);
|
||||
controller.addControlComponent(errorView);//错误界面
|
||||
|
||||
TitleView titleView = new TitleView(this);//标题栏
|
||||
|
||||
controller.addControlComponent(titleView);
|
||||
//根据是否为直播设置不同的底部控制条
|
||||
controller.addControlComponent(new LiveControlView(this));//直播控制条
|
||||
GestureView gestureControlView = new GestureView(this);//滑动控制视图
|
||||
controller.addControlComponent(gestureControlView);
|
||||
controller.setCanChangePosition(false);
|
||||
//设置标题
|
||||
titleView.setTitle(bean.getLivePlanName());
|
||||
titleView.setState("直播中");
|
||||
mVvPlayer.setVideoController(controller);
|
||||
mVvPlayer.setUrl(bean.getLiveDeviceRtmpUrl());
|
||||
mVvPlayer.addOnStateChangeListener(mOnStateChangeListener);
|
||||
if ("2".equals(mType)) {
|
||||
mVvPlayer.start();
|
||||
}
|
||||
} else {
|
||||
//未开始
|
||||
prepareView.setState("直播未开始");
|
||||
mVvPlayer.setVideoController(controller);
|
||||
}
|
||||
|
||||
mTvDesc.setText(bean.getLivePlanRecord());
|
||||
mTvName.setText(bean.getLivePlanName());
|
||||
mTvTime.setText("直播开始:" + bean.getLivePlanStart());
|
||||
mTvTimeEnd.setText("预计结束:" + bean.getLivePlanEnd());
|
||||
}
|
||||
|
||||
private VideoView.OnStateChangeListener mOnStateChangeListener = new VideoView.SimpleOnStateChangeListener() {
|
||||
@Override
|
||||
public void onPlayerStateChanged(int playerState) {
|
||||
switch (playerState) {
|
||||
case VideoView.PLAYER_NORMAL://小屏
|
||||
break;
|
||||
case VideoView.PLAYER_FULL_SCREEN://全屏
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayStateChanged(int playState) {
|
||||
switch (playState) {
|
||||
case VideoView.STATE_IDLE:
|
||||
break;
|
||||
case VideoView.STATE_PREPARING:
|
||||
//在STATE_PREPARING时设置setMute(true)可实现静音播放
|
||||
// mVideoView.setMute(true);
|
||||
break;
|
||||
case VideoView.STATE_PREPARED:
|
||||
break;
|
||||
case VideoView.STATE_PLAYING:
|
||||
//需在此时获取视频宽高
|
||||
int[] videoSize = mVvPlayer.getVideoSize();
|
||||
L.d("视频宽:" + videoSize[0]);
|
||||
L.d("视频高:" + videoSize[1]);
|
||||
break;
|
||||
case VideoView.STATE_PAUSED:
|
||||
break;
|
||||
case VideoView.STATE_BUFFERING:
|
||||
break;
|
||||
case VideoView.STATE_BUFFERED:
|
||||
break;
|
||||
case VideoView.STATE_PLAYBACK_COMPLETED:
|
||||
break;
|
||||
case VideoView.STATE_ERROR:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mVvPlayer.pause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mVvPlayer.pause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
mOnStateChangeListener = null;
|
||||
if (mVvPlayer != null) {
|
||||
mVvPlayer.release();
|
||||
}
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|