Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fe7cd352
authored
Sep 05, 2023
by
wukun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0905
parent
c120d69a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
baseSDK/src/main/java/com/dayu/utils/ImageFileCropEngine.java
baseSDK/src/main/java/com/dayu/utils/ImageFileCropEngine.java
View file @
fe7cd352
...
...
@@ -33,8 +33,13 @@ public class ImageFileCropEngine implements CropFileEngine {
UCrop
.
Options
options
=
buildOptions
(
fragment
);
UCrop
uCrop
=
UCrop
.
of
(
srcUri
,
destinationUri
,
dataSource
);
options
.
withAspectRatio
(
1
,
1
);
float
x
=
0
;
if
(
isFree
){
x
=
1.5
F
;
}
else
{
x
=
1
;
}
options
.
withAspectRatio
(
x
,
1
);
options
.
setHideBottomControls
(
true
);
options
.
setCropOutputPathDir
(
fragment
.
requireActivity
().
getFilesDir
().
getAbsolutePath
()
...
...
@@ -48,20 +53,14 @@ public class ImageFileCropEngine implements CropFileEngine {
}
private
UCrop
.
Options
buildOptions
(
Fragment
fragment
)
{
float
x
=
0
;
if
(
isFree
){
x
=
1.5
F
;
}
else
{
x
=
1
;
}
UCrop
.
Options
options
=
new
UCrop
.
Options
();
// options.setHideBottomControls(!cb_hide.isChecked());
// options.setFreeStyleCropEnabled(isFree);
// options.setShowCropFrame(cb_showCropFrame.isChecked());
// options.setShowCropGrid(cb_showCropGrid.isChecked());
// options.setCircleDimmedLayer(cb_crop_circular.isChecked());
options
.
withAspectRatio
(
x
,
1
);
options
.
setHideBottomControls
(
true
);
// options.withAspectRatio(1
, 1);
//
options.setHideBottomControls(true);
// options.setCropOutputPathDir(getApplication().getFilesDir().getAbsolutePath() + "/wkCrop");
// options.setCropOutputFileName(System.currentTimeMillis() + ".png");
options
.
setStatusBarColor
(
ContextCompat
.
getColor
(
fragment
.
getContext
(),
R
.
color
.
white
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment