Commit b76f8dad authored by 陈赛康's avatar 陈赛康

上线版本代码;

parent da7093bf
......@@ -10,8 +10,8 @@ android {
applicationId "cn.com.bril.androidocr.studio"
minSdkVersion 21
targetSdkVersion 25
versionCode 14
versionName "3.4.0"
versionCode 31
versionName "5.1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
......
......@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.com.bril.androidocr.studio">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
......@@ -20,8 +20,7 @@
android:name=".ui.activity.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
......@@ -38,10 +37,8 @@
<activity
android:name=".ui.activity.OcrRecordActivity"
android:launchMode="singleTask" />
<activity android:name=".ui.activity.SearchActivity"></activity>
<activity android:name=".ui.activity.SearchActivity" />
<activity android:name=".ui.activity.OcrDetailActivity"></activity>
</application>
</manifest>
\ No newline at end of file
......@@ -3,4 +3,5 @@ package com.bril.baoding.studio.aidl;
interface GetUserid {
int getUserid();
String getUsername();
String getLoginName();
}
\ No newline at end of file
......@@ -8,16 +8,17 @@ import android.os.Environment;
public class Configs {
public static String USER_NAME="科员";
public static String USER_ID="11";
public static String USER_NAME="";
public static String USER_ID="";
public final static String IMAGE_BASE= Environment
.getExternalStorageDirectory().getPath() + "/documentocr/images";
.getExternalStorageDirectory().getPath() + "/wuzhihuaOA/images";
public final static String PDF_BASE= Environment
.getExternalStorageDirectory().getPath() + "/documentocr/pdfs";
.getExternalStorageDirectory().getPath() + "/wuzhihuaOA/pdfs";
public final static String TXT_BASE= Environment
.getExternalStorageDirectory().getPath() + "/documentocr/txts";
// public final static String TXT_BASE= "sdcard/documentocr/txts";
.getExternalStorageDirectory().getPath() + "/wuzhihuaOA/txts";
// public final static String TXT_BASE= "sdcard/wuzhihuaOA/txts";
public final static String WORD_BASE= Environment
.getExternalStorageDirectory().getPath() + "/documentocr/docs";
.getExternalStorageDirectory().getPath() + "/wuzhihuaOA/docs";
}
......@@ -8,11 +8,13 @@ public class RequestConfig {
public static int TAKE_PHOTO_REQUEST=1;
public static int PERMISSION_REQUEST_CODE=99;
public static String BASE_URL="http://zjk.haomo-studio.com/zhangjiakouOA/";
// public static String BASE_URL="http://192.168.1.72:8050/zhangjiakouOA/";
// public static String BASE_URL="http://143.19.128.79:19195/api/";
//添加
public static String ADD_URL=BASE_URL+"cc_files/new";
//上传文件
public static String UP_FILE=BASE_URL+"upload_ocr_file";
public static String UP_SOURCE_URL=BASE_URL+"upload_ocrfile_generate_thumb";
//编辑文件
public static String EDIT_FILE_URL=BASE_URL+"cc_files/";
//创建导出记录
......@@ -39,5 +41,7 @@ public class RequestConfig {
public final static String BATCH_CREATE_FILE_URL=BASE_URL+"cc_files/create/batch";
//创建文件
public final static String CREATE_FILE_URL=BASE_URL+"cc_files/new";
//获取文件
public final static String GET_FILE_FROM_NET=BASE_URL+"return_file?filePath=";
}
......@@ -45,8 +45,9 @@ public class HttpHolder {
x.http().post(params,callBack);
}
//上传文件
public static void upLoadFile(String path, VertifyActivity.HttpCallBack callBack){
RequestParams params=new RequestParams(RequestConfig.UP_FILE);
public static void upLoadFile(String url,String path,Callback.CommonCallback callBack){
// RequestParams params=new RequestParams(RequestConfig.UP_FILE);
RequestParams params=new RequestParams(url);
List<KeyValue> list = new ArrayList<>();
list.add(new KeyValue("file", new File(path)));//文件流数据
// list.add(new KeyValue("parameters", json.toString()));
......@@ -54,7 +55,7 @@ public class HttpHolder {
//添加请求参数
params.setRequestBody(body);
x.http().post(params,callBack);
};
}
//创建记录
public static void createFileRecord(String url,Map<String,Object> map,Callback.CommonCallback<String> listener){
RequestParams params=new RequestParams(url);
......@@ -126,6 +127,8 @@ public class HttpHolder {
if(entry.getKey().equals("downloadName")){
if(entry.getValue().contains("doc"))
params.setSaveFilePath(Configs.WORD_BASE+"/"+entry.getValue().substring(entry.getValue().lastIndexOf("/")+1));
else if(entry.getValue().contains("jpg") ||entry.getValue().contains("png"))
params.setSaveFilePath(Configs.IMAGE_BASE+"/"+entry.getValue().substring(entry.getValue().lastIndexOf("/")+1));
}
params.addBodyParameter(entry.getKey(),String.valueOf(entry.getValue()));
}
......@@ -192,4 +195,5 @@ public class HttpHolder {
params.addBodyParameter("fileName",name);
x.http().post(params,callBack);
}
}
......@@ -49,6 +49,7 @@ import cn.com.bril.androidocr.studio.ui.adapter.TabFragmentPagerAdapter;
import cn.com.bril.androidocr.studio.ui.fragment.ExportFragment;
import cn.com.bril.androidocr.studio.ui.fragment.ShareFragment;
import cn.com.bril.androidocr.studio.ui.widget.NoScrollViewPager;
import cn.com.bril.androidocr.studio.utils.FileUtil;
import cn.com.bril.androidocr.studio.utils.ScreenUtil;
import cn.com.bril.androidocr.studio.utils.ViewUtil;
......@@ -80,7 +81,7 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
@BindView(R.id.bottom_menu)
RelativeLayout bottomMenu;
@BindView(R.id.left_iv)
ImageView leftIv;
LinearLayout leftIv;
@BindView(R.id.tab_back)
ImageView tabBack;
// @BindView(R.id.tab_head)
......@@ -141,12 +142,14 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
OcrApplication.getInstance().addActivity(this);
// bindService();
bindService();
initViews();
......@@ -154,9 +157,13 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
initEvents();
checkPermission();
initPermission();
dialog = new ProgressDialog(this);
FileUtil.creatDir(Configs.WORD_BASE);
FileUtil.creatDir(Configs.TXT_BASE);
FileUtil.creatDir(Configs.IMAGE_BASE);
}
private void bindService() {
......@@ -164,20 +171,27 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
intent.setPackage("com.bril.baoding.studio");
bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE);
}
public void checkPermission() {
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
//权限还没有授予,需要在这里写申请权限的代码
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE},
PERMISSION_REQUEST_CODE);
} else {
//权限已经被授予,在这里直接写要执行的相应方法即可
// creatDir(Configs.IMAGE_CACHE);
// getIntentData();
private void initPermission() {
String permissions[] = {
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.CAMERA
};
ArrayList<String> toApplyList = new ArrayList<String>();
for (String perm : permissions) {
if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(this, perm)) {
toApplyList.add(perm);
//进入到这里代表没有权限.
}
}
String tmpList[] = new String[toApplyList.size()];
if (!toApplyList.isEmpty()) {
ActivityCompat.requestPermissions(this, toApplyList.toArray(tmpList), PERMISSION_REQUEST_CODE);
}
}
private void initViews() {
rightIv.setVisibility(View.VISIBLE);
rightTv.setVisibility(View.GONE);
......@@ -201,7 +215,6 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
ViewUtil.setNavImageSize(this, share, R.drawable.share_focused, 40, 45);//40
// ViewUtil.setNavImageSize(this, rename, R.drawable.rename, 50, 50);//40
ViewUtil.setNavImageSize(this, delete, R.drawable.delete_normal, 35, 45);//32
}
private void setImageGone() {
......@@ -215,7 +228,6 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
String tag = null;
switch (checkedId) {
case R.id.radio_1:
......@@ -260,7 +272,7 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
if(requestCode==PERMISSION_REQUEST_CODE){
for(int grant: grantResults){
if(grant!=PackageManager.PERMISSION_GRANTED)
Toast.makeText(this,"请开启读取与写入权限",Toast.LENGTH_SHORT).show();
Toast.makeText(this,"文件或拍照权限未开启",Toast.LENGTH_SHORT).show();
}
}
}
......@@ -283,7 +295,7 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
viewPager.setCurrentItem(position);
}
@OnClick({R.id.right_iv, R.id.fabbtn, R.id.tab_select, R.id.tab_back})
@OnClick({R.id.right_iv, R.id.fabbtn, R.id.tab_select, R.id.tab_back,R.id.left_iv})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.rightTv:
......@@ -319,6 +331,9 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
else
shareFragment.setAllItemChecked(isAllSelected);
break;
case R.id.left_iv:
finish();
break;
}
}
//展示工具栏
......@@ -351,7 +366,6 @@ public class MainActivity extends BaseActivity implements View.OnClickListener,
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
......
......@@ -3,6 +3,7 @@ package cn.com.bril.androidocr.studio.ui.activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
......@@ -18,7 +19,7 @@ public class OcrRecordActivity extends BaseActivity implements View.OnClickListe
@BindView(R.id.left_tv)
TextView title;
@BindView(R.id.left_iv)
ImageView back;
LinearLayout back;
@BindView(R.id.right_iv)
ImageView rightIv;
......
......@@ -6,7 +6,7 @@ import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
......@@ -17,17 +17,18 @@ import butterknife.OnClick;
import cn.com.bril.androidocr.studio.OcrApplication;
import cn.com.bril.androidocr.studio.R;
import cn.com.bril.androidocr.studio.beans.Image;
import cn.com.bril.androidocr.studio.ui.widget.MatrixImageView;
public class ProofreadActivity extends AppCompatActivity {
@BindView(R.id.left_iv)
ImageView lefIv;
LinearLayout lefIv;
@BindView(R.id.topTitle)
TextView topTitle;
@BindView(R.id.rightTv)
TextView rightTv;
@BindView(R.id.photo)
ImageView photo;
MatrixImageView photo;
@BindView(R.id.content)
EditText content;
@BindView(R.id.left_tv)
......
......@@ -16,6 +16,7 @@ import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
......@@ -28,6 +29,11 @@ import com.abbyy.mobile.ocr4.layout.MocrPrebuiltLayoutInfo;
import com.bumptech.glide.Glide;
import com.scanlibrary.ScanActivity;
import com.scanlibrary.ScanConstants;
import com.scanlibrary.Utils;
import org.json.JSONException;
import org.json.JSONObject;
import org.xutils.common.Callback;
import java.io.File;
import java.io.IOException;
......@@ -44,6 +50,8 @@ import cn.com.bril.androidocr.studio.beans.Image;
import cn.com.bril.androidocr.studio.configs.RequestConfig;
import cn.com.bril.androidocr.studio.engine.RecognitionContext;
import cn.com.bril.androidocr.studio.engine.RecognitionService;
import cn.com.bril.androidocr.studio.http.HttpHolder;
import cn.com.bril.androidocr.studio.utils.PhotoBitmapUtils;
import static cn.com.bril.androidocr.studio.utils.FileUtil.saveBitmap;
......@@ -63,6 +71,8 @@ public class RecognizeActivity extends AppCompatActivity {
TextView progress;
@BindView(R.id.bottom_progress)
RelativeLayout bottomProgress;
@BindView(R.id.rotate)
LinearLayout rotate;
private BroadcastReceiver _progressReceiver;
private BroadcastReceiver _prebuiltWordsInfoReceiver;
private BroadcastReceiver _rotationTypeDetectionReceiver;
......@@ -74,7 +84,7 @@ public class RecognizeActivity extends AppCompatActivity {
@BindView(R.id.bottom)
LinearLayout bottom;
@BindView(R.id.left_iv)
ImageView lefIv;
LinearLayout lefIv;
@BindView(R.id.contentIv)
ImageView contentIv;
@BindView(R.id.left_tv)
......@@ -83,24 +93,23 @@ public class RecognizeActivity extends AppCompatActivity {
int image_type;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recognize_layout);
OcrApplication.getInstance().addActivity(this);
ButterKnife.bind(this);
leftTv.setText("识别");
rightTv.setVisibility(View.GONE);
image_type=getIntentData();
image_type = getIntentData();
checkPermission();
}
public int getIntentData() {
return getIntent().getIntExtra("type",4);
return getIntent().getIntExtra("type", 4);
}
public void setButtonEnable(boolean flg) {
......@@ -145,8 +154,6 @@ public class RecognizeActivity extends AppCompatActivity {
}
}
@Override
protected void onStart() {
super.onStart();
......@@ -209,7 +216,7 @@ public class RecognizeActivity extends AppCompatActivity {
}
}
@OnClick({R.id.left_iv, R.id.bottom})
@OnClick({R.id.left_iv, R.id.bottom,R.id.rotate})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.left_iv:
......@@ -218,9 +225,13 @@ public class RecognizeActivity extends AppCompatActivity {
case R.id.bottom://识别触发
setRecogniztionView(View.VISIBLE);
Uri uri = Uri.fromFile(new File(image.getPath()));
// String path= Configs.IMAGE_BASE+"/1525487086902.jpg";
// uri= FileUtil.getFileUri(this,new File(path));
startRecogniziton(uri);
setButtonEnable(false);
break;
case R.id.rotate:
break;
}
}
......@@ -274,16 +285,17 @@ public class RecognizeActivity extends AppCompatActivity {
}
break;
case 99:
if(null ==data)
if (null == data)
finish();
else{
else {
Uri uri = data.getExtras().getParcelable(ScanConstants.SCANNED_RESULT);
Bitmap bitmap = null;
try {
bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri);
getContentResolver().delete(uri, null, null);
// iv.setImageBitmap(bitmap);
String path = saveBitmap(this, bitmap);
String path = PhotoBitmapUtils.amendRotatePhoto(saveBitmap(this, bitmap), this);
path = Utils.saveBitmap(bitmap, System.currentTimeMillis() + ".jpg").getPath();
String name = path.substring(path.lastIndexOf("/") + 1);
image = new Image(path, name);
......@@ -312,16 +324,57 @@ public class RecognizeActivity extends AppCompatActivity {
if (result != null) {
RecognitionContext.setRecognitionResult(result);
Intent intent = new Intent(this, VertifyActivity.class);
// image.setRecogniztion(getResources().getString(R.string.vertify_content));
image.setRecogniztion(result.toString());
intent.putExtra("image", image);
startActivity(intent);
/**
* {
"sourcePicturePath": "/home/haomo/zhangjiakou/upload/ocr/1525684712085.jpg",
"thumbPath": "/home/haomo/zhangjiakou/upload/ocr/thum/1525684712085.jpg"
}
{"code":0,"message":"ocr/1525684863204.jpg","fields":null}
*/
HttpHolder.upLoadFile(RequestConfig.UP_SOURCE_URL, image.getPath(), new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
if (result != null) {
JSONObject object = null;
try {
object = new JSONObject(result);
// String filePath = object.getString("message");
String filePath = object.getString("sourcePicturePath");
String thumPath = object.getString("thumbPath");
Intent intent = new Intent(RecognizeActivity.this, VertifyActivity.class);
intent.putExtra("image", image);
intent.putExtra("sourceFile", filePath);
intent.putExtra("sourceThumFile", thumPath);
startActivity(intent);
RecognizeActivity.this.finish();
} catch (JSONException e) {
e.printStackTrace();
}
}
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
Toast.makeText(RecognizeActivity.this,"网络异常,请重新操作",Toast.LENGTH_SHORT).show();
Log.e("TAG", ex.getMessage());
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
}
});
} else {
Toast.makeText(this, "No result.", Toast.LENGTH_LONG).show();
}
finish();
}
//识别结果 -失败
......@@ -347,14 +400,15 @@ public class RecognizeActivity extends AppCompatActivity {
private void dispatchRecognitionProgress(int progress) {
bar.setProgress(progress);
this.progress.setText("已识别:"+progress+"%");
this.progress.setText("已识别:" + progress + "%");
}
private void setRecogniztionView(int type){
if(type==View.GONE){
private void setRecogniztionView(int type) {
if (type == View.GONE) {
bottomProgress.setVisibility(type);
bottomBtn.setVisibility(View.VISIBLE);
bar.setProgress(0);
}else{
} else {
bottomBtn.setVisibility(View.GONE);
bottomProgress.setVisibility(type);
}
......
......@@ -27,6 +27,7 @@ public class FragmentListAdapter extends BaseAdapter {
private ListTextClickListener listTextClickListener;
private int show=View.GONE;
AdapterRadioSelectedListener radioSelectedListener;
ListFileClickListener fileOnClickListener;
public FragmentListAdapter(Context context, List<OcrRootBean> list, ListTextClickListener listTextClickListener, AdapterRadioSelectedListener radioSelectedListener) {
this.context=context;
this.infos=list;
......@@ -34,6 +35,15 @@ public class FragmentListAdapter extends BaseAdapter {
this.radioSelectedListener=radioSelectedListener;
}
public void setFileOnClickListener(ListFileClickListener fileOnClickListener){
this.fileOnClickListener=fileOnClickListener;
}
public void setAdapterData(List<OcrRootBean> list){
this.infos=list;
notifyDataSetChanged();
}
public void setRadioShow(int show){
this.show=show;
notifyDataSetChanged();
......@@ -87,7 +97,7 @@ public class FragmentListAdapter extends BaseAdapter {
String s=info.getIncludes().getCc_file().getFileName();
String fileName;
if(s.contains("."))
fileName=s.substring(0,s.indexOf("."));
fileName=s.substring(0,s.lastIndexOf("."));
else
fileName=s;
holder.title.setText(fileName);
......@@ -102,6 +112,7 @@ public class FragmentListAdapter extends BaseAdapter {
}else
holder.iv.setImageDrawable(context.getResources().getDrawable(R.drawable.word));
holder.iv.setOnClickListener(new ListFileOnClickListener(position));
holder.title.setOnClickListener(new ListTextOnClickListener(position));
holder.radioButton.setVisibility(show);
holder.radioButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
......@@ -127,6 +138,19 @@ public class FragmentListAdapter extends BaseAdapter {
}
}
class ListFileOnClickListener implements View.OnClickListener{
int position;
public ListFileOnClickListener(int position) {
this.position = position;
}
@Override
public void onClick(View v) {
fileOnClickListener.onListFileCallBack(position);
}
}
public interface AdapterRadioSelectedListener{
void adapterRadioSelectedCallBack();
}
......@@ -134,6 +158,10 @@ public class FragmentListAdapter extends BaseAdapter {
public interface ListTextClickListener{
void onListTextCallBack(int postion);
}
public interface ListFileClickListener{
void onListFileCallBack(int position);
}
class ViewHolder{
TextView title,time;
ImageView iv;
......
......@@ -4,6 +4,7 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
......@@ -41,6 +42,7 @@ import cn.com.bril.androidocr.studio.http.HttpHolder;
import cn.com.bril.androidocr.studio.http.MainHttpCallBack;
import cn.com.bril.androidocr.studio.interf.HandleMenuListener;
import cn.com.bril.androidocr.studio.interf.OnHttpListener;
import cn.com.bril.androidocr.studio.ui.activity.OcrDetailActivity;
import cn.com.bril.androidocr.studio.ui.adapter.FragmentListAdapter;
import cn.com.bril.androidocr.studio.ui.adapter.ShareFragmentAdapter;
import cn.com.bril.androidocr.studio.ui.pulltorefresh.PullToRefreshBase;
......@@ -56,9 +58,7 @@ import cn.com.bril.androidocr.studio.utils.ShareUtil;
* Created by sunny on 2018-3-12.
*/
public class ShareFragment extends Fragment implements OnHttpListener, FragmentListAdapter.ListTextClickListener, View.OnClickListener {
public class ShareFragment extends Fragment implements OnHttpListener, FragmentListAdapter.ListTextClickListener, View.OnClickListener , ShareFragmentAdapter.ListFileClickListener {
private PullToRefreshListView pullToRefreshListView;
private ListView listView;
private Context context;
......@@ -96,6 +96,7 @@ public class ShareFragment extends Fragment implements OnHttpListener, FragmentL
}
}
};
private ArrayList<Uri> shareFileUris;
private EditText reNameEdit;
private AlertDialog reNameDialog;
......@@ -153,16 +154,18 @@ public class ShareFragment extends Fragment implements OnHttpListener, FragmentL
pullToRefreshListView.setPullRefreshEnabled(true);
listView=pullToRefreshListView.getRefreshableView();
pullToRefreshListView.doPullRefreshing(true,500);
adaper=new ShareFragmentAdapter(context, beanList, this, new ShareFragmentAdapter.AdapterRadioSelectedListener() {
@Override
public void adapterRadioSelectedCallBack() {
setSelectedInfos(adaper.getSelectedInfo());
messageToMain.noticeMessage(adaper.getSelectedInfo().size());
}
});
adaper.setFileOnClickListener(this);
listView.setAdapter(adaper);
}
public void initEvents(){
pullToRefreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() {
......@@ -202,32 +205,24 @@ public class ShareFragment extends Fragment implements OnHttpListener, FragmentL
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String path=beanList.get(position).getIncludes().getCc_file().getFilePath();
String fileName=beanList.get(position).getIncludes().getCc_file().getFileName();
if(fileName.contains(".pdf")){
if(FileUtil.isFileExist(Configs.PDF_BASE+"/"+fileName)){
FileType.openFile(context,new File(Configs.PDF_BASE+"/"+fileName));
}
else{
downLoadFile(path, fileName,"single");
}
}else if(fileName.contains(".doc")|| fileName.contains(".docs")){
if(FileUtil.isFileExist(Configs.WORD_BASE+"/"+fileName)){
FileType.openFile(context,new File(Configs.WORD_BASE+"/"+fileName));
}
else
downLoadFile(path, fileName,"single");
}else if(fileName.contains(".txt")){
if(FileUtil.isFileExist(Configs.TXT_BASE+"/"+fileName)){
FileType.openFile(context,new File(Configs.TXT_BASE+"/"+fileName));
}
else
downLoadFile(path, fileName,"single");
}
String filePath=beanList.get(position).getIncludes().getCc_file().getFileSource();
String content=beanList.get(position).getIncludes().getCc_file().getContent();
Intent intent=new Intent(context, OcrDetailActivity.class);
intent.putExtra("image",filePath);
intent.putExtra("content",content);
context.startActivity(intent);
}
});
}
@Override
public void onResume() {
super.onResume();
pullToRefreshListView.doPullRefreshing(true,500);
if(adaper!=null)
adaper.setRadioShow(View.GONE);
}
public void setAllItemChecked(boolean flg){
adaper.setRadioAllSelected(flg);
}
......@@ -246,7 +241,7 @@ public class ShareFragment extends Fragment implements OnHttpListener, FragmentL
params.addBodyParameter("filters",json);
String json2="{\"cc_file\":{\"includes\":[\"file_id\"]}}";
params.addBodyParameter("includes",json2);
x.http().post(params,new MainHttpCallBack("list",this));
x.http().get(params,new MainHttpCallBack("list",this));
}
//下载文件
private void downLoadFile(String path, String fileName, final String type) {
......@@ -300,7 +295,7 @@ public class ShareFragment extends Fragment implements OnHttpListener, FragmentL
shareFileUris = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
OcrRootBean.Cc_file cc_file = list.get(i).getIncludes().getCc_file();
String type = cc_file.getFileName().substring(cc_file.getFileName().indexOf(".") + 1);
String type = cc_file.getFileName().substring(cc_file.getFileName().lastIndexOf(".") + 1);
String filePath = "";
if ("doc".equals(type) || "docs".equals(type))
filePath = Configs.WORD_BASE + "/" + cc_file.getFileName();
......@@ -398,6 +393,7 @@ public class ShareFragment extends Fragment implements OnHttpListener, FragmentL
pullToRefreshListView.onPullUpRefreshComplete();
pullToRefreshListView.onPullDownRefreshComplete();
}
Toast.makeText(context,"网络异常,请检查",Toast.LENGTH_SHORT).show();
}
@Override
......@@ -427,4 +423,30 @@ public class ShareFragment extends Fragment implements OnHttpListener, FragmentL
break;
}
}
@Override
public void onListFileCallBack(int position) {
String path=beanList.get(position).getIncludes().getCc_file().getFilePath();
String fileName=beanList.get(position).getIncludes().getCc_file().getFileName();
if(fileName.contains(".pdf")){
if(FileUtil.isFileExist(Configs.PDF_BASE+"/"+fileName)){
FileType.openFile(context,new File(Configs.PDF_BASE+"/"+fileName));
}
else{
downLoadFile(path, fileName,"single");
}
}else if(fileName.contains(".doc")|| fileName.contains(".docs")){
if(FileUtil.isFileExist(Configs.WORD_BASE+"/"+fileName)){
FileType.openFile(context,new File(Configs.WORD_BASE+"/"+fileName));
}
else
downLoadFile(path, fileName,"single");
}else if(fileName.contains(".txt")){
if(FileUtil.isFileExist(Configs.TXT_BASE+"/"+fileName)){
FileType.openFile(context,new File(Configs.TXT_BASE+"/"+fileName));
}
else
downLoadFile(path, fileName,"single");
}
}
}
......@@ -23,7 +23,7 @@ public class FileUtil {
public static String saveBitmap(Context context, Bitmap mBitmap) {
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new
Date());
String savePath= ScanConstants.IMAGE_PATH+"/"+"IMG_" + timeStamp +
String savePath= ScanConstants.IMAGE_PATH+"/" + timeStamp +
".jpg";
File filePic;
......@@ -45,6 +45,16 @@ public class FileUtil {
return filePic.getAbsolutePath();
}
//文件夹创建
public static void creatDir(String path){
if(!isFileExist(path)){
File file=new File(path);
if(!file.exists())
file.mkdirs();
}
}
//判断文件是否存在
public static boolean isFileExist(String path){
try
......@@ -75,4 +85,5 @@ public class FileUtil {
}
return tempFileUri;
}
}
......@@ -18,9 +18,10 @@ public class ShareUtil {
// 調用系統方法分享文件
public static void shareFile(Activity activity, File file) {
if (null != file && file.exists()) {
Intent share = new Intent(Intent.ACTION_SEND);
share.putExtra(Intent.EXTRA_STREAM, FileUtil.getFileUri(activity,file));
share.putExtra(Intent.EXTRA_STREAM,FileUtil.getFileUri(activity,file) );
share.setType(getMimeType(file.getAbsolutePath()));//此处可发送多种文件
share.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
......@@ -55,6 +56,7 @@ public class ShareUtil {
Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE);//发送多个文件
intent.setType("*/*");//多个文件格式
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);//Intent.EXTRA_STREAM同于传输文件流
activity.startActivity(Intent.createChooser(intent, "多文件分享"));
activity.startActivity(intent);//Intent.createChooser(intent, "多文件分享")
}
}
......@@ -11,11 +11,12 @@
android:id="@+id/head"
layout="@layout/top_title_layout"/>
<ImageView
<cn.com.bril.androidocr.studio.ui.widget.MatrixImageView
android:id="@+id/photo"
android:layout_width="500dp"
android:layout_height="300dp"
android:layout_width="300dp"
android:layout_height="250dp"
android:layout_centerHorizontal="true"
android:scaleType="matrix"
android:layout_below="@+id/head"/>
<ScrollView
......@@ -30,6 +31,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="300dp"
android:gravity="start"
android:padding="8dp"
android:textColorHighlight="@color/yellow"
android:background="@color/white"/>
</ScrollView>
......
......@@ -7,6 +7,7 @@
>
<TextView
android:id="@+id/tilte"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/export"
......@@ -18,19 +19,20 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/bg_normal"/>
<LinearLayout
android:id="@+id/pdfLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:visibility="gone">
>
<TextView
android:id="@+id/pdf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Pdf导出"
android:text="WPS导出"
android:textColor="@color/txtcolor"
android:textSize="@dimen/txt16sp" />
......
......@@ -9,6 +9,7 @@
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/word"
android:padding="5dp"
/>
......@@ -18,13 +19,18 @@
android:orientation="vertical"
android:gravity="center_vertical"
android:layout_marginLeft="15dp"
android:padding="10dp"
android:layout_toRightOf="@+id/icon">
android:layout_toRightOf="@+id/icon"
android:padding="5dp"
android:layout_centerVertical="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:minWidth="100dp"
android:singleLine="true"
android:id="@+id/title"
android:textSize="@dimen/txt16sp"
android:focusable="false"
......
......@@ -10,8 +10,10 @@
<ImageView
android:id="@+id/contentIv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="280dp"
android:layout_height="350dp"
android:scaleType="centerInside"
android:layout_margin="12dp"
android:layout_below="@+id/head"
android:layout_above="@+id/bottom"
android:layout_centerInParent="true"
......@@ -74,6 +76,7 @@
<LinearLayout
android:id="@+id/rotate"
android:layout_width="90dp"
android:layout_height="35dp"
android:background="@drawable/gary_round_bg"
......
......@@ -6,14 +6,23 @@
android:id="@+id/topBarLayout"
>
<ImageView
<LinearLayout
android:id="@+id/left_iv"
android:layout_width="12dp"
android:layout_height="15dp"
android:src="@drawable/back_icon"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
/>
android:gravity="center_vertical">
<ImageView
android:layout_width="15dp"
android:layout_height="18dp"
android:src="@drawable/back_icon"
android:layout_marginLeft="15dp"
/>
</LinearLayout>
<TextView
android:id="@+id/left_tv"
......
......@@ -9,6 +9,7 @@
<!--Button按钮正常状态颜色-->
<item name="colorButtonNormal">@color/normal</item>
<!--//colorAccent-->
<!--<item name="android:colorControlNormal">@color/normal</item>-->
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
......
......@@ -16,7 +16,7 @@
<activity
android:name=".ScanActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name" >
android:label="@string/app_name">
</activity>
<provider
......
package com.scanlibrary;
import android.graphics.Bitmap;
import android.net.Uri;
/**
......@@ -9,5 +10,9 @@ public interface IScanner {
void onBitmapSelect(Uri uri);
void onBitmapScan(Bitmap bitmap);
void onScanFinish(Uri uri);
void onRotate(Bitmap bitmap);
}
......@@ -19,6 +19,7 @@ import android.view.ViewGroup;
import android.widget.ImageButton;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -63,9 +64,11 @@ public class PickImageFragment extends Fragment {
}
}
private void clearTempImages() {
try {
File tempFolder = new File(ScanConstants.IMAGE_PATH);
File tempFolder = new File(ScanConstants.IMAGE_CACHE);
for (File f : tempFolder.listFiles())
f.delete();
} catch (Exception e) {
......@@ -118,16 +121,17 @@ public class PickImageFragment extends Fragment {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
File file = createImageFile();
boolean isDirectoryCreated = file.getParentFile().mkdirs();
Uri tempFileUri;
Log.d("", "openCamera: isDirectoryCreated: " + isDirectoryCreated);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Uri tempFileUri = FileProvider.getUriForFile(getActivity().getApplicationContext(),
tempFileUri = FileProvider.getUriForFile(getActivity().getApplicationContext(),
"com.scanlibrary.provider", // As defined in Manifest
file);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, tempFileUri);
cameraIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
} else {
Uri tempFileUri = Uri.fromFile(file);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, tempFileUri);
tempFileUri = Uri.fromFile(file);
}
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, tempFileUri);
startActivityForResult(cameraIntent, ScanConstants.START_CAMERA_REQUEST_CODE);
}
......@@ -135,7 +139,7 @@ public class PickImageFragment extends Fragment {
clearTempImages();
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new
Date());
File file = new File(ScanConstants.IMAGE_PATH, "IMG_" + timeStamp +
File file = new File(ScanConstants.IMAGE_CACHE, timeStamp +
".jpg");
fileUri = Uri.fromFile(file);
return file;
......@@ -150,12 +154,13 @@ public class PickImageFragment extends Fragment {
switch (requestCode) {
case ScanConstants.START_CAMERA_REQUEST_CODE:
bitmap = getBitmap(fileUri);
// Bundle bundle = data.getExtras();
// bitmap = (Bitmap) bundle.get("data");
// bitmap=decodeUriAsBitmap(fileUri);
break;
case ScanConstants.PICKFILE_REQUEST_CODE:
bitmap = getBitmap(data.getData());
// Uri originalUri = data.getData(); //获得图片的uri
bitmap=getBitmap(data.getData());
break;
default:
break;
......@@ -163,14 +168,24 @@ public class PickImageFragment extends Fragment {
} catch (Exception e) {
e.printStackTrace();
}
if (bitmap != null) {
// sendToRoatate(bitmap);
postImagePick(bitmap);
}
} else {
getActivity().finish();
}
if (bitmap != null) {
postImagePick(bitmap);
if (isIntentPreferenceSet()) {
handleIntentPreference();
} else {
getActivity().finish();
}
// getActivity().finish();
}
}
protected void sendToRoatate(Bitmap bitmap){
scanner.onRotate(bitmap);
}
protected void postImagePick(Bitmap bitmap) {
Uri uri = Utils.getUri(getActivity(), bitmap);
// Uri uri = Uri.parse(MediaStore.Images.Media.insertImage(context.getContentResolver(), bitmap, null,null));
......@@ -180,7 +195,16 @@ public class PickImageFragment extends Fragment {
private Bitmap getBitmap(Uri selectedimg) throws IOException {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 3;
int height = options.outHeight;
int width= options.outWidth;
int minLen = Math.min(height, width); // 原图的最小边长
int inSampleSize = 2; // 默认像素压缩比例,压缩为原图的1/2
if(minLen > 100) { // 如果原始图像的最小边长大于100dp(此处单位我认为是dp,而非px)
float ratio = (float)minLen / 100.0f; // 计算像素压缩比例
inSampleSize = (int)ratio;
}
options.inJustDecodeBounds = false; // 计算好压缩比例后,这次可以去加载原图了
options.inSampleSize = inSampleSize;
AssetFileDescriptor fileDescriptor = null;
fileDescriptor =
getActivity().getContentResolver().openAssetFileDescriptor(selectedimg, "r");
......@@ -189,4 +213,18 @@ public class PickImageFragment extends Fragment {
fileDescriptor.getFileDescriptor(), null, options);
return original;
}
/**
* @param uri:图片的本地url地址
* @return Bitmap;
*/
private Bitmap decodeUriAsBitmap(Uri uri) {
Bitmap bitmap = null;
try {
bitmap = BitmapFactory.decodeStream(getActivity().getContentResolver().openInputStream(uri));
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
}
return bitmap;
}
}
\ No newline at end of file
......@@ -95,13 +95,13 @@ public class ResultFragment extends Fragment {
Uri uri = Utils.getUri(getActivity(), bitmap);
data.putExtra(ScanConstants.SCANNED_RESULT, uri);
getActivity().setResult(Activity.RESULT_OK, data);
getActivity().finish();
original.recycle();
System.gc();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
dismissDialog();
getActivity().finish();
}
});
} catch (Exception e) {
......
......@@ -8,6 +8,8 @@ import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import static com.scanlibrary.ScanConstants.ROTATE_BITMAP;
/**
* Created by jhansi on 28/03/15.
*/
......@@ -31,6 +33,7 @@ public class ScanActivity extends Activity implements IScanner, ComponentCallbac
fragmentTransaction.commit();
}
protected int getPreferenceContent() {
return getIntent().getIntExtra(ScanConstants.OPEN_INTENT_PREFERENCE, 0);
}
......@@ -48,6 +51,19 @@ public class ScanActivity extends Activity implements IScanner, ComponentCallbac
fragmentTransaction.commit();
}
@Override
public void onBitmapScan(Bitmap bitmap) {
ScanFragment fragment = new ScanFragment();
Bundle bundle = new Bundle();
bundle.putParcelable(ScanConstants.SELECTED_BITMAP, bitmap);
fragment.setArguments(bundle);
android.app.FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.content, fragment);
fragmentTransaction.addToBackStack(ScanFragment.class.toString());
fragmentTransaction.commit();
}
@Override
public void onScanFinish(Uri uri) {
ResultFragment fragment = new ResultFragment();
......@@ -61,6 +77,20 @@ public class ScanActivity extends Activity implements IScanner, ComponentCallbac
fragmentTransaction.commit();
}
@Override
public void onRotate(Bitmap bitmap) {
RotateFragment fragment=new RotateFragment();
Bundle bundle = new Bundle();
bundle.putParcelable(ScanConstants.ROTATE_BITMAP,bitmap);
fragment.setArguments(bundle);
android.app.FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.content, fragment);
fragmentTransaction.addToBackStack(RotateFragment.class.toString());
fragmentTransaction.commit();
}
@Override
public void onTrimMemory(int level) {
switch (level) {
......@@ -97,9 +127,10 @@ public class ScanActivity extends Activity implements IScanner, ComponentCallbac
new AlertDialog.Builder(this)
.setTitle(R.string.low_memory)
.setMessage(R.string.low_memory_message)
.create()
.show();
.create();
// .show();
break;
default:
/*
Release any non-critical data structures.
......
......@@ -15,7 +15,11 @@ public class ScanConstants {
public final static int OPEN_MEDIA = 5;
public final static String SCANNED_RESULT = "scannedResult";
public final static String IMAGE_PATH = Environment
.getExternalStorageDirectory().getPath() + "/documentocr/images";
.getExternalStorageDirectory().getPath() + "/wuzhihuaOA/images";
public final static String IMAGE_CACHE= Environment
.getExternalStorageDirectory().getPath() + "/wuzhihuaOA/cache";
public final static String SELECTED_BITMAP = "selectedBitmap";
public final static String ROTATE_BITMAP="rotateBitmap";
}
......@@ -19,6 +19,7 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import java.io.IOException;
import java.util.ArrayList;
......@@ -39,6 +40,8 @@ public class ScanFragment extends Fragment {
private ProgressDialogFragment progressDialogFragment;
private IScanner scanner;
private Bitmap original;
private TextView rotateTv;
private boolean isRotate=false;
@Override
public void onAttach(Activity activity) {
......@@ -66,10 +69,12 @@ public class ScanFragment extends Fragment {
scanButton.setOnClickListener(new ScanButtonClickListener());
sourceFrame = (FrameLayout) view.findViewById(R.id.sourceFrame);
polygonView = (PolygonView) view.findViewById(R.id.polygonView);
rotateTv= (TextView) view.findViewById(R.id.rotate);
sourceFrame.post(new Runnable() {
@Override
public void run() {
original = getBitmap();
// original=getRotateBitmap();
if (original != null) {
setBitmap(original);
}
......@@ -77,6 +82,11 @@ public class ScanFragment extends Fragment {
});
}
private Bitmap getRotateBitmap(){
Bitmap bitmap= getArguments().getParcelable(ScanConstants.SELECTED_BITMAP);
return bitmap;
}
private Bitmap getBitmap() {
Uri uri = getUri();
try {
......@@ -97,6 +107,11 @@ public class ScanFragment extends Fragment {
private void setBitmap(Bitmap original) {
Bitmap scaledBitmap = scaledBitmap(original, sourceFrame.getWidth(), sourceFrame.getHeight());
sourceImageView.setImageBitmap(scaledBitmap);
initPolygonView();
}
private void initPolygonView() {
Bitmap tempBitmap = ((BitmapDrawable) sourceImageView.getDrawable()).getBitmap();
Map<Integer, PointF> pointFs = getEdgePoints(tempBitmap);
polygonView.setPoints(pointFs);
......@@ -153,6 +168,8 @@ public class ScanFragment extends Fragment {
private class ScanButtonClickListener implements View.OnClickListener {
@Override
public void onClick(View v) {
Map<Integer, PointF> points = polygonView.getPoints();
if (isScanPointsValid(points)) {
new ScanAsyncTask(points).execute();
......@@ -215,6 +232,7 @@ public class ScanFragment extends Fragment {
protected Bitmap doInBackground(Void... params) {
Bitmap bitmap = getScannedBitmap(original, points);
Uri uri = Utils.getUri(getActivity(), bitmap);
// uri=Utils.saveBitmap(bitmap,System.currentTimeMillis() + ".jpg");
scanner.onScanFinish(uri);
return bitmap;
}
......
......@@ -6,6 +6,9 @@ import android.net.Uri;
import android.provider.MediaStore;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**
......@@ -28,4 +31,33 @@ public class Utils {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(context.getContentResolver(), uri);
return bitmap;
}
/**
* 将得到的一个Bitmap保存到SD卡上,得到一个URI地址
*/
public static Uri saveBitmap(Bitmap bm,String name) {
//在SD卡上创建目录
File tmpDir = new File(ScanConstants.IMAGE_PATH);
if (!tmpDir.exists()) {
tmpDir.mkdir();
}
File img = new File(tmpDir.getAbsolutePath() ,name);
if(img.exists())
img.delete();
try {
img.createNewFile();
FileOutputStream fos = new FileOutputStream(img);
bm.compress(Bitmap.CompressFormat.PNG, 85, fos);
fos.flush();
fos.close();
return Uri.fromFile(img);
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}
\ No newline at end of file
......@@ -110,6 +110,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="centerInside"
android:layout_margin="@dimen/scanPadding" />
</FrameLayout>
......
......@@ -5,6 +5,8 @@
android:background="@android:color/black"
android:orientation="vertical">
<Button
android:id="@+id/scanButton"
android:layout_width="fill_parent"
......@@ -13,7 +15,7 @@
android:background="@color/normal"
android:orientation="horizontal"
android:padding="@dimen/bottom_bar_padding"
android:textSize="16sp"
android:textColor="@android:color/white"
android:text="@string/scan"/>
......@@ -44,8 +46,41 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:visibility="gone"></com.scanlibrary.PolygonView>
android:visibility="gone"/>
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="49dp"
android:background="@color/normal"
android:gravity="center_vertical"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:textSize="18sp"
android:textColor="@color/white"
android:text="裁剪页"/>
<TextView
android:id="@+id/rotate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:layout_alignParentRight="true"
android:textSize="16sp"
android:layout_marginRight="15dp"
android:text="旋转"
android:visibility="gone"/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -11,4 +11,6 @@
<color name="status_bar">#FF034D71</color>
<color name="normal">#00BF8B</color>
<color name="white">#fff</color>
</resources>
\ No newline at end of file
......@@ -10,5 +10,10 @@
<dimen name="bottom_bar_padding">15dp</dimen>
<dimen name="txt18">18sp</dimen>
<dimen name="txt16">16sp</dimen>
<dimen name="txt14">14sp</dimen>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
<external-path name="external_files" path="wuzhihuaOA/"/>
<!--external_files-->
</paths>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment