Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AndiovisualRecord
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yu_Tung
AndiovisualRecord
Commits
dbf8746f
Commit
dbf8746f
authored
Jun 30, 2020
by
Yu_Tung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉多餘的圖片
parent
4b1c599e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
MainActivity.java
...a/com/example/audiovisualrecord/ui/main/MainActivity.java
+7
-3
login.xml
app/src/main/res/layout/login.xml
+2
-2
No files found.
app/src/main/java/com/example/audiovisualrecord/ui/main/MainActivity.java
View file @
dbf8746f
...
...
@@ -263,20 +263,23 @@ public class MainActivity extends BaseActivity implements MainContract.View, Vie
}
try
{
Date
c
=
Calendar
.
getInstance
(
Locale
.
TAIWAN
).
getTime
();
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyyMMdd_HH
_mm_
ss"
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyyMMdd_HH
mm
ss"
);
String
formattedDate
=
df
.
format
(
c
);
filePhth
=
path
+
"/"
+
formattedDate
+
".
pn
g"
;
filePhth
=
path
+
"/"
+
formattedDate
+
".
jp
g"
;
fileName
=
System
.
currentTimeMillis
()
+
""
;
Log
.
e
(
"filepath"
,
filePhth
);
File
file1
=
new
File
(
filePhth
);
fileOutputStream
=
new
FileOutputStream
(
file1
.
getPath
());
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
100
,
fileOutputStream
);
fileOutputStream
.
close
();
//图片路径
// MediaStore.Images.Media.insertImage(context.getContentResolver(),
// filePhth,fileName , null);
MediaStore
.
Images
.
Media
.
insertImage
(
this
.
getContentResolver
(),
bitmap
,
""
,
""
);
// MediaStore.Images.Media.insertImage(this.getContentResolver(), bitmap, "", "");
this
.
sendBroadcast
(
new
Intent
(
Intent
.
ACTION_MEDIA_SCANNER_SCAN_FILE
,
Uri
.
parse
(
"file://"
+
file1
.
getAbsolutePath
())));
Log
.
d
(
"aaa"
,
file1
.
getAbsolutePath
()
+
"-----"
+
path
);
// context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));
...
...
@@ -327,6 +330,7 @@ public class MainActivity extends BaseActivity implements MainContract.View, Vie
Bitmap
myBitmap
=
BitmapFactory
.
decodeFile
(
mCameraImagePath
);
String
path1
=
Environment
.
getExternalStorageDirectory
().
toString
()
+
"/Pictures"
;
SavaImage
(
myBitmap
,
path1
);
...
...
app/src/main/res/layout/login.xml
View file @
dbf8746f
...
...
@@ -39,7 +39,7 @@
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:hint=
"@string/login_account_hint"
android:text=
"N000158385"
android:textColorHint=
"@color/white"
android:paddingStart=
"100dp"
app:layout_constraintWidth_percent=
"0.9"
...
...
@@ -55,7 +55,7 @@
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:hint=
"@string/login_password_hint"
android:text=
"781122222"
android:textColorHint=
"@color/white"
android:paddingStart=
"100dp"
android:background=
"@drawable/bg_login_password"
...
...
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