平板页面调整、手写签名
This commit is contained in:
parent
963ea4ac81
commit
68504bdf04
233
baselib/src/main/java/com/tenlionsoft/baselib/core/widget/handsign/BasePen.java
Executable file
233
baselib/src/main/java/com/tenlionsoft/baselib/core/widget/handsign/BasePen.java
Executable file
@ -0,0 +1,233 @@
|
||||
package com.tenlionsoft.baselib.core.widget.handsign;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public abstract class BasePen {
|
||||
|
||||
/**
|
||||
* 绘制计算的次数,数值越小计算的次数越多
|
||||
*/
|
||||
public static final int STEP_FACTOR = 20;
|
||||
|
||||
protected ArrayList<ControllerPoint> mHWPointList = new ArrayList<>();
|
||||
protected ControllerPoint mLastPoint = new ControllerPoint(0, 0);
|
||||
protected Paint mPaint;
|
||||
|
||||
/**
|
||||
* 笔的宽度信息
|
||||
*/
|
||||
private double mBaseWidth;
|
||||
|
||||
private double mLastVel;
|
||||
private double mLastWidth;
|
||||
|
||||
protected Bezier mBezier = new Bezier();
|
||||
|
||||
protected ControllerPoint mCurPoint;
|
||||
|
||||
public void setPaint(Paint paint) {
|
||||
mPaint = paint;
|
||||
mBaseWidth = paint.getStrokeWidth();
|
||||
}
|
||||
|
||||
public void draw(Canvas canvas) {
|
||||
mPaint.setStyle(Paint.Style.FILL);
|
||||
//点的集合少 不去绘制
|
||||
if (mHWPointList == null || mHWPointList.size() < 1) {
|
||||
return;
|
||||
}
|
||||
mCurPoint = mHWPointList.get(0);
|
||||
doPreDraw(canvas);
|
||||
}
|
||||
|
||||
private int lastId = 0;//记录最先/最后的手指id
|
||||
|
||||
public boolean onTouchEvent(MotionEvent event, Canvas canvas) {
|
||||
// event会被下一次事件重用,这里必须生成新的,否则会有问题
|
||||
int action = event.getAction() & event.getActionMasked();
|
||||
MotionEvent event2 = MotionEvent.obtain(event);
|
||||
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
lastId = event2.getPointerId(0);
|
||||
onDown(createMotionElement(event2), canvas);
|
||||
return true;
|
||||
case MotionEvent.ACTION_POINTER_DOWN:
|
||||
lastId = 0;
|
||||
mLastVel = 0;
|
||||
mLastPoint = new ControllerPoint(event2.getX(event2.getActionIndex()), event2.getY(event2.getActionIndex()));
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if (lastId != event2.getPointerId(event2.getActionIndex())) {
|
||||
return true;
|
||||
}
|
||||
onMove(createMotionElement(event2), canvas);
|
||||
return true;
|
||||
case MotionEvent.ACTION_POINTER_UP:
|
||||
onUp(createMotionElement(event2), canvas);
|
||||
return true;
|
||||
case MotionEvent.ACTION_UP:
|
||||
lastId = event2.getPointerId(0);
|
||||
onUp(createMotionElement(event2), canvas);
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按下的事件
|
||||
*/
|
||||
public void onDown(MotionElement mElement, Canvas canvas) {
|
||||
if (mPaint == null) {
|
||||
throw new NullPointerException("paint不能为null");
|
||||
}
|
||||
if (getNewPaint(mPaint) != null) {
|
||||
Paint paint = getNewPaint(mPaint);
|
||||
mPaint = paint;
|
||||
paint = null;
|
||||
}
|
||||
mHWPointList.clear();
|
||||
//记录down的控制点的信息
|
||||
ControllerPoint curPoint = new ControllerPoint(mElement.x, mElement.y);
|
||||
mLastWidth = 0.7 * mBaseWidth;
|
||||
//down下的点的宽度
|
||||
curPoint.width = (float) mLastWidth;
|
||||
mLastVel = 0;
|
||||
//记录当前的点
|
||||
mLastPoint = curPoint;
|
||||
}
|
||||
|
||||
protected Paint getNewPaint(Paint paint) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手指移动的事件
|
||||
*/
|
||||
public void onMove(MotionElement mElement, Canvas canvas) {
|
||||
ControllerPoint curPoint = new ControllerPoint(mElement.x, mElement.y);
|
||||
double deltaX = curPoint.x - mLastPoint.x;
|
||||
double deltaY = curPoint.y - mLastPoint.y;
|
||||
//deltaX和deltay平方和的二次方根 想象一个例子 1+1的平方根为1.4 (x²+y²)开根号
|
||||
//同理,当滑动的越快的话,deltaX+deltaY的值越大,这个越大的话,curDis也越大
|
||||
double curDis = Math.hypot(deltaX, deltaY);
|
||||
//我们求出的这个值越小,画的点或者是绘制椭圆形越多,这个值越大的话,绘制的越少,笔就越细,宽度越小
|
||||
double curVel = curDis * 0.008f;
|
||||
double curWidth;
|
||||
//点的集合少,我们得必须改变宽度,每次点击的down的时候,这个事件
|
||||
if (mHWPointList.size() < 2) {
|
||||
curWidth = calcNewWidth(curVel, mLastVel, curDis, 1.7,
|
||||
mLastWidth);
|
||||
curPoint.width = (float) curWidth;
|
||||
mBezier.init(mLastPoint, curPoint);
|
||||
} else {
|
||||
mLastVel = curVel;
|
||||
curWidth = calcNewWidth(curVel, mLastVel, curDis, 1.7,
|
||||
mLastWidth);
|
||||
curPoint.width = (float) curWidth;
|
||||
mBezier.addNode(curPoint);
|
||||
}
|
||||
//每次移动的话,这里赋值新的值
|
||||
mLastWidth = curWidth;
|
||||
doMove(curDis);
|
||||
mLastPoint = curPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手指抬起来的事件
|
||||
*/
|
||||
public void onUp(MotionElement mElement, Canvas canvas) {
|
||||
if (mHWPointList.size() == 0) {
|
||||
return;
|
||||
}
|
||||
mCurPoint = new ControllerPoint(mElement.x, mElement.y);
|
||||
double deltaX = mCurPoint.x - mLastPoint.x;
|
||||
double deltaY = mCurPoint.y - mLastPoint.y;
|
||||
double curDis = Math.hypot(deltaX, deltaY);
|
||||
mCurPoint.width = 0;
|
||||
|
||||
mBezier.addNode(mCurPoint);
|
||||
|
||||
int steps = 1 + (int) curDis / STEP_FACTOR;
|
||||
double step = 1.0 / steps;
|
||||
for (double t = 0; t < 1.0; t += step) {
|
||||
ControllerPoint point = mBezier.getPoint(t);
|
||||
mHWPointList.add(point);
|
||||
}
|
||||
mBezier.end();
|
||||
for (double t = 0; t < 1.0; t += step) {
|
||||
ControllerPoint point = mBezier.getPoint(t);
|
||||
mHWPointList.add(point);
|
||||
}
|
||||
draw(canvas);
|
||||
clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算新的宽度信息
|
||||
*/
|
||||
public double calcNewWidth(double curVel, double lastVel, double curDis,
|
||||
double factor, double lastWidth) {
|
||||
double calVel = curVel * 0.6 + lastVel * (1 - 0.6);
|
||||
double vfac = Math.log(factor * 2.0f) * (-calVel);
|
||||
double calWidth = mBaseWidth * Math.exp(vfac);
|
||||
return calWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建触摸点信息
|
||||
*/
|
||||
public MotionElement createMotionElement(MotionEvent motionEvent) {
|
||||
MotionElement motionElement = new MotionElement(motionEvent.getX(0), motionEvent.getY(0),
|
||||
motionEvent.getPressure(), motionEvent.getToolType(0));
|
||||
return motionElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除缓存的触摸点
|
||||
*/
|
||||
public void clear() {
|
||||
mHWPointList.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制
|
||||
* 当现在的点和触摸点的位置在一起的时候不用去绘制
|
||||
*/
|
||||
protected void drawToPoint(Canvas canvas, ControllerPoint point, Paint paint) {
|
||||
if ((mCurPoint.x == point.x) && (mCurPoint.y == point.y)) {
|
||||
return;
|
||||
}
|
||||
doDraw(canvas, point, paint);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断笔是否为空
|
||||
*/
|
||||
public boolean isNullPaint() {
|
||||
return mPaint == null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移动的时候的处理方法
|
||||
*/
|
||||
protected abstract void doMove(double f);
|
||||
|
||||
/**
|
||||
* 绘制方法
|
||||
*/
|
||||
protected abstract void doDraw(Canvas canvas, ControllerPoint point, Paint paint);
|
||||
|
||||
/**
|
||||
* onDraw之前的操作
|
||||
*/
|
||||
protected abstract void doPreDraw(Canvas canvas);
|
||||
}
|
128
baselib/src/main/java/com/tenlionsoft/baselib/core/widget/handsign/Bezier.java
Executable file
128
baselib/src/main/java/com/tenlionsoft/baselib/core/widget/handsign/Bezier.java
Executable file
@ -0,0 +1,128 @@
|
||||
package com.tenlionsoft.baselib.core.widget.handsign;
|
||||
|
||||
|
||||
public class Bezier {
|
||||
|
||||
/**
|
||||
* 控制点
|
||||
*/
|
||||
private ControllerPoint mControl = new ControllerPoint();
|
||||
/**
|
||||
* 距离
|
||||
*/
|
||||
private ControllerPoint mDestination = new ControllerPoint();
|
||||
/**
|
||||
* 下一个需要控制点
|
||||
*/
|
||||
private ControllerPoint mNextControl = new ControllerPoint();
|
||||
/**
|
||||
* 资源的点
|
||||
*/
|
||||
private ControllerPoint mSource = new ControllerPoint();
|
||||
|
||||
/**
|
||||
* 初始化两个点,
|
||||
*
|
||||
* @param last 最后的点的信息
|
||||
* @param cur 当前点的信息,当前点的信息,当前点的是根据事件获得,同时这个当前点的宽度是经过计算的得出的
|
||||
*/
|
||||
public void init(ControllerPoint last, ControllerPoint cur) {
|
||||
init(last.x, last.y, last.width, cur.x, cur.y, cur.width);
|
||||
}
|
||||
|
||||
public void init(float lastx, float lasty, float lastWidth, float x, float y, float width) {
|
||||
//资源点设置,最后的点的为资源点
|
||||
mSource.set(lastx, lasty, lastWidth);
|
||||
float xmid = getMid(lastx, x);
|
||||
float ymid = getMid(lasty, y);
|
||||
float wmid = getMid(lastWidth, width);
|
||||
//距离点为平均点
|
||||
mDestination.set(xmid, ymid, wmid);
|
||||
//控制点为当前的距离点
|
||||
mControl.set(getMid(lastx, xmid), getMid(lasty, ymid), getMid(lastWidth, wmid));
|
||||
//下个控制点为当前点
|
||||
mNextControl.set(x, y, width);
|
||||
}
|
||||
|
||||
public void addNode(ControllerPoint cur) {
|
||||
addNode(cur.x, cur.y, cur.width);
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换就的点,原来的距离点变换为资源点,控制点变为原来的下一个控制点,距离点取原来控制点的和新的的一半
|
||||
* 下个控制点为新的点
|
||||
*
|
||||
* @param x 新的点的坐标
|
||||
* @param y 新的点的坐标
|
||||
* @param width
|
||||
*/
|
||||
public void addNode(float x, float y, float width) {
|
||||
mSource.set(mDestination);
|
||||
mControl.set(mNextControl);
|
||||
mDestination.set(getMid(mNextControl.x, x), getMid(mNextControl.y, y), getMid(mNextControl.width, width));
|
||||
mNextControl.set(x, y, width);
|
||||
}
|
||||
|
||||
/**
|
||||
* 结合手指抬起来的动作,告诉现在的曲线控制点也必须变化,其实在这里也不需要结合着up事件使用
|
||||
* 因为在down的事件中,所有点都会被重置,然后设置这个没有多少意义,但是可以改变下个事件的朝向改变
|
||||
* 先留着,因为后面如果需要控制整个颜色的改变的话,我的依靠这个方法,还有按压的时间的变化
|
||||
*/
|
||||
public void end() {
|
||||
mSource.set(mDestination);
|
||||
float x = getMid(mNextControl.x, mSource.x);
|
||||
float y = getMid(mNextControl.y, mSource.y);
|
||||
float w = getMid(mNextControl.width, mSource.width);
|
||||
mControl.set(x, y, w);
|
||||
mDestination.set(mNextControl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点信息
|
||||
*/
|
||||
public ControllerPoint getPoint(double t) {
|
||||
float x = (float) getX(t);
|
||||
float y = (float) getY(t);
|
||||
float w = (float) getW(t);
|
||||
ControllerPoint point = new ControllerPoint();
|
||||
point.set(x, y, w);
|
||||
return point;
|
||||
}
|
||||
|
||||
/**
|
||||
* 三阶曲线的控制点
|
||||
*/
|
||||
private double getValue(double p0, double p1, double p2, double t) {
|
||||
double a = p2 - 2 * p1 + p0;
|
||||
double b = 2 * (p1 - p0);
|
||||
double c = p0;
|
||||
return a * t * t + b * t + c;
|
||||
}
|
||||
|
||||
private double getX(double t) {
|
||||
return getValue(mSource.x, mControl.x, mDestination.x, t);
|
||||
}
|
||||
|
||||
private double getY(double t) {
|
||||
return getValue(mSource.y, mControl.y, mDestination.y, t);
|
||||
}
|
||||
|
||||
private double getW(double t) {
|
||||
return getWidth(mSource.width, mDestination.width, t);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取两个数平均值
|
||||
*
|
||||
* @param x1 一个点的x
|
||||
* @param x2 一个点的x
|
||||
*/
|
||||
private float getMid(float x1, float x2) {
|
||||
return (float) ((x1 + x2) / 2.0);
|
||||
}
|
||||
|
||||
private double getWidth(double w0, double w1, double t) {
|
||||
return w0 + (w1 - w0) * t;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,475 @@
|
||||
package com.tenlionsoft.baselib.core.widget.handsign;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.os.Environment;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class BitmapUtil {
|
||||
|
||||
/**
|
||||
* 逐行扫描 清除边界空白
|
||||
*
|
||||
* @param blank 边距留多少个像素
|
||||
* @param color 背景色限定
|
||||
* @return 清除边界后的Bitmap
|
||||
*/
|
||||
public static Bitmap clearBlank(Bitmap mBitmap, int blank, int color) {
|
||||
if (mBitmap != null) {
|
||||
int height = mBitmap.getHeight();
|
||||
int width = mBitmap.getWidth();
|
||||
int top = 0, left = 0, right = 0, bottom = 0;
|
||||
int[] widthPixels = new int[width];
|
||||
boolean isStop;
|
||||
for (int y = 0; y < height; y++) {
|
||||
mBitmap.getPixels(widthPixels, 0, width, 0, y, width, 1);
|
||||
isStop = false;
|
||||
for (int pix : widthPixels) {
|
||||
if (pix != color) {
|
||||
|
||||
top = y;
|
||||
isStop = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isStop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int y = height - 1; y >= 0; y--) {
|
||||
mBitmap.getPixels(widthPixels, 0, width, 0, y, width, 1);
|
||||
isStop = false;
|
||||
for (int pix : widthPixels) {
|
||||
if (pix != color) {
|
||||
bottom = y;
|
||||
isStop = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isStop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
widthPixels = new int[height];
|
||||
for (int x = 0; x < width; x++) {
|
||||
mBitmap.getPixels(widthPixels, 0, 1, x, 0, 1, height);
|
||||
isStop = false;
|
||||
for (int pix : widthPixels) {
|
||||
if (pix != color) {
|
||||
left = x;
|
||||
isStop = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isStop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int x = width - 1; x > 0; x--) {
|
||||
mBitmap.getPixels(widthPixels, 0, 1, x, 0, 1, height);
|
||||
isStop = false;
|
||||
for (int pix : widthPixels) {
|
||||
if (pix != color) {
|
||||
right = x;
|
||||
isStop = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isStop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (blank < 0) {
|
||||
blank = 0;
|
||||
}
|
||||
left = left - blank > 0 ? left - blank : 0;
|
||||
top = top - blank > 0 ? top - blank : 0;
|
||||
right = right + blank > width - 1 ? width - 1 : right + blank;
|
||||
bottom = bottom + blank > height - 1 ? height - 1 : bottom + blank;
|
||||
return Bitmap.createBitmap(mBitmap, left, top, right - left, bottom - top);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除bitmap左右边界空白
|
||||
*
|
||||
* @param mBitmap 源图
|
||||
* @param blank 边距留多少个像素
|
||||
* @param color 背景色限定
|
||||
* @return 清除后的bitmap
|
||||
*/
|
||||
public static Bitmap clearLRBlank(Bitmap mBitmap, int blank, int color) {
|
||||
if (mBitmap != null) {
|
||||
int height = mBitmap.getHeight();
|
||||
int width = mBitmap.getWidth();
|
||||
int left = 0, right = 0;
|
||||
int[] pixs = new int[height];
|
||||
boolean isStop;
|
||||
for (int x = 0; x < width; x++) {
|
||||
mBitmap.getPixels(pixs, 0, 1, x, 0, 1, height);
|
||||
isStop = false;
|
||||
for (int pix : pixs) {
|
||||
if (pix != color) {
|
||||
left = x;
|
||||
isStop = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isStop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int x = width - 1; x > 0; x--) {
|
||||
mBitmap.getPixels(pixs, 0, 1, x, 0, 1, height);
|
||||
isStop = false;
|
||||
for (int pix : pixs) {
|
||||
if (pix != color) {
|
||||
right = x;
|
||||
isStop = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isStop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (blank < 0) {
|
||||
blank = 0;
|
||||
}
|
||||
left = left - blank > 0 ? left - blank : 0;
|
||||
right = right + blank > width - 1 ? width - 1 : right + blank;
|
||||
return Bitmap.createBitmap(mBitmap, left, 0, right - left, height);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 给Bitmap添加背景色
|
||||
*
|
||||
* @param srcBitmap 源图
|
||||
* @param color 背景颜色
|
||||
* @return 修改背景后的bitmap
|
||||
*/
|
||||
public static Bitmap drawBgToBitmap(Bitmap srcBitmap, int color) {
|
||||
Paint paint = new Paint();
|
||||
paint.setColor(color);
|
||||
|
||||
Paint paint_background = new Paint();
|
||||
paint_background.setColor(Color.TRANSPARENT);
|
||||
Bitmap bitmap = Bitmap.createBitmap(srcBitmap.getWidth(), srcBitmap.getHeight(), srcBitmap.getConfig());
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
canvas.drawRect(0, 0, srcBitmap.getWidth(), srcBitmap.getHeight(), paint_background);
|
||||
canvas.drawBitmap(srcBitmap, 0, 0, paint);
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存图像到本地
|
||||
*
|
||||
* @param paintView 画板
|
||||
* @param quality 压缩质量0-100
|
||||
* @param filePth 图片的路径 Environment.getExternalStorageDirectory()+ File.separator+"signImage"
|
||||
* @param name 图片名称
|
||||
* @return 保存后的图片地址
|
||||
*/
|
||||
public static String saveImage(Context context, PaintView paintView, int quality, String filePth, String name) {
|
||||
Bitmap bmp = paintView.buildAreaBitmap(true);
|
||||
// bmp = drawBgToBitmap(bmp, Color.WHITE);
|
||||
if (bmp == null) {
|
||||
return "图片保存失败";
|
||||
}
|
||||
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
// String appDir = context.getExternalCacheDir().getAbsolutePath();
|
||||
// String appDir = Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||
// File saveDir = new File(appDir, "signImage");
|
||||
File saveDir = new File(filePth);
|
||||
if (!saveDir.exists()) {
|
||||
saveDir.mkdirs();
|
||||
}
|
||||
|
||||
String fileName = name + ".png";
|
||||
// File file = new File(saveDir, fileName);
|
||||
File file = new File(saveDir+File.separator, fileName);
|
||||
fos = new FileOutputStream(file);
|
||||
bmp.compress(Bitmap.CompressFormat.PNG, quality, fos);
|
||||
fos.flush();
|
||||
return file.getAbsolutePath();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (fos != null) {
|
||||
try {
|
||||
fos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String saveImage(Context context, Bitmap bmp, int quality, String filePth, String name) {
|
||||
if (bmp == null) {
|
||||
return "图片保存失败";
|
||||
}
|
||||
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
File saveDir = new File(filePth);
|
||||
if (!saveDir.exists()) {
|
||||
saveDir.mkdirs();
|
||||
}
|
||||
|
||||
String fileName = name + ".png";
|
||||
File file = new File(saveDir+File.separator, fileName);
|
||||
fos = new FileOutputStream(file);
|
||||
bmp.compress(Bitmap.CompressFormat.PNG, quality, fos);
|
||||
fos.flush();
|
||||
return file.getAbsolutePath();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (fos != null) {
|
||||
try {
|
||||
fos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存图像到本地
|
||||
*
|
||||
* @param paintView 画板
|
||||
* @param quality 压缩质量0-100
|
||||
* @param name 图片名称
|
||||
* @return 保存后的图片地址
|
||||
*/
|
||||
public static String saveImage(Context context, PaintView paintView, int quality, String name) {
|
||||
Bitmap bmp = paintView.buildAreaBitmap(true);
|
||||
// bmp = drawBgToBitmap(bmp, Color.WHITE);
|
||||
if (bmp == null) {
|
||||
return "图片保存失败";
|
||||
}
|
||||
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
String appDir = context.getExternalCacheDir().getAbsolutePath();
|
||||
// String appDir = Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||
File saveDir = new File(appDir, "signImage");
|
||||
// File saveDir = new File(appDir+ File.separator+"signImage");
|
||||
if (!saveDir.exists()) {
|
||||
saveDir.mkdirs();
|
||||
}
|
||||
|
||||
String fileName = name + ".png";
|
||||
File file = new File(saveDir, fileName);
|
||||
// File file = new File(saveDir+File.separator, fileName);
|
||||
fos = new FileOutputStream(file);
|
||||
bmp.compress(Bitmap.CompressFormat.PNG, quality, fos);
|
||||
fos.flush();
|
||||
return file.getAbsolutePath();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (fos != null) {
|
||||
try {
|
||||
fos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据宽度缩放图片,高度等比例
|
||||
*
|
||||
* @param bm 源图
|
||||
* @param newWidth 新宽度
|
||||
* @return 缩放后的bitmap
|
||||
*/
|
||||
public static Bitmap zoomImg(Bitmap bm, int newWidth) {
|
||||
// 获得图片的宽高
|
||||
int width = bm.getWidth();
|
||||
int height = bm.getHeight();
|
||||
// 计算缩放比例
|
||||
float ratio = ((float) newWidth) / width;
|
||||
// 取得想要缩放的matrix参数
|
||||
Matrix matrix = new Matrix();
|
||||
matrix.postScale(ratio, ratio);
|
||||
// 得到新的图片
|
||||
return Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 缩放图片至指定宽高
|
||||
*
|
||||
* @param bm 源图
|
||||
* @param newWidth 新宽度
|
||||
* @param newHeight 新高度
|
||||
* @return 缩放后的bitmap
|
||||
*/
|
||||
public static Bitmap zoomImage(Bitmap bm, int newWidth, int newHeight) {
|
||||
// 获得图片的宽高
|
||||
int width = bm.getWidth();
|
||||
int height = bm.getHeight();
|
||||
// 计算缩放比例
|
||||
float scaleWidth = ((float) newWidth) / width;
|
||||
float scaleHeight = ((float) newHeight) / height;
|
||||
// 取得想要缩放的matrix参数
|
||||
Matrix matrix = new Matrix();
|
||||
matrix.postScale(scaleWidth, scaleHeight);
|
||||
// 得到新的图片
|
||||
return Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据宽高之中最大缩放比缩放图片
|
||||
*
|
||||
* @param bitmap 源图
|
||||
* @param newWidth 新宽度
|
||||
* @param newHeight 新高度
|
||||
* @return 缩放后的bitmap
|
||||
*/
|
||||
public static Bitmap zoomImg(Bitmap bitmap, int newWidth,
|
||||
int newHeight) {
|
||||
// 获取这个图片的宽和高
|
||||
int width = bitmap.getWidth();
|
||||
int height = bitmap.getHeight();
|
||||
// 创建操作图片用的matrix对象
|
||||
Matrix matrix = new Matrix();
|
||||
// 计算宽高缩放率
|
||||
float scaleWidth = ((float) newWidth) / width;
|
||||
float scaleHeight = ((float) newHeight) / height;
|
||||
float ratio = Math.max(scaleWidth, scaleHeight);
|
||||
// 缩放图片动作
|
||||
matrix.postScale(ratio, ratio);
|
||||
return Bitmap.createBitmap(bitmap, 0, 0, width,
|
||||
height, matrix, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 给图片右下角添加水印
|
||||
*
|
||||
* @param src 源图
|
||||
* @param watermark 水印图
|
||||
* @param bgColor 背景色
|
||||
* @param fixed 源图是否固定大小,固定则在源图上绘制印章,不固定则动态改变图片大小
|
||||
* @return 添加水印后的图片
|
||||
*/
|
||||
public static Bitmap addWaterMask(Bitmap src, Bitmap watermark, int bgColor, boolean fixed) {
|
||||
int w = src.getWidth();
|
||||
int h = src.getHeight();
|
||||
//获取原始水印图片的宽、高
|
||||
int w2 = watermark.getWidth();
|
||||
int h2 = watermark.getHeight();
|
||||
|
||||
//合理控制水印大小
|
||||
Matrix matrix1 = new Matrix();
|
||||
float ratio;
|
||||
|
||||
ratio = (float) w2 / w;
|
||||
if (ratio > 1.0f && ratio <= 2.0f) {
|
||||
ratio = 0.7f;
|
||||
} else if (ratio > 2.0f) {
|
||||
ratio = 0.5f;
|
||||
} else if (ratio <= 0.2f) {
|
||||
ratio = 2.0f;
|
||||
} else if (ratio < 0.3f) {
|
||||
ratio = 1.5f;
|
||||
} else if (ratio <= 0.4f) {
|
||||
ratio = 1.2f;
|
||||
} else if (ratio < 1.0f) {
|
||||
ratio = 1.0f;
|
||||
}
|
||||
matrix1.postScale(ratio, ratio);
|
||||
watermark = Bitmap.createBitmap(watermark, 0, 0, w2, h2, matrix1, true);
|
||||
|
||||
//获取新的水印图片的宽、高
|
||||
w2 = watermark.getWidth();
|
||||
h2 = watermark.getHeight();
|
||||
if (!fixed) {
|
||||
if (w < 1.5 * w2) {
|
||||
w = w + w2;
|
||||
}
|
||||
if (h < 2 * h2) {
|
||||
h = h + h2;
|
||||
}
|
||||
}
|
||||
// 创建一个新的和SRC长度宽度一样的位图
|
||||
Bitmap result = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_4444);
|
||||
Canvas cv = new Canvas(result);
|
||||
cv.drawColor(bgColor);
|
||||
//在canvas上绘制原图和新的水印图
|
||||
cv.drawBitmap(src, 0, 0, null);
|
||||
//水印图绘制在画布的右下角,距离右边和底部都为20
|
||||
cv.drawBitmap(watermark, w - w2 - 20, h - h2 - 20, null);
|
||||
cv.save();
|
||||
cv.restore();
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图片颜色
|
||||
*
|
||||
* @param inBitmap 源图
|
||||
* @param color 颜色
|
||||
* @return 修改颜色后的图片
|
||||
*/
|
||||
public static Bitmap changeBitmapColor(Bitmap inBitmap, int color) {
|
||||
if (inBitmap == null) {
|
||||
return null;
|
||||
}
|
||||
Bitmap outBitmap = Bitmap.createBitmap(inBitmap.getWidth(), inBitmap.getHeight(), inBitmap.getConfig());
|
||||
Canvas canvas = new Canvas(outBitmap);
|
||||
Paint paint = new Paint();
|
||||
paint.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN));
|
||||
canvas.drawBitmap(inBitmap, 0, 0, paint);
|
||||
return outBitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置ImageView的图片,支持改变图片颜色
|
||||
* @param iv
|
||||
* @param id
|
||||
* @param color
|
||||
*/
|
||||
public static void setImage(ImageView iv, int id, int color) {
|
||||
Bitmap bitmap = BitmapFactory.decodeResource(iv.getResources(), id);
|
||||
iv.setImageBitmap(BitmapUtil.changeBitmapColor(bitmap, color));
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.tenlionsoft.baselib.core.widget.handsign;
|
||||
|
||||
|
||||
public class ControllerPoint {
|
||||
|
||||
public float x;
|
||||
public float y;
|
||||
|
||||
public float width;
|
||||
public int alpha = 255;
|
||||
|
||||
public ControllerPoint() {
|
||||
}
|
||||
|
||||
public ControllerPoint(float x, float y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
|
||||
public void set(float x, float y, float w) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = w;
|
||||
}
|
||||
|
||||
|
||||
public void set(ControllerPoint point) {
|
||||
this.x = point.x;
|
||||
this.y = point.y;
|
||||
this.width = point.width;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.tenlionsoft.baselib.core.widget.handsign;
|
||||
|
||||
|
||||
public class MotionElement {
|
||||
|
||||
public float x;
|
||||
public float y;
|
||||
/**
|
||||
* 压力值 物理设备决定的,和设计的设备有关系
|
||||
*/
|
||||
public float pressure;
|
||||
/**
|
||||
* 绘制的工具是否是手指或者是笔(触摸笔)
|
||||
*/
|
||||
public int toolType;
|
||||
|
||||
public MotionElement(float mx, float my, float mp, int ttype) {
|
||||
x = mx;
|
||||
y = my;
|
||||
pressure = mp;
|
||||
toolType = ttype;
|
||||
}
|
||||
}
|
@ -0,0 +1,218 @@
|
||||
package com.tenlionsoft.baselib.core.widget.handsign;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
public class PaintView extends View {
|
||||
private Paint mPaint;
|
||||
private Canvas mCanvas;
|
||||
private Bitmap mBitmap;
|
||||
private int strokeWidth = 10;
|
||||
private BasePen mStokeBrushPen;
|
||||
|
||||
/**
|
||||
* 是否允许写字
|
||||
*/
|
||||
private boolean isFingerEnable = true;
|
||||
|
||||
|
||||
/**
|
||||
* 画笔轨迹记录
|
||||
*/
|
||||
private StepOperator mStepOperation;
|
||||
|
||||
//是否正在绘制
|
||||
private boolean isDrawing = false;
|
||||
|
||||
//记录手写笔类型:触控笔/手指
|
||||
private int toolType = 0;
|
||||
|
||||
|
||||
public PaintView(Context context) {
|
||||
this(context, null);
|
||||
init();
|
||||
}
|
||||
|
||||
public PaintView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
init();
|
||||
}
|
||||
|
||||
public PaintView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
public void init() {
|
||||
mStokeBrushPen = new SteelPen();
|
||||
initPaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
mBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
|
||||
mStepOperation = new StepOperator();
|
||||
mStepOperation.addBitmap(mBitmap);
|
||||
initCanvas();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始画笔设置
|
||||
*/
|
||||
private void initPaint() {
|
||||
mPaint = new Paint();
|
||||
mPaint.setColor(Color.parseColor("#101010"));
|
||||
mPaint.setStrokeWidth(strokeWidth);
|
||||
mPaint.setStyle(Paint.Style.STROKE);
|
||||
mPaint.setAlpha(0xFF);
|
||||
mPaint.setAntiAlias(true);
|
||||
mPaint.setStrokeMiter(1.0f);
|
||||
mStokeBrushPen.setPaint(mPaint);
|
||||
}
|
||||
|
||||
private void initCanvas() {
|
||||
mCanvas = new Canvas(mBitmap);
|
||||
//设置画布的背景色为透明
|
||||
mCanvas.drawColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
canvas.drawBitmap(mBitmap, 0, 0, mPaint);
|
||||
mStokeBrushPen.draw(canvas);
|
||||
super.onDraw(canvas);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
//通过压感值来设置画笔的粗细
|
||||
setPaintPressure(event.getPressure());
|
||||
//获取触摸的工具
|
||||
toolType = event.getToolType(event.getActionIndex());
|
||||
// FINGER手指 STYLUS手写笔 MOUSE鼠标
|
||||
if (!isFingerEnable && toolType != MotionEvent.TOOL_TYPE_STYLUS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//画笔的手势监听
|
||||
mStokeBrushPen.onTouchEvent(event, mCanvas);
|
||||
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
isDrawing = false;
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
isDrawing = true;
|
||||
break;
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
isDrawing = false;
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
if (mStepOperation != null && isDrawing) {
|
||||
mStepOperation.addBitmap(mBitmap);
|
||||
}
|
||||
isDrawing = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建Bitmap,用来保存绘制的图
|
||||
* @isCrop 是否清除边界空白
|
||||
* @return 所绘制的bitmap
|
||||
*/
|
||||
public Bitmap buildAreaBitmap(boolean isCrop) {
|
||||
Bitmap result;
|
||||
if (isCrop) {
|
||||
result = BitmapUtil.clearBlank(mBitmap, 20, Color.TRANSPARENT);
|
||||
} else {
|
||||
result = mBitmap;
|
||||
}
|
||||
destroyDrawingCache();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置压力传感值
|
||||
* @param pressure
|
||||
*/
|
||||
private void setPaintPressure(float pressure) {
|
||||
if (mPaint != null) {
|
||||
mPaint.setStrokeWidth(strokeWidth*pressure);
|
||||
mStokeBrushPen.setPaint(mPaint);
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置画笔大小
|
||||
* @param width 大小
|
||||
*/
|
||||
public void setPaintWidth(int width) {
|
||||
if (mPaint != null) {
|
||||
strokeWidth = width;
|
||||
mPaint.setStrokeWidth(width);
|
||||
mStokeBrushPen.setPaint(mPaint);
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置画笔颜色
|
||||
* @param color 颜色
|
||||
*/
|
||||
public void setPaintColor(int color) {
|
||||
if (mPaint != null) {
|
||||
mPaint.setColor(color);
|
||||
mStokeBrushPen.setPaint(mPaint);
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 清除画布,记得清除点的集合
|
||||
*/
|
||||
public void reset() {
|
||||
mBitmap.eraseColor(Color.TRANSPARENT);
|
||||
mStokeBrushPen.clear();
|
||||
if (mStepOperation != null) {
|
||||
mStepOperation.reset();
|
||||
mStepOperation.addBitmap(mBitmap);
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 释放
|
||||
*/
|
||||
public void release() {
|
||||
destroyDrawingCache();
|
||||
if (mBitmap != null) {
|
||||
mBitmap.recycle();
|
||||
mBitmap = null;
|
||||
}
|
||||
if (mStepOperation != null) {
|
||||
mStepOperation.freeBitmaps();
|
||||
mStepOperation = null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.tenlionsoft.baselib.core.widget.handsign;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
|
||||
public class SteelPen extends BasePen {
|
||||
|
||||
@Override
|
||||
protected void doPreDraw(Canvas canvas) {
|
||||
for (int i = 1; i < mHWPointList.size(); i++) {
|
||||
ControllerPoint point = mHWPointList.get(i);
|
||||
drawToPoint(canvas, point, mPaint);
|
||||
mCurPoint = point;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doMove(double curDis) {
|
||||
int steps = 1 + (int) curDis / STEP_FACTOR;
|
||||
double step = 1.0 / steps;
|
||||
for (double t = 0; t < 1.0; t += step) {
|
||||
ControllerPoint point = mBezier.getPoint(t);
|
||||
mHWPointList.add(point);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doDraw(Canvas canvas, ControllerPoint point, Paint paint) {
|
||||
drawLine(canvas, mCurPoint.x, mCurPoint.y, mCurPoint.width, point.x,
|
||||
point.y, point.width, paint);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制方法,实现笔锋效果
|
||||
*/
|
||||
private void drawLine(Canvas canvas, double x0, double y0, double w0, double x1, double y1, double w1, Paint paint) {
|
||||
//求两个数字的平方根 x的平方+y的平方在开方记得X的平方+y的平方=1,这就是一个园
|
||||
double curDis = Math.hypot(x0 - x1, y0 - y1);
|
||||
int steps;
|
||||
//绘制的笔的宽度是多少,绘制多少个椭圆
|
||||
if (paint.getStrokeWidth() < 6) {
|
||||
steps = 1 + (int) (curDis / 2);
|
||||
} else if (paint.getStrokeWidth() > 60) {
|
||||
steps = 1 + (int) (curDis / 4);
|
||||
} else {
|
||||
steps = 1 + (int) (curDis / 3);
|
||||
}
|
||||
double deltaX = (x1 - x0) / steps;
|
||||
double deltaY = (y1 - y0) / steps;
|
||||
double deltaW = (w1 - w0) / steps;
|
||||
double x = x0;
|
||||
double y = y0;
|
||||
double w = w0;
|
||||
|
||||
for (int i = 0; i < steps; i++) {
|
||||
RectF oval = new RectF();
|
||||
float top = (float) (y - w / 2.0f);
|
||||
float left = (float) (x - w / 4.0f);
|
||||
float right = (float) (x + w / 4.0f);
|
||||
float bottom = (float) (y + w / 2.0f);
|
||||
oval.set(left, top, right, bottom);
|
||||
//最基本的实现,通过点控制线,绘制椭圆
|
||||
canvas.drawOval(oval, paint);
|
||||
x += deltaX;
|
||||
y += deltaY;
|
||||
w += deltaW;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
package com.tenlionsoft.baselib.core.widget.handsign;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StepOperator {
|
||||
|
||||
/**
|
||||
* 缓存步骤数
|
||||
*/
|
||||
private static final int CAPACITY = 12;
|
||||
/**
|
||||
* 保存每一步绘制的bitmap
|
||||
*/
|
||||
private List<Bitmap> mBitmaps = null;
|
||||
|
||||
/**
|
||||
* 允许缓存Bitmap的最大宽度限制,过大容易内存溢出
|
||||
*/
|
||||
public static int MAX_CACHE_BITMAP_WIDTH = 1024;
|
||||
/**
|
||||
* 当前位置
|
||||
*/
|
||||
private int currentIndex;
|
||||
|
||||
private boolean isUndo = false;
|
||||
|
||||
/**
|
||||
* 最大缓存内存大小
|
||||
*/
|
||||
private int cacheMemory;
|
||||
|
||||
public StepOperator() {
|
||||
if (mBitmaps == null) {
|
||||
mBitmaps = new ArrayList<>();
|
||||
}
|
||||
currentIndex = -1;
|
||||
int maxMemory = (int) Runtime.getRuntime().maxMemory();
|
||||
cacheMemory = maxMemory / 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
public void reset() {
|
||||
if (mBitmaps != null) {
|
||||
for (Bitmap bitmap : mBitmaps) {
|
||||
bitmap.recycle();
|
||||
}
|
||||
mBitmaps.clear();
|
||||
}
|
||||
currentIndex = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内存是否足够
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isMemoryEnable() {
|
||||
int bitmapCache = 0;
|
||||
for (Bitmap bitmap : mBitmaps) {
|
||||
bitmapCache += bitmap.getRowBytes() * bitmap.getHeight();
|
||||
}
|
||||
if (bitmapCache > cacheMemory) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存绘制的Bitmap
|
||||
*
|
||||
* @param bitmap
|
||||
*/
|
||||
public void addBitmap(Bitmap bitmap) {
|
||||
if (mBitmaps == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (!isMemoryEnable() && mBitmaps.size() > 1) {
|
||||
mBitmaps.get(1).recycle();
|
||||
//删除第一笔(0的位置有空的占位图)
|
||||
mBitmaps.remove(1);
|
||||
}
|
||||
if (currentIndex != -1 && isUndo) {
|
||||
for (int i = currentIndex + 1; i < mBitmaps.size(); i++) {
|
||||
mBitmaps.get(i).recycle();
|
||||
}
|
||||
mBitmaps = mBitmaps.subList(0, currentIndex + 1);
|
||||
isUndo = false;
|
||||
}
|
||||
|
||||
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), null, true);
|
||||
mBitmaps.add(bitmap);
|
||||
currentIndex = mBitmaps.size() - 1;
|
||||
|
||||
if (mBitmaps.size() > CAPACITY) {
|
||||
mBitmaps.get(1).recycle();
|
||||
//删除第一笔(0的位置有空的占位图)
|
||||
mBitmaps.remove(1);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (OutOfMemoryError e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 清空
|
||||
*/
|
||||
public void freeBitmaps() {
|
||||
if (mBitmaps == null) {
|
||||
return;
|
||||
}
|
||||
for (Bitmap bitmap : mBitmaps) {
|
||||
bitmap.recycle();
|
||||
}
|
||||
mBitmaps.clear();
|
||||
mBitmaps = null;
|
||||
currentIndex = -1;
|
||||
}
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
package com.tenlionsoft.baselib.core.widget.views;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tenlionsoft.baselib.R;
|
||||
import com.tenlionsoft.baselib.core.widget.handsign.BitmapUtil;
|
||||
import com.tenlionsoft.baselib.core.widget.handsign.PaintView;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/4/25 - 15:31
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 手写输入框
|
||||
*/
|
||||
public class CustomHandWritingDialog extends Dialog {
|
||||
private Context mContext;
|
||||
private View view;
|
||||
private ImageView mIvClear;
|
||||
private ImageView mIvUndo;
|
||||
private ImageView mIvRedo;
|
||||
private ImageView mIvPen;
|
||||
private int mPenColor = Color.BLACK;
|
||||
private int mPenWidth = 5;
|
||||
private PaintView mPaintView;
|
||||
|
||||
public CustomHandWritingDialog(@NonNull Context context) {
|
||||
super(context, R.style.dialog_center_alpha);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
view = LayoutInflater.from(mContext).inflate(R.layout.dialog_custom_hand_writing, null);
|
||||
setContentView(view);
|
||||
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
mIvClear = view.findViewById(R.id.iv_clear);
|
||||
mIvUndo = view.findViewById(R.id.iv_undo);
|
||||
mIvRedo = view.findViewById(R.id.iv_redo);
|
||||
mIvPen = view.findViewById(R.id.iv_pen);
|
||||
mPaintView = view.findViewById(R.id.pv_content);
|
||||
mPaintView.setPaintColor(mPenColor);
|
||||
mPaintView.setPaintWidth(mPenWidth);
|
||||
mIvClear.setOnClickListener(v -> {
|
||||
mPaintView.reset();
|
||||
});
|
||||
// mIvUndo.setOnClickListener(v -> mInkView.undo());
|
||||
// mIvRedo.setOnClickListener(v -> mInkView.redo());
|
||||
mIvPen.setOnClickListener(v -> showPenPickerView());
|
||||
view.findViewById(R.id.tv_cancel).setOnClickListener(v -> this.dismiss());
|
||||
view.findViewById(R.id.tv_confirm).setOnClickListener(v -> doConfirm());
|
||||
DisplayMetrics displayMetrics = mContext.getResources().getDisplayMetrics();
|
||||
Window window = this.getWindow();
|
||||
window.setGravity(Gravity.CENTER);
|
||||
window.setWindowAnimations(R.style.dialog_center_alpha);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = (int) (displayMetrics.widthPixels * 0.9);
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setAttributes(params);
|
||||
window.setBackgroundDrawable(new ColorDrawable());
|
||||
}
|
||||
|
||||
/**
|
||||
* .
|
||||
*
|
||||
* @method
|
||||
* @description 换笔换色设置界面
|
||||
* @date: 2019/9/27 19:19
|
||||
* @author: yan
|
||||
*/
|
||||
private void showPenPickerView() {
|
||||
// final PenPickerView panel = new PenPickerView(mContext, mContext.getPackageName());
|
||||
// panel.onAdded(null, (context, pen) -> {
|
||||
//// mInkView.setStrokeColor(pen.getPenColor());
|
||||
//// mInkView.setStrokeWidth(pen.getPenWidth());
|
||||
// });
|
||||
// panel.show(mContext, null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void exportBitmap(String fileName) {
|
||||
try {
|
||||
Bitmap bitmap = BitmapUtil.zoomImage(mPaintView.buildAreaBitmap(true), 200, 100);
|
||||
String filePth = Environment.getExternalStorageDirectory() + File.separator + "signImage";
|
||||
|
||||
String path = BitmapUtil.saveImage(mContext, bitmap, 100, filePth, "sign");
|
||||
if (mSuccessListener != null) {
|
||||
if ("图片保存失败".equals(path)) {
|
||||
mSuccessListener.onError("图片保存失败");
|
||||
} else {
|
||||
mSuccessListener.onSuccess(filePth);
|
||||
}
|
||||
} else {
|
||||
this.dismiss();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ToastUtils.show("签名生成失败");
|
||||
}
|
||||
}
|
||||
|
||||
private OnSaveSuccessListener mSuccessListener;
|
||||
|
||||
public void addListener(OnSaveSuccessListener listener) {
|
||||
this.mSuccessListener = listener;
|
||||
}
|
||||
|
||||
public interface OnSaveSuccessListener {
|
||||
void onSuccess(String path);
|
||||
|
||||
void onError(String err);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存签名
|
||||
*/
|
||||
private void doConfirm() {
|
||||
|
||||
exportBitmap("sign.png");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.tenlionsoft.baselib.core.widget.views;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.tenlionsoft.baselib.R;
|
||||
import com.tenlionsoft.baselib.core.widget.handsign.PaintView;
|
||||
|
||||
/**
|
||||
* 画笔大小
|
||||
*/
|
||||
public class PaintSizeView extends Dialog {
|
||||
private Context mContext;
|
||||
private View view;
|
||||
private ImageView mIvClear;
|
||||
private ImageView mIvUndo;
|
||||
private ImageView mIvRedo;
|
||||
private ImageView mIvPen;
|
||||
private int mPenColor = Color.BLACK;
|
||||
private int mPenWidth = 5;
|
||||
private PaintView mPaintView;
|
||||
|
||||
public PaintSizeView(@NonNull Context context) {
|
||||
super(context, R.style.dialog_center_alpha);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
view = LayoutInflater.from(mContext).inflate(R.layout.dialog_custom_hand_writing, null);
|
||||
setContentView(view);
|
||||
|
||||
setCancelable(false);
|
||||
setCanceledOnTouchOutside(false);
|
||||
DisplayMetrics displayMetrics = mContext.getResources().getDisplayMetrics();
|
||||
Window window = this.getWindow();
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
window.setWindowAnimations(R.style.dialog_center_alpha);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = (int) (displayMetrics.widthPixels * 0.9);
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
window.setAttributes(params);
|
||||
window.setBackgroundDrawable(new ColorDrawable());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="300"
|
||||
android:interpolator="@android:anim/decelerate_interpolator">
|
||||
<translate
|
||||
android:duration="300"
|
||||
android:fromXDelta="-100%p"
|
||||
android:toXDelta="0%p" />
|
||||
<alpha
|
||||
android:duration="300"
|
||||
android:fromAlpha="0.5"
|
||||
android:toAlpha="1.0" />
|
||||
</set>
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="300"
|
||||
android:interpolator="@android:anim/decelerate_interpolator">
|
||||
<translate
|
||||
android:duration="300"
|
||||
android:fromXDelta="0%p"
|
||||
android:toXDelta="-100%p" />
|
||||
<alpha
|
||||
android:duration="300"
|
||||
android:fromAlpha="1.0"
|
||||
android:toAlpha="0.5" />
|
||||
</set>
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="300"
|
||||
android:interpolator="@android:anim/decelerate_interpolator">
|
||||
<translate
|
||||
android:fromXDelta="100%p"
|
||||
android:duration="300"
|
||||
android:toXDelta="0%p" />
|
||||
<alpha
|
||||
android:fromAlpha="0.5"
|
||||
android:duration="300"
|
||||
android:toAlpha="1.0" />
|
||||
</set>
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="300"
|
||||
android:interpolator="@android:anim/decelerate_interpolator">
|
||||
<translate
|
||||
android:duration="300"
|
||||
android:fromXDelta="0%p"
|
||||
android:toXDelta="100%p" />
|
||||
<alpha
|
||||
android:duration="300"
|
||||
android:fromAlpha="1.0"
|
||||
android:toAlpha="0.5" />
|
||||
</set>
|
117
baselib/src/main/res/layout/dialog_custom_hand_writing.xml
Normal file
117
baselib/src/main/res/layout/dialog_custom_hand_writing.xml
Normal file
@ -0,0 +1,117 @@
|
||||
<?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_margin="20dp"
|
||||
android:background="@drawable/shp_rectangle_white_5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="10dp"
|
||||
android:text="请在下方区域内书写内容"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_16"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center|right"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_pen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_pen_icon"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_clear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:src="@drawable/ic_clear_icon" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_undo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:src="@drawable/ic_undo_icon"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_redo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:src="@drawable/ic_redo_icon"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/shape_rectangle_gray_rim_dash"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.handsign.PaintView
|
||||
android:id="@+id/pv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="280dp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:padding="15dp"
|
||||
android:text="取消"
|
||||
android:textColor="@color/gray_text"
|
||||
android:textSize="@dimen/text_18" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@color/gray_text" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_confirm"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:padding="15dp"
|
||||
android:text="确定"
|
||||
android:textColor="@color/text_blue"
|
||||
android:textSize="@dimen/text_18" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -11,73 +11,61 @@
|
||||
<activity
|
||||
android:name=".activity.document.DocumentTypeAddActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.document.DocumentTypeActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.addresslist.AddressUserDetailActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.addresslist.AddressListActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.OaFlowCenterActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.OaFlowApproveActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.common.WebDemoActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.ApplyOaFlowActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.MineUnreadActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.MineReadActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.MineTodoActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.MineDoneActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
@ -94,7 +82,6 @@
|
||||
<activity
|
||||
android:name=".activity.news.NewsCenterActivity"
|
||||
android:configChanges="keyboardHidden|screenSize|orientation"
|
||||
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
|
@ -172,10 +172,10 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
private List<OaFlowFormBean.FieldsBean> mFieldsList = new ArrayList<>();
|
||||
private List<DicBean> mTempDicList;//字典选择
|
||||
private OptionsPickerView<DicBean> mPicker;
|
||||
private String webViewCallBack = "";
|
||||
private int mUploadCount = 0;
|
||||
private int mCurrentSigned = 0;//当前会签框
|
||||
private List<OperateBean> mControls;
|
||||
private String webViewCallBack = "";
|
||||
private String[] fileFilter = new String[]{
|
||||
".doc",
|
||||
".docx",
|
||||
|
@ -341,12 +341,13 @@ public class UserRecordEditActivity extends BaseActivity {
|
||||
//证件照
|
||||
if (!TextUtils.isEmpty(b.getPhoto())) {
|
||||
doGetFileInfos(b.getPhoto(), null, 2);
|
||||
} else {
|
||||
if (mImgList != null && mImgList.size() > 0) {
|
||||
mImgList.clear();
|
||||
mImgAdapter.setData(mImgList);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// if (mImgList != null && mImgList.size() > 0) {
|
||||
// mImgList.clear();
|
||||
// mImgAdapter.setData(mImgList);
|
||||
// }
|
||||
// }
|
||||
//简历附件
|
||||
if (!TextUtils.isEmpty(b.getResume())) {
|
||||
|
||||
|
@ -5,6 +5,8 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.beans.ChoosePersonListBean;
|
||||
@ -15,8 +17,6 @@ import com.tenlionsoft.oamodule.holder.PersonSelHolder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/11/24 - 9:16 AM
|
||||
@ -55,6 +55,9 @@ public class ChooseDeptUserAdapter extends BaseRecyclerAdapter<Object, RecyclerV
|
||||
personHolder.mTvName.setText(bean.getUserName());
|
||||
personHolder.mCbSel.setOnCheckedChangeListener(null);
|
||||
personHolder.mCbSel.setChecked(bean.isCheck());
|
||||
personHolder.mTvName.setOnClickListener(v -> {
|
||||
mLis.onItemCheckChange(bean, !bean.isCheck(), i);
|
||||
});
|
||||
personHolder.mCbSel.setOnCheckedChangeListener((buttonView, isChecked) -> mLis.onItemCheckChange(bean, isChecked, i));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.tenlionsoft.oamodule.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.beans.MineDoneBean;
|
||||
import com.tenlionsoft.oamodule.beans.MineTodoBean;
|
||||
import com.tenlionsoft.oamodule.holder.MineTodoHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/5/17 - 10:04
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 适配横竖屏切换
|
||||
*/
|
||||
public class MineTodoScreenAdapter extends BaseRecyclerAdapter<Object, MineTodoHolder> {
|
||||
private int mScreen = 1;// 2横 1竖
|
||||
|
||||
public MineTodoScreenAdapter(Context ctx, List<Object> list, int type) {
|
||||
super(ctx, list);
|
||||
this.mScreen = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MineTodoHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView;
|
||||
if (mScreen == 1) {
|
||||
itemView = LayoutInflater.from(mContext).inflate(R.layout.item_todo, parent, false);
|
||||
} else {
|
||||
itemView = LayoutInflater.from(mContext).inflate(R.layout.item_todo_p, parent, false);
|
||||
}
|
||||
return new MineTodoHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(MineTodoHolder h, int i) {
|
||||
Object o = mData.get(i);
|
||||
if (o instanceof MineTodoBean.RowsBean) {
|
||||
MineTodoBean.RowsBean b = (MineTodoBean.RowsBean) o;
|
||||
h.mTvTime.setText(b.getProcessStartTime());
|
||||
h.mTvTitle.setText(b.getMainTitle());
|
||||
h.mTvTitle.setTextColor(Color.BLACK);
|
||||
h.mTvName.setText(b.getTaskName());
|
||||
h.mTvState.setVisibility(View.VISIBLE);
|
||||
} else if (o instanceof MineDoneBean.RowsBean) {
|
||||
MineDoneBean.RowsBean b = (MineDoneBean.RowsBean) o;
|
||||
h.mTvTitle.setTextColor(Color.BLACK);
|
||||
h.mTvTime.setText(b.getProcessStartTime());
|
||||
h.mTvTitle.setText(b.getMainTitle());
|
||||
h.mTvName.setText(b.getTaskName());
|
||||
h.mTvState.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
package com.tenlionsoft.oamodule.fragments;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
import static com.tenlionsoft.baselib.core.widget.PhotoActivity.TAG_IMGURL;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@ -8,6 +11,12 @@ import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
@ -23,6 +32,7 @@ import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
@ -33,20 +43,12 @@ import com.tenlionsoft.oamodule.net.OAApi;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
import static com.tenlionsoft.baselib.core.widget.PhotoActivity.TAG_IMGURL;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/7/1 - 17:11
|
||||
@ -131,6 +133,7 @@ public class UserRecordBaseFragment extends BaseFragment {
|
||||
private ActivityResultLauncher<Intent> mLauncher = registerForActivityResult(
|
||||
new ActivityResultContracts.StartActivityForResult(),
|
||||
result -> {
|
||||
LogUtils.e("编辑返回" + result.getResultCode());
|
||||
if (result.getResultCode() == RESULT_OK) {
|
||||
setStateView(STATE_LOAD);
|
||||
getUserRecordDetail();
|
||||
|
@ -9,6 +9,9 @@ import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
@ -32,6 +35,7 @@ import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
||||
import com.tenlionsoft.baselib.utils.KeyBoardListener;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
@ -41,8 +45,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
@ -372,7 +374,15 @@ public class PadMainActivity extends BaseActivity {
|
||||
R.anim.slide_left_out,
|
||||
R.anim.slide_left_in,
|
||||
R.anim.slide_right_out);
|
||||
//
|
||||
// fragmentTransaction.hide(mPreFragment)
|
||||
// .setCustomAnimations(
|
||||
// R.anim.slide_left_in,//进入
|
||||
// R.anim.slide_right_out,//退出
|
||||
// R.anim.slide_right_in,//上一个进入
|
||||
// R.anim.slide_left_in);//上一个退出
|
||||
}
|
||||
LogUtils.e("fragment是否添加===" + fragment.isAdded());
|
||||
if (fragment.isAdded()) {
|
||||
fragmentTransaction.setCustomAnimations(
|
||||
R.anim.slide_right_in,
|
||||
@ -381,6 +391,7 @@ public class PadMainActivity extends BaseActivity {
|
||||
R.anim.slide_right_out)
|
||||
.show(fragment)
|
||||
.commit();
|
||||
|
||||
} else {
|
||||
fragmentTransaction
|
||||
.setCustomAnimations(
|
||||
@ -486,6 +497,7 @@ public class PadMainActivity extends BaseActivity {
|
||||
* @param fragment
|
||||
*/
|
||||
public void backFragment(int source, BaseFragment fragment) {
|
||||
hideSoftKeyboard();
|
||||
if (fragment != null) {
|
||||
List<BaseFragment> list = mFragments.get(mCurrentItem);
|
||||
list.remove(fragment);
|
||||
|
@ -2,6 +2,7 @@ package com.tenlionsoft.oamodule.pad.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@ -23,23 +24,23 @@ import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FunctionTitleNumAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ItemSplitDivider;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.TimeUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.adapter.MeetingTimeAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.MineTodoScreenAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.NewsAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.NoticeShowAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.ScheduleTimeLineAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.SuperviseHomeAdapter;
|
||||
import com.tenlionsoft.oamodule.beans.MineJoinMeetingListBean;
|
||||
import com.tenlionsoft.oamodule.beans.MineTodoBean;
|
||||
import com.tenlionsoft.oamodule.beans.NewsDetailBean;
|
||||
import com.tenlionsoft.oamodule.beans.NewsListBean;
|
||||
import com.tenlionsoft.oamodule.beans.NoticeListBean;
|
||||
import com.tenlionsoft.oamodule.beans.ScheduleDetailBean;
|
||||
import com.tenlionsoft.oamodule.beans.SuperviseBean;
|
||||
import com.tenlionsoft.oamodule.beans.SuperviseListBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
import com.tenlionsoft.oamodule.pad.activitys.home.PadMainActivity;
|
||||
|
||||
@ -47,7 +48,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -114,8 +117,8 @@ public class PadOaMainFragment extends BaseFragment {
|
||||
private List<NoticeListBean.RowsBean> mNoticeListBeanRows;
|
||||
private List<MineJoinMeetingListBean.RowsBean> mMeetingDatas;
|
||||
private MeetingTimeAdapter mMeetingTimeAdapter;
|
||||
private List<SuperviseBean> mSuperviseBeans;
|
||||
private SuperviseHomeAdapter mSuperviseHomeAdapter;
|
||||
private List<Object> mSuperviseBeans;
|
||||
private MineTodoScreenAdapter mSuperviseHomeAdapter;
|
||||
private List<NewsDetailBean> mNewsDatas;
|
||||
private NewsAdapter mNewsAdapter;
|
||||
private PadMainActivity mPadMainActivity;
|
||||
@ -168,19 +171,12 @@ public class PadOaMainFragment extends BaseFragment {
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
|
||||
//我的督办
|
||||
mSuperviseBeans = new ArrayList<>();
|
||||
mSuperviseHomeAdapter = new SuperviseHomeAdapter(mActivity, mSuperviseBeans);
|
||||
mRlvSupervise.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvSupervise.setAdapter(mSuperviseHomeAdapter);
|
||||
mSuperviseHomeAdapter.addOnItemClickListener(superviseBean -> {
|
||||
BaseFragment fragment =
|
||||
FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_SUPERVISE_DETAIL, "id",
|
||||
superviseBean.getOverseeId());
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
//我的待办
|
||||
|
||||
mRlvSupervise.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#F9F9F9")));
|
||||
|
||||
mTvSuperviseMore.setOnClickListener(v -> {
|
||||
BaseFragment fragment = FragmentUtils.getFragment(PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_SUPERVISE);
|
||||
BaseFragment fragment = FragmentUtils.getFragment(PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_MINE_TODO);
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
//新闻
|
||||
@ -240,11 +236,29 @@ public class PadOaMainFragment extends BaseFragment {
|
||||
//竖屏
|
||||
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 6, 140);
|
||||
mMeetingTimeAdapter = new MeetingTimeAdapter(mActivity, mMeetingDatas, 2);
|
||||
mSuperviseHomeAdapter = new MineTodoScreenAdapter(mActivity, mSuperviseBeans, 2);
|
||||
} else {
|
||||
//横屏
|
||||
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 11, 20);
|
||||
mMeetingTimeAdapter = new MeetingTimeAdapter(mActivity, mMeetingDatas, 1);
|
||||
mSuperviseHomeAdapter = new MineTodoScreenAdapter(mActivity, mSuperviseBeans, 1);
|
||||
}
|
||||
//待办
|
||||
mRlvSupervise.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvSupervise.setAdapter(mSuperviseHomeAdapter);
|
||||
mSuperviseHomeAdapter.addOnItemClickListener(superviseBean -> {
|
||||
MineTodoBean.RowsBean b = (MineTodoBean.RowsBean) superviseBean;
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("title", b.getMainTitle());
|
||||
params.put("bean", b);
|
||||
BaseFragment fragment = FragmentUtils.getFragmentMap(PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY, params);
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
// BaseFragment fragment =
|
||||
// FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_SUPERVISE_DETAIL, "id",
|
||||
// superviseBean.getOverseeId());
|
||||
// mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
//会议
|
||||
mMeetingTimeAdapter.setData(mMeetingDatas);
|
||||
mRlvMeeting.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvMeeting.setAdapter(mMeetingTimeAdapter);
|
||||
@ -258,6 +272,7 @@ public class PadOaMainFragment extends BaseFragment {
|
||||
BaseFragment fragment = FragmentUtils.getFragment(PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_MEETING);
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
//功能按钮
|
||||
mFunctionAdapter.setData(mFuncBeans);
|
||||
}
|
||||
|
||||
@ -269,6 +284,8 @@ public class PadOaMainFragment extends BaseFragment {
|
||||
mMeetingDatas = new ArrayList<>();
|
||||
//常用功能
|
||||
mFuncBeans = new ArrayList<>();
|
||||
//我的待办
|
||||
mSuperviseBeans = new ArrayList<>();
|
||||
FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager(mActivity, FlexDirection.ROW,
|
||||
FlexWrap.WRAP);
|
||||
//判断横竖屏
|
||||
@ -278,11 +295,24 @@ public class PadOaMainFragment extends BaseFragment {
|
||||
//竖屏
|
||||
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 6, 140);
|
||||
mMeetingTimeAdapter = new MeetingTimeAdapter(mActivity, mMeetingDatas, 2);
|
||||
mSuperviseHomeAdapter = new MineTodoScreenAdapter(mActivity, mSuperviseBeans, 2);
|
||||
} else {
|
||||
//横屏
|
||||
mFunctionAdapter = new FunctionTitleNumAdapter(mActivity, mFuncBeans, 11, 20);
|
||||
mMeetingTimeAdapter = new MeetingTimeAdapter(mActivity, mMeetingDatas, 1);
|
||||
mSuperviseHomeAdapter = new MineTodoScreenAdapter(mActivity, mSuperviseBeans, 1);
|
||||
}
|
||||
//我的待办
|
||||
mRlvSupervise.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvSupervise.setAdapter(mSuperviseHomeAdapter);
|
||||
mSuperviseHomeAdapter.addOnItemClickListener(superviseBean -> {
|
||||
MineTodoBean.RowsBean b = (MineTodoBean.RowsBean) superviseBean;
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("title", b.getMainTitle());
|
||||
params.put("bean", b);
|
||||
BaseFragment fragment = FragmentUtils.getFragmentMap(PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY, params);
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
//功能按钮
|
||||
mRlvFuncs.setLayoutManager(flexboxLayoutManager);
|
||||
mRlvFuncs.setAdapter(mFunctionAdapter);
|
||||
@ -376,18 +406,18 @@ public class PadOaMainFragment extends BaseFragment {
|
||||
private void getSuperviseList() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getMineApplySuperviseList("", "", "", "1")
|
||||
.getMineTodoList("", "", "", "1")
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<SuperviseListBean>() {
|
||||
.subscribe(new Observer<MineTodoBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull SuperviseListBean listBean) {
|
||||
public void onNext(@NonNull MineTodoBean listBean) {
|
||||
if (listBean.getRows() != null && listBean.getRows().size() > 0) {
|
||||
mSuperviseBeans = listBean.getRows();
|
||||
mSuperviseBeans.addAll(listBean.getRows());
|
||||
mCsvSupervise.setState(CustomStateView.STATE_SUCCESS);
|
||||
} else {
|
||||
mSuperviseBeans.clear();
|
||||
|
@ -9,6 +9,7 @@ import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
@ -37,6 +38,10 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.bigkoo.pickerview.view.TimePickerView;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.just.agentweb.AbsAgentWebSettings;
|
||||
@ -50,6 +55,7 @@ import com.tenlionsoft.baselib.constant.LionActions;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AddFileBean;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.beans.DicBean;
|
||||
import com.tenlionsoft.baselib.core.beans.OperateBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
@ -70,9 +76,15 @@ import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.activity.car.ChooseCarActivity;
|
||||
import com.tenlionsoft.oamodule.activity.car.ChooseDriverActivity;
|
||||
import com.tenlionsoft.oamodule.activity.car.ChooseUserActivity;
|
||||
import com.tenlionsoft.oamodule.activity.meeting.ChooseMeetingRoomActivity;
|
||||
import com.tenlionsoft.oamodule.adapter.OaFlowLogAdapter;
|
||||
import com.tenlionsoft.oamodule.beans.CarBean;
|
||||
import com.tenlionsoft.oamodule.beans.ChoosePersonListBean;
|
||||
import com.tenlionsoft.oamodule.beans.DriverBean;
|
||||
import com.tenlionsoft.oamodule.beans.MeetingRoomBean;
|
||||
import com.tenlionsoft.oamodule.beans.MineDoneBean;
|
||||
import com.tenlionsoft.oamodule.beans.MineReadBean;
|
||||
import com.tenlionsoft.oamodule.beans.MineTodoBean;
|
||||
@ -90,6 +102,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -97,9 +110,11 @@ import java.util.Map;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
@ -188,6 +203,15 @@ public class OaFlowApplyFragment extends BaseFragment {
|
||||
private ActivityResultLauncher<Intent> mFileLauncher;
|
||||
private ActivityResultLauncher<Intent> mTrLauncher;
|
||||
private ActivityResultLauncher<Intent> mCopyLauncher;
|
||||
private ActivityResultLauncher<Intent> mDriverLauncher;//司机
|
||||
private ActivityResultLauncher<Intent> mPassengerLauncher;//乘客
|
||||
private ActivityResultLauncher<Intent> mCarLauncher;//车辆
|
||||
private List<DicBean> mTempDicList;//字典选择
|
||||
private OptionsPickerView<DicBean> mPicker;
|
||||
private String webViewCallBack = "";
|
||||
private ActivityResultLauncher<Intent> mRoomLauncher;
|
||||
private ActivityResultLauncher<Intent> mPersonMultLauncher;
|
||||
private ActivityResultLauncher<Intent> mPersonSingleLauncher;
|
||||
|
||||
@Override
|
||||
protected int getContentViewId() {
|
||||
@ -622,9 +646,70 @@ public class OaFlowApplyFragment extends BaseFragment {
|
||||
doCopyTo(id);
|
||||
}
|
||||
});
|
||||
//司机
|
||||
mDriverLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
Intent data = result.getData();
|
||||
if (data != null) {
|
||||
DriverBean bean = (DriverBean) data.getSerializableExtra("bean");
|
||||
setSelectBeanToView(2, bean.getDriverId(), bean.getDriverName(), "");
|
||||
}
|
||||
});
|
||||
//乘客
|
||||
mPassengerLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
|
||||
});
|
||||
//车辆
|
||||
mCarLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
Intent data = result.getData();
|
||||
if (data != null) {
|
||||
CarBean bean = (CarBean) data.getSerializableExtra("bean");
|
||||
setSelectBeanToView(1, bean.getCarId(), bean.getCarNum(), "");
|
||||
}
|
||||
});
|
||||
//会议室
|
||||
mRoomLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
//会议室
|
||||
Intent data = result.getData();
|
||||
if (data != null) {
|
||||
MeetingRoomBean bean = (MeetingRoomBean) data.getSerializableExtra("bean");
|
||||
setSelectBeanToView(3, bean.getRoomId(), bean.getRoomName(), bean.getRoomType());
|
||||
}
|
||||
});
|
||||
//人员多选
|
||||
mPersonMultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
Intent data = result.getData();
|
||||
if (data != null) {
|
||||
String ids = data.getStringExtra("id");
|
||||
String names = data.getStringExtra("name");
|
||||
mWebView.getJsAccessEntrace().quickCallJs("setSelectPerson", ids, names, webViewCallBack);
|
||||
}
|
||||
});
|
||||
//人员单选择
|
||||
mPersonSingleLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
|
||||
Intent data = result.getData();
|
||||
if (data != null) {
|
||||
ChoosePersonListBean b = (ChoosePersonListBean) data.getSerializableExtra("bean");
|
||||
mWebView.getJsAccessEntrace().quickCallJs("setSelectPerson", b.getUserId(), b.getUserName(),
|
||||
webViewCallBack);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 填写选择的车辆1、司机2、会议室3
|
||||
*/
|
||||
private void setSelectBeanToView(int type, String id, String name, String typeStr) {
|
||||
if (type == 1) {
|
||||
//车辆
|
||||
mWebView.getJsAccessEntrace().quickCallJs("setApplyCar", id, name);
|
||||
} else if (type == 2) {
|
||||
//司机
|
||||
mWebView.getJsAccessEntrace().quickCallJs("setApplyDriver", id, name);
|
||||
} else if (type == 3) {
|
||||
//会议室 //roomType,roomId,roomName
|
||||
mWebView.getJsAccessEntrace().quickCallJs("backMeetingRoom", typeStr, id, name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面回填数据
|
||||
@ -991,8 +1076,8 @@ public class OaFlowApplyFragment extends BaseFragment {
|
||||
|
||||
@JavascriptInterface
|
||||
public void invokeNative(String method, String params) {
|
||||
mActivity.runOnUiThread(() -> {
|
||||
LogUtils.e(method + "===" + params);
|
||||
mMainActivity.runOnUiThread(() -> {
|
||||
mMainActivity.hideSoftKeyboard();
|
||||
if ("back".equals(method)) {
|
||||
LogUtils.e("关闭");
|
||||
mMainActivity.getPreFragment().mIsRefresh = true;
|
||||
@ -1033,7 +1118,6 @@ public class OaFlowApplyFragment extends BaseFragment {
|
||||
//设置标题栏状态栏颜色
|
||||
LogUtils.e(params);
|
||||
if (!TextUtils.isEmpty(params)) {
|
||||
// TODO 状态栏标题栏颜色
|
||||
// mRlTitleBar.setBackgroundColor(Color.parseColor(params));
|
||||
// mTvBaseTitle.setTextColor(Color.WHITE);
|
||||
// mTvPublish.setTextColor(Color.WHITE);
|
||||
@ -1044,8 +1128,30 @@ public class OaFlowApplyFragment extends BaseFragment {
|
||||
// .titleBar(mRlTitleBar)
|
||||
// .init();
|
||||
}
|
||||
} else if ("chooseDriver".equals(method)) {
|
||||
//选择司机
|
||||
Intent intent = new Intent(mMainActivity, ChooseDriverActivity.class);
|
||||
mDriverLauncher.launch(intent);
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_OA_ACTIVITY_SEL_DRIVER)
|
||||
// .navigation(mActivity, 16);
|
||||
} else if ("chooseMeetingRoom".equals(method)) {
|
||||
//选择会议室
|
||||
Intent intent= new Intent(mMainActivity, ChooseMeetingRoomActivity.class);
|
||||
mRoomLauncher.launch(intent);
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_OA_ACTIVITY_SEL_MEETING_ROOM)
|
||||
// .navigation(mActivity, 17);
|
||||
} else if ("chooseCar".equals(method)) {
|
||||
//选择车辆
|
||||
Intent intent =new Intent(mMainActivity, ChooseCarActivity.class);
|
||||
mCarLauncher.launch(intent);
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_OA_ACTIVITY_SEL_CAR)
|
||||
// .navigation(mActivity, 15);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1057,7 +1163,163 @@ public class OaFlowApplyFragment extends BaseFragment {
|
||||
mMainActivity.backFragment(1, OaFlowApplyFragment.this);
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void invokeNative(String method, String type, String callBack) {
|
||||
mMainActivity.runOnUiThread(() -> {
|
||||
if ("doSelectTime".equals(method)) {
|
||||
onShowTimePicker(type, callBack);
|
||||
} else if ("onShowPicker".equals(method)) {
|
||||
onShowPicker(type, callBack);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void invokeNative(String method, String callBack, String isSingle, String userId, String userNames) {
|
||||
mMainActivity.runOnUiThread(() -> {
|
||||
LogUtils.e(method + "==" + callBack + "==" + isSingle + "==" + userId + "===" + userNames);
|
||||
if ("doSelectPerson".equals(method)) {
|
||||
boolean single = Boolean.valueOf(isSingle);
|
||||
webViewCallBack = callBack;
|
||||
Intent intent = new Intent(mActivity, ChooseUserActivity.class);
|
||||
intent.putExtra("isSingle", !single);
|
||||
intent.putExtra("userId", userId);
|
||||
intent.putExtra("userName", userNames);
|
||||
if (!single) {
|
||||
mPersonSingleLauncher.launch(intent);
|
||||
} else {
|
||||
mPersonMultLauncher.launch(intent);
|
||||
}
|
||||
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_OA_ACTIVITY_SEL_PERSON)
|
||||
// .withBoolean("isSingle", !single)
|
||||
// .withString("userId", userId)
|
||||
// .withString("userName", userNames)
|
||||
// .navigation(mActivity, !single ? 18 : 19);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间选择
|
||||
*/
|
||||
private void onShowTimePicker(String formatStr, String callBack) {
|
||||
mMainActivity.hideSoftKeyboard();
|
||||
boolean[] type;
|
||||
SimpleDateFormat format;
|
||||
if ("year".equals(formatStr)) {
|
||||
type = new boolean[]{true, true, true, false, false, false};
|
||||
format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
} else {
|
||||
type = new boolean[]{true, true, true, true, true, true};
|
||||
format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
TimePickerView mTimePickerView = new TimePickerBuilder(mActivity, (date, v) -> {
|
||||
mWebView.getJsAccessEntrace().quickCallJs("setSelectTime", format.format(date), callBack);
|
||||
})
|
||||
.setTitleText("请选时间")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.isDialog(false)
|
||||
.setType(type)
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTimePickerView.show();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 字典选择
|
||||
*
|
||||
* @param id
|
||||
* @param callBack
|
||||
*/
|
||||
private void onShowPicker(String id, String callBack) {
|
||||
mMainActivity.hideSoftKeyboard();
|
||||
if (mTempDicList != null && mTempDicList.size() > 0) {
|
||||
if (mPicker == null) {
|
||||
mPicker = new OptionsPickerBuilder(mActivity, (o1, o2, o3, v) -> {
|
||||
DicBean bean = mTempDicList.get(o1);
|
||||
mWebView.getJsAccessEntrace().quickCallJs("setSelectItem", bean.getDataId(), bean.getDataName(),
|
||||
callBack);
|
||||
})
|
||||
.setTitleText("请选择")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mPicker.setPicker(mTempDicList);
|
||||
}
|
||||
mPicker.show();
|
||||
} else {
|
||||
getDicListByType(id, callBack);
|
||||
}
|
||||
}
|
||||
// public class OnJsInterface {
|
||||
//
|
||||
// @JavascriptInterface
|
||||
// public void invokeNative(String method, String params) {
|
||||
// mActivity.runOnUiThread(() -> {
|
||||
// LogUtils.e(method + "===" + params);
|
||||
// if ("back".equals(method)) {
|
||||
|
||||
// } else if ("webBack".equals(method)) {
|
||||
|
||||
// } else if ("initFormData".equals(method)) {
|
||||
// LogUtils.e(params);
|
||||
// if (!TextUtils.isEmpty(params)) {
|
||||
// buildPageData(params);
|
||||
// }
|
||||
// } else if ("toast".equals(method)) {
|
||||
// LogUtils.e(params);
|
||||
// } else if ("echoAccessory".equals(method)) {
|
||||
// if (!TextUtils.isEmpty(params)) {
|
||||
// String[] split = params.split(",");
|
||||
// for (int i = 0; i < split.length; i++) {
|
||||
// String s = split[i];
|
||||
// String[] ids = s.split(":");
|
||||
// AddFileBean bean = new AddFileBean();
|
||||
// bean.setId(ids[0]);
|
||||
// bean.setFileName(ids[1]);
|
||||
// bean.setFileType(FileUtils.getFileType(ids[1]));
|
||||
// bean.setPath(BaseUrlApi.BASE_IMG_URL + ids[0]);
|
||||
// mFiles.add(bean);
|
||||
// }
|
||||
// doSetFileToWebView();
|
||||
// }
|
||||
// } else if ("submitState".equals(method)) {
|
||||
// if ("true".equals(params)) {
|
||||
// // 刷新附件页面去除删除按钮
|
||||
// mLlApproveInput.setVisibility(View.GONE);
|
||||
// }
|
||||
// } else if ("setTitleBarColor".equals(method)) {
|
||||
// //设置标题栏状态栏颜色
|
||||
// LogUtils.e(params);
|
||||
// if (!TextUtils.isEmpty(params)) {
|
||||
// // TODO 状态栏标题栏颜色
|
||||
// //mRlTitleBar.setBackgroundColor(Color.parseColor(params));
|
||||
// //mTvBaseTitle.setTextColor(Color.WHITE);
|
||||
// //mTvPublish.setTextColor(Color.WHITE);
|
||||
// //mTvAppBack.setBackgroundResource(R.drawable.ic_back_white);
|
||||
// // ImmersionBar.with(OaFlowCenterActivity.this)
|
||||
// // .statusBarDarkFont(false)
|
||||
// // .statusBarColor(params)
|
||||
// // .titleBar(mRlTitleBar)
|
||||
// // .init();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @JavascriptInterface
|
||||
// public void invokeNative(String method) {
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
@ -1167,6 +1429,47 @@ public class OaFlowApplyFragment extends BaseFragment {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典
|
||||
*/
|
||||
private void getDicListByType(String pId, String callBack) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mMainActivity, "获取中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.getDictListAllByPid(pId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<DicBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull List<DicBean> beans) {
|
||||
dialog.dismiss();
|
||||
if (beans.size() > 0) {
|
||||
mTempDicList = beans;
|
||||
onShowPicker(pId, callBack);
|
||||
} else {
|
||||
ToastUtils.show("暂无数据");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private Observable createObservable(File file) {
|
||||
int fileType = FileUtils.getFileType(file.getName());
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
|
@ -11,6 +11,9 @@ import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
||||
import com.bigkoo.pickerview.view.TimePickerView;
|
||||
@ -22,6 +25,7 @@ import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
||||
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ItemSplitDivider;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TypeFaceEditText;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
@ -42,8 +46,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
@ -114,6 +116,7 @@ public class OaFlowMineTodoFragment extends BaseFragment {
|
||||
mDatas = new ArrayList<>();
|
||||
mAdapter = new MineTodoAdapter(mActivity, mDatas);
|
||||
mRlvContent.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvContent.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#F9F9F9")));
|
||||
mRlvContent.setAdapter(mAdapter);
|
||||
mRgType.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
if (checkedId == R.id.rb_apply) {
|
||||
|
@ -1,37 +1,31 @@
|
||||
package com.tenlionsoft.oamodule.pad.fragments.mine;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import static com.tenlionsoft.baselib.core.widget.base.BaseActivity.STATE_LOAD_LOADING;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AddFileBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.bean.FileInfoBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.AddFileAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseViewPage2Adapter;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ItemSplitDivider;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.adapter.EducateAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.ResumeAdapter;
|
||||
import com.tenlionsoft.oamodule.beans.UserRecordDetailBean;
|
||||
import com.tenlionsoft.oamodule.beans.UserRecordTypeList;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
import com.tenlionsoft.oamodule.pad.activitys.home.PadMainActivity;
|
||||
|
||||
@ -40,18 +34,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
import static com.tenlionsoft.baselib.core.widget.PhotoActivity.TAG_IMGURL;
|
||||
import static com.tenlionsoft.baselib.core.widget.base.BaseActivity.STATE_LOAD_LOADING;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/5/11 - 14:44
|
||||
@ -60,88 +47,34 @@ import static com.tenlionsoft.baselib.core.widget.base.BaseActivity.STATE_LOAD_L
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_USER_RECORD_DETAIL)
|
||||
public class UserRecordDetailFragment extends BaseFragment {
|
||||
@BindView(R2.id.rb_base)
|
||||
RadioButton mRbBase;
|
||||
@BindView(R2.id.rb_job)
|
||||
RadioButton mRbJob;
|
||||
@BindView(R2.id.rg_type)
|
||||
RadioGroup mRgType;
|
||||
@BindView(R2.id.rlv_imgs)
|
||||
RecyclerView mRlvImgs;
|
||||
@BindView(R2.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R2.id.tv_gender)
|
||||
TextView mTvGender;
|
||||
@BindView(R2.id.tv_birthday)
|
||||
TextView mTvBirthday;
|
||||
@BindView(R2.id.tv_id_card)
|
||||
TextView mTvIdCard;
|
||||
@BindView(R2.id.tv_political)
|
||||
TextView mTvPolitical;
|
||||
@BindView(R2.id.tv_marital)
|
||||
TextView mTvMarital;
|
||||
@BindView(R2.id.tv_nationality)
|
||||
TextView mTvNationality;
|
||||
@BindView(R2.id.tv_native_place)
|
||||
TextView mTvNativePlace;
|
||||
@BindView(R2.id.tv_passport)
|
||||
TextView mTvPassport;
|
||||
@BindView(R2.id.tv_passport_type)
|
||||
TextView mTvPassportType;
|
||||
@BindView(R2.id.tv_address)
|
||||
TextView mTvAddress;
|
||||
@BindView(R2.id.tv_email)
|
||||
TextView mTvEmail;
|
||||
@BindView(R2.id.tv_phone)
|
||||
TextView mTvPhone;
|
||||
@BindView(R2.id.tv_school)
|
||||
TextView mTvSchool;
|
||||
@BindView(R2.id.tv_specialty)
|
||||
TextView mTvSpecialty;
|
||||
@BindView(R2.id.tv_degree)
|
||||
TextView mTvDegree;
|
||||
@BindView(R2.id.tv_graduate_date)
|
||||
TextView mTvGraduateDate;
|
||||
@BindView(R2.id.tv_link_man)
|
||||
TextView mTvLinkMan;
|
||||
@BindView(R2.id.et_link_phone)
|
||||
TextView mEtLinkPhone;
|
||||
@BindView(R2.id.ll_base)
|
||||
LinearLayout mLlBase;
|
||||
@BindView(R2.id.tv_obtain_date)
|
||||
TextView mTvObtainDate;
|
||||
@BindView(R2.id.tv_positive_date)
|
||||
TextView mTvPositiveDate;
|
||||
@BindView(R2.id.tv_dept)
|
||||
TextView mTvDept;
|
||||
@BindView(R2.id.tv_post)
|
||||
TextView mTvPost;
|
||||
@BindView(R2.id.tv_leader)
|
||||
TextView mTvLeader;
|
||||
@BindView(R2.id.tv_bank_num)
|
||||
TextView mTvBankNum;
|
||||
@BindView(R2.id.tv_fund_num)
|
||||
TextView mTvFundNum;
|
||||
@BindView(R2.id.tv_social_num)
|
||||
TextView mTvSocialNum;
|
||||
@BindView(R2.id.tv_job_title)
|
||||
TextView mTvJobTitle;
|
||||
@BindView(R2.id.tv_job_level)
|
||||
TextView mTvJobLevel;
|
||||
@BindView(R2.id.tv_persion_type)
|
||||
TextView mTvPersionType;
|
||||
@BindView(R2.id.rlv_teach)
|
||||
RecyclerView mRlvTeach;
|
||||
@BindView(R2.id.tv_educate_hint)
|
||||
TextView mTvEducateHint;
|
||||
@BindView(R2.id.rlv_resume)
|
||||
RecyclerView mRlvResume;
|
||||
@BindView(R2.id.tv_resume_hint)
|
||||
TextView mTvResumeHint;
|
||||
@BindView(R2.id.rlv_resume_file)
|
||||
RecyclerView mRlvResumeFile;
|
||||
@BindView(R2.id.ll_job)
|
||||
LinearLayout mLlJob;
|
||||
@BindView(R2.id.tv_type_base)
|
||||
TypeFaceTextView mTvTypeBase;
|
||||
@BindView(R2.id.iv_type_base)
|
||||
ImageView mIvTypeBase;
|
||||
@BindView(R2.id.ll_type_base)
|
||||
LinearLayout mLlTypeBase;
|
||||
@BindView(R2.id.tv_type_job)
|
||||
TypeFaceTextView mTvTypeJob;
|
||||
@BindView(R2.id.iv_type_job)
|
||||
ImageView mIvTypeJob;
|
||||
@BindView(R2.id.ll_type_edu)
|
||||
LinearLayout mLlTypeEdu;
|
||||
@BindView(R2.id.tv_type_work)
|
||||
TypeFaceTextView mTvTypeWork;
|
||||
@BindView(R2.id.iv_type_work)
|
||||
ImageView mIvTypeWork;
|
||||
@BindView(R2.id.ll_type_work)
|
||||
LinearLayout mLlTypeWork;
|
||||
@BindView(R2.id.tv_type_honour)
|
||||
TypeFaceTextView mTvTypeHonour;
|
||||
@BindView(R2.id.iv_type_honour)
|
||||
ImageView mIvTypeHonour;
|
||||
@BindView(R2.id.ll_type_honour)
|
||||
LinearLayout mLlTypeHonour;
|
||||
@BindView(R2.id.vp_content)
|
||||
ViewPager2 mVpContent;
|
||||
private List<UserRecordTypeList> mRecordTypeLists;
|
||||
private List<BaseFragment> mFragments;
|
||||
private PadMainActivity mMainActivity;
|
||||
|
||||
@Override
|
||||
@ -155,16 +88,163 @@ public class UserRecordDetailFragment extends BaseFragment {
|
||||
setTitleView(true);
|
||||
mTvFragmentTitle.setText("个人档案");
|
||||
mIvFragmentBack.setOnClickListener(v -> mMainActivity.backFragment(4, this));
|
||||
mRgType.setOnCheckedChangeListener((v, id) -> {
|
||||
if (id == R.id.rb_base) {
|
||||
mLlBase.setVisibility(View.VISIBLE);
|
||||
mLlJob.setVisibility(View.GONE);
|
||||
} else if (id == R.id.rb_job) {
|
||||
mLlBase.setVisibility(View.GONE);
|
||||
mLlJob.setVisibility(View.VISIBLE);
|
||||
|
||||
//个人简历
|
||||
mLlTypeBase.setOnClickListener(v -> {
|
||||
mTvTypeBase.setTextColor(getResources().getColor(R.color.black_10));
|
||||
mTvTypeJob.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeWork.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeHonour.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mIvTypeBase.setVisibility(View.VISIBLE);
|
||||
mIvTypeJob.setVisibility(View.INVISIBLE);
|
||||
mIvTypeWork.setVisibility(View.INVISIBLE);
|
||||
mIvTypeHonour.setVisibility(View.INVISIBLE);
|
||||
chooseFragment("base");
|
||||
});
|
||||
//教育经历
|
||||
mLlTypeEdu.setOnClickListener(v -> {
|
||||
mTvTypeJob.setTextColor(getResources().getColor(R.color.black_10));
|
||||
mTvTypeBase.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeHonour.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeWork.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mIvTypeJob.setVisibility(View.VISIBLE);
|
||||
mIvTypeBase.setVisibility(View.INVISIBLE);
|
||||
mIvTypeHonour.setVisibility(View.INVISIBLE);
|
||||
mIvTypeWork.setVisibility(View.INVISIBLE);
|
||||
chooseFragment("edu");
|
||||
});
|
||||
//工作简历
|
||||
mLlTypeWork.setOnClickListener(v -> {
|
||||
mTvTypeJob.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeBase.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeHonour.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeWork.setTextColor(getResources().getColor(R.color.black_10));
|
||||
mIvTypeJob.setVisibility(View.INVISIBLE);
|
||||
mIvTypeBase.setVisibility(View.INVISIBLE);
|
||||
mIvTypeHonour.setVisibility(View.INVISIBLE);
|
||||
mIvTypeWork.setVisibility(View.VISIBLE);
|
||||
chooseFragment("work");
|
||||
});
|
||||
//个人荣誉
|
||||
mLlTypeHonour.setOnClickListener(v -> {
|
||||
mTvTypeJob.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeBase.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mTvTypeHonour.setTextColor(getResources().getColor(R.color.black_10));
|
||||
mTvTypeWork.setTextColor(getResources().getColor(R.color.gray_a9));
|
||||
mIvTypeJob.setVisibility(View.INVISIBLE);
|
||||
mIvTypeBase.setVisibility(View.INVISIBLE);
|
||||
mIvTypeHonour.setVisibility(View.VISIBLE);
|
||||
mIvTypeWork.setVisibility(View.INVISIBLE);
|
||||
chooseFragment("honour");
|
||||
});
|
||||
getCatalog();
|
||||
}
|
||||
|
||||
private void getCatalog() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getUserRecordTypeList()
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<List<UserRecordTypeList>>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull List<UserRecordTypeList> userRecordTypeLists) {
|
||||
mRecordTypeLists = userRecordTypeLists;
|
||||
if (mRecordTypeLists.size() > 0) {
|
||||
getUserRecordId();
|
||||
} else {
|
||||
setStateView(STATE_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
setStateView(STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
getDetailData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人档案ID
|
||||
*/
|
||||
private void getUserRecordId() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getUserRecordId()
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<String>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull String bean) {
|
||||
if (!TextUtils.isEmpty(bean)) {
|
||||
setStateView(STATE_SUCCESS);
|
||||
initView(bean);
|
||||
} else {
|
||||
setStateView(STATE_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
setStateView(STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化视图
|
||||
*/
|
||||
private void initView(String id) {
|
||||
mFragments = new ArrayList<>();
|
||||
for (int i = 0; i < mRecordTypeLists.size(); i++) {
|
||||
UserRecordTypeList bean = mRecordTypeLists.get(i);
|
||||
if ("基本信息".equals(bean.getTypeName())) {
|
||||
BaseFragment fragment = FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_OA_FRAGMENT_USER_RECORD_BASE, "id", id);
|
||||
fragment.setCustomTag("base");
|
||||
mFragments.add(fragment);
|
||||
mLlTypeBase.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if ("教育经历".equals(bean.getTypeName())) {
|
||||
BaseFragment fragment = FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_OA_FRAGMENT_USER_RECORD_EDU, "id", id);
|
||||
fragment.setCustomTag("edu");
|
||||
mFragments.add(fragment);
|
||||
mLlTypeEdu.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if ("工作简历".equals(bean.getTypeName())) {
|
||||
BaseFragment fragment = FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_OA_FRAGMENT_USER_RECORD_WORK, "id", id);
|
||||
fragment.setCustomTag("work");
|
||||
mFragments.add(fragment);
|
||||
mLlTypeWork.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if ("个人荣誉".equals(bean.getTypeName())) {
|
||||
BaseFragment fragment = FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_OA_FRAGMENT_USER_RECORD_HONOUR, "id", id);
|
||||
fragment.setCustomTag("honour");
|
||||
mFragments.add(fragment);
|
||||
mLlTypeHonour.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
mVpContent.setAdapter(new BaseViewPage2Adapter(mActivity, mFragments));
|
||||
mVpContent.setUserInputEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -173,44 +253,25 @@ public class UserRecordDetailFragment extends BaseFragment {
|
||||
mMainActivity = (PadMainActivity) getActivity();
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择页面
|
||||
*/
|
||||
private void chooseFragment(String type) {
|
||||
for (int i = 0; i < mFragments.size(); i++) {
|
||||
BaseFragment fragment = mFragments.get(i);
|
||||
LogUtils.e(fragment.getCustomTag());
|
||||
if (type.equals(fragment.getCustomTag())) {
|
||||
mVpContent.setCurrentItem(i, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void getDetailData() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getUserRecordDetailById()
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<UserRecordDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull UserRecordDetailBean userRecordDetailBean) {
|
||||
if (!TextUtils.isEmpty(userRecordDetailBean.getUserArchivesId())) {
|
||||
setDataToView(userRecordDetailBean);
|
||||
} else {
|
||||
setStateView(STATE_EMPTY);
|
||||
mSrlView.setEnableRefresh(false);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
setStateView(STATE_ERROR);
|
||||
mSrlView.setEnableRefresh(false);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 回显数据
|
||||
@ -224,201 +285,120 @@ public class UserRecordDetailFragment extends BaseFragment {
|
||||
BaseFragment fragment = FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_USER_RECORD_EDIT, "id", b.getUserArchivesId());
|
||||
mMainActivity.addFragment(4, fragment);
|
||||
});
|
||||
mTvName.setText(b.getName());
|
||||
mTvGender.setText(b.getSexName());
|
||||
mTvBirthday.setText(b.getBirthday());
|
||||
mTvIdCard.setText(b.getIdCard());
|
||||
mTvPolitical.setText(b.getPoliticalOutlookName());
|
||||
mTvMarital.setText(b.getMaritalStatusName());
|
||||
mTvNationality.setText(b.getNationality());
|
||||
mTvNativePlace.setText(b.getNativeAddress());
|
||||
mTvPassport.setText(b.getResidence());
|
||||
mTvPassportType.setText(b.getResidenceNatureName());
|
||||
mTvAddress.setText(b.getAddress());
|
||||
mTvEmail.setText(b.getEmail());
|
||||
mTvPhone.setText(b.getPhone());
|
||||
mTvSchool.setText(b.getGraduation());
|
||||
mTvSpecialty.setText(b.getMajorName());
|
||||
mTvDegree.setText(b.getHighestDegree());
|
||||
mTvGraduateDate.setText(b.getGraduationDate());
|
||||
mTvLinkMan.setText(b.getEmergencyContact());
|
||||
mEtLinkPhone.setText(b.getEmergencyContactPhone());
|
||||
mTvObtainDate.setText(b.getJoinTime());
|
||||
mTvPositiveDate.setText(b.getCeremonialTime());
|
||||
mTvDept.setText(b.getDeptName());
|
||||
mTvPost.setText(b.getPostName());
|
||||
mTvLeader.setText(b.getDirectSuperiorName());
|
||||
mTvBankNum.setText(b.getBankAccount());
|
||||
mTvFundNum.setText(b.getFundAccount());
|
||||
mTvSocialNum.setText(b.getSecurityAccount());
|
||||
mTvJobTitle.setText(b.getTitleName());
|
||||
mTvJobLevel.setText(b.getTitleGradeName());
|
||||
mTvPersionType.setText(b.getUserTypeName());
|
||||
if (b.getEducationList() != null && b.getEducationList().size() > 0) {
|
||||
EducateAdapter adapter = new EducateAdapter(mActivity, b.getEducationList(), 1);
|
||||
mRlvTeach.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvTeach.setAdapter(adapter);
|
||||
mRlvTeach.setVisibility(View.VISIBLE);
|
||||
mRlvTeach.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#BFBFBF")));
|
||||
mTvEducateHint.setVisibility(View.GONE);
|
||||
} else {
|
||||
mRlvTeach.setVisibility(View.GONE);
|
||||
mTvEducateHint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (b.getWorkList() != null && b.getWorkList().size() > 0) {
|
||||
ResumeAdapter adapter = new ResumeAdapter(mActivity, b.getWorkList(), 1);
|
||||
mRlvResume.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvResume.setAdapter(adapter);
|
||||
mRlvResume.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#BFBFBF")));
|
||||
mRlvResume.setVisibility(View.VISIBLE);
|
||||
mTvResumeHint.setVisibility(View.GONE);
|
||||
} else {
|
||||
mRlvResume.setVisibility(View.GONE);
|
||||
mTvResumeHint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
//证件照
|
||||
if (!TextUtils.isEmpty(b.getPhoto())) {
|
||||
mRlvImgs.setVisibility(View.VISIBLE);
|
||||
List<AddFileBean> files = new ArrayList<>();
|
||||
String[] split = b.getPhoto().split(",");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
AddFileBean bean = new AddFileBean();
|
||||
bean.setId(split[i]);
|
||||
bean.setPath(BaseUrlApi.BASE_IMG_URL + split[i]);
|
||||
files.add(bean);
|
||||
}
|
||||
doGetFileInfos(b.getPhoto(), files, 2);
|
||||
} else {
|
||||
mRlvImgs.setVisibility(View.GONE);
|
||||
}
|
||||
//简历附件
|
||||
if (!TextUtils.isEmpty(b.getResume())) {
|
||||
mRlvResumeFile.setVisibility(View.VISIBLE);
|
||||
List<AddFileBean> files = new ArrayList<>();
|
||||
String[] split = b.getResume().split(",");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
AddFileBean bean = new AddFileBean();
|
||||
bean.setId(split[i]);
|
||||
bean.setPath(BaseUrlApi.BASE_IMG_URL + split[i]);
|
||||
files.add(bean);
|
||||
}
|
||||
doGetFileInfos(b.getResume(), files, 1);
|
||||
} else {
|
||||
mRlvResumeFile.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void doGetFileInfos(String fileId, List<AddFileBean> files, int type) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
dialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(BaseApiService.class)
|
||||
.getFileInfoList(fileId)
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<List<FileInfoBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull List<FileInfoBean> fileInfoBeans) {
|
||||
if (dialog.isShowing()) dialog.dismiss();
|
||||
if (fileInfoBeans.size() > 0) {
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
for (int j = 0; j < fileInfoBeans.size(); j++) {
|
||||
if (files.get(i).getId().equals(fileInfoBeans.get(j).getFileId())) {
|
||||
files.get(i).setFileName(fileInfoBeans.get(j).getFileName());
|
||||
files.get(i).setFileType(FileUtils.getFileType(fileInfoBeans.get(j).getFileName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type == 2) {
|
||||
AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
||||
mRlvImgs.setLayoutManager(new GridLayoutManager(mActivity, 5));
|
||||
mRlvImgs.setAdapter(adapter);
|
||||
adapter.addOnItemClickListener(addFileBean -> {
|
||||
if (addFileBean.getFileType() == 1) {
|
||||
//文档
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||
.withString("fileName", addFileBean.getFileName())
|
||||
.withString("fileId", addFileBean.getId())
|
||||
.navigation();
|
||||
} else if (2 == addFileBean.getFileType()) {
|
||||
//图片预览
|
||||
//遍历文件获取所有图片文件
|
||||
ArrayList<String> imgUrls = new ArrayList<>();
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
AddFileBean fileBean = files.get(i);
|
||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||
imgUrls.add(url);
|
||||
}
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||
.navigation();
|
||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||
//TODO 视频或音频预览
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||
.navigation();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
||||
mRlvResumeFile.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvResumeFile.setAdapter(adapter);
|
||||
adapter.addOnItemClickListener(addFileBean -> {
|
||||
if (addFileBean.getFileType() == 1) {
|
||||
//文档
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||
.withString("fileName", addFileBean.getFileName())
|
||||
.withString("fileId", addFileBean.getId())
|
||||
.navigation();
|
||||
} else if (2 == addFileBean.getFileType()) {
|
||||
//图片预览
|
||||
//遍历文件获取所有图片文件
|
||||
ArrayList<String> imgUrls = new ArrayList<>();
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
AddFileBean fileBean = files.get(i);
|
||||
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||
imgUrls.add(url);
|
||||
}
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||
.navigation();
|
||||
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||
//TODO 视频或音频预览
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
.withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||
.withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||
.navigation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
ToastUtils.show("未找到文档信息");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
if (dialog.isShowing()) dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
// ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||
// dialog.show();
|
||||
// RetrofitManager.getInstance()
|
||||
// .create(BaseApiService.class)
|
||||
// .getFileInfoList(fileId)
|
||||
// .compose(RxTransformer.getTransformer())
|
||||
// .subscribe(new Observer<List<FileInfoBean>>() {
|
||||
// @Override
|
||||
// public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(@io.reactivex.rxjava3.annotations.NonNull List<FileInfoBean> fileInfoBeans) {
|
||||
// if (dialog.isShowing()) dialog.dismiss();
|
||||
// if (fileInfoBeans.size() > 0) {
|
||||
// for (int i = 0; i < files.size(); i++) {
|
||||
// for (int j = 0; j < fileInfoBeans.size(); j++) {
|
||||
// if (files.get(i).getId().equals(fileInfoBeans.get(j).getFileId())) {
|
||||
// files.get(i).setFileName(fileInfoBeans.get(j).getFileName());
|
||||
// files.get(i).setFileType(FileUtils.getFileType(fileInfoBeans.get(j).getFileName()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (type == 2) {
|
||||
// AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
||||
// mRlvImgs.setLayoutManager(new GridLayoutManager(mActivity, 5));
|
||||
// mRlvImgs.setAdapter(adapter);
|
||||
// adapter.addOnItemClickListener(addFileBean -> {
|
||||
// if (addFileBean.getFileType() == 1) {
|
||||
// //文档
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||
// .withString("fileName", addFileBean.getFileName())
|
||||
// .withString("fileId", addFileBean.getId())
|
||||
// .navigation();
|
||||
// } else if (2 == addFileBean.getFileType()) {
|
||||
// //图片预览
|
||||
// //遍历文件获取所有图片文件
|
||||
// ArrayList<String> imgUrls = new ArrayList<>();
|
||||
// for (int i = 0; i < files.size(); i++) {
|
||||
// AddFileBean fileBean = files.get(i);
|
||||
// String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||
// imgUrls.add(url);
|
||||
// }
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||
// .withStringArrayList(TAG_IMGURL, imgUrls)
|
||||
// .navigation();
|
||||
// } else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||
// //TODO 视频或音频预览
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
// .withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||
// .withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||
// .navigation();
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// AddFileAdapter adapter = new AddFileAdapter(mActivity, files);
|
||||
// mRlvResumeFile.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
// mRlvResumeFile.setAdapter(adapter);
|
||||
// adapter.addOnItemClickListener(addFileBean -> {
|
||||
// if (addFileBean.getFileType() == 1) {
|
||||
// //文档
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||
// .withString("fileName", addFileBean.getFileName())
|
||||
// .withString("fileId", addFileBean.getId())
|
||||
// .navigation();
|
||||
// } else if (2 == addFileBean.getFileType()) {
|
||||
// //图片预览
|
||||
// //遍历文件获取所有图片文件
|
||||
// ArrayList<String> imgUrls = new ArrayList<>();
|
||||
// for (int i = 0; i < files.size(); i++) {
|
||||
// AddFileBean fileBean = files.get(i);
|
||||
// String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||
// imgUrls.add(url);
|
||||
// }
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||
// .withStringArrayList(TAG_IMGURL, imgUrls)
|
||||
// .navigation();
|
||||
// } else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||
// //TODO 视频或音频预览
|
||||
// ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_PLAYER_SIMPLE_VIDEO)
|
||||
// .withString("title", addFileBean.getFileName().substring(0, addFileBean.getFileName().lastIndexOf(".")))
|
||||
// .withString("url", BaseUrlApi.BASE_IMG_URL + addFileBean.getId())
|
||||
// .navigation();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// ToastUtils.show("未找到文档信息");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
// if (dialog.isShowing()) dialog.dismiss();
|
||||
// ExceptionHandler.handleException(e);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
@ -435,11 +415,12 @@ public class UserRecordDetailFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
protected void refreshView() {
|
||||
|
||||
mSrlView.finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadMoreData() {
|
||||
|
||||
mSrlView.finishLoadMore();
|
||||
mSrlView.setNoMoreData(true);
|
||||
}
|
||||
}
|
||||
|
@ -61,9 +61,9 @@
|
||||
android:id="@+id/iv_banner"
|
||||
android:layout_width="216dp"
|
||||
android:layout_height="178dp"
|
||||
android:visibility="gone"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_empty_data" />
|
||||
android:src="@drawable/ic_empty_data"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
<!-- 常用功能 -->
|
||||
<LinearLayout
|
||||
@ -94,8 +94,8 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:textColor="#CACACA"
|
||||
android:text="查看更多>>"
|
||||
android:textColor="#CACACA"
|
||||
android:textSize="@dimen/text_12"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
@ -162,8 +162,8 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:textColor="#CACACA"
|
||||
android:text="查看更多>>"
|
||||
android:textColor="#CACACA"
|
||||
android:textSize="@dimen/text_12" />
|
||||
</RelativeLayout>
|
||||
|
||||
@ -271,7 +271,7 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
<!-- 我的督办 -->
|
||||
<!-- 我的待办 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
@ -284,13 +284,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ic_func_title_bg"
|
||||
android:text="我的督办"
|
||||
android:text="我的待办"
|
||||
android:textColor="@color/black"
|
||||
app:text_type_cus="2" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_supervise_more"
|
||||
@ -300,9 +306,11 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:textColor="#CACACA"
|
||||
android:text="查看更多>>"
|
||||
android:textColor="#CACACA"
|
||||
android:textSize="@dimen/text_12" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
@ -343,7 +351,8 @@
|
||||
android:gravity="center"
|
||||
android:padding="5dp"
|
||||
android:text="+发起督办"
|
||||
android:textColor="@color/col_white_gray_press" />
|
||||
android:textColor="@color/col_white_gray_press"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
<!-- 新闻资讯 -->
|
||||
<LinearLayout
|
||||
|
@ -3,837 +3,136 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_f0"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp"
|
||||
tools:context=".activity.record.UserRecordAddActivity">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_base"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/switch_custom_w_g"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="基础信息"
|
||||
android:textSize="@dimen/text_16"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_job"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/switch_custom_w_g"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="入职信息"
|
||||
android:textSize="@dimen/text_16"
|
||||
android:textStyle="bold" />
|
||||
</RadioGroup>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:padding="5dp"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/gray_f7"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_base"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:visibility="gone">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_imgs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="姓名"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="性别"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_gender"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="出生日期"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_birthday"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="身份证号"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_id_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:digits="@string/limit_id_card"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="政治面貌"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_political"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="婚姻状况"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_marital"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="国籍"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_nationality"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="籍贯"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_native_place"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="户口"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_passport"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="户口性质"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_passport_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="家庭地址"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="电子邮箱"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="联系电话"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:digits="@string/limit_phone"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="毕业院校"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_school"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="专业"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_specialty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="最高学位"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_degree"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="毕业日期"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_graduate_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="紧急联系人"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_link_man"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="联系人电话"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/et_link_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_job"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_type_base"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_type_base"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="入职日期"
|
||||
android:textColor="@color/black"
|
||||
android:text="基础信息"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_obtain_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
<ImageView
|
||||
android:id="@+id/iv_type_base"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="转正日期"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_positive_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="所在部门"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_dept"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="岗位"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_post"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="直接上级"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_leader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="银行账号"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_bank_num"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="公积金号"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_fund_num"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="社保卡号"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_social_num"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="职称"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_job_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="职称职等"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_job_level"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/item_hor_content">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="人员分类"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_persion_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="right"
|
||||
android:hint="未录入"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp" />
|
||||
android:layout_height="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_type_bottom_icon" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/ll_type_edu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical">
|
||||
android:layout_marginLeft="15dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/tv_type_job"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="教育经历"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_16" />
|
||||
android:textColor="@color/gray_a9"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_teach"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_educate_hint"
|
||||
<ImageView
|
||||
android:id="@+id/iv_type_job"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:padding="20dp"
|
||||
android:text="未录入教育经历" />
|
||||
</RelativeLayout>
|
||||
android:layout_height="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_type_bottom_icon"
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:text="工作简历"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_16" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_resume"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_resume_hint"
|
||||
android:id="@+id/ll_type_work"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:padding="20dp"
|
||||
android:text="未录入工作简历" />
|
||||
</RelativeLayout>
|
||||
android:layout_marginLeft="15dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_resume_file"
|
||||
android:layout_width="match_parent"
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_type_work"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:layout_marginRight="10dp" />
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="工作简历"
|
||||
android:textColor="@color/gray_a9"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_type_work"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_type_bottom_icon"
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_type_honour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_type_honour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="个人荣誉"
|
||||
android:textColor="@color/gray_a9"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_type_honour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_type_bottom_icon"
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vp_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
@ -32,6 +32,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
tools:text="测试" />
|
||||
|
@ -38,6 +38,8 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".6"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/text_14"
|
||||
tools:text="发布时间" />
|
||||
|
||||
@ -47,6 +49,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".4"
|
||||
android:gravity="right"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/text_14"
|
||||
tools:text="发布人" />
|
||||
</LinearLayout>
|
||||
|
76
oamodule/src/main/res/layout/item_todo_p.xml
Normal file
76
oamodule/src/main/res/layout/item_todo_p.xml
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/tv_state"
|
||||
android:ellipsize="end"
|
||||
android:gravity="left"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/text_12"
|
||||
app:text_type_cus="2"
|
||||
tools:text="内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/shp_rectangle_blue_ra"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:text="处理"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/text_12" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".6"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/text_10"
|
||||
tools:text="发布时间" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".4"
|
||||
android:ellipsize="end"
|
||||
android:gravity="right"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/text_10"
|
||||
tools:text="发布人" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user