Skip to content

Commit d3e40a9

Browse files
author
Lesion
committed
change: 解决编译失败的问题
1 parent e7d9b1e commit d3e40a9

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

demo/src/main/java/com/xinlan/imageeditandroid/MainActivity.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
4848

4949
private View mTakenPhoto;//拍摄照片用于编辑
5050
private Uri photoURI = null;
51+
private String savePath = null;
5152

5253
@Override
5354
public void onCreate(Bundle savedInstanceState) {
5455
super.onCreate(savedInstanceState);
55-
setContentView(R.layout.image_editor_activity_main);
56+
setContentView(R.layout.activity_main);
5657
initView();
5758
}
5859

@@ -142,7 +143,8 @@ private void doTakePhoto() {
142143
*/
143144
private void editImageClick() {
144145
File outputFile = FileUtils.genEditFile();
145-
EditImageActivity.start(this,path,outputFile.getAbsolutePath(),ACTION_REQUEST_EDITIMAGE);
146+
savePath = outputFile.getAbsolutePath();
147+
EditImageActivity.start(this,path,savePath,ACTION_REQUEST_EDITIMAGE);
146148
}
147149

148150
/**
@@ -203,7 +205,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
203205
handleTakePhoto(data);
204206
break;
205207
case ACTION_REQUEST_EDITIMAGE://
206-
handleEditorImage(data);
208+
handleEditorImage();
207209
break;
208210
}// end switch
209211
}
@@ -222,23 +224,14 @@ private void handleTakePhoto(Intent data) {
222224
}
223225
}
224226

225-
private void handleEditorImage(Intent data) {
226-
String newFilePath = data.getStringExtra(EditImageActivity.EXTRA_OUTPUT);
227-
boolean isImageEdit = data.getBooleanExtra(EditImageActivity.IMAGE_IS_EDIT, false);
228-
229-
if (isImageEdit){
230-
Toast.makeText(this, getString(R.string.save_path, newFilePath), Toast.LENGTH_LONG).show();
231-
}else{//未编辑 还是用原来的图片
232-
newFilePath = data.getParcelableExtra(EditImageActivity.FILE_PATH);;
233-
}
234-
//System.out.println("newFilePath---->" + newFilePath);
227+
private void handleEditorImage() {
228+
System.out.println("newFilePath---->" + savePath);
235229
//File file = new File(newFilePath);
236230
//System.out.println("newFilePath size ---->" + (file.length() / 1024)+"KB");
237-
Log.d("image is edit", isImageEdit + "");
238231

239232

240233
LoadImageTask loadTask = new LoadImageTask();
241-
loadTask.execute(getImageContentUri(this,new File(newFilePath)));
234+
loadTask.execute(getImageContentUri(this,new File(savePath)));
242235
}
243236

244237
private void handleSelectFromAblum(Intent data) {

imageeditlibrary/src/main/java/com/xinlan/imageeditlibrary/editimage/task/StickerTask.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
* 贴图合成任务 抽象类
1919
*/
2020
public abstract class StickerTask extends AsyncTask<Bitmap, Void, Bitmap> {
21-
private Dialog dialog;
2221

2322
private EditImageActivity mContext;
2423

@@ -32,10 +31,6 @@ protected void onPreExecute() {
3231

3332
if (mContext.isFinishing())
3433
return;
35-
36-
dialog = mContext.getLoadingDialog(mContext, R.string.image_editor_saving_image,
37-
false);
38-
dialog.show();
3934
}
4035

4136
@Override
@@ -63,21 +58,18 @@ protected Bitmap doInBackground(Bitmap... params) {
6358
@Override
6459
protected void onCancelled() {
6560
super.onCancelled();
66-
dialog.dismiss();
6761
}
6862

6963
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
7064
@Override
7165
protected void onCancelled(Bitmap result) {
7266
super.onCancelled(result);
73-
dialog.dismiss();
7467
}
7568

7669
@Override
7770
protected void onPostExecute(Bitmap result) {
7871
super.onPostExecute(result);
7972
onPostResult(result);
80-
dialog.dismiss();
8173
}
8274

8375
public abstract void handleImage(Canvas canvas, Matrix m);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="rectangle">
4+
<solid android:color="@color/image_editor_main_backgroud" />
5+
<corners android:radius="2dp" />
6+
</shape>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:color="#ffffff"
5+
tools:ignore="NewApi">
6+
<item android:drawable="@drawable/image_edit_click_ripple"/>
7+
</ripple>

imageeditlibrary/src/main/res/layout/image_editor_activity_main.xml

Whitespace-only changes.

0 commit comments

Comments
 (0)