├── README.md
├── VCameraDemo
├── .classpath
├── .gitattributes
├── .gitignore
├── .project
├── .settings
│ ├── org.eclipse.core.resources.prefs
│ └── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── assets
│ ├── Common.zip
│ ├── Empty.zip
│ ├── FilterAssets.zip
│ ├── MusicAssets.zip
│ └── MusicVideoAssets.zip
├── ic_launcher-web.png
├── libs
│ ├── android-support-v4.jar
│ ├── gson-2.2.4.jar
│ ├── nineoldandroids-2.4.0.jar
│ └── pinyin4j-2.5.0.jar
├── proguard-project.txt
├── project.properties
├── res
│ ├── anim
│ │ ├── push_bottom_in.xml
│ │ ├── push_bottom_out.xml
│ │ ├── push_up_in.xml
│ │ ├── push_up_out.xml
│ │ └── record_focus.xml
│ ├── color
│ │ ├── record_text_color_selector.xml
│ │ └── video_edit_text_color_selector.xml
│ ├── drawable-hdpi
│ │ ├── aii.png
│ │ ├── contact_list_normal.png
│ │ ├── contact_list_pressed.png
│ │ ├── find_normal.png
│ │ ├── find_pressed.png
│ │ ├── head.png
│ │ ├── ic_launcher.png
│ │ ├── ic_sex_female.png
│ │ ├── ic_sex_male.png
│ │ ├── icon.png
│ │ ├── icon_addfriend.png
│ │ ├── icon_de_game.png
│ │ ├── icon_de_nearby.png
│ │ ├── icon_de_ping.png
│ │ ├── icon_de_saoyisao.png
│ │ ├── icon_de_shop.png
│ │ ├── icon_de_yao.png
│ │ ├── icon_me_card.png
│ │ ├── icon_me_collect.png
│ │ ├── icon_me_money.png
│ │ ├── icon_me_photo.png
│ │ ├── icon_me_setting.png
│ │ ├── icon_me_smail.png
│ │ ├── icon_public.png
│ │ ├── icon_qunliao.png
│ │ ├── icon_tip.png
│ │ ├── profile_normal.png
│ │ ├── profile_pressed.png
│ │ ├── right.png
│ │ ├── search_ba.png
│ │ ├── search_icon.png
│ │ ├── v2.png
│ │ ├── weixin_normal.png
│ │ └── weixin_pressed.png
│ ├── drawable-ldpi
│ │ ├── eye.png
│ │ ├── eye_gray_1.png
│ │ ├── eye_gray_2.png
│ │ ├── eye_light1.png
│ │ └── eye_light2.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── play_big.png
│ │ ├── preview_music_bg.9.png
│ │ ├── preview_music_original.png
│ │ ├── preview_music_original_disable.png
│ │ ├── preview_music_theme.png
│ │ ├── preview_music_theme_disable.png
│ │ ├── priview_orig_volumn_close.png
│ │ ├── priview_orig_volumn_open.png
│ │ ├── priview_theme_volumn_close.png
│ │ ├── priview_theme_volumn_open.png
│ │ ├── record_back.png
│ │ ├── record_camera_flash_led_off_disable.png
│ │ ├── record_camera_flash_led_off_normal.png
│ │ ├── record_camera_flash_led_off_pressed.png
│ │ ├── record_camera_flash_led_on_disable.png
│ │ ├── record_camera_flash_led_on_normal.png
│ │ ├── record_camera_flash_led_on_pressed.png
│ │ ├── record_camera_switch_disable.png
│ │ ├── record_camera_switch_normal.png
│ │ ├── record_camera_switch_pressed.png
│ │ ├── record_cancel_normal.png
│ │ ├── record_cancel_press.png
│ │ ├── record_controller_normal.png
│ │ ├── record_controller_press.png
│ │ ├── record_delete_check_normal.png
│ │ ├── record_delete_check_press.png
│ │ ├── record_delete_normal.png
│ │ ├── record_delete_press.png
│ │ ├── record_next_normal.png
│ │ ├── record_next_press.png
│ │ ├── record_theme_selected.png
│ │ ├── record_theme_square_selected.png
│ │ ├── title_text_left.png
│ │ ├── title_text_right.png
│ │ ├── toast_tip_bg.9.png
│ │ ├── uploader_dialog_bg.9.png
│ │ ├── video_edit_tab_selected_bg.png
│ │ ├── video_edit_tab_split_line.png
│ │ └── video_focus.png
│ ├── drawable
│ │ ├── btn_bg_green.xml
│ │ ├── priview_edit_tab_selector.xml
│ │ ├── priview_orig_volumn_selector.xml
│ │ ├── priview_theme_volumn_selector.xml
│ │ ├── record_camera_flash_led_selector.xml
│ │ ├── record_camera_switch_selector.xml
│ │ ├── record_cancel_seletor.xml
│ │ ├── record_controller_seletor.xml
│ │ ├── record_delete_selector.xml
│ │ ├── record_next_seletor.xml
│ │ ├── selector_bg.xml
│ │ ├── setting_item_selector.xml
│ │ ├── tab_contact_list.xml
│ │ ├── tab_find.xml
│ │ ├── tab_profile.xml
│ │ └── tab_weixin.xml
│ ├── layout
│ │ ├── activity_import_video.xml
│ │ ├── activity_main.xml
│ │ ├── activity_main2.xml
│ │ ├── activity_media_preview.xml
│ │ ├── activity_media_recorder.xml
│ │ ├── activity_video_player.xml
│ │ ├── contact_item.xml
│ │ ├── fragment_dicover.xml
│ │ ├── fragment_friends.xml
│ │ ├── fragment_profile.xml
│ │ ├── framen_msg.xml
│ │ ├── include_tilte_record.xml
│ │ ├── layout_bottom.xml
│ │ ├── layout_fragment.xml
│ │ ├── layout_head_friend.xml
│ │ ├── layout_head_search.xml
│ │ ├── layout_item_msg.xml
│ │ ├── layout_title.xml
│ │ ├── list_position.xml
│ │ ├── menu_record_import.xml
│ │ ├── movie_recorder_view.xml
│ │ ├── toast_layout.xml
│ │ ├── view_radio_item.xml
│ │ └── view_theme_item.xml
│ ├── values-v11
│ │ ├── arrays.xml
│ │ ├── colors.xml
│ │ ├── drawables.xml
│ │ ├── integers.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── movie_attrs.xml
│ │ ├── strings.xml
│ │ ├── styles.xml
│ │ ├── swipe_attrs.xml
│ │ └── swipelistview__attrs.xml
└── src
│ └── com
│ ├── example
│ └── wechat01
│ │ ├── Fragment_Dicover.java
│ │ ├── Fragment_Friends.java
│ │ ├── Fragment_Msg.java
│ │ ├── Fragment_Profile.java
│ │ ├── MainActivity.java
│ │ ├── adpter
│ │ └── NewMsgAdpter.java
│ │ ├── common
│ │ ├── PingYinUtil.java
│ │ └── PinyinComparator.java
│ │ └── widght
│ │ ├── EyeView.java
│ │ ├── PullDownListView.java
│ │ ├── SideBar.java
│ │ └── swipe
│ │ ├── SimpleSwipeListener.java
│ │ ├── SwipeLayout.java
│ │ ├── adapters
│ │ ├── ArraySwipeAdapter.java
│ │ ├── BaseSwipeAdapter.java
│ │ ├── CursorSwipeAdapter.java
│ │ └── SimpleCursorSwipeAdapter.java
│ │ ├── implments
│ │ └── SwipeItemMangerImpl.java
│ │ └── interfaces
│ │ ├── SwipeAdapterInterface.java
│ │ └── SwipeItemMangerInterface.java
│ └── yixia
│ └── camera
│ └── demo
│ ├── VCameraDemoApplication.java
│ ├── common
│ └── CommonIntentExtra.java
│ ├── log
│ └── Logger.java
│ ├── media
│ └── MediaPlayer.java
│ ├── os
│ └── ThreadTask.java
│ ├── po
│ └── POThemeSingle.java
│ ├── preference
│ ├── PreferenceKeys.java
│ └── PreferenceUtils.java
│ ├── service
│ └── AssertService.java
│ ├── ui
│ ├── BaseActivity.java
│ ├── LaunchActivity.java
│ ├── record
│ │ ├── ImportVideoActivity.java
│ │ ├── MediaPreviewActivity.java
│ │ ├── MediaRecorderActivity.java
│ │ ├── VideoPlayerActivity.java
│ │ ├── helper
│ │ │ ├── RecorderHelper.java
│ │ │ └── ThemeHelper.java
│ │ └── views
│ │ │ ├── BitmapImageView.java
│ │ │ ├── ProgressView.java
│ │ │ ├── ThemeGroupLayout.java
│ │ │ ├── ThemeRadioButton.java
│ │ │ ├── ThemeSufaceView.java
│ │ │ └── ThemeView.java
│ └── widget
│ │ ├── NestRadioGroup.java
│ │ ├── SurfaceVideoView.java
│ │ └── VideoView.java
│ └── utils
│ ├── AndroidBmpUtil.java
│ ├── ConvertToUtils.java
│ ├── IsUtils.java
│ ├── NetworkUtils.java
│ ├── ResourceUtils.java
│ ├── ToastUtils.java
│ └── ZipUtils.java
└── VitamioRecorderLibrary
├── .DS_Store
├── .classpath
├── .project
├── .settings
└── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── bin
├── AndroidManifest.xml
├── R.txt
├── classes
│ └── com
│ │ └── yixia
│ │ ├── camera
│ │ ├── AudioRecorder.class
│ │ ├── BuildConfig.class
│ │ ├── FFMpegUtils.class
│ │ ├── IMediaRecorder.class
│ │ ├── MediaRecorderBase$1.class
│ │ ├── MediaRecorderBase$2.class
│ │ ├── MediaRecorderBase$EncodeHandler.class
│ │ ├── MediaRecorderBase$OnEncodeListener.class
│ │ ├── MediaRecorderBase$OnErrorListener.class
│ │ ├── MediaRecorderBase$OnPreparedListener.class
│ │ ├── MediaRecorderBase.class
│ │ ├── MediaRecorderCustom$YuvHandler.class
│ │ ├── MediaRecorderCustom.class
│ │ ├── MediaRecorderNative.class
│ │ ├── MediaRecorderSystem$1.class
│ │ ├── MediaRecorderSystem.class
│ │ ├── R$attr.class
│ │ ├── R$drawable.class
│ │ ├── R$string.class
│ │ ├── R$style.class
│ │ ├── R.class
│ │ ├── VCamera.class
│ │ ├── model
│ │ │ ├── MediaObject$MediaPart.class
│ │ │ ├── MediaObject.class
│ │ │ └── MediaThemeObject.class
│ │ └── util
│ │ │ ├── DeviceUtils.class
│ │ │ ├── FileUtils.class
│ │ │ ├── Log.class
│ │ │ └── StringUtils.class
│ │ └── videoeditor
│ │ └── adapter
│ │ ├── UtilityAdapter$OnNativeListener.class
│ │ └── UtilityAdapter.class
├── res
│ └── crunch
│ │ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ │ └── drawable-xhdpi
│ │ └── ic_launcher.png
└── vitamiorecorderlibrary.jar
├── build.gradle
├── gen
└── com
│ └── yixia
│ └── camera
│ ├── BuildConfig.java
│ └── R.java
├── libs
└── armeabi-v7a
│ └── libutility.so
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
└── yixia
├── camera
├── AudioRecorder.java
├── FFMpegUtils.java
├── IMediaRecorder.java
├── MediaRecorderBase.java
├── MediaRecorderCustom.java
├── MediaRecorderNative.java
├── MediaRecorderSystem.java
├── VCamera.java
├── model
│ ├── MediaObject.java
│ └── MediaThemeObject.java
└── util
│ ├── DeviceUtils.java
│ ├── FileUtils.java
│ ├── Log.java
│ └── StringUtils.java
└── videoeditor
└── adapter
└── UtilityAdapter.java
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | 微信从6.0版本开始推出小视频功能,随着4G网络的出现,视频将会是一个趋势,他能表达出文字所不能表现的东西,增加了微信的黏性。
4 | 还记得微信小视频这个功能一推出,如同病毒一样席卷朋友圈。
5 |
6 | 如果你要问,微博的下一个时代是什么,互联网大佬会告诉你,**短视频**
7 |
8 |
9 | 
10 |
11 |
12 | 作为爱美的我们,怎么能把我们的窘态暴露给朋友圈的小伙伴呢,必须正能量!美好的!必须美化!
13 | So,录制小视频后,加各种滤镜,炫酷MV主题,妈妈再也不担心我的猪窝了...
14 |
15 |
16 | 
17 |
18 | PS:gif 图片比较大,如果等不及的童鞋,可以[点击这里查看视频](http://video.weibo.com/show?fid=1034:b50abae7fe8bd291c5fac40d75a1028a)
19 |
20 |
21 | Download Apk
22 | ===
23 |
24 |
25 |
27 |
28 |
--------------------------------------------------------------------------------
/VCameraDemo/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/VCameraDemo/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/VCameraDemo/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # Windows shortcuts
18 | *.lnk
19 |
20 | # =========================
21 | # Operating System Files
22 | # =========================
23 |
24 | # OSX
25 | # =========================
26 |
27 | .DS_Store
28 | .AppleDouble
29 | .LSOverride
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear on external disk
35 | .Spotlight-V100
36 | .Trashes
37 |
38 | # Directories potentially created on remote AFP share
39 | .AppleDB
40 | .AppleDesktop
41 | Network Trash Folder
42 | Temporary Items
43 | .apdisk
44 |
--------------------------------------------------------------------------------
/VCameraDemo/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | VCameraDemo
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/VCameraDemo/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding/=UTF-8
3 |
--------------------------------------------------------------------------------
/VCameraDemo/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/VCameraDemo/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
26 |
29 |
30 |
36 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
51 |
52 |
58 |
64 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/VCameraDemo/assets/Common.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/assets/Common.zip
--------------------------------------------------------------------------------
/VCameraDemo/assets/Empty.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/assets/Empty.zip
--------------------------------------------------------------------------------
/VCameraDemo/assets/FilterAssets.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/assets/FilterAssets.zip
--------------------------------------------------------------------------------
/VCameraDemo/assets/MusicAssets.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/assets/MusicAssets.zip
--------------------------------------------------------------------------------
/VCameraDemo/assets/MusicVideoAssets.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/assets/MusicVideoAssets.zip
--------------------------------------------------------------------------------
/VCameraDemo/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/ic_launcher-web.png
--------------------------------------------------------------------------------
/VCameraDemo/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/VCameraDemo/libs/gson-2.2.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/libs/gson-2.2.4.jar
--------------------------------------------------------------------------------
/VCameraDemo/libs/nineoldandroids-2.4.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/libs/nineoldandroids-2.4.0.jar
--------------------------------------------------------------------------------
/VCameraDemo/libs/pinyin4j-2.5.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/libs/pinyin4j-2.5.0.jar
--------------------------------------------------------------------------------
/VCameraDemo/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/VCameraDemo/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-17
15 | android.library.reference.1=../VitamioRecorderLibrary
16 |
--------------------------------------------------------------------------------
/VCameraDemo/res/anim/push_bottom_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/VCameraDemo/res/anim/push_bottom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/VCameraDemo/res/anim/push_up_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/VCameraDemo/res/anim/push_up_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/VCameraDemo/res/anim/record_focus.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
19 |
25 |
37 |
38 |
--------------------------------------------------------------------------------
/VCameraDemo/res/color/record_text_color_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/VCameraDemo/res/color/video_edit_text_color_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/aii.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/aii.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/contact_list_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/contact_list_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/contact_list_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/contact_list_pressed.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/find_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/find_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/find_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/find_pressed.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/head.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/head.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/ic_sex_female.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/ic_sex_female.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/ic_sex_male.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/ic_sex_male.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_addfriend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_addfriend.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_de_game.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_de_game.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_de_nearby.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_de_nearby.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_de_ping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_de_ping.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_de_saoyisao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_de_saoyisao.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_de_shop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_de_shop.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_de_yao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_de_yao.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_me_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_me_card.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_me_collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_me_collect.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_me_money.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_me_money.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_me_photo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_me_photo.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_me_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_me_setting.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_me_smail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_me_smail.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_public.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_public.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_qunliao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_qunliao.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/icon_tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/icon_tip.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/profile_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/profile_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/profile_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/profile_pressed.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/right.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/search_ba.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/search_ba.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/search_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/search_icon.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/v2.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/weixin_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/weixin_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-hdpi/weixin_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-hdpi/weixin_pressed.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-ldpi/eye.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-ldpi/eye.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-ldpi/eye_gray_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-ldpi/eye_gray_1.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-ldpi/eye_gray_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-ldpi/eye_gray_2.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-ldpi/eye_light1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-ldpi/eye_light1.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-ldpi/eye_light2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-ldpi/eye_light2.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/play_big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/play_big.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/preview_music_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/preview_music_bg.9.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/preview_music_original.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/preview_music_original.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/preview_music_original_disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/preview_music_original_disable.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/preview_music_theme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/preview_music_theme.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/preview_music_theme_disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/preview_music_theme_disable.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/priview_orig_volumn_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/priview_orig_volumn_close.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/priview_orig_volumn_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/priview_orig_volumn_open.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/priview_theme_volumn_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/priview_theme_volumn_close.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/priview_theme_volumn_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/priview_theme_volumn_open.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_back.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_off_disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_off_disable.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_off_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_off_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_off_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_off_pressed.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_on_disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_on_disable.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_on_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_on_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_on_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_flash_led_on_pressed.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_switch_disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_switch_disable.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_switch_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_switch_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_camera_switch_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_camera_switch_pressed.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_cancel_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_cancel_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_cancel_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_cancel_press.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_controller_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_controller_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_controller_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_controller_press.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_delete_check_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_delete_check_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_delete_check_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_delete_check_press.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_delete_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_delete_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_delete_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_delete_press.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_next_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_next_normal.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_next_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_next_press.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_theme_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_theme_selected.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/record_theme_square_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/record_theme_square_selected.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/title_text_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/title_text_left.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/title_text_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/title_text_right.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/toast_tip_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/toast_tip_bg.9.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/uploader_dialog_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/uploader_dialog_bg.9.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/video_edit_tab_selected_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/video_edit_tab_selected_bg.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/video_edit_tab_split_line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/video_edit_tab_split_line.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable-xhdpi/video_focus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VCameraDemo/res/drawable-xhdpi/video_focus.png
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/btn_bg_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/priview_edit_tab_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/priview_orig_volumn_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/priview_theme_volumn_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/record_camera_flash_led_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/record_camera_switch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/record_cancel_seletor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/record_controller_seletor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/record_delete_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/record_next_seletor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/selector_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/setting_item_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/tab_contact_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/tab_find.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/tab_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/VCameraDemo/res/drawable/tab_weixin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/activity_import_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
24 |
25 |
26 |
30 |
31 |
32 |
33 |
37 |
38 |
42 |
43 |
47 |
48 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/activity_main2.xml:
--------------------------------------------------------------------------------
1 |
5 |
12 |
13 |
17 |
18 |
24 |
25 |
26 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/activity_video_player.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
25 |
26 |
34 |
35 |
41 |
42 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/contact_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
24 |
25 |
31 |
32 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/fragment_friends.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
12 |
18 |
27 |
28 |
29 |
35 |
36 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/framen_msg.xml:
--------------------------------------------------------------------------------
1 |
5 |
12 |
13 |
17 |
18 |
24 |
25 |
26 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/include_tilte_record.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
18 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/layout_fragment.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/layout_head_friend.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
18 |
24 |
25 |
29 |
30 |
36 |
40 |
46 |
47 |
51 |
52 |
58 |
62 |
68 |
69 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/layout_head_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
20 |
21 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/layout_item_msg.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
14 |
20 |
29 |
30 |
36 |
42 |
47 |
57 |
58 |
64 |
70 |
71 |
83 |
84 |
95 |
96 |
97 |
98 |
99 |
103 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/layout_title.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/list_position.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/menu_record_import.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/movie_recorder_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/toast_layout.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/view_radio_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/VCameraDemo/res/layout/view_theme_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
21 |
22 |
32 |
33 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values-v11/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - Empty
6 | - 7AM
7 | - 1974
8 | - Absinth
9 | - Stark
10 | - Papilio
11 | - Ice
12 | - Professional
13 | - Smoky
14 | - Stage
15 |
16 |
17 |
18 | - Shining
19 | - Dreamworld
20 | - Love
21 | - Fashion
22 | - SunShine
23 | - Magic
24 | - Hawaii
25 | - Pulse
26 |
27 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values-v11/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #404040ff
5 | #000
6 | #FF0000
7 | #0ff0ff
8 | #c0c0c0ff
9 | #ffffffff
10 | #ffFF33ff
11 | #ff0f81d9
12 | #ff666666
13 | #ffC3C3C3
14 | #ff6699ff
15 | #66ffffff
16 | #00000000
17 | #ff000000
18 | #f0f0f0
19 | #2c2c2c
20 | #2980B9
21 | #005084
22 | #24ff00
23 | #1b5d89
24 | #2980B9
25 | #1b1c1f
26 | #fcb840
27 | #f68b2b
28 | #CC000000
29 | #7f000000
30 | #66000000
31 | #DA000000
32 | #4D000000
33 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values-v11/drawables.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #2c2c2c
5 | #fcb840
6 | #929292
7 | #00000000
8 | #F2F2F2
9 | #E5E5E5
10 | #64000000
11 | #ffffff
12 | #c3c3c3
13 |
14 | #1E1E1E
15 |
16 | #252527
17 | #000000
18 |
19 | #c3c3c3
20 |
21 | #434345
22 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values-v11/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - 0
5 | - 0
6 | - 1
7 | - 0
8 | - 1
9 |
10 |
11 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values-v11/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 提示
4 | 是
5 | 否
6 | 返回
7 | 取消
8 | 确定
9 |
10 | %1$s 作品
11 | 拍摄
12 | 返回
13 | 下一步
14 | 回删
15 | 延迟
16 | 滤镜
17 | 初始化视频存储路径失败
18 | 正在转码…
19 | 手机满了!至少需要200M存储空间才能继续拍摄!
20 | 无法打开录音设备!
21 | 视频信息保存失败!
22 | 是否放弃这段视频?
23 | 导入
24 | 照片
25 | 从本地照片选择
26 | 导入照片失败
27 | 视频
28 | 截\t取
29 | 从本地视频选择
30 | 导入视频失败
31 | 焦点
32 | 闪光
33 | 幽灵
34 | 编辑
35 | 拍摄
36 | 下一步
37 | 确定
38 | 取消
39 | 视频转码失败
40 | 视频保存在:%s
41 | 拍摄信息读取失败!请检查SD卡,稍后重试!
42 | 主题
43 | 预览
44 | 原始
45 | 主题加载失败
46 | 正在转码…
47 | 转码中\t%d%%
48 | 无
49 | 主题
50 | 滤镜
51 | 视频生成中…
52 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
35 |
36 |
51 |
52 |
63 |
64 |
65 |
76 |
77 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #ffffff
5 | #ff000000
6 | #ffeeeeee
7 | #FC2828
8 | #7A7E83
9 |
10 | #33555555
11 | #00000000
12 | #50000000
13 |
14 | #F5F5F5
15 | #00CB0D
16 | #232325
17 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values/movie_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 微信
5 | Hello world!
6 | Settings
7 |
8 |
9 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
16 |
21 |
28 |
29 |
42 |
50 |
59 |
72 |
73 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values/swipe_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/VCameraDemo/res/values/swipelistview__attrs.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/Fragment_Dicover.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | /**
11 | * 发现界面
12 | *
13 | * @author allenjuns@yahoo.com
14 | *
15 | */
16 | public class Fragment_Dicover extends Fragment {
17 | private Activity ctx;
18 | private View layout;
19 |
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
22 | Bundle savedInstanceState) {
23 | if (layout == null) {
24 | ctx = this.getActivity();
25 | layout = ctx.getLayoutInflater().inflate(R.layout.fragment_dicover,
26 | null);
27 | initView();
28 | } else {
29 | ViewGroup parent = (ViewGroup) layout.getParent();
30 | if (parent != null) {
31 | parent.removeView(layout);
32 | }
33 | }
34 | return layout;
35 | }
36 |
37 | private void initView() {
38 | // TODO 实现本页面的布局
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/Fragment_Msg.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.support.v4.app.Fragment;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.AdapterView;
11 | import android.widget.AdapterView.OnItemClickListener;
12 | import android.widget.ListView;
13 |
14 | import com.example.wechat01.adpter.NewMsgAdpter;
15 | import com.example.wechat01.widght.EyeView;
16 | import com.example.wechat01.widght.PullDownListView;
17 | import com.example.wechat01.widght.PullDownListView.OnPullHeightChangeListener;
18 | import com.yixia.camera.demo.ui.record.MediaRecorderActivity;
19 |
20 | /**
21 | * 消息界面
22 | *
23 | * @author allenjuns@yahoo.com
24 | *
25 | */
26 | public class Fragment_Msg extends Fragment {
27 | private Activity ctx;
28 | private View layout;
29 | private ListView listview;
30 |
31 | @Override
32 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
33 | Bundle savedInstanceState) {
34 | if (layout == null) {
35 | ctx = this.getActivity();
36 | layout = ctx.getLayoutInflater().inflate(R.layout.framen_msg, null);
37 | initView();
38 | initPullDownView();
39 | } else {
40 | ViewGroup parent = (ViewGroup) layout.getParent();
41 | if (parent != null) {
42 | parent.removeView(layout);
43 | }
44 | }
45 | return layout;
46 | }
47 |
48 | private void initView() {
49 | // TODO 实现本页面的布局
50 |
51 | }
52 |
53 | private void initPullDownView() {
54 | final PullDownListView pullDownListView = (PullDownListView) layout
55 | .findViewById(R.id.pullDownListView);
56 | final EyeView eyeView = (EyeView) layout.findViewById(R.id.eyeView);
57 |
58 | pullDownListView.getListView().setAdapter(
59 | new NewMsgAdpter(getActivity()));
60 |
61 | pullDownListView
62 | .setOnPullHeightChangeListener(new OnPullHeightChangeListener() {
63 |
64 | @Override
65 | public void onTopHeightChange(int headerHeight,
66 | int pullHeight) {
67 | // TODO Auto-generated method stub
68 | float progress = (float) pullHeight
69 | / (float) headerHeight;
70 |
71 | if (progress < 0.5) {
72 | progress = 0.0f;
73 | } else {
74 | progress = (progress - 0.5f) / 0.5f;
75 | }
76 |
77 | if (progress > 1.0f) {
78 | progress = 1.0f;
79 | }
80 |
81 | if (!pullDownListView.isRefreshing()) {
82 | eyeView.setProgress(progress);
83 | }
84 | }
85 |
86 | @Override
87 | public void onBottomHeightChange(int footerHeight,
88 | int pullHeight) {
89 | // TODO Auto-generated method stub
90 | float progress = (float) pullHeight
91 | / (float) footerHeight;
92 |
93 | if (progress < 0.5) {
94 | progress = 0.0f;
95 | } else {
96 | progress = (progress - 0.5f) / 0.5f;
97 | }
98 |
99 | if (progress > 1.0f) {
100 | progress = 1.0f;
101 | }
102 |
103 | if (!pullDownListView.isRefreshing()) {
104 |
105 | }
106 |
107 | }
108 |
109 | @Override
110 | public void onRefreshing(final boolean isTop) {
111 | // TODO Auto-generated method stub
112 | if (isTop) {
113 | eyeView.startAnimate();
114 | } else {
115 | // progressView.startAnimate();
116 | }
117 | Intent intent = new Intent(ctx,
118 | MediaRecorderActivity.class);
119 | ctx.startActivity(intent);
120 | ctx.overridePendingTransition(R.anim.push_up_in,
121 | R.anim.push_up_out);
122 | pullDownListView.pullUp();
123 | }
124 |
125 | });
126 |
127 | pullDownListView.getListView().setOnItemClickListener(
128 | new OnItemClickListener() {
129 |
130 | @Override
131 | public void onItemClick(AdapterView> arg0, View arg1,
132 | int arg2, long arg3) {
133 | // TODO Auto-generated method stub
134 |
135 | }
136 |
137 | });
138 |
139 | }
140 |
141 | }
142 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/Fragment_Profile.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | /**
11 | * 个人中心界面
12 | *
13 | * @author allenjuns@yahoo.com
14 | *
15 | */
16 | public class Fragment_Profile extends Fragment {
17 | private Activity ctx;
18 | private View layout;
19 |
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
22 | Bundle savedInstanceState) {
23 | if (layout == null) {
24 | ctx = this.getActivity();
25 | layout = ctx.getLayoutInflater().inflate(R.layout.fragment_profile,
26 | null);
27 | initView();
28 | } else {
29 | ViewGroup parent = (ViewGroup) layout.getParent();
30 | if (parent != null) {
31 | parent.removeView(layout);
32 | }
33 | }
34 | return layout;
35 | }
36 |
37 | private void initView() {
38 | // TODO 实现本页面的布局
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentActivity;
6 | import android.support.v4.app.FragmentTransaction;
7 | import android.view.View;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | /**
12 | * 【高仿微信】01、微信主界面
13 | *
14 | * @author allenjuns@yahoo.com
15 | *
16 | */
17 | public class MainActivity extends FragmentActivity {
18 | private TextView txt_title;
19 | private TextView unreaMsgdLabel;// 未读消息textview
20 | private TextView unreadAddressLable;// 未读通讯录textview
21 | private TextView unreadFindLable;// 发现
22 | private Fragment[] fragments;
23 | public Fragment_Msg homefragment;
24 | private Fragment_Friends contactlistfragment;
25 | private Fragment_Dicover findfragment;
26 | private Fragment_Profile profilefragment;
27 | private ImageView[] imagebuttons;
28 | private TextView[] textviews;
29 | private int index;
30 | private int currentTabIndex;// 当前fragment的index
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_main);
36 | initTabView();
37 | }
38 |
39 | private void initTabView() {
40 | txt_title = (TextView) findViewById(R.id.txt_tiele);
41 | unreaMsgdLabel = (TextView) findViewById(R.id.unread_msg_number);
42 | unreadAddressLable = (TextView) findViewById(R.id.unread_address_number);
43 | unreadFindLable = (TextView) findViewById(R.id.unread_find_number);
44 | homefragment = new Fragment_Msg();
45 | contactlistfragment = new Fragment_Friends();
46 | findfragment = new Fragment_Dicover();
47 | profilefragment = new Fragment_Profile();
48 | fragments = new Fragment[] { homefragment, contactlistfragment,
49 | findfragment, profilefragment };
50 | imagebuttons = new ImageView[4];
51 | imagebuttons[0] = (ImageView) findViewById(R.id.ib_weixin);
52 | imagebuttons[1] = (ImageView) findViewById(R.id.ib_contact_list);
53 | imagebuttons[2] = (ImageView) findViewById(R.id.ib_find);
54 | imagebuttons[3] = (ImageView) findViewById(R.id.ib_profile);
55 |
56 | imagebuttons[0].setSelected(true);
57 | textviews = new TextView[4];
58 | textviews[0] = (TextView) findViewById(R.id.tv_weixin);
59 | textviews[1] = (TextView) findViewById(R.id.tv_contact_list);
60 | textviews[2] = (TextView) findViewById(R.id.tv_find);
61 | textviews[3] = (TextView) findViewById(R.id.tv_profile);
62 | textviews[0].setTextColor(0xFF45C01A);
63 | // 添加显示第一个fragment
64 | getSupportFragmentManager().beginTransaction()
65 | .add(R.id.fragment_container, homefragment)
66 | .add(R.id.fragment_container, contactlistfragment)
67 | .add(R.id.fragment_container, profilefragment)
68 | .add(R.id.fragment_container, findfragment)
69 | .hide(contactlistfragment).hide(profilefragment)
70 | .hide(findfragment).show(homefragment).commit();
71 | }
72 |
73 | public void onTabClicked(View view) {
74 | switch (view.getId()) {
75 | case R.id.re_weixin:
76 | index = 0;
77 | txt_title.setText("微信");
78 | break;
79 | case R.id.re_contact_list:
80 | index = 1;
81 | txt_title.setText("通讯录");
82 | break;
83 | case R.id.re_find:
84 | index = 2;
85 | txt_title.setText("发现");
86 | break;
87 | case R.id.re_profile:
88 | index = 3;
89 | txt_title.setText("我");
90 | break;
91 | }
92 | if (currentTabIndex != index) {
93 | FragmentTransaction trx = getSupportFragmentManager()
94 | .beginTransaction();
95 | trx.hide(fragments[currentTabIndex]);
96 | if (!fragments[index].isAdded()) {
97 | trx.add(R.id.fragment_container, fragments[index]);
98 | }
99 | trx.show(fragments[index]).commit();
100 | }
101 | imagebuttons[currentTabIndex].setSelected(false);
102 | // 把当前tab设为选中状态
103 | imagebuttons[index].setSelected(true);
104 | textviews[currentTabIndex].setTextColor(0xFF999999);
105 | textviews[index].setTextColor(0xFF45C01A);
106 | currentTabIndex = index;
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/adpter/NewMsgAdpter.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.adpter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 | import android.widget.TextView;
9 |
10 | import com.example.wechat01.R;
11 |
12 | public class NewMsgAdpter extends BaseAdapter {
13 | protected Context context;
14 | LayoutInflater mInflater;
15 |
16 | public NewMsgAdpter(Context ctx) {
17 | context = ctx;
18 | }
19 |
20 | @Override
21 | public int getCount() {
22 | return 5;
23 | }
24 |
25 | @Override
26 | public Object getItem(int position) {
27 | return null;
28 | }
29 |
30 | @Override
31 | public long getItemId(int position) {
32 | return position;
33 | }
34 |
35 | @Override
36 | public View getView(int position, View convertView, ViewGroup parent) {
37 | if (convertView == null) {
38 | convertView = LayoutInflater.from(context).inflate(
39 | R.layout.layout_item_msg, parent, false);
40 | TextView txtnum = (TextView) convertView
41 | .findViewById(R.id.unread_msg_number);
42 | if (position == 0) {
43 | txtnum.setVisibility(View.VISIBLE);
44 | } else {
45 | txtnum.setVisibility(View.GONE);
46 | }
47 | }
48 |
49 | return convertView;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/common/PingYinUtil.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.common;
2 |
3 | import net.sourceforge.pinyin4j.PinyinHelper;
4 | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
5 | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
6 | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
7 | import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
8 | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
9 |
10 | public class PingYinUtil {
11 | /**
12 | * 将字符串中的中文转化为拼音,其他字符不变
13 | *
14 | * @param inputString
15 | * @return
16 | */
17 | public static String getPingYin(String inputString) {
18 | HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
19 | format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
20 | format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
21 | format.setVCharType(HanyuPinyinVCharType.WITH_V);
22 |
23 | char[] input = inputString.trim().toCharArray();
24 | String output = "";
25 |
26 | try {
27 | for (int i = 0; i < input.length; i++) {
28 | if (java.lang.Character.toString(input[i]).matches(
29 | "[\\u4E00-\\u9FA5]+")) {
30 | String[] temp = PinyinHelper.toHanyuPinyinStringArray(
31 | input[i], format);
32 | output += temp[0];
33 | } else
34 | output += java.lang.Character.toString(input[i]);
35 | }
36 | } catch (BadHanyuPinyinOutputFormatCombination e) {
37 | e.printStackTrace();
38 | }
39 | return output;
40 | }
41 |
42 | /**
43 | * 汉字转换位汉语拼音首字母,英文字符不变
44 | *
45 | * @param chines
46 | * 汉字
47 | * @return 拼音
48 | */
49 | public static String converterToFirstSpell(String chines) {
50 | String pinyinName = "";
51 | char[] nameChar = chines.toCharArray();
52 | HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
53 | defaultFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE);
54 | defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
55 | for (int i = 0; i < nameChar.length; i++) {
56 | if (nameChar[i] > 128) {
57 | try {
58 | pinyinName += PinyinHelper.toHanyuPinyinStringArray(
59 | nameChar[i], defaultFormat)[0].charAt(0);
60 | } catch (BadHanyuPinyinOutputFormatCombination e) {
61 | e.printStackTrace();
62 | }
63 | } else {
64 | pinyinName += nameChar[i];
65 | }
66 | }
67 | return pinyinName;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/common/PinyinComparator.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.common;
2 |
3 | import java.util.Comparator;
4 |
5 | public class PinyinComparator implements Comparator {
6 |
7 | @Override
8 | public int compare(Object o1, Object o2) {
9 | String str1 = PingYinUtil.getPingYin((String) o1);
10 | String str2 = PingYinUtil.getPingYin((String) o2);
11 | return str1.compareTo(str2);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/EyeView.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.graphics.Bitmap.Config;
6 | import android.graphics.Canvas;
7 | import android.graphics.Matrix;
8 | import android.graphics.Paint;
9 | import android.graphics.PorterDuff;
10 | import android.graphics.PorterDuffXfermode;
11 | import android.graphics.drawable.BitmapDrawable;
12 | import android.os.Handler;
13 | import android.util.AttributeSet;
14 | import android.widget.ImageView;
15 |
16 | import com.example.wechat01.R;
17 |
18 | public class EyeView extends ImageView {
19 | Paint mPaint;
20 | float progress;
21 | boolean isAnimate;
22 | int rotateProgress;
23 | Handler mHandler = new Handler();
24 |
25 | public EyeView(Context context, AttributeSet attrs) {
26 | super(context, attrs);
27 | // TODO Auto-generated constructor stub
28 | mPaint = new Paint();
29 | mPaint.setAntiAlias(true);
30 | rotateProgress = 0;
31 | progress = 0.0f;
32 | }
33 |
34 | @Override
35 | public void onDraw(Canvas canvas) {
36 | int minWidth = (int) (this.getWidth() * progress);
37 | int minHeight = (int) (this.getHeight() * progress);
38 | if (minWidth > 1 && minHeight > 1) {
39 | Bitmap bitmap = getBitmap();
40 | canvas.drawBitmap(bitmap, 0, 0, null);
41 | bitmap.recycle();
42 |
43 | }
44 | }
45 |
46 | public Bitmap getBitmap() {
47 | Bitmap origin1 = null;
48 | Bitmap origin2 = null;
49 | if (progress >= 1.0) {
50 | BitmapDrawable drawable1 = (BitmapDrawable) this.getResources()
51 | .getDrawable(R.drawable.eye_light1);
52 | origin1 = drawable1.getBitmap();
53 | BitmapDrawable drawable2 = (BitmapDrawable) this.getResources()
54 | .getDrawable(R.drawable.eye_light2);
55 | origin2 = drawable2.getBitmap();
56 | } else {
57 | BitmapDrawable drawable1 = (BitmapDrawable) this.getResources()
58 | .getDrawable(R.drawable.eye_gray_1);
59 | origin1 = drawable1.getBitmap();
60 | BitmapDrawable drawable2 = (BitmapDrawable) this.getResources()
61 | .getDrawable(R.drawable.eye_gray_2);
62 | origin2 = drawable2.getBitmap();
63 | }
64 | Paint paint = new Paint();
65 | paint.setAntiAlias(true);
66 | float scale = (float) origin1.getWidth() / (float) getWidth();
67 | int maxWidth = (int) (origin1.getWidth() / scale);
68 | int maxHeight = (int) (origin1.getHeight() / scale);
69 |
70 | int maskSize = 1;
71 |
72 | if (progress > 0.3f) {
73 | maskSize = (int) (maxHeight * (progress - 0.3) / 0.7);
74 | }
75 |
76 | Bitmap temp1 = Bitmap.createScaledBitmap(origin1, (int) (maxWidth),
77 | (int) (maxHeight), true);
78 |
79 | Canvas canvas = new Canvas();
80 | Bitmap mask = Bitmap.createBitmap(temp1.getWidth(), temp1.getWidth(),
81 | Config.ARGB_8888);
82 | canvas.setBitmap(mask);
83 | canvas.drawCircle(mask.getWidth() / 2, mask.getHeight() / 2, maskSize,
84 | mPaint);
85 |
86 | Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(),
87 | Config.ARGB_8888);
88 | canvas.setBitmap(bitmap);
89 | canvas.drawBitmap(temp1, (getWidth() - temp1.getWidth()) / 2,
90 | (getHeight() - temp1.getHeight()) / 2, paint);
91 |
92 | paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
93 | canvas.drawBitmap(mask, (getWidth() - mask.getWidth()) / 2,
94 | (getHeight() - mask.getHeight()) / 2, paint);
95 | paint.setXfermode(null);
96 |
97 | float scaleProgress = progress / 0.3f;
98 | if (scaleProgress > 1.0f) {
99 | scaleProgress = 1.0f;
100 | }
101 | Bitmap temp2 = Bitmap.createScaledBitmap(origin2,
102 | (int) (maxWidth * scaleProgress),
103 | (int) (maxHeight * scaleProgress), true);
104 | Matrix matrix = new Matrix();
105 | matrix.postRotate(rotateProgress);
106 | temp2 = Bitmap.createBitmap(temp2, 0, 0, temp2.getWidth(),
107 | temp2.getHeight(), matrix, false);
108 | canvas.drawBitmap(temp2, (getWidth() - temp2.getWidth()) / 2,
109 | (getHeight() - temp2.getHeight()) / 2, paint);
110 |
111 | temp1.recycle();
112 | temp2.recycle();
113 | mask.recycle();
114 | return bitmap;
115 | }
116 |
117 | public void setProgress(float progress) {
118 | this.progress = progress;
119 | this.invalidate();
120 | }
121 |
122 | public void startAnimate() {
123 | if (!isAnimate) {
124 | isAnimate = true;
125 | // mHandler.post(mRunnable);
126 | }
127 |
128 | }
129 |
130 | public void stopAnimate() {
131 |
132 | isAnimate = false;
133 | // mHandler.removeCallbacks(mRunnable);
134 | rotateProgress = 0;
135 | }
136 |
137 | public Runnable mRunnable = new Runnable() {
138 |
139 | @Override
140 | public void run() {
141 | // TODO Auto-generated method stub
142 | rotateProgress += 10;
143 | if (rotateProgress > 360) {
144 | rotateProgress = 0;
145 | }
146 |
147 | if (isAnimate) {
148 | mHandler.postDelayed(this, 10);
149 | }
150 | EyeView.this.invalidate();
151 | }
152 |
153 | };
154 |
155 | }
156 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/SideBar.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Paint;
6 | import android.graphics.Typeface;
7 | import android.util.AttributeSet;
8 | import android.util.DisplayMetrics;
9 | import android.view.MotionEvent;
10 | import android.view.View;
11 | import android.view.WindowManager;
12 | import android.widget.HeaderViewListAdapter;
13 | import android.widget.ListView;
14 | import android.widget.SectionIndexer;
15 | import android.widget.TextView;
16 |
17 | import com.example.wechat01.R;
18 |
19 | public class SideBar extends View {
20 | private char[] l;
21 | private SectionIndexer sectionIndexter = null;
22 | private ListView list;
23 | private TextView mDialogText;
24 | private int m_nItemHeight = dipToPixel(getContext(), 15);
25 |
26 | public SideBar(Context context) {
27 | super(context);
28 | init();
29 | }
30 |
31 | public SideBar(Context context, AttributeSet attrs) {
32 | super(context, attrs);
33 | init();
34 | }
35 |
36 | private void init() {
37 | l = new char[] { '#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
38 | 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
39 | 'W', 'X', 'Y', 'Z' };
40 | }
41 |
42 | public SideBar(Context context, AttributeSet attrs, int defStyle) {
43 | super(context, attrs, defStyle);
44 | init();
45 | }
46 |
47 | public void setListView(ListView _list) {
48 | list = _list;
49 | }
50 |
51 | public void setTextView(TextView mDialogText) {
52 | this.mDialogText = mDialogText;
53 | }
54 |
55 | public boolean onTouchEvent(MotionEvent event) {
56 | super.onTouchEvent(event);
57 | int i = (int) event.getY();
58 | int idx = i / m_nItemHeight;
59 | if (idx >= l.length) {
60 | idx = l.length - 1;
61 | } else if (idx < 0) {
62 | idx = 0;
63 | }
64 | if (event.getAction() == MotionEvent.ACTION_DOWN
65 | || event.getAction() == MotionEvent.ACTION_MOVE) {
66 | mDialogText.setVisibility(View.VISIBLE);
67 | mDialogText.setText("" + l[idx]);
68 | if (sectionIndexter == null) {
69 | HeaderViewListAdapter ha = (HeaderViewListAdapter) list
70 | .getAdapter();
71 | sectionIndexter = (SectionIndexer) ha.getWrappedAdapter();
72 | }
73 | int position = sectionIndexter.getPositionForSection(l[idx]);
74 | if (position == -1) {
75 | return true;
76 | }
77 | list.setSelection(position);
78 | } else {
79 | mDialogText.setVisibility(View.INVISIBLE);
80 | }
81 | return true;
82 | }
83 |
84 | protected void onDraw(Canvas canvas) {
85 | Paint paint = new Paint();
86 | paint.setColor(getResources().getColor(R.color.gray));
87 | paint.setTextSize(dipToPixel(getContext(), 12));
88 | // paint.setTextSize(20);
89 | // paint.setColor(0xff595c61);
90 | Typeface font = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD);
91 | paint.setTypeface(font);
92 | paint.setFlags(Paint.ANTI_ALIAS_FLAG);
93 | paint.setTextAlign(Paint.Align.CENTER);
94 | float widthCenter = getMeasuredWidth() / 2;
95 | for (int i = 0; i < l.length; i++) {
96 | canvas.drawText(String.valueOf(l[i]), widthCenter, m_nItemHeight
97 | + (i * m_nItemHeight), paint);
98 | }
99 | super.onDraw(canvas);
100 | }
101 |
102 | private static float sDensity = 0;
103 |
104 | public static int dipToPixel(Context context, int nDip) {
105 | if (sDensity == 0) {
106 | final WindowManager wm = (WindowManager) context
107 | .getSystemService(Context.WINDOW_SERVICE);
108 | DisplayMetrics dm = new DisplayMetrics();
109 | wm.getDefaultDisplay().getMetrics(dm);
110 | sDensity = dm.density;
111 | }
112 | return (int) (sDensity * nDip);
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/swipe/SimpleSwipeListener.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght.swipe;
2 |
3 | public class SimpleSwipeListener implements SwipeLayout.SwipeListener {
4 |
5 | @Override
6 | public void onStartOpen(SwipeLayout layout) {
7 | }
8 |
9 | @Override
10 | public void onOpen(SwipeLayout layout) {
11 | }
12 |
13 | @Override
14 | public void onStartClose(SwipeLayout layout) {
15 | }
16 |
17 | @Override
18 | public void onClose(SwipeLayout layout) {
19 | }
20 |
21 | @Override
22 | public void onUpdate(SwipeLayout layout, int leftOffset, int topOffset) {
23 | }
24 |
25 | @Override
26 | public void onHandRelease(SwipeLayout layout, float xvel, float yvel) {
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/swipe/adapters/ArraySwipeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght.swipe.adapters;
2 |
3 | import java.util.List;
4 |
5 | import android.content.Context;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ArrayAdapter;
9 |
10 | import com.example.wechat01.widght.swipe.SwipeLayout;
11 | import com.example.wechat01.widght.swipe.implments.SwipeItemMangerImpl;
12 | import com.example.wechat01.widght.swipe.interfaces.SwipeAdapterInterface;
13 | import com.example.wechat01.widght.swipe.interfaces.SwipeItemMangerInterface;
14 |
15 | public abstract class ArraySwipeAdapter extends ArrayAdapter implements
16 | SwipeItemMangerInterface, SwipeAdapterInterface {
17 |
18 | private SwipeItemMangerImpl mItemManger = new SwipeItemMangerImpl(this);
19 | {
20 | }
21 |
22 | public ArraySwipeAdapter(Context context, int resource) {
23 | super(context, resource);
24 | }
25 |
26 | public ArraySwipeAdapter(Context context, int resource,
27 | int textViewResourceId) {
28 | super(context, resource, textViewResourceId);
29 | }
30 |
31 | public ArraySwipeAdapter(Context context, int resource, T[] objects) {
32 | super(context, resource, objects);
33 | }
34 |
35 | public ArraySwipeAdapter(Context context, int resource,
36 | int textViewResourceId, T[] objects) {
37 | super(context, resource, textViewResourceId, objects);
38 | }
39 |
40 | public ArraySwipeAdapter(Context context, int resource, List objects) {
41 | super(context, resource, objects);
42 | }
43 |
44 | public ArraySwipeAdapter(Context context, int resource,
45 | int textViewResourceId, List objects) {
46 | super(context, resource, textViewResourceId, objects);
47 | }
48 |
49 | @Override
50 | public View getView(int position, View convertView, ViewGroup parent) {
51 | boolean convertViewIsNull = convertView == null;
52 | View v = super.getView(position, convertView, parent);
53 | if (convertViewIsNull) {
54 | mItemManger.initialize(v, position);
55 | } else {
56 | mItemManger.updateConvertView(v, position);
57 | }
58 | return v;
59 | }
60 |
61 | @Override
62 | public void openItem(int position) {
63 | mItemManger.openItem(position);
64 | }
65 |
66 | @Override
67 | public void closeItem(int position) {
68 | mItemManger.closeItem(position);
69 | }
70 |
71 | @Override
72 | public void closeAllExcept(SwipeLayout layout) {
73 | mItemManger.closeAllExcept(layout);
74 | }
75 |
76 | @Override
77 | public List getOpenItems() {
78 | return mItemManger.getOpenItems();
79 | }
80 |
81 | @Override
82 | public List getOpenLayouts() {
83 | return mItemManger.getOpenLayouts();
84 | }
85 |
86 | @Override
87 | public void removeShownLayouts(SwipeLayout layout) {
88 | mItemManger.removeShownLayouts(layout);
89 | }
90 |
91 | @Override
92 | public boolean isOpen(int position) {
93 | return mItemManger.isOpen(position);
94 | }
95 |
96 | @Override
97 | public SwipeItemMangerImpl.Mode getMode() {
98 | return mItemManger.getMode();
99 | }
100 |
101 | @Override
102 | public void setMode(SwipeItemMangerImpl.Mode mode) {
103 | mItemManger.setMode(mode);
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/swipe/adapters/BaseSwipeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght.swipe.adapters;
2 |
3 | import java.util.List;
4 |
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 |
9 | import com.example.wechat01.widght.swipe.SwipeLayout;
10 | import com.example.wechat01.widght.swipe.implments.SwipeItemMangerImpl;
11 | import com.example.wechat01.widght.swipe.interfaces.SwipeAdapterInterface;
12 | import com.example.wechat01.widght.swipe.interfaces.SwipeItemMangerInterface;
13 |
14 | public abstract class BaseSwipeAdapter extends BaseAdapter implements
15 | SwipeItemMangerInterface, SwipeAdapterInterface {
16 |
17 | protected SwipeItemMangerImpl mItemManger = new SwipeItemMangerImpl(this);
18 |
19 | /**
20 | * return the {@link com.daimajia.swipe.SwipeLayout} resource id, int the
21 | * view item.
22 | *
23 | * @param position
24 | * @return
25 | */
26 | public abstract int getSwipeLayoutResourceId(int position);
27 |
28 | /**
29 | * generate a new view item. Never bind SwipeListener or fill values here,
30 | * every item has a chance to fill value or bind listeners in fillValues. to
31 | * fill it in {@code fillValues} method.
32 | *
33 | * @param position
34 | * @param parent
35 | * @return
36 | */
37 | public abstract View generateView(int position, ViewGroup parent);
38 |
39 | /**
40 | * fill values or bind listeners to the view.
41 | *
42 | * @param position
43 | * @param convertView
44 | */
45 | public abstract void fillValues(int position, View convertView);
46 |
47 | @Override
48 | public final View getView(int position, View convertView, ViewGroup parent) {
49 | View v = convertView;
50 | if (v == null) {
51 | v = generateView(position, parent);
52 | mItemManger.initialize(v, position);
53 | } else {
54 | mItemManger.updateConvertView(v, position);
55 | }
56 | fillValues(position, v);
57 | return v;
58 | }
59 |
60 | @Override
61 | public void openItem(int position) {
62 | mItemManger.openItem(position);
63 | }
64 |
65 | @Override
66 | public void closeItem(int position) {
67 | mItemManger.closeItem(position);
68 | }
69 |
70 | @Override
71 | public void closeAllExcept(SwipeLayout layout) {
72 | mItemManger.closeAllExcept(layout);
73 | }
74 |
75 | @Override
76 | public List getOpenItems() {
77 | return mItemManger.getOpenItems();
78 | }
79 |
80 | @Override
81 | public List getOpenLayouts() {
82 | return mItemManger.getOpenLayouts();
83 | }
84 |
85 | @Override
86 | public void removeShownLayouts(SwipeLayout layout) {
87 | mItemManger.removeShownLayouts(layout);
88 | }
89 |
90 | @Override
91 | public boolean isOpen(int position) {
92 | return mItemManger.isOpen(position);
93 | }
94 |
95 | @Override
96 | public SwipeItemMangerImpl.Mode getMode() {
97 | return mItemManger.getMode();
98 | }
99 |
100 | @Override
101 | public void setMode(SwipeItemMangerImpl.Mode mode) {
102 | mItemManger.setMode(mode);
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/swipe/adapters/CursorSwipeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght.swipe.adapters;
2 |
3 | import java.util.List;
4 |
5 | import android.content.Context;
6 | import android.database.Cursor;
7 | import android.support.v4.widget.CursorAdapter;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 |
11 | import com.example.wechat01.widght.swipe.SwipeLayout;
12 | import com.example.wechat01.widght.swipe.implments.SwipeItemMangerImpl;
13 | import com.example.wechat01.widght.swipe.interfaces.SwipeAdapterInterface;
14 | import com.example.wechat01.widght.swipe.interfaces.SwipeItemMangerInterface;
15 |
16 | public abstract class CursorSwipeAdapter extends CursorAdapter implements
17 | SwipeItemMangerInterface, SwipeAdapterInterface {
18 |
19 | private SwipeItemMangerImpl mItemManger = new SwipeItemMangerImpl(this);
20 |
21 | protected CursorSwipeAdapter(Context context, Cursor c, boolean autoRequery) {
22 | super(context, c, autoRequery);
23 | }
24 |
25 | protected CursorSwipeAdapter(Context context, Cursor c, int flags) {
26 | super(context, c, flags);
27 | }
28 |
29 | @Override
30 | public View getView(int position, View convertView, ViewGroup parent) {
31 | boolean convertViewIsNull = convertView == null;
32 | View v = super.getView(position, convertView, parent);
33 | if (convertViewIsNull) {
34 | mItemManger.initialize(v, position);
35 | } else {
36 | mItemManger.updateConvertView(v, position);
37 | }
38 | return v;
39 | }
40 |
41 | @Override
42 | public void openItem(int position) {
43 | mItemManger.openItem(position);
44 | }
45 |
46 | @Override
47 | public void closeItem(int position) {
48 | mItemManger.closeItem(position);
49 | }
50 |
51 | @Override
52 | public void closeAllExcept(SwipeLayout layout) {
53 | mItemManger.closeAllExcept(layout);
54 | }
55 |
56 | @Override
57 | public List getOpenItems() {
58 | return mItemManger.getOpenItems();
59 | }
60 |
61 | @Override
62 | public List getOpenLayouts() {
63 | return mItemManger.getOpenLayouts();
64 | }
65 |
66 | @Override
67 | public void removeShownLayouts(SwipeLayout layout) {
68 | mItemManger.removeShownLayouts(layout);
69 | }
70 |
71 | @Override
72 | public boolean isOpen(int position) {
73 | return mItemManger.isOpen(position);
74 | }
75 |
76 | @Override
77 | public SwipeItemMangerImpl.Mode getMode() {
78 | return mItemManger.getMode();
79 | }
80 |
81 | @Override
82 | public void setMode(SwipeItemMangerImpl.Mode mode) {
83 | mItemManger.setMode(mode);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/swipe/adapters/SimpleCursorSwipeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght.swipe.adapters;
2 |
3 | import java.util.List;
4 |
5 | import android.content.Context;
6 | import android.database.Cursor;
7 | import android.support.v4.widget.SimpleCursorAdapter;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 |
11 | import com.example.wechat01.widght.swipe.SwipeLayout;
12 | import com.example.wechat01.widght.swipe.implments.SwipeItemMangerImpl;
13 | import com.example.wechat01.widght.swipe.interfaces.SwipeAdapterInterface;
14 | import com.example.wechat01.widght.swipe.interfaces.SwipeItemMangerInterface;
15 |
16 | public abstract class SimpleCursorSwipeAdapter extends SimpleCursorAdapter
17 | implements SwipeItemMangerInterface, SwipeAdapterInterface {
18 |
19 | private SwipeItemMangerImpl mItemManger = new SwipeItemMangerImpl(this);
20 |
21 | protected SimpleCursorSwipeAdapter(Context context, int layout, Cursor c,
22 | String[] from, int[] to, int flags) {
23 | super(context, layout, c, from, to, flags);
24 | }
25 |
26 | protected SimpleCursorSwipeAdapter(Context context, int layout, Cursor c,
27 | String[] from, int[] to) {
28 | super(context, layout, c, from, to);
29 | }
30 |
31 | @Override
32 | public View getView(int position, View convertView, ViewGroup parent) {
33 | boolean convertViewIsNull = convertView == null;
34 | View v = super.getView(position, convertView, parent);
35 | if (convertViewIsNull) {
36 | mItemManger.initialize(v, position);
37 | } else {
38 | mItemManger.updateConvertView(v, position);
39 | }
40 | return v;
41 | }
42 |
43 | @Override
44 | public void openItem(int position) {
45 | mItemManger.openItem(position);
46 | }
47 |
48 | @Override
49 | public void closeItem(int position) {
50 | mItemManger.closeItem(position);
51 | }
52 |
53 | @Override
54 | public void closeAllExcept(SwipeLayout layout) {
55 | mItemManger.closeAllExcept(layout);
56 | }
57 |
58 | @Override
59 | public List getOpenItems() {
60 | return mItemManger.getOpenItems();
61 | }
62 |
63 | @Override
64 | public List getOpenLayouts() {
65 | return mItemManger.getOpenLayouts();
66 | }
67 |
68 | @Override
69 | public void removeShownLayouts(SwipeLayout layout) {
70 | mItemManger.removeShownLayouts(layout);
71 | }
72 |
73 | @Override
74 | public boolean isOpen(int position) {
75 | return mItemManger.isOpen(position);
76 | }
77 |
78 | @Override
79 | public SwipeItemMangerImpl.Mode getMode() {
80 | return mItemManger.getMode();
81 | }
82 |
83 | @Override
84 | public void setMode(SwipeItemMangerImpl.Mode mode) {
85 | mItemManger.setMode(mode);
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/swipe/interfaces/SwipeAdapterInterface.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght.swipe.interfaces;
2 |
3 | public interface SwipeAdapterInterface {
4 | public int getSwipeLayoutResourceId(int position);
5 | }
6 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/example/wechat01/widght/swipe/interfaces/SwipeItemMangerInterface.java:
--------------------------------------------------------------------------------
1 | package com.example.wechat01.widght.swipe.interfaces;
2 |
3 | import java.util.List;
4 |
5 | import com.example.wechat01.widght.swipe.SwipeLayout;
6 | import com.example.wechat01.widght.swipe.implments.SwipeItemMangerImpl;
7 |
8 | public interface SwipeItemMangerInterface {
9 |
10 | public void openItem(int position);
11 |
12 | public void closeItem(int position);
13 |
14 | public void closeAllExcept(SwipeLayout layout);
15 |
16 | public List getOpenItems();
17 |
18 | public List getOpenLayouts();
19 |
20 | public void removeShownLayouts(SwipeLayout layout);
21 |
22 | public boolean isOpen(int position);
23 |
24 | public SwipeItemMangerImpl.Mode getMode();
25 |
26 | public void setMode(SwipeItemMangerImpl.Mode mode);
27 | }
28 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/VCameraDemoApplication.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo;
2 |
3 | import java.io.File;
4 | import java.util.LinkedList;
5 | import java.util.List;
6 |
7 | import android.app.Activity;
8 | import android.app.Application;
9 | import android.content.Context;
10 | import android.content.Intent;
11 | import android.os.Environment;
12 |
13 | import com.yixia.camera.VCamera;
14 | import com.yixia.camera.demo.service.AssertService;
15 | import com.yixia.camera.util.DeviceUtils;
16 |
17 | public class VCameraDemoApplication extends Application {
18 |
19 | private static VCameraDemoApplication application;
20 |
21 | @Override
22 | public void onCreate() {
23 | super.onCreate();
24 | application = this;
25 |
26 | // 设置拍摄视频缓存路径
27 | File dcim = Environment
28 | .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
29 | if (DeviceUtils.isZte()) {
30 | if (dcim.exists()) {
31 | VCamera.setVideoCachePath(dcim + "/WeChatJuns/");
32 | } else {
33 | VCamera.setVideoCachePath(dcim.getPath().replace("/sdcard/",
34 | "/sdcard-ext/")
35 | + "/WeChatJuns/");
36 | }
37 | } else {
38 | VCamera.setVideoCachePath(dcim + "/WeChatJuns/");
39 | }
40 | // 开启log输出,ffmpeg输出到logcat
41 | VCamera.setDebugMode(true);
42 | // 初始化拍摄SDK,必须
43 | VCamera.initialize(this);
44 |
45 | // 解压assert里面的文件
46 | startService(new Intent(this, AssertService.class));
47 | }
48 |
49 | public static Context getContext() {
50 | return application;
51 | }
52 |
53 | // 运用list来保存们每一个activity是关键
54 | private List mList = new LinkedList();
55 | private static VCameraDemoApplication instance;
56 |
57 | // 构造方法
58 | // 实例化一次
59 | public synchronized static VCameraDemoApplication getInstance() {
60 | if (null == instance) {
61 | instance = new VCameraDemoApplication();
62 | }
63 | return instance;
64 | }
65 |
66 | // add Activity
67 | public void addActivity(Activity activity) {
68 | mList.add(activity);
69 | }
70 |
71 | // 关闭每一个list内的activity
72 | public void exit() {
73 | try {
74 | for (Activity activity : mList) {
75 | if (activity != null)
76 | activity.finish();
77 | }
78 | } catch (Exception e) {
79 | e.printStackTrace();
80 | } finally {
81 | System.exit(0);
82 | }
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/common/CommonIntentExtra.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.common;
2 |
3 | public class CommonIntentExtra {
4 |
5 | /** 是否退出 */
6 | public final static String USER_IS_LOGOUT = "is_logout";
7 |
8 | /** 录制时间控制 */
9 | public final static String RECORD_TIME_INTENT = "RECORD_TIME";
10 |
11 | /** 录制信息存储 */
12 | public final static String EXTRA_MEDIA_OBJECT = "extra_media_object";
13 |
14 | /** 是否图片导入 */
15 | public final static String EXTRA_MEDIA_IMPORT_IMAGE = "extra_media_import_image";
16 |
17 | /** 是否视频导入 */
18 | public final static String EXTRA_MEDIA_IMPORT_VIDEO = "extra_media_import_video";
19 |
20 | /** 是否在线视频导入 */
21 | public final static String EXTRA_MEDIA_IMPORT_VIDEO_ONLINE = "extra_media_import_video_online";
22 |
23 | /** 多格视频 */
24 | public final static String EXTRA_MEDIA_VIDEO_MULTI = "extra_media_video_multi";
25 | }
26 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/os/ThreadTask.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.os;
2 |
3 | import android.os.Handler;
4 | import android.os.HandlerThread;
5 | import android.os.Looper;
6 | import android.os.Message;
7 |
8 | public abstract class ThreadTask {
9 |
10 | private HandlerThread mHandlerThread;
11 | private TaskHandler mHandler;
12 | private TaskHandler mUiHandler;
13 | private Params[] mParams;
14 | private boolean mRunning = true;
15 | private long mStartTime;
16 | private long mEndTime;
17 |
18 | private static final int MESSAGE_INBACKGROUND = 0;
19 | private static final int MESSAGE_POSTEXECUTE = 1;
20 | private static final int MESSAGE_PROGRESS = 2;
21 |
22 | public ThreadTask() {
23 | //降低线程的优先级
24 | mHandlerThread = new HandlerThread("ThreadTask", android.os.Process.THREAD_PRIORITY_BACKGROUND);
25 | mHandlerThread.start();
26 |
27 | mHandler = new TaskHandler(mHandlerThread.getLooper());
28 | mUiHandler = new TaskHandler(Looper.getMainLooper());
29 | }
30 |
31 | public synchronized boolean isRunning() {
32 | return mRunning;
33 | }
34 |
35 | protected abstract Result doInBackground(Params... params);
36 |
37 | protected void onPreExecute() {
38 | }
39 |
40 | protected synchronized void onProgressUpdate(Progress... values) {
41 | }
42 |
43 | protected final void publishProgress(Progress... values) {
44 | mUiHandler.obtainMessage(MESSAGE_PROGRESS, values).sendToTarget();
45 | }
46 |
47 | protected synchronized void onPostExecute(Result result) {
48 | }
49 |
50 | public final boolean isCancelled() {
51 | return !mRunning;
52 | }
53 |
54 | public void cancel() {
55 | mRunning = false;
56 | mHandlerThread.quit();
57 | }
58 |
59 | public void execute(Params... params) {
60 | mRunning = true;
61 | mParams = params;
62 | onPreExecute();
63 | mHandler.sendEmptyMessage(MESSAGE_INBACKGROUND);
64 | }
65 |
66 | /** 获取doInBackground的执行时间 毫秒 */
67 | public long getExecuteTime() {
68 | return mEndTime - mStartTime;
69 | }
70 |
71 | private class TaskHandler extends Handler {
72 |
73 | public TaskHandler(Looper looper) {
74 | super(looper);
75 | }
76 |
77 | @SuppressWarnings("unchecked")
78 | @Override
79 | public void handleMessage(Message msg) {
80 | switch (msg.what) {
81 | case MESSAGE_INBACKGROUND:
82 | mStartTime = System.currentTimeMillis();
83 | mUiHandler.obtainMessage(MESSAGE_POSTEXECUTE, doInBackground(mParams)).sendToTarget();
84 | break;
85 | case MESSAGE_POSTEXECUTE:
86 | mEndTime = System.currentTimeMillis();
87 | mRunning = false;
88 | onPostExecute((Result) msg.obj);
89 | try {
90 | mHandlerThread.quit();
91 | } catch (Exception e) {
92 | e.printStackTrace();
93 | }
94 | break;
95 | case MESSAGE_PROGRESS:
96 | onProgressUpdate((Progress[]) msg.obj);
97 | break;
98 | }
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/preference/PreferenceKeys.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.preference;
2 |
3 | /**
4 | *
5 | * @author tangjun
6 | *
7 | */
8 | public final class PreferenceKeys {
9 |
10 | public static final String PERFERENCE = "perference.db";
11 |
12 | /** 相册缓存文件夹满了 */
13 | public static final String PHOTO_CACHE_FULL = "photo_cache_full";
14 |
15 | public static final String FLOWER_DAY = "flower_day";
16 |
17 | /** 录制页提示 */
18 | public static final String RECORD_ONLINE_TIPS = "record_online_tips";
19 | /** 录制页提示 */
20 | public static final String RECORD_TIPS = "record_tips";
21 | /** 首页拍摄引导 */
22 | public static final String RECORD_TIPS_FIRST = "record_tips_first";
23 | /** 高级编辑引导 */
24 | public static final String RECORD_TIPS_SENIOR_EDITOR = "record_tips_senior_editor";
25 | /** 视频画面拖动提示-左右 */
26 | public static final String VIDEO_EDIT_TIPS_LR = "video_edit_tips_lr";
27 | /** 视频画面拖动提示-上下 */
28 | public static final String VIDEO_EDIT_TIPS_TB = "video_edit_tips_tb";
29 |
30 | /** 默认主题 */
31 | public static final String THEME_CURRENT_DEFAULT = "default";
32 | /** 当前主题 */
33 | // public static final String THEME_CURRENT = THEME_CURRENT_DEFAULT;
34 | /** 当前主题列表 */
35 | public static final String THEME_CURRENT_SERIES_THEMES = "_SERIES_THEMES";
36 | /** 主题版本 */
37 | public static final String THEME_CURRENT_VERSION = "theme_current_version";
38 | /** 默认主题更新时间 */
39 | public static final String THEME_DEFAULT_UPDATE_TIME = "theme_default_update_time";
40 | /** 默认主题排序 */
41 | public static final String THEME_DEFAULT_ORDER = "theme_default_order";
42 | /** 主题排序 */
43 | public static final String THEME_ORDER = "theme_order_";
44 | /** 作者名称 */
45 | public static final String THEME_LOGO_AUTHOR_NAME = "theme_logo_author_name";
46 | /** 作者截图宽度 */
47 | public static final String THEME_LOGO_AUTHOR_WIDTH = "theme_logo_author_width";
48 | /** 作者截图高度 */
49 | public static final String THEME_LOGO_AUTHOR_HEIGHT = "theme_logo_author_height";
50 |
51 | /** 音乐随机 */
52 | public static final String THEME_MUSIC_RANDOM_INDEX = "theme_music_random_index";
53 |
54 | /** 检测新音乐 */
55 | public static final String THEME_UPDATETIME = "theme_updatetime_";
56 | /** 检测新音乐 */
57 | public static final String THEME_UPDATETIME_MUSIC = "theme_updatetime_music";
58 | // /** 检测MV主题 */
59 | // public static final String THEME_UPDATETIME_MV = "theme_updatetime_mv";
60 | // /** 检测水印 */
61 | // public static final String THEME_UPDATETIME_WATERMARK = "theme_updatetime_watermark";
62 | //
63 |
64 | /** 3G下码率 */
65 | public static final String VIDEO_BITRATE_3G_600K = "video_bitrate_3g_600k";
66 | public static final boolean VIDEO_BITRATE_3G_600K_DEFAULT = true;
67 |
68 | /** 拍摄时长限制 */
69 | public static final String VIDEO_TIME_LIMIT = "video_time_limit";
70 | /** 拍摄时长限制默认值 */
71 | public static final int VIDEO_TIME_LIMIT_DEFAULT = 10 * 1000;
72 |
73 | /** 是否开启上传 */
74 | public static final String VERSION_DEBUG = "version_debug";
75 |
76 | public static final String THREAD_STARTER_PREFIX_SCID = "thread_starter_prefix_";
77 |
78 |
79 | /** 使用系统录制 */
80 | public static final String USE_SYSTEM_RECORD = "use_system_record";
81 | public static final boolean USE_SYSTEM_RECORD_DEFAULT = false;
82 |
83 | /** 城市信息缓存 */
84 | public static final String THEME_CITY_INFO_CACHE = "theme_city_info_cache";
85 | /** 城市信息拼音缓存 */
86 | public static final String THEME_CITY_PINYIN_INFO_CACHE = "theme_city_pinyin_info_cache";
87 | }
88 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/service/AssertService.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.service;
2 |
3 | import java.io.File;
4 |
5 | import android.app.Service;
6 | import android.content.Intent;
7 | import android.os.Environment;
8 | import android.os.IBinder;
9 |
10 | import com.yixia.camera.demo.log.Logger;
11 | import com.yixia.camera.demo.ui.record.helper.ThemeHelper;
12 | import com.yixia.camera.util.DeviceUtils;
13 |
14 | /**
15 | * 专门用来处理解压资源
16 | *
17 | * @author tangjun
18 | *
19 | */
20 | public class AssertService extends Service implements Runnable {
21 |
22 | /** 是否正在运行 */
23 | private static boolean mIsRunning;
24 |
25 | @Override
26 | public void onCreate() {
27 | super.onCreate();
28 | mIsRunning = true;
29 | new Thread(this).start();
30 | }
31 |
32 | @Override
33 | public IBinder onBind(Intent intent) {
34 | return null;
35 | }
36 |
37 | @Override
38 | public void run() {
39 | try {
40 | File mThemeCacheDir;
41 | // 获取传入参数
42 | if (Environment.MEDIA_MOUNTED.equals(Environment
43 | .getExternalStorageState())
44 | && !isExternalStorageRemovable())
45 | mThemeCacheDir = new File(getExternalCacheDir(), "Theme");
46 | else
47 | mThemeCacheDir = new File(getCacheDir(), "Theme");
48 | ThemeHelper.prepareTheme(getApplication(), mThemeCacheDir);
49 | } catch (OutOfMemoryError e) {
50 | Logger.e(e);
51 | } catch (Exception e) {
52 | Logger.e(e);
53 | }
54 | mIsRunning = false;
55 | stopSelf();
56 | }
57 |
58 | public static boolean isRunning() {
59 | return mIsRunning;
60 | }
61 |
62 | public static boolean isExternalStorageRemovable() {
63 | if (DeviceUtils.hasGingerbread())
64 | return Environment.isExternalStorageRemovable();
65 | else
66 | return Environment.MEDIA_REMOVED.equals(Environment
67 | .getExternalStorageState());
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/ui/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.ui;
2 |
3 | import java.io.File;
4 | import java.io.FileOutputStream;
5 |
6 | import android.app.Activity;
7 | import android.app.ProgressDialog;
8 | import android.view.Window;
9 |
10 | import com.google.gson.Gson;
11 | import com.yixia.camera.demo.log.Logger;
12 | import com.yixia.camera.model.MediaObject;
13 | import com.yixia.camera.model.MediaObject.MediaPart;
14 | import com.yixia.camera.util.FileUtils;
15 | import com.yixia.camera.util.Log;
16 | import com.yixia.camera.util.StringUtils;
17 |
18 | public class BaseActivity extends Activity {
19 |
20 | protected ProgressDialog mProgressDialog;
21 |
22 | public ProgressDialog showProgress(String title, String message) {
23 | return showProgress(title, message, -1);
24 | }
25 |
26 | public ProgressDialog showProgress(String title, String message, int theme) {
27 | if (mProgressDialog == null) {
28 | if (theme > 0)
29 | mProgressDialog = new ProgressDialog(this, theme);
30 | else
31 | mProgressDialog = new ProgressDialog(this);
32 | mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
33 | mProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
34 | mProgressDialog.setCanceledOnTouchOutside(false);// 不能取消
35 | mProgressDialog.setIndeterminate(true);// 设置进度条是否不明确
36 | }
37 |
38 | if (!StringUtils.isEmpty(title))
39 | mProgressDialog.setTitle(title);
40 | mProgressDialog.setMessage(message);
41 | mProgressDialog.show();
42 | return mProgressDialog;
43 | }
44 |
45 | public void hideProgress() {
46 | if (mProgressDialog != null) {
47 | mProgressDialog.dismiss();
48 | }
49 | }
50 |
51 | @Override
52 | protected void onStop() {
53 | super.onStop();
54 |
55 | hideProgress();
56 | mProgressDialog = null;
57 | }
58 |
59 | /** 反序列化对象 */
60 | protected static MediaObject restoneMediaObject(String obj) {
61 | try {
62 | String str = FileUtils.readFile(new File(obj));
63 | Gson gson = new Gson();
64 | MediaObject result = gson.fromJson(str.toString(),
65 | MediaObject.class);
66 | result.getCurrentPart();
67 | preparedMediaObject(result);
68 | return result;
69 | } catch (Exception e) {
70 | if (e != null)
71 | Log.e("VCamera", "readFile", e);
72 | }
73 | return null;
74 | }
75 |
76 | /** 预处理数据对象 */
77 | public static void preparedMediaObject(MediaObject mMediaObject) {
78 | if (mMediaObject != null && mMediaObject.getMedaParts() != null) {
79 | int duration = 0;
80 | for (MediaPart part : mMediaObject.getMedaParts()) {
81 | part.startTime = duration;
82 | part.endTime = part.startTime + part.duration;
83 | duration += part.duration;
84 | }
85 | }
86 | }
87 |
88 | /** 序列号保存视频数据 */
89 | public static boolean saveMediaObject(MediaObject mMediaObject) {
90 | if (mMediaObject != null) {
91 | try {
92 | if (StringUtils.isNotEmpty(mMediaObject.getObjectFilePath())) {
93 | FileOutputStream out = new FileOutputStream(
94 | mMediaObject.getObjectFilePath());
95 | Gson gson = new Gson();
96 | out.write(gson.toJson(mMediaObject).getBytes());
97 | out.flush();
98 | out.close();
99 | return true;
100 | }
101 | } catch (Exception e) {
102 | Logger.e(e);
103 | }
104 | }
105 | return false;
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/ui/LaunchActivity.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.ui;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | public class LaunchActivity extends Activity {
7 | // launcher
8 |
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 |
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/ui/record/helper/RecorderHelper.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.ui.record.helper;
2 |
3 | import com.google.gson.Gson;
4 | import com.yixia.camera.demo.log.Logger;
5 | import com.yixia.camera.demo.preference.PreferenceKeys;
6 | import com.yixia.camera.demo.preference.PreferenceUtils;
7 | import com.yixia.camera.util.FileUtils;
8 | import com.yixia.camera.util.StringUtils;
9 |
10 | import java.io.File;
11 | import java.io.FileOutputStream;
12 |
13 | /**
14 | * 拍摄帮助类
15 | *
16 | * @author tangjun
17 | *
18 | */
19 | public class RecorderHelper {
20 |
21 | /** 获取视频码率 */
22 | public static int getVideoBitrate() {
23 | // if (NetworkUtils.isWifiAvailable(VideoApplication.getContext()) || !PreferenceUtils.getBoolean(PreferenceKeys.VIDEO_BITRATE_3G_600K, PreferenceKeys.VIDEO_BITRATE_3G_600K_DEFAULT))
24 | // return 1500;//MediaRecorder.VIDEO_BITRATE_MEDIUM;//WIFI下800码率
25 | // else {
26 | // return 800;//MediaRecorder.VIDEO_BITRATE_NORMAL;//3G、2G下600码率
27 | // }
28 | return 1500;
29 | }
30 |
31 | /** 获取最大拍摄时长,默认10秒 */
32 | public static int getMaxDuration() {
33 | return PreferenceUtils.getIntProcess(PreferenceKeys.VIDEO_TIME_LIMIT, PreferenceKeys.VIDEO_TIME_LIMIT_DEFAULT);
34 | }
35 |
36 | /**
37 | * 清除账号权限拍摄时长
38 | */
39 | public static void removeDuration() {
40 | PreferenceUtils.remove(PreferenceKeys.VIDEO_TIME_LIMIT);
41 | }
42 |
43 | /** 讲对象实例化到磁盘 */
44 | public static boolean saveObject(Object obj, String target) {
45 | try {
46 | if (StringUtils.isNotEmpty(target)) {
47 | FileOutputStream out = new FileOutputStream(target);
48 | Gson gson = new Gson();
49 | out.write(gson.toJson(obj).getBytes());
50 | out.flush();
51 | out.close();
52 | return true;
53 | }
54 | } catch (Exception e) {
55 | Logger.e(e);
56 | }
57 | return false;
58 | }
59 |
60 | /** 从文件中反序列化对象 */
61 | public static T restoreObject(Class cls, String target) {
62 | try {
63 | String sb = FileUtils.readFile(new File(target));
64 | if (sb != null) {
65 | String str = sb.toString();
66 | Gson gson = new Gson();
67 | T result = gson.fromJson(str.toString(), cls);
68 | return result;
69 | }
70 | } catch (Exception e) {
71 | Logger.e(e);
72 | }
73 | return null;
74 | }
75 |
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/ui/record/views/BitmapImageView.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.ui.record.views;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.graphics.BitmapFactory;
6 | import android.util.AttributeSet;
7 | import android.widget.ImageView;
8 |
9 | import com.yixia.camera.demo.log.Logger;
10 | import com.yixia.camera.util.StringUtils;
11 |
12 | /**
13 | * 专门用来处理Bitmap类型的ImageView,onDetachedFromWindow时释放,防止内存泄露
14 | *
15 | * @author tangjun
16 | *
17 | */
18 | public class BitmapImageView extends ImageView {
19 |
20 | private Bitmap mBitmap;
21 | private String mPath;
22 |
23 | public BitmapImageView(Context context) {
24 | super(context);
25 | }
26 |
27 | public BitmapImageView(Context context, AttributeSet attrs) {
28 | super(context, attrs);
29 | }
30 |
31 | public void setImagePath(String path) {
32 | release();
33 | if (StringUtils.isNotEmpty(path)) {
34 | try {
35 | mBitmap = BitmapFactory.decodeFile(path);
36 | if (mBitmap != null && !mBitmap.isRecycled()) {
37 | mPath = path;
38 | setImageBitmap(mBitmap);
39 | }
40 | } catch (OutOfMemoryError e) {
41 | Logger.e(e);
42 | } catch (Exception e) {
43 | Logger.e(e);
44 | }
45 | }
46 | }
47 |
48 | @Override
49 | protected void onAttachedToWindow() {
50 | super.onAttachedToWindow();
51 | if (StringUtils.isNotEmpty(mPath)) {
52 | setImagePath(mPath);
53 | }
54 | }
55 |
56 | @Override
57 | protected void onDetachedFromWindow() {
58 | super.onDetachedFromWindow();
59 | release();
60 | }
61 |
62 | public void release() {
63 | if (mBitmap != null) {
64 | if (!mBitmap.isRecycled())
65 | mBitmap.recycle();
66 | mBitmap = null;
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/ui/record/views/ThemeGroupLayout.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.ui.record.views;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.LinearLayout;
6 |
7 | import java.util.Observable;
8 |
9 | public class ThemeGroupLayout extends LinearLayout {
10 |
11 | public ThemeGroupLayout(Context context, AttributeSet attrs) {
12 | super(context, attrs);
13 | }
14 |
15 | public ThemeGroupLayout(Context context) {
16 | super(context);
17 | }
18 |
19 | public void addView(ThemeView child, android.view.ViewGroup.LayoutParams params) {
20 | super.addView(child, params);
21 | mObservable.addObserver(child);
22 | }
23 |
24 | public void addView(ThemeView child, int index, android.view.ViewGroup.LayoutParams params) {
25 | super.addView(child, index, params);
26 | mObservable.addObserver(child);
27 | }
28 |
29 | @Override
30 | public void removeAllViews() {
31 | super.removeAllViews();
32 | mObservable.deleteObservers();
33 | }
34 |
35 | public Observable mObservable = new Observable() {
36 | @Override
37 | public void notifyObservers() {
38 | setChanged();
39 | super.notifyObservers();
40 | clearChanged();
41 | }
42 |
43 | @Override
44 | public void notifyObservers(Object data) {
45 | setChanged();
46 | super.notifyObservers(data);
47 | clearChanged();
48 | };
49 | };
50 | }
51 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/ui/record/views/ThemeRadioButton.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.ui.record.views;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.CompoundButton;
6 | import android.widget.RadioButton;
7 |
8 | import com.example.wechat01.R;
9 |
10 | public class ThemeRadioButton extends RadioButton implements
11 | android.widget.CompoundButton.OnCheckedChangeListener {
12 |
13 | private int mColorNormal, mColorSelected;
14 |
15 | public ThemeRadioButton(Context context, AttributeSet attrs, int defStyle) {
16 | super(context, attrs, defStyle);
17 | init();
18 | }
19 |
20 | public ThemeRadioButton(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | init();
23 | }
24 |
25 | public ThemeRadioButton(Context context) {
26 | super(context);
27 | init();
28 | }
29 |
30 | private void init() {
31 | mColorNormal = getResources().getColor(R.color.transparent);
32 | mColorSelected = getResources().getColor(
33 | R.color.camera_theme_selected_bgcolor);
34 | setOnCheckedChangeListener(this);
35 | }
36 |
37 | @Override
38 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
39 | if (isChecked)
40 | setBackgroundColor(mColorSelected);
41 | else
42 | setBackgroundColor(mColorNormal);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/ui/record/views/ThemeView.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.ui.record.views;
2 |
3 | import java.util.Observable;
4 | import java.util.Observer;
5 |
6 | import android.content.Context;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.widget.ImageView;
10 | import android.widget.RelativeLayout;
11 | import android.widget.TextView;
12 |
13 | import com.example.wechat01.R;
14 | import com.yixia.camera.demo.po.POThemeSingle;
15 | import com.yixia.camera.demo.utils.IsUtils;
16 |
17 | public class ThemeView extends RelativeLayout implements Observer {
18 |
19 | /** 图标 */
20 | private ImageView mSelectedIcon;
21 | private BitmapImageView mIcon;
22 | /** 标题 */
23 | private TextView mTitle;
24 | /** 当前主题 */
25 | private POThemeSingle mTheme;
26 |
27 | public ThemeView(Context context, POThemeSingle theme) {
28 | super(context);
29 | this.mTheme = theme;
30 |
31 | LayoutInflater.from(context).inflate(R.layout.view_theme_item, this);
32 | mIcon = (BitmapImageView) findViewById(R.id.icon);
33 | mSelectedIcon = (ImageView) findViewById(R.id.selected);
34 | mTitle = (TextView) findViewById(R.id.title);
35 |
36 | mTitle.setText(mTheme.themeDisplayName);
37 |
38 | if (!mTheme.isMV()) {
39 | // 高级编辑全部变成方的
40 | // if (mTheme.isWatermark() || mTheme.isSoundEffect() ||
41 | // mTheme.isFilter() || mTheme.isSpeed())
42 | mSelectedIcon
43 | .setImageResource(R.drawable.record_theme_square_selected);
44 | }
45 | if (mTheme.isEmpty()) {
46 | mSelectedIcon.setVisibility(View.VISIBLE);
47 | }
48 | }
49 |
50 | /** 获取主题图标 */
51 | public BitmapImageView getIcon() {
52 | return mIcon;
53 | }
54 |
55 | @Override
56 | public void update(Observable observable, Object data) {
57 | if (data != null && mTheme != null) {
58 | if (IsUtils.equals(mTheme.themeName, data.toString())) {
59 | mSelectedIcon.setVisibility(View.VISIBLE);
60 | } else {
61 | mSelectedIcon.setVisibility(View.GONE);
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/utils/ConvertToUtils.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.utils;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.util.TypedValue;
6 |
7 | public class ConvertToUtils {
8 |
9 | private static final String EMPTY_STRING = "";
10 |
11 | /**
12 | *
13 | * @param str
14 | * @return
15 | */
16 | public static String toString(String str) {
17 | if (IsUtils.isNullOrEmpty(str)) {
18 | return EMPTY_STRING;
19 | } else {
20 | return str;
21 | }
22 | }
23 |
24 | /**
25 | *
26 | * @param o
27 | * @return
28 | */
29 | public static String toString(Object o) {
30 | if (IsUtils.isNullOrEmpty(o)) {
31 | return EMPTY_STRING;
32 | } else {
33 | return o.toString();
34 | }
35 | }
36 |
37 | /**
38 | * 转换字符串为int
39 | *
40 | * @param str
41 | * @return
42 | */
43 | public static int toInt(String str) {
44 | return toInt(str, 0);
45 | }
46 |
47 | /**
48 | * 转换字符串为int
49 | *
50 | * @param str
51 | * @param def 默认值
52 | * @return
53 | */
54 | public static int toInt(String str, int def) {
55 | if (IsUtils.isNullOrEmpty(str)) {
56 | return def;
57 | }
58 | try {
59 | return Integer.parseInt(str);
60 | } catch (NumberFormatException e) {
61 | return def;
62 | }
63 | }
64 |
65 | /**
66 | * 转换字符串为boolean
67 | *
68 | * @param str
69 | * @return
70 | */
71 | public static boolean toBoolean(String str) {
72 | return toBoolean(str, false);
73 | }
74 |
75 | /**
76 | * 转换字符串为boolean
77 | *
78 | * @param str
79 | * @param def
80 | * @return
81 | */
82 | public static boolean toBoolean(String str, boolean def) {
83 | if (IsUtils.isNullOrEmpty(str)) {
84 | return def;
85 | }
86 | if ("false".equalsIgnoreCase(str) || "0".equals(str)) {
87 | return false;
88 | } else if ("true".equalsIgnoreCase(str) || "1".equals(str)) {
89 | return true;
90 | } else {
91 | return def;
92 | }
93 | }
94 |
95 | /**
96 | * 转换字符串为float
97 | *
98 | * @param str
99 | * @return
100 | */
101 | public static float toFloat(String str) {
102 | return toFloat(str, 0F);
103 | }
104 |
105 | /**
106 | * 转换字符串为float
107 | *
108 | * @param str
109 | * @param def
110 | * @return
111 | */
112 | public static float toFloat(String str, float def) {
113 | if (IsUtils.isNullOrEmpty(str)) {
114 | return def;
115 | }
116 | try {
117 | return Float.parseFloat(str);
118 | } catch (NumberFormatException e) {
119 | return def;
120 | }
121 | }
122 |
123 | /**
124 | * 转换字符串为long
125 | *
126 | * @param str
127 | * @return
128 | */
129 | public static long toLong(String str) {
130 | return toLong(str, 0L);
131 | }
132 |
133 | /**
134 | * 转换字符串为long
135 | *
136 | * @param str
137 | * @param def
138 | * @return
139 | */
140 | public static long toLong(String str, long def) {
141 | if (IsUtils.isNullOrEmpty(str)) {
142 | return def;
143 | }
144 | try {
145 | return Long.parseLong(str);
146 | } catch (NumberFormatException e) {
147 | return def;
148 | }
149 | }
150 |
151 | /**
152 | * 转换字符串为short
153 | *
154 | * @param str
155 | * @return
156 | */
157 | public static short toShort(String str) {
158 | return toShort(str, (short) 0);
159 | }
160 |
161 | /**
162 | * 转换字符串为short
163 | *
164 | * @param str
165 | * @param def
166 | * @return
167 | */
168 | public static short toShort(String str, short def) {
169 | if (IsUtils.isNullOrEmpty(str)) {
170 | return def;
171 | }
172 | try {
173 | return Short.parseShort(str);
174 | } catch (NumberFormatException e) {
175 | return def;
176 | }
177 | }
178 |
179 | /** 颜色转化 */
180 | public static int toColor(String str, int def) {
181 | if (IsUtils.isNullOrEmpty(str)) {
182 | return def;
183 | }
184 | try {
185 | return Color.parseColor(str);
186 | } catch (Exception e) {
187 | return def;
188 | }
189 | }
190 |
191 | /**
192 | * px = dp * (dpi / 160)
193 | *
194 | * @param ctx
195 | * @param dip
196 | * @return
197 | */
198 | public static int dipToPX(final Context ctx, float dip) {
199 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, ctx.getResources().getDisplayMetrics());
200 | }
201 |
202 | /**
203 | * sp*ppi/160 =px
204 | *
205 | * @param ctx
206 | * @param dip
207 | * @return
208 | */
209 | public static int spToPX(final Context ctx, float sp) {
210 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, ctx.getResources().getDisplayMetrics());
211 | }
212 | }
213 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/utils/IsUtils.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.utils;
2 |
3 | import java.util.regex.Pattern;
4 |
5 | public class IsUtils {
6 |
7 | private static final String PATTERN_ALPHABETIC_OR_NUMBERIC = "[A-Za-z0-9]*";
8 | private static final String PATTERN_NUMBERIC = "\\d*\\.{0,1}\\d*";
9 |
10 | /**
11 | * 字符串是否由字面或数字组成
12 | *
13 | * @param str
14 | * @return
15 | */
16 | public static boolean isAlphabeticOrNumberic(String str) {
17 | return Pattern.compile(PATTERN_ALPHABETIC_OR_NUMBERIC).matcher(str).matches();
18 | }
19 |
20 | /**
21 | * 字符串是否是数组
22 | *
23 | * @param str
24 | * @return
25 | */
26 | public static boolean isNumeric(String str) {
27 | return Pattern.compile(PATTERN_NUMBERIC).matcher(str).matches();
28 | }
29 |
30 | /**
31 | * 判断字符串是否为空
32 | *
33 | * @param str
34 | * @return
35 | */
36 | public static boolean isNullOrEmpty(String str) {
37 | return (str == null || str.length() == 0);
38 | }
39 |
40 | /**
41 | * 判断对象是否为空
42 | *
43 | * @param str
44 | * @return
45 | */
46 | public static boolean isNullOrEmpty(final Object str) {
47 | return (str == null || str.toString().length() == 0);
48 | }
49 |
50 | /**
51 | * 判断一组字符串是否有一个为空
52 | *
53 | * @param strs
54 | * @return
55 | */
56 | public static boolean isNullOrEmpty(final String... strs) {
57 | if (strs == null || strs.length == 0) {
58 | return true;
59 | }
60 | for (String str : strs) {
61 | if (str == null || str.length() == 0) {
62 | return true;
63 | }
64 | }
65 | return false;
66 | }
67 |
68 | /**
69 | * 判断子字符串是否有出现在指定字符串中
70 | *
71 | * @param str
72 | * @param c
73 | * @return
74 | */
75 | public static boolean find(String str, String c) {
76 | if (isNullOrEmpty(str)) {
77 | return false;
78 | }
79 | return str.indexOf(c) > -1;
80 | }
81 |
82 | public static boolean findIgnoreCase(String str, String c) {
83 | if (isNullOrEmpty(str)) {
84 | return false;
85 | }
86 | return str.toLowerCase().indexOf(c.toLowerCase()) > -1;
87 | }
88 |
89 | /**
90 | * 比较两个字符串是否相
91 | *
92 | * @param str1
93 | * @param str2
94 | * @return
95 | */
96 | public static boolean equals(String str1, String str2) {
97 | if (str1 == str2)
98 | return true;
99 |
100 | if (str1 == null)
101 | str1 = "";
102 | return str1.equals(str2);
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/utils/NetworkUtils.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.utils;
2 |
3 | import java.net.InetAddress;
4 | import java.net.NetworkInterface;
5 | import java.util.Collections;
6 | import java.util.List;
7 |
8 | import org.apache.http.conn.util.InetAddressUtils;
9 |
10 | import android.content.Context;
11 | import android.net.ConnectivityManager;
12 | import android.net.NetworkInfo;
13 | import android.telephony.TelephonyManager;
14 |
15 | public class NetworkUtils {
16 |
17 | public static boolean isWifiAvailable(Context ctx) {
18 | ConnectivityManager manager = (ConnectivityManager) ctx
19 | .getSystemService(Context.CONNECTIVITY_SERVICE);
20 | return manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI)
21 | .isConnected();
22 | }
23 |
24 | /**
25 | * 检测网络连接是否可用
26 | *
27 | * @param ctx
28 | * @return true 可用; false 不可用
29 | */
30 | public static boolean isNetworkAvailable(Context ctx) {
31 | ConnectivityManager cm = (ConnectivityManager) ctx
32 | .getSystemService(Context.CONNECTIVITY_SERVICE);
33 | if (cm == null) {
34 | return false;
35 | }
36 | try {
37 | NetworkInfo[] netinfo = cm.getAllNetworkInfo();
38 | if (netinfo == null) {
39 | return false;
40 | }
41 | for (NetworkInfo element : netinfo) {
42 | if (element.isConnected()) {
43 | return true;
44 | }
45 | }
46 | } catch (Exception ex) {
47 |
48 | }
49 | return false;
50 | }
51 |
52 | /**
53 | * Get IP address from first non-localhost interface
54 | *
55 | * @param ipv4
56 | * true=return ipv4, false=return ipv6
57 | * @return address or empty string
58 | */
59 | public static String getIPAddress(boolean useIPv4) {
60 | try {
61 | List interfaces = Collections
62 | .list(NetworkInterface.getNetworkInterfaces());
63 | for (NetworkInterface intf : interfaces) {
64 | List addrs = Collections.list(intf
65 | .getInetAddresses());
66 | for (InetAddress addr : addrs) {
67 | if (!addr.isLoopbackAddress()) {
68 | String sAddr = addr.getHostAddress().toUpperCase();
69 | boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr);
70 | if (useIPv4) {
71 | if (isIPv4)
72 | return sAddr;
73 | } else {
74 | if (!isIPv4) {
75 | int delim = sAddr.indexOf('%'); // drop ip6 port
76 | // suffix
77 | return delim < 0 ? sAddr : sAddr.substring(0,
78 | delim);
79 | }
80 | }
81 | }
82 | }
83 | }
84 | } catch (Exception ex) {
85 | } // for now eat exceptions
86 | return "";
87 | }
88 |
89 | public static String getNetworkTypeName(Context context) {
90 | if (context != null) {
91 | ConnectivityManager connectMgr = (ConnectivityManager) context
92 | .getSystemService(Context.CONNECTIVITY_SERVICE);
93 | if (connectMgr != null) {
94 | NetworkInfo info = connectMgr.getActiveNetworkInfo();
95 | if (info != null) {
96 | switch (info.getType()) {
97 | case ConnectivityManager.TYPE_WIFI:
98 | return "WIFI";
99 | case ConnectivityManager.TYPE_MOBILE:
100 | return getNetworkTypeName(info.getSubtype());
101 | }
102 | }
103 | }
104 | }
105 | return getNetworkTypeName(TelephonyManager.NETWORK_TYPE_UNKNOWN);
106 | }
107 |
108 | public static String getNetworkTypeName(int type) {
109 | switch (type) {
110 | case TelephonyManager.NETWORK_TYPE_GPRS:
111 | return "GPRS";
112 | case TelephonyManager.NETWORK_TYPE_EDGE:
113 | return "EDGE";
114 | case TelephonyManager.NETWORK_TYPE_UMTS:
115 | return "UMTS";
116 | case TelephonyManager.NETWORK_TYPE_HSDPA:
117 | return "HSDPA";
118 | case TelephonyManager.NETWORK_TYPE_HSUPA:
119 | return "HSUPA";
120 | case TelephonyManager.NETWORK_TYPE_HSPA:
121 | return "HSPA";
122 | case TelephonyManager.NETWORK_TYPE_CDMA:
123 | return "CDMA";
124 | case TelephonyManager.NETWORK_TYPE_EVDO_0:
125 | return "CDMA - EvDo rev. 0";
126 | case TelephonyManager.NETWORK_TYPE_EVDO_A:
127 | return "CDMA - EvDo rev. A";
128 | case TelephonyManager.NETWORK_TYPE_EVDO_B:
129 | return "CDMA - EvDo rev. B";
130 | case TelephonyManager.NETWORK_TYPE_1xRTT:
131 | return "CDMA - 1xRTT";
132 | case TelephonyManager.NETWORK_TYPE_LTE:
133 | return "LTE";
134 | case TelephonyManager.NETWORK_TYPE_EHRPD:
135 | return "CDMA - eHRPD";
136 | case TelephonyManager.NETWORK_TYPE_IDEN:
137 | return "iDEN";
138 | case TelephonyManager.NETWORK_TYPE_HSPAP:
139 | return "HSPA+";
140 | default:
141 | return "UNKNOWN";
142 | }
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/utils/ResourceUtils.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.utils;
2 |
3 | import java.io.File;
4 | import java.io.FileOutputStream;
5 | import java.io.IOException;
6 | import java.io.InputStream;
7 | import java.io.OutputStream;
8 |
9 | import org.apache.http.util.EncodingUtils;
10 |
11 | import android.content.Context;
12 | import android.graphics.drawable.Drawable;
13 | import android.widget.ImageView;
14 |
15 | import com.yixia.camera.demo.log.Logger;
16 | import com.yixia.camera.util.StringUtils;
17 |
18 | public class ResourceUtils {
19 |
20 | /** 从assets 文件夹中获取文件并读取数据 */
21 | public static String getTextFromAssets(final Context context, String fileName) {
22 | String result = "";
23 | try {
24 | InputStream in = context.getResources().getAssets().open(fileName);
25 | // 获取文件的字节数
26 | int lenght = in.available();
27 | // 创建byte数组
28 | byte[] buffer = new byte[lenght];
29 | // 将文件中的数据读到byte数组中
30 | in.read(buffer);
31 | result = EncodingUtils.getString(buffer, "UTF-8");
32 | in.close();
33 | } catch (Exception e) {
34 | Logger.e("Assert:" + fileName);
35 | Logger.e(e);
36 | }
37 | return result;
38 | }
39 |
40 | /** 拷贝资源到sdcard */
41 | public static boolean copyToSdcard(final Context ctx, String fileName, String target) {
42 | InputStream in = null;
43 | OutputStream out = null;
44 | try {
45 | in = ctx.getAssets().open(fileName);
46 | out = new FileOutputStream(target);
47 |
48 | byte[] buffer = new byte[1024];
49 | int length;
50 | while ((length = in.read(buffer)) > 0) {
51 | out.write(buffer, 0, length);
52 | }
53 | } catch (Exception ex) {
54 | Logger.e(ex);
55 | return false;
56 | } finally {
57 | try {
58 | if (in != null)
59 | in.close();
60 | } catch (Exception e) {
61 |
62 | }
63 | try {
64 | if (out != null)
65 | out.close();
66 | } catch (Exception e) {
67 |
68 | }
69 | }
70 | return true;
71 | }
72 |
73 | public static Drawable loadImageFromAsserts(final Context ctx, String fileName) {
74 | try {
75 | InputStream is = ctx.getResources().getAssets().open(fileName);
76 | return Drawable.createFromStream(is, null);
77 | } catch (IOException e) {
78 | if (e != null) {
79 | Logger.e("Assert:" + fileName);
80 | Logger.e(e);
81 | }
82 | } catch (OutOfMemoryError e) {
83 | if (e != null) {
84 | Logger.e("Assert:" + fileName);
85 | Logger.e(e);
86 | }
87 | } catch (Exception e) {
88 | if (e != null) {
89 | Logger.e("Assert:" + fileName);
90 | Logger.e(e);
91 | }
92 | }
93 | return null;
94 | }
95 |
96 | /** 从Asset从加载图片 */
97 | public static void loadImageFromAsserts(final Context ctx, ImageView view, String fileName) {
98 | try {
99 | if (ctx != null && !StringUtils.isEmpty(fileName)) {
100 | InputStream is = ctx.getResources().getAssets().open(fileName);
101 | view.setImageDrawable(Drawable.createFromStream(is, null));
102 | }
103 | } catch (IOException e) {
104 | if (e != null) {
105 | Logger.e("Assert:" + fileName);
106 | Logger.e(e);
107 | }
108 | } catch (OutOfMemoryError e) {
109 | if (e != null) {
110 | Logger.e("Assert:" + fileName);
111 | Logger.e(e);
112 | }
113 | } catch (Exception e) {
114 | if (e != null) {
115 | Logger.e("Assert:" + fileName);
116 | Logger.e(e);
117 | }
118 | }
119 | }
120 |
121 | /** 拷贝数据库 */
122 | public static void copyDatabase(final Context ctx, String dbName) {
123 | if (ctx != null) {
124 | File f = ctx.getDatabasePath(dbName);
125 | if (!f.exists()) {
126 |
127 | // 检测databases文件夹是否已创建
128 | if (!f.getParentFile().exists())
129 | f.getParentFile().mkdir();
130 |
131 | try {
132 | InputStream in = ctx.getAssets().open(dbName);
133 | OutputStream out = new FileOutputStream(f.getAbsolutePath());
134 |
135 | byte[] buffer = new byte[1024];
136 | int length;
137 | while ((length = in.read(buffer)) > 0) {
138 | out.write(buffer, 0, length);
139 | }
140 | in.close();
141 | out.close();
142 | Logger.i("Database copy successed! " + f.getPath());
143 | } catch (Exception ex) {
144 | Logger.e(ex);
145 | }
146 | }
147 | }
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/VCameraDemo/src/com/yixia/camera/demo/utils/ToastUtils.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.demo.utils;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.view.Gravity;
6 | import android.view.View;
7 | import android.widget.RelativeLayout;
8 | import android.widget.TextView;
9 | import android.widget.Toast;
10 |
11 | import com.example.wechat01.R;
12 | import com.yixia.camera.demo.VCameraDemoApplication;
13 |
14 | public class ToastUtils {
15 |
16 | public static void showToast(int resID) {
17 | showToast(VCameraDemoApplication.getContext(), Toast.LENGTH_SHORT,
18 | resID);
19 | }
20 |
21 | public static void showToast(String text) {
22 | showToast(VCameraDemoApplication.getContext(), Toast.LENGTH_SHORT, text);
23 | }
24 |
25 | public static void showToast(Context ctx, int resID) {
26 | showToast(ctx, Toast.LENGTH_SHORT, resID);
27 | }
28 |
29 | public static void showToast(Context ctx, String text) {
30 | showToast(ctx, Toast.LENGTH_SHORT, text);
31 | }
32 |
33 | public static void showLongToast(Context ctx, int resID) {
34 | showToast(ctx, Toast.LENGTH_LONG, resID);
35 | }
36 |
37 | public static void showLongToast(int resID) {
38 | showToast(VCameraDemoApplication.getContext(), Toast.LENGTH_LONG, resID);
39 | }
40 |
41 | public static void showLongToast(Context ctx, String text) {
42 | showToast(ctx, Toast.LENGTH_LONG, text);
43 | }
44 |
45 | public static void showLongToast(String text) {
46 | showToast(VCameraDemoApplication.getContext(), Toast.LENGTH_LONG, text);
47 | }
48 |
49 | public static void showToast(Context ctx, int duration, int resID) {
50 | showToast(ctx, duration, ctx.getString(resID));
51 | }
52 |
53 | /** Toast一个图片 */
54 | public static Toast showToastImage(Context ctx, int resID) {
55 | final Toast toast = Toast.makeText(ctx, "", Toast.LENGTH_SHORT);
56 | View mNextView = toast.getView();
57 | if (mNextView != null)
58 | mNextView.setBackgroundResource(resID);
59 | toast.setGravity(Gravity.CENTER, 0, 0);
60 | toast.show();
61 | return toast;
62 | }
63 |
64 | public static void showToast(final Context ctx, final int duration,
65 | final String text) {
66 | final Toast toast = Toast.makeText(ctx, text, duration);
67 | View view = RelativeLayout.inflate(ctx, R.layout.toast_layout, null);
68 | TextView mNextView = (TextView) view.findViewById(R.id.toast_name);
69 | toast.setView(view);
70 | mNextView.setText(text);
71 | toast.setGravity(Gravity.CENTER, 0, 0);
72 | toast.show();
73 | }
74 |
75 | /** 在UI线程运行弹出 */
76 | public static void showToastOnUiThread(final Activity ctx, final String text) {
77 | if (ctx != null) {
78 | ctx.runOnUiThread(new Runnable() {
79 | public void run() {
80 | showToast(ctx, text);
81 | }
82 | });
83 | }
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/.DS_Store
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | VitamioRecorderLibrary
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/R.txt:
--------------------------------------------------------------------------------
1 | int drawable ic_launcher 0x7f020000
2 | int string app_name 0x7f030000
3 | int style AppBaseTheme 0x7f040000
4 | int style AppTheme 0x7f040001
5 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/AudioRecorder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/AudioRecorder.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/BuildConfig.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/FFMpegUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/FFMpegUtils.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/IMediaRecorder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/IMediaRecorder.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$1.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$2.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$EncodeHandler.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$EncodeHandler.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$OnEncodeListener.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$OnEncodeListener.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$OnErrorListener.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$OnErrorListener.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$OnPreparedListener.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase$OnPreparedListener.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderBase.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderCustom$YuvHandler.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderCustom$YuvHandler.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderCustom.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderCustom.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderNative.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderNative.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderSystem$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderSystem$1.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderSystem.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/MediaRecorderSystem.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R$attr.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R$drawable.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R$string.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R$style.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/R.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/VCamera.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/VCamera.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/model/MediaObject$MediaPart.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/model/MediaObject$MediaPart.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/model/MediaObject.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/model/MediaObject.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/model/MediaThemeObject.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/model/MediaThemeObject.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/util/DeviceUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/util/DeviceUtils.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/util/FileUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/util/FileUtils.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/util/Log.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/util/Log.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/camera/util/StringUtils.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/camera/util/StringUtils.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/videoeditor/adapter/UtilityAdapter$OnNativeListener.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/videoeditor/adapter/UtilityAdapter$OnNativeListener.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/classes/com/yixia/videoeditor/adapter/UtilityAdapter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/classes/com/yixia/videoeditor/adapter/UtilityAdapter.class
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/res/crunch/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/res/crunch/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/res/crunch/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/res/crunch/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/res/crunch/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/res/crunch/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/bin/vitamiorecorderlibrary.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/bin/vitamiorecorderlibrary.jar
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'android-library'
2 |
3 | dependencies {
4 | compile fileTree(dir: 'libs', include: '*.jar')
5 | }
6 |
7 | task copyNativeLibs(type: Copy) {
8 | from fileTree(dir: 'libs', include: 'armeabi-v7a/*.so') into 'build/lib'
9 | }
10 | tasks.withType(Compile) {
11 | compileTask -> compileTask.dependsOn copyNativeLibs
12 | }
13 | clean.dependsOn 'cleanCopyNativeLibs'
14 |
15 | tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
16 | pkgTask.jniFolders = [new File(buildDir, 'lib')]
17 | }
18 |
19 | android {
20 | compileSdkVersion 19
21 | buildToolsVersion "19.1.0"
22 |
23 | sourceSets {
24 | main {
25 | manifest.srcFile 'AndroidManifest.xml'
26 | java.srcDirs = ['src']
27 | resources.srcDirs = ['src']
28 | aidl.srcDirs = ['src']
29 | renderscript.srcDirs = ['src']
30 | res.srcDirs = ['res']
31 | assets.srcDirs = ['assets']
32 | }
33 |
34 | // Move the tests to tests/java, tests/res, etc...
35 | instrumentTest.setRoot('tests')
36 |
37 | // Move the build types to build-types/
38 | // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
39 | // This moves them out of them default location under src//... which would
40 | // conflict with src/ being used by the main source set.
41 | // Adding new build types or product flavors should be accompanied
42 | // by a similar customization.
43 | debug.setRoot('build-types/debug')
44 | release.setRoot('build-types/release')
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/gen/com/yixia/camera/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.yixia.camera;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/gen/com/yixia/camera/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.yixia.camera;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class drawable {
14 | public static int ic_launcher=0x7f020000;
15 | }
16 | public static final class string {
17 | public static int app_name=0x7f030000;
18 | }
19 | public static final class style {
20 | /**
21 | Base application theme, dependent on API level. This theme is replaced
22 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
23 |
24 |
25 | Theme customizations available in newer API levels can go in
26 | res/values-vXX/styles.xml, while customizations related to
27 | backward-compatibility can go here.
28 |
29 |
30 | Base application theme for API 11+. This theme completely replaces
31 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
32 |
33 | API 11 theme customizations can go here.
34 |
35 | Base application theme for API 14+. This theme completely replaces
36 | AppBaseTheme from BOTH res/values/styles.xml and
37 | res/values-v11/styles.xml on API 14+ devices.
38 |
39 | API 14 theme customizations can go here.
40 | */
41 | public static int AppBaseTheme=0x7f040000;
42 | /** Application theme.
43 | All customizations that are NOT specific to a particular API-level can go here.
44 | */
45 | public static int AppTheme=0x7f040001;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/libs/armeabi-v7a/libutility.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/libs/armeabi-v7a/libutility.so
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 | android.library=true
16 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Naoki2015/VCameraDemo/6148500988b3602eb3537fb71d0b996088cb321a/VitamioRecorderLibrary/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | VCameraLibrary
4 |
5 |
6 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/src/com/yixia/camera/AudioRecorder.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera;
2 |
3 | import android.media.AudioFormat;
4 | import android.media.AudioRecord;
5 |
6 | /**
7 | * 音频录制
8 | *
9 | * @author yixia.com
10 | *
11 | */
12 | public class AudioRecorder extends Thread {
13 |
14 | private AudioRecord mAudioRecord = null;
15 | /** 采样率 */
16 | private int mSampleRate = 44100;
17 | private IMediaRecorder mMediaRecorder;
18 |
19 | public AudioRecorder(IMediaRecorder mediaRecorder) {
20 | this.mMediaRecorder = mediaRecorder;
21 | }
22 |
23 | /** 设置采样率 */
24 | public void setSampleRate(int sampleRate) {
25 | this.mSampleRate = sampleRate;
26 | }
27 |
28 | @Override
29 | public void run() {
30 | if (mSampleRate != 8000 && mSampleRate != 16000 && mSampleRate != 22050 && mSampleRate != 44100) {
31 | mMediaRecorder.onAudioError(MediaRecorderBase.AUDIO_RECORD_ERROR_SAMPLERATE_NOT_SUPPORT, "sampleRate not support.");
32 | return;
33 | }
34 |
35 | final int mMinBufferSize = AudioRecord.getMinBufferSize(mSampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT);
36 |
37 | if (AudioRecord.ERROR_BAD_VALUE == mMinBufferSize) {
38 | mMediaRecorder.onAudioError(MediaRecorderBase.AUDIO_RECORD_ERROR_GET_MIN_BUFFER_SIZE_NOT_SUPPORT, "parameters are not supported by the hardware.");
39 | return;
40 | }
41 |
42 | mAudioRecord = new AudioRecord(android.media.MediaRecorder.AudioSource.MIC, mSampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, mMinBufferSize);
43 | if (null == mAudioRecord) {
44 | mMediaRecorder.onAudioError(MediaRecorderBase.AUDIO_RECORD_ERROR_CREATE_FAILED, "new AudioRecord failed.");
45 | return;
46 | }
47 |
48 | try {
49 | mAudioRecord.startRecording();
50 | } catch (IllegalStateException e) {
51 | mMediaRecorder.onAudioError(MediaRecorderBase.AUDIO_RECORD_ERROR_UNKNOWN, "startRecording failed.");
52 | return;
53 | }
54 |
55 | byte[] sampleBuffer = new byte[mMinBufferSize];
56 |
57 | try {
58 | while (!Thread.currentThread().isInterrupted()) {
59 | int result = mAudioRecord.read(sampleBuffer, 0, mMinBufferSize);
60 | if (result > 0) {
61 | mMediaRecorder.receiveAudioData(sampleBuffer, result);
62 | }
63 | }
64 | } catch (Exception e) {
65 | String message = "";
66 | if (e != null)
67 | message = e.getMessage();
68 | mMediaRecorder.onAudioError(MediaRecorderBase.AUDIO_RECORD_ERROR_UNKNOWN, message);
69 | }
70 |
71 | mAudioRecord.release();
72 | mAudioRecord = null;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/src/com/yixia/camera/IMediaRecorder.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera;
2 |
3 | import com.yixia.camera.model.MediaObject.MediaPart;
4 |
5 | /**
6 | * 视频录制接口
7 | *
8 | * @author yixia.com
9 | *
10 | */
11 | public interface IMediaRecorder {
12 |
13 | /**
14 | * 开始录制
15 | *
16 | * @return 录制失败返回null
17 | */
18 | public MediaPart startRecord();
19 |
20 | /**
21 | * 停止录制
22 | */
23 | public void stopRecord();
24 |
25 | /**
26 | * 音频错误
27 | *
28 | * @param what 错误类型
29 | * @param message
30 | */
31 | public void onAudioError(int what, String message);
32 | /**
33 | * 接收音频数据
34 | *
35 | * @param sampleBuffer 音频数据
36 | * @param len
37 | */
38 | public void receiveAudioData(byte[] sampleBuffer, int len);
39 | }
40 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/src/com/yixia/camera/MediaRecorderNative.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera;
2 |
3 | import android.hardware.Camera;
4 | import android.media.MediaRecorder;
5 | import android.util.Log;
6 |
7 | import com.yixia.camera.model.MediaObject.MediaPart;
8 | import com.yixia.videoeditor.adapter.UtilityAdapter;
9 |
10 | /**
11 | * 视频录制:边录制边底层处理视频(旋转和裁剪)
12 | *
13 | * @author yixia.com
14 | *
15 | */
16 | public class MediaRecorderNative extends MediaRecorderBase implements MediaRecorder.OnErrorListener {
17 |
18 | /** 视频后缀 */
19 | private static final String VIDEO_SUFFIX = ".ts";
20 |
21 | /** 开始录制 */
22 | @Override
23 | public MediaPart startRecord() {
24 | //防止没有初始化的情况
25 | if (!UtilityAdapter.isInitialized()) {
26 | UtilityAdapter.initFilterParser();
27 | }
28 |
29 | MediaPart result = null;
30 |
31 | if (mMediaObject != null) {
32 | mRecording = true;
33 | result = mMediaObject.buildMediaPart(mCameraId, VIDEO_SUFFIX);
34 | String cmd = String.format("filename = \"%s\"; ", result.mediaPath);
35 | //如果需要定制非480x480的视频,可以启用以下代码,其他vf参数参考ffmpeg的文档:
36 | //cmd += String.format("addcmd = %s; "," -vf \"transpose=1,crop=480:480:0:0\" ");
37 | UtilityAdapter.FilterParserAction(cmd, UtilityAdapter.PARSERACTION_START);
38 | if (mAudioRecorder == null && result != null) {
39 | mAudioRecorder = new AudioRecorder(this);
40 | mAudioRecorder.start();
41 | }
42 | }
43 | return result;
44 | }
45 |
46 | /** 停止录制 */
47 | @Override
48 | public void stopRecord() {
49 | UtilityAdapter.FilterParserAction("", UtilityAdapter.PARSERACTION_STOP);
50 | super.stopRecord();
51 | }
52 |
53 | /** 数据回调 */
54 | @Override
55 | public void onPreviewFrame(byte[] data, Camera camera) {
56 | if (mRecording) {
57 | //底层实时处理视频,将视频旋转好,并剪切成480x480
58 | UtilityAdapter.RenderDataYuv(data);
59 | }
60 | super.onPreviewFrame(data, camera);
61 | }
62 |
63 | /** 预览成功,设置视频输入输出参数 */
64 | @Override
65 | protected void onStartPreviewSuccess() {
66 | if (mCameraId == Camera.CameraInfo.CAMERA_FACING_BACK) {
67 | UtilityAdapter.RenderInputSettings(640, 480, 0, UtilityAdapter.FLIPTYPE_NORMAL);
68 | } else {
69 | UtilityAdapter.RenderInputSettings(640, 480, 180, UtilityAdapter.FLIPTYPE_HORIZONTAL);
70 | }
71 | UtilityAdapter.RenderOutputSettings(480, 480, mFrameRate, UtilityAdapter.OUTPUTFORMAT_YUV | UtilityAdapter.OUTPUTFORMAT_MASK_MP4 /*| UtilityAdapter.OUTPUTFORMAT_MASK_HARDWARE_ACC*/);
72 | }
73 |
74 | @Override
75 | public void onError(MediaRecorder mr, int what, int extra) {
76 | try {
77 | if (mr != null)
78 | mr.reset();
79 | } catch (IllegalStateException e) {
80 | Log.w("Yixia", "stopRecord", e);
81 | } catch (Exception e) {
82 | Log.w("Yixia", "stopRecord", e);
83 | }
84 | if (mOnErrorListener != null)
85 | mOnErrorListener.onVideoError(what, extra);
86 | }
87 |
88 | /** 接收音频数据,传递到底层 */
89 | @Override
90 | public void receiveAudioData(byte[] sampleBuffer, int len) {
91 | if (mRecording && len > 0) {
92 | UtilityAdapter.RenderDataPcm(sampleBuffer);
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/src/com/yixia/camera/VCamera.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera;
2 |
3 | import android.content.Context;
4 | import android.content.pm.PackageManager.NameNotFoundException;
5 |
6 | import com.yixia.camera.util.DeviceUtils;
7 | import com.yixia.camera.util.Log;
8 | import com.yixia.videoeditor.adapter.UtilityAdapter;
9 |
10 | import java.io.File;
11 | import java.io.FileInputStream;
12 | import java.io.FileNotFoundException;
13 | import java.io.FileOutputStream;
14 | import java.io.IOException;
15 |
16 | /**
17 | *
18 | * 拍摄SDK
19 | *
20 | * @author yixia.com
21 | *
22 | */
23 | public class VCamera {
24 | /** 应用包名 */
25 | private static String mPackageName;
26 | /** 应用版本名称 */
27 | private static String mAppVersionName;
28 | /** 应用版本号 */
29 | private static int mAppVersionCode;
30 | /** 视频缓存路径 */
31 | private static String mVideoCachePath;
32 | /** SDK版本号 */
33 | public final static String VCAMERA_SDK_VERSION = "1.2.0";
34 | /** FFMPEG执行失败存的log文件 */
35 | public final static String FFMPEG_LOG_FILENAME = "ffmpeg.log";
36 | /** 执行FFMPEG命令保存路径 */
37 | public final static String FFMPEG_LOG_FILENAME_TEMP = "temp_ffmpeg.log";
38 |
39 | /**
40 | * 初始化SDK
41 | *
42 | * @param context
43 | * @param applicationId
44 | * @param clientKey
45 | */
46 | public static void initialize(Context context) {
47 | mPackageName = context.getPackageName();
48 |
49 | mAppVersionName = getVerName(context);
50 | mAppVersionCode = getVerCode(context);
51 |
52 | //初始化底层库
53 | UtilityAdapter.FFmpegInit(context, String.format("versionName=%s&versionCode=%d&sdkVersion=%s&android=%s&device=%s", mAppVersionName, mAppVersionCode, VCAMERA_SDK_VERSION, DeviceUtils.getReleaseVersion(), DeviceUtils.getDeviceModel()));
54 | }
55 |
56 | /**
57 | * 获取当前应用的版本号
58 | * @param context
59 | * @return
60 | */
61 | public static int getVerCode(Context context) {
62 | int verCode = -1;
63 | try {
64 | verCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
65 | } catch (NameNotFoundException e) {
66 | }
67 | return verCode;
68 | }
69 |
70 | /** 获取当前应用的版本名称 */
71 | public static String getVerName(Context context) {
72 | try {
73 | return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
74 | } catch (NameNotFoundException e) {
75 | }
76 | return "";
77 | }
78 |
79 | // /** 上传错误日志 */
80 | // public static void uploadErrorLog() {
81 | // LogHelper.upload();
82 | // }
83 |
84 | /** 是否开启log输出 */
85 | public static boolean isLog() {
86 | return Log.getIsLog();
87 | }
88 |
89 | public static String getPackageName() {
90 | return mPackageName;
91 | }
92 |
93 | /** 是否开启Debug模式,会输出log */
94 | public static void setDebugMode(boolean enable) {
95 | Log.setLog(enable);
96 | }
97 |
98 | /** 获取视频缓存文件夹 */
99 | public static String getVideoCachePath() {
100 | return mVideoCachePath;
101 | }
102 |
103 | /** 设置视频缓存路径 */
104 | public static void setVideoCachePath(String path) {
105 | File file = new File(path);
106 | if (!file.exists()) {
107 | file.mkdirs();
108 | }
109 |
110 | mVideoCachePath = path;
111 |
112 | // 生成空的日志文件
113 | File temp = new File(VCamera.getVideoCachePath(), VCamera.FFMPEG_LOG_FILENAME_TEMP);
114 | if (!temp.exists()) {
115 | try {
116 | temp.createNewFile();
117 | } catch (IOException e) {
118 | e.printStackTrace();
119 | }
120 | }
121 | }
122 |
123 | /** 拷贝转码失败的log */
124 | protected static boolean copyFFmpegLog(String cmd) {
125 | boolean result = false;
126 |
127 | int size = 1 * 1024;
128 |
129 | FileInputStream in = null;
130 | FileOutputStream out = null;
131 | try {
132 | File temp = new File(VCamera.getVideoCachePath(), VCamera.FFMPEG_LOG_FILENAME_TEMP);
133 | if (!temp.exists()) {
134 | temp.createNewFile();
135 | return false;
136 | }
137 | in = new FileInputStream(temp);
138 | out = new FileOutputStream(new File(VCamera.getVideoCachePath(), VCamera.FFMPEG_LOG_FILENAME), true);
139 | out.write("--------------------------------------------------\r\n".getBytes());
140 | out.write(cmd.getBytes());
141 | out.write("\r\n\r\n".getBytes());
142 | byte[] buffer = new byte[size];
143 | int bytesRead = -1;
144 | while ((bytesRead = in.read(buffer)) != -1) {
145 | out.write(buffer, 0, bytesRead);
146 | }
147 | out.flush();
148 | result = true;
149 | } catch (FileNotFoundException e) {
150 | Log.e("upload", e);
151 | } catch (IOException e) {
152 | Log.e("upload", e);
153 | } catch (Exception e) {
154 | Log.e("upload", e);
155 | } finally {
156 | try {
157 | if (in != null) {
158 | in.close();
159 | }
160 | } catch (IOException e) {
161 | }
162 | try {
163 | if (out != null) {
164 | out.close();
165 | }
166 | } catch (IOException e) {
167 | }
168 | }
169 | return result;
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/src/com/yixia/camera/model/MediaThemeObject.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.model;
2 |
3 | public class MediaThemeObject {
4 |
5 | /** MV主题 */
6 | public String mMVThemeName;
7 |
8 | /** 音乐 */
9 | public String mMusicThemeName;
10 |
11 | /** 水印 */
12 | public String mWatermarkThemeName;
13 |
14 | /** 滤镜 */
15 | public String mFilterThemeName;
16 |
17 | // ~~~ 变声
18 | /** 音频文件 */
19 | public String mSoundText;
20 | /** 音频文件编号 */
21 | public String mSoundTextId;
22 | /** 变声主题名称 */
23 | public String mSoundThemeName;
24 |
25 | // ~~~ 变速
26 | /** 变声主题名称 */
27 | public String mSpeedThemeName;
28 |
29 | // ~~~ 静音
30 | /** 主题静音 */
31 | public boolean mThemeMute;
32 | /** 原声静音 */
33 | public boolean mOrgiMute;
34 |
35 | public MediaThemeObject() {
36 |
37 | }
38 |
39 | /** 检测是否是空主题,没有设置任何参数 */
40 | public boolean isEmpty() {
41 | //非空主题
42 | if (!"Empty".equals(mMVThemeName)) {
43 | return false;
44 | }
45 | //没有静音、没有音乐、没有水印、没有滤镜、没有变声、没有变速
46 | return !mOrgiMute && isEmpty(mMusicThemeName, mWatermarkThemeName, mFilterThemeName, mSoundThemeName, mSpeedThemeName);
47 | }
48 |
49 | private boolean isEmpty(String... themes) {
50 | for (String theme : themes) {
51 | //非空
52 | if (!"Empty".equals(theme)) {
53 | return false;
54 | }
55 | }
56 | return true;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/VitamioRecorderLibrary/src/com/yixia/camera/util/Log.java:
--------------------------------------------------------------------------------
1 | package com.yixia.camera.util;
2 |
3 | public class Log {
4 |
5 | private static boolean gIsLog;
6 | private static final String TAG = "VCamera";
7 |
8 | public static void setLog(boolean isLog) {
9 | Log.gIsLog = isLog;
10 | }
11 |
12 | public static boolean getIsLog() {
13 | return gIsLog;
14 | }
15 |
16 | public static void d(String tag, String msg) {
17 | if (gIsLog) {
18 | android.util.Log.d(tag, msg);
19 | }
20 | }
21 |
22 | public static void d(String msg) {
23 | if (gIsLog) {
24 | android.util.Log.d(TAG, msg);
25 | }
26 |
27 | }
28 |
29 | /**
30 | * Send a {@link #DEBUG} log message and log the exception.
31 | *
32 | * @param tag
33 | * Used to identify the source of a log message. It usually
34 | * identifies the class or activity where the log call occurs.
35 | * @param msg
36 | * The message you would like logged.
37 | * @param tr
38 | * An exception to log
39 | */
40 | public static void d(String tag, String msg, Throwable tr) {
41 | if (gIsLog) {
42 | android.util.Log.d(tag, msg, tr);
43 | }
44 | }
45 |
46 | public static void i(String tag, String msg) {
47 | if (gIsLog) {
48 | android.util.Log.i(tag, msg);
49 | }
50 | }
51 |
52 | /**
53 | * Send a {@link #INFO} log message and log the exception.
54 | *
55 | * @param tag
56 | * Used to identify the source of a log message. It usually
57 | * identifies the class or activity where the log call occurs.
58 | * @param msg
59 | * The message you would like logged.
60 | * @param tr
61 | * An exception to log
62 | */
63 | public static void i(String tag, String msg, Throwable tr) {
64 | if (gIsLog) {
65 | android.util.Log.i(tag, msg, tr);
66 | }
67 |
68 | }
69 |
70 | /**
71 | * Send an {@link #ERROR} log message.
72 | *
73 | * @param tag
74 | * Used to identify the source of a log message. It usually
75 | * identifies the class or activity where the log call occurs.
76 | * @param msg
77 | * The message you would like logged.
78 | */
79 | public static void e(String tag, String msg) {
80 | if (gIsLog) {
81 | android.util.Log.e(tag, msg);
82 | }
83 | }
84 |
85 | public static void e(String msg) {
86 | if (gIsLog) {
87 | android.util.Log.e(TAG, msg);
88 | }
89 | }
90 |
91 | /**
92 | * Send a {@link #ERROR} log message and log the exception.
93 | *
94 | * @param tag
95 | * Used to identify the source of a log message. It usually
96 | * identifies the class or activity where the log call occurs.
97 | * @param msg
98 | * The message you would like logged.
99 | * @param tr
100 | * An exception to log
101 | */
102 | public static void e(String tag, String msg, Throwable tr) {
103 | if (gIsLog) {
104 | android.util.Log.e(tag, msg, tr);
105 | }
106 | }
107 |
108 | public static void e(String msg, Throwable tr) {
109 | if (gIsLog) {
110 | android.util.Log.e(TAG, msg, tr);
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------