Commit 74649a6dc12abb76e7d3171653886aac07929be4
1 parent
62c5d875
更新短视频SDK
Showing
54 changed files
with
206 additions
and
194 deletions
.idea/misc.xml
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | 2 | <project version="4"> |
| 3 | - <component name="EntryPointsManager"> | |
| 4 | - <entry_points version="2.0" /> | |
| 5 | - </component> | |
| 6 | 3 | <component name="NullableNotNullManager"> |
| 7 | 4 | <option name="myDefaultNullable" value="android.support.annotation.Nullable" /> |
| 8 | 5 | <option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> |
| ... | ... | @@ -27,17 +24,7 @@ |
| 27 | 24 | </value> |
| 28 | 25 | </option> |
| 29 | 26 | </component> |
| 30 | - <component name="ProjectLevelVcsManager" settingsEditedManually="false"> | |
| 31 | - <OptionsSetting value="true" id="Add" /> | |
| 32 | - <OptionsSetting value="true" id="Remove" /> | |
| 33 | - <OptionsSetting value="true" id="Checkout" /> | |
| 34 | - <OptionsSetting value="true" id="Update" /> | |
| 35 | - <OptionsSetting value="true" id="Status" /> | |
| 36 | - <OptionsSetting value="true" id="Edit" /> | |
| 37 | - <ConfirmationsSetting value="0" id="Add" /> | |
| 38 | - <ConfirmationsSetting value="0" id="Remove" /> | |
| 39 | - </component> | |
| 40 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
| 27 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
| 41 | 28 | <output url="file://$PROJECT_DIR$/build/classes" /> |
| 42 | 29 | </component> |
| 43 | 30 | <component name="ProjectType"> | ... | ... |
app/build.gradle
| ... | ... | @@ -4,8 +4,8 @@ android { |
| 4 | 4 | compileSdkVersion 25 |
| 5 | 5 | buildToolsVersion "25.0.3" |
| 6 | 6 | defaultConfig { |
| 7 | - applicationId "com.cnlive.demo.shortvideo" | |
| 8 | - minSdkVersion 15 | |
| 7 | + applicationId "com.cnlive.cnUploadDemo" | |
| 8 | + minSdkVersion 16 | |
| 9 | 9 | targetSdkVersion 25 |
| 10 | 10 | versionCode 1 |
| 11 | 11 | versionName "1.0" |
| ... | ... | @@ -24,10 +24,12 @@ android { |
| 24 | 24 | dependencies { |
| 25 | 25 | compile fileTree(include: ['*.jar'], dir: 'libs') |
| 26 | 26 | compile files('libs/android-async-http-1.4.6.jar') |
| 27 | - compile files('libs/libcnliveupload.jar') | |
| 28 | 27 | compile 'com.android.support:appcompat-v7:25.3.1' |
| 29 | 28 | compile 'com.android.support:recyclerview-v7:25.3.1' |
| 30 | 29 | compile 'com.android.support.constraint:constraint-layout:1.0.2' |
| 31 | 30 | compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4' |
| 32 | 31 | testCompile 'junit:junit:4.12' |
| 32 | + compile 'com.cnlive:lib_upload:2.0.5' | |
| 33 | + compile 'com.cnlive:lib_cnlive:2.2.0' | |
| 34 | + compile 'com.cnlive:lib_shortvideo:1.0.2' | |
| 33 | 35 | } | ... | ... |
app/libs/libcnlivelive.jar deleted
100644 → 0
No preview for this file type
app/libs/libcnliveshortvideo.jar deleted
100644 → 0
No preview for this file type
app/libs/libcnliveupload.jar deleted
100644 → 0
No preview for this file type
app/libs/libcnliveutil.jar deleted
100644 → 0
No preview for this file type
app/src/main/AndroidManifest.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | - package="com.cnlive.demo.shortvideo"> | |
| 3 | + package="com.cnlive.cnUploadDemo"> | |
| 4 | 4 | |
| 5 | 5 | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
| 6 | 6 | <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> |
| ... | ... | @@ -20,14 +20,14 @@ |
| 20 | 20 | <uses-permission android:name="android.permission.VIBRATE" /> |
| 21 | 21 | |
| 22 | 22 | <application |
| 23 | - android:name=".application.CNShrotVideoApplication" | |
| 23 | + android:name="com.cnlive.cnUploadDemo.application.CNShrotVideoApplication" | |
| 24 | 24 | android:allowBackup="true" |
| 25 | 25 | android:icon="@mipmap/ic_launcher" |
| 26 | 26 | android:label="@string/app_name" |
| 27 | 27 | android:roundIcon="@mipmap/ic_launcher_round" |
| 28 | 28 | android:supportsRtl="true" |
| 29 | 29 | android:theme="@style/AppTheme"> |
| 30 | - <activity android:name=".ui.activity.MainActivity"> | |
| 30 | + <activity android:name="com.cnlive.cnUploadDemo.ui.activity.MainActivity"> | |
| 31 | 31 | <intent-filter> |
| 32 | 32 | <action android:name="android.intent.action.MAIN" /> |
| 33 | 33 | |
| ... | ... | @@ -35,20 +35,20 @@ |
| 35 | 35 | </intent-filter> |
| 36 | 36 | </activity> |
| 37 | 37 | <activity |
| 38 | - android:name=".ui.activity.RecordActivity" | |
| 38 | + android:name="com.cnlive.cnUploadDemo.ui.activity.RecordActivity" | |
| 39 | 39 | android:configChanges="orientation|keyboardHidden|screenSize" |
| 40 | 40 | android:launchMode="singleTop" |
| 41 | 41 | android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> |
| 42 | 42 | <activity |
| 43 | - android:name=".ui.activity.EditActivity" | |
| 43 | + android:name="com.cnlive.cnUploadDemo.ui.activity.EditActivity" | |
| 44 | 44 | android:configChanges="orientation|keyboardHidden|screenSize" |
| 45 | 45 | android:launchMode="singleTop" |
| 46 | 46 | android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> |
| 47 | 47 | <activity |
| 48 | - android:name=".ui.activity.FileImportActivity" | |
| 48 | + android:name="com.cnlive.cnUploadDemo.ui.activity.FileImportActivity" | |
| 49 | 49 | android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> |
| 50 | - <activity android:name=".ui.activity.ListVideoActivity"></activity> | |
| 51 | - <activity android:name=".ui.activity.ShortVideoPlayActivity"/> | |
| 50 | + <activity android:name="com.cnlive.cnUploadDemo.ui.activity.ListVideoActivity"></activity> | |
| 51 | + <activity android:name="com.cnlive.cnUploadDemo.ui.activity.ShortVideoPlayActivity"/> | |
| 52 | 52 | </application> |
| 53 | 53 | |
| 54 | 54 | </manifest> |
| 55 | 55 | \ No newline at end of file | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/application/CNShrotVideoApplication.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/application/CNShrotVideoApplication.java
| 1 | -package com.cnlive.demo.shortvideo.application; | |
| 1 | +package com.cnlive.cnUploadDemo.application; | |
| 2 | 2 | |
| 3 | 3 | import android.app.Application; |
| 4 | 4 | |
| ... | ... | @@ -18,6 +18,7 @@ public class CNShrotVideoApplication extends Application { |
| 18 | 18 | * param appKey 在open.cnlive.com网站申请得到的appKey |
| 19 | 19 | * param isTestEnvironment 是否是测试环境 true 测试环境 false 正式环境 |
| 20 | 20 | */ |
| 21 | - Config.init(this, "60_j4rzqads62", "ae0c2fea70d08e49b6a5ebb99ad7d6e8eec07de722701b", true); | |
| 21 | +// Config.init(this, "60_j4rzqads62", "ae0c2fea70d08e49b6a5ebb99ad7d6e8eec07de722701b"); | |
| 22 | + Config.init(this, "60_jaxisljz90", "1ee33b54e18a66b94eca7f8149408565b02f749d314926"); | |
| 22 | 23 | } |
| 23 | 24 | } | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/file/FileUtils.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/file/FileUtils.java
app/src/main/java/com/cnlive/demo/shortvideo/file/LocalStorageProvider.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/file/LocalStorageProvider.java
| 1 | 1 | |
| 2 | -package com.cnlive.demo.shortvideo.file; | |
| 2 | +package com.cnlive.cnUploadDemo.file; | |
| 3 | 3 | |
| 4 | 4 | import android.content.res.AssetFileDescriptor; |
| 5 | 5 | import android.database.Cursor; |
| ... | ... | @@ -16,7 +16,7 @@ import android.provider.DocumentsProvider; |
| 16 | 16 | import android.util.Log; |
| 17 | 17 | import android.webkit.MimeTypeMap; |
| 18 | 18 | |
| 19 | -import com.cnlive.demo.shortvideo.R; | |
| 19 | +import com.cnlive.cnUploadDemo.R; | |
| 20 | 20 | |
| 21 | 21 | import java.io.File; |
| 22 | 22 | import java.io.FileNotFoundException; | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/file/VideoInfo.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/file/VideoInfo.java
app/src/main/java/com/cnlive/demo/shortvideo/network/HttpRequest.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/network/HttpRequest.java
| 1 | -package com.cnlive.demo.shortvideo.network; | |
| 1 | +package com.cnlive.cnUploadDemo.network; | |
| 2 | 2 | |
| 3 | -import android.provider.ContactsContract; | |
| 4 | 3 | import android.text.TextUtils; |
| 5 | 4 | import android.util.Log; |
| 6 | 5 | |
| 7 | -import com.cnlive.demo.shortvideo.network.model.ShortVideoDataModel; | |
| 8 | -import com.cnlive.demo.shortvideo.network.model.ShortVideoInfo; | |
| 9 | -import com.cnlive.demo.shortvideo.network.util.SignUtil; | |
| 6 | +import com.cnlive.cnUploadDemo.network.model.ShortVideoDataModel; | |
| 7 | +import com.cnlive.cnUploadDemo.network.util.SignUtil; | |
| 10 | 8 | import com.cnlive.libs.shortvideo.callback.Callback; |
| 11 | 9 | import com.cnlive.libs.shortvideo.kit.base.ICNEditKit; |
| 12 | 10 | import com.cnlive.libs.util.Config; |
| ... | ... | @@ -71,7 +69,9 @@ public class HttpRequest { |
| 71 | 69 | mShortVideoListCallback = new DataGenericsCallback<ShortVideoDataModel>(callback) { |
| 72 | 70 | @Override |
| 73 | 71 | public void onError(Call call, Exception e) { |
| 74 | - if (callback == null) return; | |
| 72 | + if (callback == null) { | |
| 73 | + return; | |
| 74 | + } | |
| 75 | 75 | if (!NetUtil.checkNetwork(Config.getContext())) { |
| 76 | 76 | callback.onError(-10000, "网络连接失败"); |
| 77 | 77 | } else { |
| ... | ... | @@ -85,7 +85,9 @@ public class HttpRequest { |
| 85 | 85 | |
| 86 | 86 | @Override |
| 87 | 87 | public void onResponse(ShortVideoDataModel shortVideoInfo, Exception e) { |
| 88 | - if (callback == null) return; | |
| 88 | + if (callback == null) { | |
| 89 | + return; | |
| 90 | + } | |
| 89 | 91 | if (shortVideoInfo != null && "0".equals(shortVideoInfo.getErrorCode())) { |
| 90 | 92 | callback.onInfo(ICNEditKit.INFO_GET_UPLOAD_INFO_SUCCESS, shortVideoInfo); |
| 91 | 93 | } else if (shortVideoInfo != null && !TextUtils.isEmpty(shortVideoInfo.getErrorCode())) { | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/network/model/ShortVideoDataModel.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/network/model/ShortVideoDataModel.java
app/src/main/java/com/cnlive/demo/shortvideo/network/model/ShortVideoInfo.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/network/model/ShortVideoInfo.java
app/src/main/java/com/cnlive/demo/shortvideo/network/model/ShortVideoList.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/network/model/ShortVideoList.java
app/src/main/java/com/cnlive/demo/shortvideo/network/util/SignUtil.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/network/util/SignUtil.java
| 1 | -package com.cnlive.demo.shortvideo.network.util; | |
| 1 | +package com.cnlive.cnUploadDemo.network.util; | |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.util.Log; |
| ... | ... | @@ -28,7 +28,9 @@ public class SignUtil { |
| 28 | 28 | private static final String TAG = "SignUtil"; |
| 29 | 29 | |
| 30 | 30 | public static Map<String, String> getSignParamM(Context context, Map<String, String> params) { |
| 31 | - if (context == null || params == null) return new HashMap<>(); | |
| 31 | + if (context == null || params == null) { | |
| 32 | + return new HashMap<>(); | |
| 33 | + } | |
| 32 | 34 | params.put("platform_id", context.getPackageName()); |
| 33 | 35 | params.put("timestamp", String.valueOf(getTime() / 1000)); |
| 34 | 36 | Map<String, String> map = order(params); |
| ... | ... | @@ -43,7 +45,9 @@ public class SignUtil { |
| 43 | 45 | } |
| 44 | 46 | |
| 45 | 47 | private static String getSignParam(Context context, Map<String, String> params) { |
| 46 | - if (context == null || params == null) return ""; | |
| 48 | + if (context == null || params == null) { | |
| 49 | + return ""; | |
| 50 | + } | |
| 47 | 51 | params.put("platform_id", context.getPackageName()); |
| 48 | 52 | params.put("timestamp", String.valueOf(getTime() / 1000)); |
| 49 | 53 | |
| ... | ... | @@ -92,6 +96,7 @@ public class SignUtil { |
| 92 | 96 | List<Map.Entry<String, String>> infoIds = new ArrayList<>(map.entrySet()); |
| 93 | 97 | |
| 94 | 98 | Collections.sort(infoIds, new Comparator<Map.Entry<String, String>>() { |
| 99 | + @Override | |
| 95 | 100 | public int compare(Map.Entry<String, String> o1, Map.Entry<String, String> o2) { |
| 96 | 101 | return o1.getKey().compareTo(o2.getKey()); |
| 97 | 102 | } | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/sticker/StickerAdapter.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/sticker/StickerAdapter.java
| 1 | -package com.cnlive.demo.shortvideo.sticker; | |
| 1 | +package com.cnlive.cnUploadDemo.sticker; | |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | import android.content.Context; |
| ... | ... | @@ -8,7 +8,7 @@ import android.view.View; |
| 8 | 8 | import android.view.ViewGroup; |
| 9 | 9 | import android.widget.ImageView; |
| 10 | 10 | |
| 11 | -import com.cnlive.demo.shortvideo.R; | |
| 11 | +import com.cnlive.cnUploadDemo.R; | |
| 12 | 12 | import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache; |
| 13 | 13 | import com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator; |
| 14 | 14 | import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache; | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/activity/EditActivity.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/activity/EditActivity.java
| 1 | -package com.cnlive.demo.shortvideo.ui.activity; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.activity; | |
| 2 | 2 | |
| 3 | 3 | import android.app.AlertDialog; |
| 4 | 4 | import android.content.Context; |
| ... | ... | @@ -48,18 +48,19 @@ import android.widget.SeekBar; |
| 48 | 48 | import android.widget.TextView; |
| 49 | 49 | import android.widget.Toast; |
| 50 | 50 | |
| 51 | -import com.cnlive.demo.shortvideo.R; | |
| 52 | -import com.cnlive.demo.shortvideo.file.FileUtils; | |
| 53 | -import com.cnlive.demo.shortvideo.ui.dialog.ShortVideoConfigDialog; | |
| 54 | -import com.cnlive.demo.shortvideo.sticker.StickerAdapter; | |
| 55 | -import com.cnlive.demo.shortvideo.util.ColorPicker; | |
| 56 | -import com.cnlive.demo.shortvideo.videorange.HorizontalListView; | |
| 57 | -import com.cnlive.demo.shortvideo.videorange.VideoRangeSeekBar; | |
| 58 | -import com.cnlive.demo.shortvideo.videorange.VideoThumbnailAdapter; | |
| 59 | -import com.cnlive.demo.shortvideo.videorange.VideoThumbnailInfo; | |
| 60 | -import com.cnlive.lib.upload.listener.CNPutObjectResponseListener; | |
| 61 | -import com.cnlive.lib.upload.model.UploadError; | |
| 51 | +import com.cnlive.cnUploadDemo.R; | |
| 52 | +import com.cnlive.cnUploadDemo.file.FileUtils; | |
| 53 | +import com.cnlive.cnUploadDemo.ui.dialog.ShortVideoConfigDialog; | |
| 54 | +import com.cnlive.cnUploadDemo.sticker.StickerAdapter; | |
| 55 | +import com.cnlive.cnUploadDemo.util.ColorPicker; | |
| 56 | +import com.cnlive.cnUploadDemo.videorange.HorizontalListView; | |
| 57 | +import com.cnlive.cnUploadDemo.videorange.VideoRangeSeekBar; | |
| 58 | +import com.cnlive.cnUploadDemo.videorange.VideoThumbnailAdapter; | |
| 59 | +import com.cnlive.cnUploadDemo.videorange.VideoThumbnailInfo; | |
| 60 | +import com.cnlive.libs.shortvideo.callback.CNPutObjectResponseListener; | |
| 62 | 61 | import com.cnlive.libs.shortvideo.kit.CNEditKit; |
| 62 | +import com.cnlive.libs.shortvideo.kit.base.ICNEditKit; | |
| 63 | +import com.cnlive.libs.shortvideo.model.UploadError; | |
| 63 | 64 | import com.cnlive.libs.shortvideo.utils.base.ShortVideoConstants; |
| 64 | 65 | import com.cnlive.libs.shortvideo.view.CNStickerView; |
| 65 | 66 | import com.cnlive.libs.shortvideo.view.CNTextView; |
| ... | ... | @@ -87,15 +88,15 @@ import java.util.Map; |
| 87 | 88 | import java.util.Timer; |
| 88 | 89 | import java.util.TimerTask; |
| 89 | 90 | |
| 90 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_DISABLE; | |
| 91 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_ILLUSION; | |
| 92 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_PRO; | |
| 93 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_SMOOTH; | |
| 94 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_SOFT; | |
| 95 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_SOFT_EXT; | |
| 96 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_SOFT_SHARPEN; | |
| 97 | -import static com.cnlive.libs.stream.model.Filters.DENOISE; | |
| 98 | -import static com.cnlive.libs.stream.model.Filters.SKIN_WHITEN; | |
| 91 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_DENOISE; | |
| 92 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_DISABLE; | |
| 93 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_ILLUSION; | |
| 94 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_PRO; | |
| 95 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SKINWHITEN; | |
| 96 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SMOOTH; | |
| 97 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SOFT; | |
| 98 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SOFT_EXT; | |
| 99 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SOFT_SHARPEN; | |
| 99 | 100 | |
| 100 | 101 | public class EditActivity extends AppCompatActivity implements ActivityCompat.OnRequestPermissionsResultCallback { |
| 101 | 102 | private static String TAG = EditActivity.class.getSimpleName(); |
| ... | ... | @@ -718,6 +719,9 @@ public class EditActivity extends AppCompatActivity implements ActivityCompat.On |
| 718 | 719 | @Override |
| 719 | 720 | public void onTaskFailure(int i, UploadError uploadError, Header[] headers, String s, Throwable throwable) { |
| 720 | 721 | Log.e(TAG, "upload failure " + uploadError.getErrorMessage()); |
| 722 | + if (i == ICNEditKit.ERROR_VIDEO_COMPLETE_SYNCHRODATA_INTERNET || i == ICNEditKit.ERROR_VIDEO_COMPLETE_SYNCHRODATA_OTHER || i == ICNEditKit.ERROR_VIDEO_COMPLETE_SYNCHRODATA_SERVER) { | |
| 723 | + Log.e(TAG, "同步数据出错, 可以调用mEditKit.synchroData(callback);方法重新同步数据"); | |
| 724 | + } | |
| 721 | 725 | if (mComposeAlertDialog != null) |
| 722 | 726 | mComposeAlertDialog.uploadFinished(false, null); |
| 723 | 727 | } |
| ... | ... | @@ -939,7 +943,7 @@ public class EditActivity extends AppCompatActivity implements ActivityCompat.On |
| 939 | 943 | mComposeAlertDialog.composeFinished(strings[0]); |
| 940 | 944 | mComposeFinished = true; |
| 941 | 945 | } |
| 942 | - mEditKit.getUploadInfo("1342671", strings[0], "title.mp4", "des", new File(FileUtils.saveBitmap(EditActivity.this, bitmap)), null, mPutObjectResponseListener); | |
| 946 | + mEditKit.getUploadInfo("1342671", strings[0], "title.mp4", "des", new File(FileUtils.saveBitmap(EditActivity.this, bitmap)), 1, null, mPutObjectResponseListener); | |
| 943 | 947 | } |
| 944 | 948 | case ShortVideoConstants.SHORTVIDEO_COMPOSE_ABORTED: |
| 945 | 949 | break; |
| ... | ... | @@ -1093,31 +1097,31 @@ public class EditActivity extends AppCompatActivity implements ActivityCompat.On |
| 1093 | 1097 | } |
| 1094 | 1098 | switch (position) { |
| 1095 | 1099 | case 0: |
| 1096 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), BEAUTY_DISABLE.getFilter()); | |
| 1100 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_DISABLE.getFilter()); | |
| 1097 | 1101 | break; |
| 1098 | 1102 | case 1: |
| 1099 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), BEAUTY_SOFT.getFilter()); | |
| 1103 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_SOFT.getFilter()); | |
| 1100 | 1104 | break; |
| 1101 | 1105 | case 2: |
| 1102 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), SKIN_WHITEN.getFilter()); | |
| 1106 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_SKINWHITEN.getFilter()); | |
| 1103 | 1107 | break; |
| 1104 | 1108 | case 3: |
| 1105 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), BEAUTY_ILLUSION.getFilter()); | |
| 1109 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_ILLUSION.getFilter()); | |
| 1106 | 1110 | break; |
| 1107 | 1111 | case 4: |
| 1108 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), DENOISE.getFilter()); | |
| 1112 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_DENOISE.getFilter()); | |
| 1109 | 1113 | break; |
| 1110 | 1114 | case 5: |
| 1111 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), BEAUTY_SMOOTH.getFilter()); | |
| 1115 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_SMOOTH.getFilter()); | |
| 1112 | 1116 | break; |
| 1113 | 1117 | case 6: |
| 1114 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), BEAUTY_SOFT_EXT.getFilter()); | |
| 1118 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_SOFT_EXT.getFilter()); | |
| 1115 | 1119 | break; |
| 1116 | 1120 | case 7: |
| 1117 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), BEAUTY_SOFT_SHARPEN.getFilter()); | |
| 1121 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_SOFT_SHARPEN.getFilter()); | |
| 1118 | 1122 | break; |
| 1119 | 1123 | case 8: |
| 1120 | - mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), BEAUTY_PRO.getFilter()); | |
| 1124 | + mEditKit.getImgTexFilterMgt().setFilter(mEditKit.getGLRender(), CN_FILTER_BEAUTY_PRO.getFilter()); | |
| 1121 | 1125 | break; |
| 1122 | 1126 | } |
| 1123 | 1127 | } | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/activity/FileImportActivity.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/activity/FileImportActivity.java
| 1 | -package com.cnlive.demo.shortvideo.ui.activity; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.activity; | |
| 2 | 2 | |
| 3 | 3 | import android.Manifest; |
| 4 | 4 | import android.content.ActivityNotFoundException; |
| ... | ... | @@ -25,8 +25,8 @@ import android.widget.RelativeLayout; |
| 25 | 25 | import android.widget.TextView; |
| 26 | 26 | import android.widget.Toast; |
| 27 | 27 | |
| 28 | -import com.cnlive.demo.shortvideo.R; | |
| 29 | -import com.cnlive.demo.shortvideo.file.FileUtils; | |
| 28 | +import com.cnlive.cnUploadDemo.R; | |
| 29 | +import com.cnlive.cnUploadDemo.file.FileUtils; | |
| 30 | 30 | import com.cnlive.libs.video.video.MediaPlayer; |
| 31 | 31 | import com.cnlive.libs.video.video.base.IMediaPlayer; |
| 32 | 32 | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/activity/ListVideoActivity.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/activity/ListVideoActivity.java
| 1 | -package com.cnlive.demo.shortvideo.ui.activity; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.activity; | |
| 2 | 2 | |
| 3 | 3 | import android.support.v4.widget.SwipeRefreshLayout; |
| 4 | 4 | import android.support.v7.app.AppCompatActivity; |
| 5 | 5 | import android.os.Bundle; |
| 6 | 6 | import android.support.v7.widget.LinearLayoutManager; |
| 7 | 7 | import android.support.v7.widget.RecyclerView; |
| 8 | -import android.util.Log; | |
| 9 | 8 | import android.view.View; |
| 10 | 9 | import android.widget.TextView; |
| 11 | 10 | import android.widget.Toast; |
| 12 | 11 | |
| 13 | -import com.cnlive.demo.shortvideo.R; | |
| 14 | -import com.cnlive.demo.shortvideo.network.HttpRequest; | |
| 15 | -import com.cnlive.demo.shortvideo.network.model.ShortVideoDataModel; | |
| 16 | -import com.cnlive.demo.shortvideo.ui.adapter.ShortVideoAdapter; | |
| 12 | +import com.cnlive.cnUploadDemo.R; | |
| 13 | +import com.cnlive.cnUploadDemo.network.HttpRequest; | |
| 14 | +import com.cnlive.cnUploadDemo.network.model.ShortVideoDataModel; | |
| 15 | +import com.cnlive.cnUploadDemo.ui.adapter.ShortVideoAdapter; | |
| 17 | 16 | import com.cnlive.libs.shortvideo.callback.Callback; |
| 18 | -import com.cnlive.libs.util.HttpUtils; | |
| 19 | 17 | |
| 20 | 18 | public class ListVideoActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener { |
| 21 | 19 | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/activity/MainActivity.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/activity/MainActivity.java
| 1 | -package com.cnlive.demo.shortvideo.ui.activity; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.activity; | |
| 2 | 2 | |
| 3 | 3 | import android.content.DialogInterface; |
| 4 | 4 | import android.content.Intent; |
| ... | ... | @@ -9,8 +9,8 @@ import android.view.View; |
| 9 | 9 | import android.widget.Button; |
| 10 | 10 | import android.widget.Toast; |
| 11 | 11 | |
| 12 | -import com.cnlive.demo.shortvideo.R; | |
| 13 | -import com.cnlive.demo.shortvideo.ui.dialog.ShortVideoConfigDialog; | |
| 12 | +import com.cnlive.cnUploadDemo.R; | |
| 13 | +import com.cnlive.cnUploadDemo.ui.dialog.ShortVideoConfigDialog; | |
| 14 | 14 | import com.cnlive.libs.shortvideo.ShortVideoTask; |
| 15 | 15 | import com.cnlive.libs.shortvideo.callback.Callback; |
| 16 | 16 | import com.cnlive.libs.shortvideo.callback.CheckAuthResultListener; |
| ... | ... | @@ -76,7 +76,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | private void onAuthClick() { |
| 79 | - // TODO: 6/12/2017 SDK鉴权 | |
| 80 | 79 | mAuthButton.setEnabled(false); |
| 81 | 80 | |
| 82 | 81 | ShortVideoTask.shortVideoAuth(new Callback() { | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/activity/RecordActivity.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/activity/RecordActivity.java
| 1 | -package com.cnlive.demo.shortvideo.ui.activity; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.activity; | |
| 2 | 2 | |
| 3 | 3 | import android.Manifest; |
| 4 | 4 | import android.app.AlertDialog; |
| ... | ... | @@ -40,36 +40,37 @@ import android.widget.SeekBar; |
| 40 | 40 | import android.widget.TextView; |
| 41 | 41 | import android.widget.Toast; |
| 42 | 42 | |
| 43 | -import com.cnlive.demo.shortvideo.R; | |
| 44 | -import com.cnlive.demo.shortvideo.file.FileUtils; | |
| 45 | -import com.cnlive.demo.shortvideo.ui.view.CameraHintView; | |
| 46 | -import com.cnlive.demo.shortvideo.ui.view.RecordProgressController; | |
| 47 | -import com.cnlive.demo.shortvideo.util.FaceUnityUtil; | |
| 48 | -import com.cnlive.demo.shortvideo.util.authpack; | |
| 43 | +import com.cnlive.cnUploadDemo.R; | |
| 44 | +import com.cnlive.cnUploadDemo.file.FileUtils; | |
| 45 | +import com.cnlive.cnUploadDemo.ui.view.CameraHintView; | |
| 46 | +import com.cnlive.cnUploadDemo.ui.view.RecordProgressController; | |
| 47 | +import com.cnlive.cnUploadDemo.util.FaceUnityUtil; | |
| 48 | +import com.cnlive.cnUploadDemo.util.authpack; | |
| 49 | 49 | import com.cnlive.libs.shortvideo.callback.MergeFilesFinishedListener; |
| 50 | 50 | import com.cnlive.libs.shortvideo.kit.CNRecordKit; |
| 51 | 51 | import com.cnlive.libs.stream.base.ICNAudioEffectFilter; |
| 52 | 52 | import com.cnlive.libs.stream.base.ICNAudioReverbFilter; |
| 53 | 53 | import com.cnlive.libs.stream.base.IStreamer; |
| 54 | -import com.cnlive.libs.stream.base.ImgFilterBase; | |
| 55 | 54 | import com.cnlive.libs.stream.filter.CNAudioEffectFilter; |
| 56 | 55 | import com.cnlive.libs.stream.filter.CNAudioFilterBase; |
| 57 | 56 | import com.cnlive.libs.stream.filter.CNAudioReverbFilter; |
| 57 | +import com.cnlive.libs.stream.filter.img.CNImgBeautyProFilter; | |
| 58 | +import com.cnlive.libs.stream.filter.img.CNNewImgFilterBase; | |
| 58 | 59 | import com.cnlive.libs.stream.util.ImgFaceunityFilter; |
| 59 | 60 | |
| 60 | 61 | import java.io.File; |
| 61 | 62 | import java.util.LinkedList; |
| 62 | 63 | import java.util.List; |
| 63 | 64 | |
| 64 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_DISABLE; | |
| 65 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_ILLUSION; | |
| 66 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_PRO; | |
| 67 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_SMOOTH; | |
| 68 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_SOFT; | |
| 69 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_SOFT_EXT; | |
| 70 | -import static com.cnlive.libs.stream.model.Filters.BEAUTY_SOFT_SHARPEN; | |
| 71 | -import static com.cnlive.libs.stream.model.Filters.DENOISE; | |
| 72 | -import static com.cnlive.libs.stream.model.Filters.SKIN_WHITEN; | |
| 65 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_DENOISE; | |
| 66 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_DISABLE; | |
| 67 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_ILLUSION; | |
| 68 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_PRO; | |
| 69 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SKINWHITEN; | |
| 70 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SMOOTH; | |
| 71 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SOFT; | |
| 72 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SOFT_EXT; | |
| 73 | +import static com.cnlive.libs.stream.model.Filters.CN_FILTER_BEAUTY_SOFT_SHARPEN; | |
| 73 | 74 | |
| 74 | 75 | public class RecordActivity extends AppCompatActivity implements |
| 75 | 76 | ActivityCompat.OnRequestPermissionsResultCallback { |
| ... | ... | @@ -469,36 +470,36 @@ public class RecordActivity extends AppCompatActivity implements |
| 469 | 470 | } |
| 470 | 471 | switch (position) { |
| 471 | 472 | case 0: |
| 472 | - mRecordKit.setFilter(BEAUTY_DISABLE.getFilter()); | |
| 473 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_DISABLE.getFilter()); | |
| 473 | 474 | break; |
| 474 | 475 | case 1: |
| 475 | - mRecordKit.setFilter(BEAUTY_SOFT.getFilter()); | |
| 476 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_SOFT.getFilter()); | |
| 476 | 477 | break; |
| 477 | 478 | case 2: |
| 478 | - mRecordKit.setFilter(SKIN_WHITEN.getFilter()); | |
| 479 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_SKINWHITEN.getFilter()); | |
| 479 | 480 | break; |
| 480 | 481 | case 3: |
| 481 | - mRecordKit.setFilter(BEAUTY_ILLUSION.getFilter()); | |
| 482 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_ILLUSION.getFilter()); | |
| 482 | 483 | break; |
| 483 | 484 | case 4: |
| 484 | - mRecordKit.setFilter(DENOISE.getFilter()); | |
| 485 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_DENOISE.getFilter()); | |
| 485 | 486 | break; |
| 486 | 487 | case 5: |
| 487 | - mRecordKit.setFilter(BEAUTY_SMOOTH.getFilter()); | |
| 488 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_SMOOTH.getFilter()); | |
| 488 | 489 | break; |
| 489 | 490 | case 6: |
| 490 | - mRecordKit.setFilter(BEAUTY_SOFT_EXT.getFilter()); | |
| 491 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_SOFT_EXT.getFilter()); | |
| 491 | 492 | break; |
| 492 | 493 | case 7: |
| 493 | - mRecordKit.setFilter(BEAUTY_SOFT_SHARPEN.getFilter()); | |
| 494 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_SOFT_SHARPEN.getFilter()); | |
| 494 | 495 | break; |
| 495 | 496 | case 8: |
| 496 | - mRecordKit.setFilter(BEAUTY_PRO.getFilter()); | |
| 497 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_PRO.getFilter()); | |
| 497 | 498 | break; |
| 498 | 499 | } |
| 499 | - List<ImgFilterBase> filters = mRecordKit.getFilter(); | |
| 500 | + List<CNNewImgFilterBase> filters = mRecordKit.getFilter(); | |
| 500 | 501 | if (filters != null && !filters.isEmpty()) { |
| 501 | - final com.cnlive.libs.stream.base.ImgFilterBase filter = filters.get(0); | |
| 502 | + final CNNewImgFilterBase filter = filters.get(0); | |
| 502 | 503 | mBeautyGrindLayout.setVisibility(filter.isGrindRatioSupported() ? |
| 503 | 504 | View.VISIBLE : View.GONE); |
| 504 | 505 | mBeautyWhitenLayout.setVisibility(filter.isWhitenRatioSupported() ? |
| ... | ... | @@ -519,7 +520,7 @@ public class RecordActivity extends AppCompatActivity implements |
| 519 | 520 | } else if (seekBar == mWhitenSeekBar) { |
| 520 | 521 | filter.setWhitenRatio(val); |
| 521 | 522 | } else if (seekBar == mRuddySeekBar) { |
| 522 | - if (filter instanceof com.cnlive.libs.stream.base.ImgBeautyProFilter) { | |
| 523 | + if (filter instanceof CNImgBeautyProFilter) { | |
| 523 | 524 | val = progress / 50.f - 1.0f; |
| 524 | 525 | } |
| 525 | 526 | filter.setRuddyRatio(val); |
| ... | ... | @@ -540,7 +541,7 @@ public class RecordActivity extends AppCompatActivity implements |
| 540 | 541 | mGrindSeekBar.setProgress((int) (filter.getGrindRatio() * 100)); |
| 541 | 542 | mWhitenSeekBar.setProgress((int) (filter.getWhitenRatio() * 100)); |
| 542 | 543 | int ruddyVal = (int) (filter.getRuddyRatio() * 100); |
| 543 | - if (filter instanceof com.cnlive.libs.stream.base.ImgBeautyProFilter) { | |
| 544 | + if (filter instanceof CNImgBeautyProFilter) { | |
| 544 | 545 | ruddyVal = (int) (filter.getRuddyRatio() * 50 + 50); |
| 545 | 546 | } |
| 546 | 547 | mRuddySeekBar.setProgress(ruddyVal); |
| ... | ... | @@ -963,7 +964,7 @@ public class RecordActivity extends AppCompatActivity implements |
| 963 | 964 | private void clearRecordState() { |
| 964 | 965 | mBeautySpinner.setSelection(0); |
| 965 | 966 | mStickerSpinner.setSelection(0); |
| 966 | - mRecordKit.setFilter(BEAUTY_DISABLE.getFilter()); | |
| 967 | + mRecordKit.setFilter(CN_FILTER_BEAUTY_DISABLE.getFilter()); | |
| 967 | 968 | onStickerChecked(false); |
| 968 | 969 | onBgmItemClick(-1); |
| 969 | 970 | onSoundEffectItemClick(-1); | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/activity/ShortVideoPlayActivity.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/activity/ShortVideoPlayActivity.java
| 1 | -package com.cnlive.demo.shortvideo.ui.activity; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.activity; | |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.content.Intent; |
| ... | ... | @@ -15,7 +15,7 @@ import android.widget.LinearLayout; |
| 15 | 15 | import android.widget.SeekBar; |
| 16 | 16 | import android.widget.TextView; |
| 17 | 17 | |
| 18 | -import com.cnlive.demo.shortvideo.R; | |
| 18 | +import com.cnlive.cnUploadDemo.R; | |
| 19 | 19 | import com.cnlive.libs.util.Config; |
| 20 | 20 | import com.cnlive.libs.video.video.MediaPlayer; |
| 21 | 21 | import com.cnlive.libs.video.video.VideoView; |
| ... | ... | @@ -222,8 +222,9 @@ public class ShortVideoPlayActivity extends AppCompatActivity { |
| 222 | 222 | mVideoWidth = mp.getVideoWidth(); |
| 223 | 223 | mVideoHeight = mp.getVideoHeight(); |
| 224 | 224 | |
| 225 | - if (mVideoView != null) | |
| 225 | + if (mVideoView != null) { | |
| 226 | 226 | mVideoView.setVideoScalingMode(MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING); |
| 227 | + } | |
| 227 | 228 | } |
| 228 | 229 | } |
| 229 | 230 | } |
| ... | ... | @@ -334,8 +335,9 @@ public class ShortVideoPlayActivity extends AppCompatActivity { |
| 334 | 335 | |
| 335 | 336 | public int setVideoProgress(int currentProgress) { |
| 336 | 337 | |
| 337 | - if (mVideoView == null) | |
| 338 | + if (mVideoView == null) { | |
| 338 | 339 | return -1; |
| 340 | + } | |
| 339 | 341 | |
| 340 | 342 | long time = currentProgress > 0 ? currentProgress : mVideoView.getCurrentPosition(); |
| 341 | 343 | long length = mVideoView.getDuration(); |
| ... | ... | @@ -352,8 +354,9 @@ public class ShortVideoPlayActivity extends AppCompatActivity { |
| 352 | 354 | Message msg = new Message(); |
| 353 | 355 | msg.what = UPDATE_SEEKBAR; |
| 354 | 356 | |
| 355 | - if (mHandler != null) | |
| 357 | + if (mHandler != null) { | |
| 356 | 358 | mHandler.sendMessageDelayed(msg, 1000); |
| 359 | + } | |
| 357 | 360 | return (int) time; |
| 358 | 361 | } |
| 359 | 362 | |
| ... | ... | @@ -372,17 +375,19 @@ public class ShortVideoPlayActivity extends AppCompatActivity { |
| 372 | 375 | DecimalFormat format = (DecimalFormat) NumberFormat.getInstance(Locale.US); |
| 373 | 376 | format.applyPattern("00"); |
| 374 | 377 | if (text) { |
| 375 | - if (millis > 0) | |
| 378 | + if (millis > 0) { | |
| 376 | 379 | time = (negative ? "-" : "") + hours + "h" + format.format(min) + "min"; |
| 377 | - else if (min > 0) | |
| 380 | + } else if (min > 0) { | |
| 378 | 381 | time = (negative ? "-" : "") + min + "min"; |
| 379 | - else | |
| 382 | + } else { | |
| 380 | 383 | time = (negative ? "-" : "") + sec + "s"; |
| 384 | + } | |
| 381 | 385 | } else { |
| 382 | - if (millis > 0) | |
| 386 | + if (millis > 0) { | |
| 383 | 387 | time = (negative ? "-" : "") + hours + ":" + format.format(min) + ":" + format.format(sec); |
| 384 | - else | |
| 388 | + } else { | |
| 385 | 389 | time = (negative ? "-" : "") + min + ":" + format.format(sec); |
| 390 | + } | |
| 386 | 391 | } |
| 387 | 392 | return time; |
| 388 | 393 | } | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/adapter/BitmapCache.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/adapter/BitmapCache.java
| 1 | -package com.cnlive.demo.shortvideo.ui.adapter; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.adapter; | |
| 2 | 2 | |
| 3 | 3 | import android.graphics.Bitmap; |
| 4 | 4 | import android.util.LruCache; |
| 5 | 5 | |
| 6 | -import com.android.volley.toolbox.ImageLoader; | |
| 6 | +import com.cnlive.libs.volley.toolbox.ImageLoader; | |
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Created by Lynn on 2017/7/19. | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/adapter/ShortVideoAdapter.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/adapter/ShortVideoAdapter.java
| 1 | -package com.cnlive.demo.shortvideo.ui.adapter; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.adapter; | |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.support.v7.widget.RecyclerView; |
| ... | ... | @@ -8,11 +8,11 @@ import android.view.ViewGroup; |
| 8 | 8 | import android.widget.ImageView; |
| 9 | 9 | import android.widget.TextView; |
| 10 | 10 | |
| 11 | -import com.android.volley.RequestQueue; | |
| 12 | -import com.android.volley.toolbox.ImageLoader; | |
| 13 | -import com.android.volley.toolbox.Volley; | |
| 14 | -import com.cnlive.demo.shortvideo.R; | |
| 15 | -import com.cnlive.demo.shortvideo.network.model.ShortVideoInfo; | |
| 11 | +import com.cnlive.cnUploadDemo.R; | |
| 12 | +import com.cnlive.cnUploadDemo.network.model.ShortVideoInfo; | |
| 13 | +import com.cnlive.libs.volley.RequestQueue; | |
| 14 | +import com.cnlive.libs.volley.toolbox.ImageLoader; | |
| 15 | +import com.cnlive.libs.volley.toolbox.Volley; | |
| 16 | 16 | |
| 17 | 17 | import java.util.List; |
| 18 | 18 | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/dialog/ShortVideoConfigDialog.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/dialog/ShortVideoConfigDialog.java
| 1 | -package com.cnlive.demo.shortvideo.ui.dialog; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.dialog; | |
| 2 | 2 | |
| 3 | 3 | import android.app.Dialog; |
| 4 | 4 | import android.content.Context; |
| ... | ... | @@ -14,7 +14,7 @@ import android.widget.RadioButton; |
| 14 | 14 | import android.widget.RadioGroup; |
| 15 | 15 | import android.widget.TextView; |
| 16 | 16 | |
| 17 | -import com.cnlive.demo.shortvideo.R; | |
| 17 | +import com.cnlive.cnUploadDemo.R; | |
| 18 | 18 | import com.cnlive.libs.stream.base.IStreamer; |
| 19 | 19 | |
| 20 | 20 | /** | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/model/RecordClipModel.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/model/RecordClipModel.java
app/src/main/java/com/cnlive/demo/shortvideo/ui/util/RecordProgressTimer.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/util/RecordProgressTimer.java
app/src/main/java/com/cnlive/demo/shortvideo/ui/view/CameraHintView.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/view/CameraHintView.java
app/src/main/java/com/cnlive/demo/shortvideo/ui/view/RecordProgressController.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/view/RecordProgressController.java
| 1 | -package com.cnlive.demo.shortvideo.ui.view; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.view; | |
| 2 | 2 | |
| 3 | 3 | import android.os.Handler; |
| 4 | 4 | import android.view.View; |
| 5 | 5 | |
| 6 | -import com.cnlive.demo.shortvideo.R; | |
| 7 | -import com.cnlive.demo.shortvideo.ui.activity.RecordActivity; | |
| 8 | -import com.cnlive.demo.shortvideo.ui.model.RecordClipModel; | |
| 9 | -import com.cnlive.demo.shortvideo.ui.util.RecordProgressTimer; | |
| 6 | +import com.cnlive.cnUploadDemo.R; | |
| 7 | +import com.cnlive.cnUploadDemo.ui.activity.RecordActivity; | |
| 8 | +import com.cnlive.cnUploadDemo.ui.model.RecordClipModel; | |
| 9 | +import com.cnlive.cnUploadDemo.ui.util.RecordProgressTimer; | |
| 10 | 10 | |
| 11 | 11 | import java.util.ArrayList; |
| 12 | 12 | import java.util.LinkedList; |
| ... | ... | @@ -30,8 +30,7 @@ public class RecordProgressController { |
| 30 | 30 | private RecordingLengthChangedListener mRecordingLengthChangedListener; |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | - * | |
| 34 | - * @param rootView 拍摄进度显示的父控件 | |
| 33 | + * @param rootView 拍摄进度显示的父控件 | |
| 35 | 34 | */ |
| 36 | 35 | public RecordProgressController(View rootView) { |
| 37 | 36 | mHandler = new Handler(); |
| ... | ... | @@ -103,7 +102,9 @@ public class RecordProgressController { |
| 103 | 102 | * startRecord |
| 104 | 103 | */ |
| 105 | 104 | public void startRecording() { |
| 106 | - if (mIsRecording) return; | |
| 105 | + if (mIsRecording) { | |
| 106 | + return; | |
| 107 | + } | |
| 107 | 108 | mStartRecordingTime = System.currentTimeMillis(); |
| 108 | 109 | mIsRecording = true; |
| 109 | 110 | RecordClipModel clip = new RecordClipModel(); |
| ... | ... | @@ -200,6 +201,7 @@ public class RecordProgressController { |
| 200 | 201 | |
| 201 | 202 | /** |
| 202 | 203 | * 用于通知最短拍摄时长和最长拍摄时长 |
| 204 | + * | |
| 203 | 205 | * @param listener |
| 204 | 206 | */ |
| 205 | 207 | public void setRecordingLengthChangedListener(RecordingLengthChangedListener listener) { | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/ui/view/RecordProgressView.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/ui/view/RecordProgressView.java
| 1 | -package com.cnlive.demo.shortvideo.ui.view; | |
| 1 | +package com.cnlive.cnUploadDemo.ui.view; | |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.content.res.Resources; |
| ... | ... | @@ -11,9 +11,9 @@ import android.os.Handler; |
| 11 | 11 | import android.util.AttributeSet; |
| 12 | 12 | import android.view.View; |
| 13 | 13 | |
| 14 | -import com.cnlive.demo.shortvideo.R; | |
| 15 | -import com.cnlive.demo.shortvideo.ui.activity.RecordActivity; | |
| 16 | -import com.cnlive.demo.shortvideo.ui.model.RecordClipModel; | |
| 14 | +import com.cnlive.cnUploadDemo.R; | |
| 15 | +import com.cnlive.cnUploadDemo.ui.activity.RecordActivity; | |
| 16 | +import com.cnlive.cnUploadDemo.ui.model.RecordClipModel; | |
| 17 | 17 | |
| 18 | 18 | import java.util.LinkedList; |
| 19 | 19 | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/util/ActivityUtil.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/util/ActivityUtil.java
app/src/main/java/com/cnlive/demo/shortvideo/util/ColorPicker.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/util/ColorPicker.java
| 1 | -package com.cnlive.demo.shortvideo.util; | |
| 1 | +package com.cnlive.cnUploadDemo.util; | |
| 2 | 2 | |
| 3 | 3 | import android.annotation.SuppressLint; |
| 4 | 4 | import android.app.Dialog; |
| ... | ... | @@ -412,6 +412,7 @@ public class ColorPicker extends Dialog { |
| 412 | 412 | * @see com.sinaapp.msdxblog.androidkit.graphics.ColorPickerDialog. |
| 413 | 413 | * ColorPickerView#interpRectColor(int[], float, float) |
| 414 | 414 | */ |
| 415 | + @Override | |
| 415 | 416 | protected int interpRectColor(int colors[], float x, float y) { |
| 416 | 417 | int a, r, g, b, c0, c1; |
| 417 | 418 | float p; |
| ... | ... | @@ -559,6 +560,7 @@ public class ColorPicker extends Dialog { |
| 559 | 560 | * @see com.sinaapp.msdxblog.androidkit.graphics.ColorPickerDialog. |
| 560 | 561 | * ColorPickerView#interpRectColor(int[], float, float) |
| 561 | 562 | */ |
| 563 | + @Override | |
| 562 | 564 | protected int interpRectColor(int colors[], float x, float y) { |
| 563 | 565 | int a, r, g, b, c0, c1; |
| 564 | 566 | float p; | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/util/FaceUnityUtil.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/util/FaceUnityUtil.java
app/src/main/java/com/cnlive/demo/shortvideo/util/RoundImageView.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/util/RoundImageView.java
| 1 | -package com.cnlive.demo.shortvideo.util; | |
| 1 | +package com.cnlive.cnUploadDemo.util; | |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.graphics.Bitmap; |
| ... | ... | @@ -53,8 +53,9 @@ public class RoundImageView extends ImageView { |
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | this.measure(0, 0); |
| 56 | - if (drawable.getClass() == NinePatchDrawable.class) | |
| 56 | + if (drawable.getClass() == NinePatchDrawable.class) { | |
| 57 | 57 | return; |
| 58 | + } | |
| 58 | 59 | Bitmap b = ((BitmapDrawable) drawable).getBitmap(); |
| 59 | 60 | Bitmap bitmap = b.copy(Bitmap.Config.ARGB_8888, true); |
| 60 | 61 | if (defaultWidth == 0) { | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/util/authpack.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/util/authpack.java
app/src/main/java/com/cnlive/demo/shortvideo/videorange/HorizontalListView.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/videorange/HorizontalListView.java
| 1 | -package com.cnlive.demo.shortvideo.videorange; | |
| 1 | +package com.cnlive.cnUploadDemo.videorange; | |
| 2 | 2 | |
| 3 | 3 | import android.annotation.SuppressLint; |
| 4 | 4 | import android.annotation.TargetApi; |
| ... | ... | @@ -25,7 +25,7 @@ import android.widget.ListView; |
| 25 | 25 | import android.widget.ScrollView; |
| 26 | 26 | import android.widget.Scroller; |
| 27 | 27 | |
| 28 | -import com.cnlive.demo.shortvideo.R; | |
| 28 | +import com.cnlive.cnUploadDemo.R; | |
| 29 | 29 | |
| 30 | 30 | import java.util.ArrayList; |
| 31 | 31 | import java.util.LinkedList; |
| ... | ... | @@ -1312,7 +1312,9 @@ public class HorizontalListView extends AdapterView<ListAdapter> { |
| 1312 | 1312 | * @param scrolledOffset The scroll offset |
| 1313 | 1313 | */ |
| 1314 | 1314 | private void updateOverscrollAnimation(final int scrolledOffset) { |
| 1315 | - if (mEdgeGlowLeft == null || mEdgeGlowRight == null) return; | |
| 1315 | + if (mEdgeGlowLeft == null || mEdgeGlowRight == null) { | |
| 1316 | + return; | |
| 1317 | + } | |
| 1316 | 1318 | |
| 1317 | 1319 | // Calculate where the next scroll position would be |
| 1318 | 1320 | int nextScrollPosition = mCurrentX + scrolledOffset; |
| ... | ... | @@ -1354,7 +1356,9 @@ public class HorizontalListView extends AdapterView<ListAdapter> { |
| 1354 | 1356 | * The glow is not enabled unless there are more views than can fit on the screen at one time. |
| 1355 | 1357 | */ |
| 1356 | 1358 | private boolean isEdgeGlowEnabled() { |
| 1357 | - if (mAdapter == null || mAdapter.isEmpty()) return false; | |
| 1359 | + if (mAdapter == null || mAdapter.isEmpty()) { | |
| 1360 | + return false; | |
| 1361 | + } | |
| 1358 | 1362 | |
| 1359 | 1363 | // If the maxx is more then zero then the user can scroll, so the edge effects should be shown |
| 1360 | 1364 | return mMaxX > 0; | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/videorange/PreviewPositionIndicator.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/videorange/PreviewPositionIndicator.java
app/src/main/java/com/cnlive/demo/shortvideo/videorange/RangeThumb.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/videorange/RangeThumb.java
app/src/main/java/com/cnlive/demo/shortvideo/videorange/ThumbnailMask.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/videorange/ThumbnailMask.java
app/src/main/java/com/cnlive/demo/shortvideo/videorange/VideoRangeSeekBar.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/videorange/VideoRangeSeekBar.java
| 1 | -package com.cnlive.demo.shortvideo.videorange; | |
| 1 | +package com.cnlive.cnUploadDemo.videorange; | |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.content.res.TypedArray; |
| ... | ... | @@ -9,7 +9,7 @@ import android.util.AttributeSet; |
| 9 | 9 | import android.view.MotionEvent; |
| 10 | 10 | import android.view.View; |
| 11 | 11 | |
| 12 | -import com.cnlive.demo.shortvideo.R; | |
| 12 | +import com.cnlive.cnUploadDemo.R; | |
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * Created by Lynn on 6/13/2017. | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/videorange/VideoThumbnailAdapter.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/videorange/VideoThumbnailAdapter.java
| 1 | -package com.cnlive.demo.shortvideo.videorange; | |
| 1 | +package com.cnlive.cnUploadDemo.videorange; | |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | import android.content.Context; |
| ... | ... | @@ -8,12 +8,14 @@ import android.view.ViewGroup; |
| 8 | 8 | import android.widget.ArrayAdapter; |
| 9 | 9 | import android.widget.ImageView; |
| 10 | 10 | |
| 11 | -import com.cnlive.demo.shortvideo.R; | |
| 11 | +import com.cnlive.cnUploadDemo.R; | |
| 12 | 12 | import com.cnlive.libs.shortvideo.kit.CNEditKit; |
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * 加载缩略图的Adapter |
| 16 | - * Created by Lynn on 6/13/2017. | |
| 16 | + * | |
| 17 | + * @author Lynn | |
| 18 | + * @date 6/13/2017 | |
| 17 | 19 | */ |
| 18 | 20 | |
| 19 | 21 | public class VideoThumbnailAdapter extends ArrayAdapter<VideoThumbnailInfo> { | ... | ... |
app/src/main/java/com/cnlive/demo/shortvideo/videorange/VideoThumbnailInfo.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/videorange/VideoThumbnailInfo.java
app/src/main/java/com/cnlive/demo/shortvideo/videorange/VideoThumbnailTask.java renamed to app/src/main/java/com/cnlive/cnUploadDemo/videorange/VideoThumbnailTask.java
app/src/main/jniLibs/arm64-v8a/libksylive.so deleted
100644 → 0
No preview for this file type
app/src/main/jniLibs/armeabi-v7a/libksylive.so deleted
100644 → 0
No preview for this file type
app/src/main/jniLibs/armeabi/libksylive.so deleted
100644 → 0
No preview for this file type
app/src/main/jniLibs/x86/libksylive.so deleted
100644 → 0
No preview for this file type
app/src/main/res/layout/activity_main.xml
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | android:layout_width="match_parent" |
| 6 | 6 | android:layout_height="match_parent" |
| 7 | 7 | android:orientation="vertical" |
| 8 | - tools:context="com.cnlive.demo.shortvideo.ui.activity.MainActivity"> | |
| 8 | + tools:context="com.cnlive.cnUploadDemo.ui.activity.MainActivity"> | |
| 9 | 9 | |
| 10 | 10 | <Button |
| 11 | 11 | android:id="@+id/auth" | ... | ... |
app/src/main/res/layout/activity_new_record.xml
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | android:layout_alignParentBottom="true" |
| 17 | 17 | android:layout_alignParentTop="true" /> |
| 18 | 18 | |
| 19 | - <com.cnlive.demo.shortvideo.ui.view.CameraHintView | |
| 19 | + <com.cnlive.cnUploadDemo.ui.view.CameraHintView | |
| 20 | 20 | android:id="@+id/camera_hint" |
| 21 | 21 | android:layout_width="match_parent" |
| 22 | 22 | android:layout_height="match_parent" | ... | ... |
app/src/main/res/layout/bgm_reverberation.xml
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | android:layout_marginRight="20dp" |
| 30 | 30 | android:orientation="vertical"> |
| 31 | 31 | |
| 32 | - <com.cnlive.demo.shortvideo.util.RoundImageView | |
| 32 | + <com.cnlive.cnUploadDemo.util.RoundImageView | |
| 33 | 33 | android:id="@+id/effect_iv_studio" |
| 34 | 34 | android:layout_width="60dp" |
| 35 | 35 | android:layout_height="60dp" |
| ... | ... | @@ -51,7 +51,7 @@ |
| 51 | 51 | android:layout_marginRight="20dp" |
| 52 | 52 | android:orientation="vertical"> |
| 53 | 53 | |
| 54 | - <com.cnlive.demo.shortvideo.util.RoundImageView | |
| 54 | + <com.cnlive.cnUploadDemo.util.RoundImageView | |
| 55 | 55 | android:id="@+id/effect_iv_woodWing" |
| 56 | 56 | android:layout_width="60dp" |
| 57 | 57 | android:layout_height="60dp" |
| ... | ... | @@ -73,7 +73,7 @@ |
| 73 | 73 | android:layout_marginRight="20dp" |
| 74 | 74 | android:orientation="vertical"> |
| 75 | 75 | |
| 76 | - <com.cnlive.demo.shortvideo.util.RoundImageView | |
| 76 | + <com.cnlive.cnUploadDemo.util.RoundImageView | |
| 77 | 77 | android:id="@+id/effect_iv_concert" |
| 78 | 78 | android:layout_width="60dp" |
| 79 | 79 | android:layout_height="60dp" |
| ... | ... | @@ -95,7 +95,7 @@ |
| 95 | 95 | android:layout_marginRight="20dp" |
| 96 | 96 | android:orientation="vertical"> |
| 97 | 97 | |
| 98 | - <com.cnlive.demo.shortvideo.util.RoundImageView | |
| 98 | + <com.cnlive.cnUploadDemo.util.RoundImageView | |
| 99 | 99 | android:id="@+id/effect_iv_ktv" |
| 100 | 100 | android:layout_width="60dp" |
| 101 | 101 | android:layout_height="60dp" | ... | ... |
app/src/main/res/layout/bgm_sound_change.xml
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | android:layout_marginRight="20dp" |
| 30 | 30 | android:orientation="vertical"> |
| 31 | 31 | |
| 32 | - <com.cnlive.demo.shortvideo.util.RoundImageView | |
| 32 | + <com.cnlive.cnUploadDemo.util.RoundImageView | |
| 33 | 33 | android:id="@+id/effect_iv_uncle" |
| 34 | 34 | android:layout_width="60dp" |
| 35 | 35 | android:layout_height="60dp" |
| ... | ... | @@ -51,7 +51,7 @@ |
| 51 | 51 | android:layout_marginRight="20dp" |
| 52 | 52 | android:orientation="vertical"> |
| 53 | 53 | |
| 54 | - <com.cnlive.demo.shortvideo.util.RoundImageView | |
| 54 | + <com.cnlive.cnUploadDemo.util.RoundImageView | |
| 55 | 55 | android:id="@+id/effect_iv_lolita" |
| 56 | 56 | android:layout_width="60dp" |
| 57 | 57 | android:layout_height="60dp" |
| ... | ... | @@ -73,7 +73,7 @@ |
| 73 | 73 | android:layout_marginRight="20dp" |
| 74 | 74 | android:orientation="vertical"> |
| 75 | 75 | |
| 76 | - <com.cnlive.demo.shortvideo.util.RoundImageView | |
| 76 | + <com.cnlive.cnUploadDemo.util.RoundImageView | |
| 77 | 77 | android:id="@+id/effect_iv_solemn" |
| 78 | 78 | android:layout_width="60dp" |
| 79 | 79 | android:layout_height="60dp" |
| ... | ... | @@ -95,7 +95,7 @@ |
| 95 | 95 | android:layout_marginRight="20dp" |
| 96 | 96 | android:orientation="vertical"> |
| 97 | 97 | |
| 98 | - <com.cnlive.demo.shortvideo.util.RoundImageView | |
| 98 | + <com.cnlive.cnUploadDemo.util.RoundImageView | |
| 99 | 99 | android:id="@+id/effect_iv_robot" |
| 100 | 100 | android:layout_width="60dp" |
| 101 | 101 | android:layout_height="60dp" | ... | ... |
app/src/main/res/layout/new_record_bottombar.xml
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | android:layout_centerVertical="true" |
| 55 | 55 | android:background="@color/record_progress_pause"> |
| 56 | 56 | |
| 57 | - <com.cnlive.demo.shortvideo.ui.view.RecordProgressView | |
| 57 | + <com.cnlive.cnUploadDemo.ui.view.RecordProgressView | |
| 58 | 58 | android:id="@+id/record_progress" |
| 59 | 59 | android:layout_width="match_parent" |
| 60 | 60 | android:layout_height="16dp"/> | ... | ... |
app/src/main/res/layout/video_range_choose.xml
| ... | ... | @@ -66,13 +66,13 @@ |
| 66 | 66 | android:layout_height="114dp" |
| 67 | 67 | android:layout_alignParentBottom="true"> |
| 68 | 68 | |
| 69 | - <com.cnlive.demo.shortvideo.videorange.HorizontalListView | |
| 69 | + <com.cnlive.cnUploadDemo.videorange.HorizontalListView | |
| 70 | 70 | android:id="@+id/hlistview" |
| 71 | 71 | android:layout_width="match_parent" |
| 72 | 72 | android:layout_height="59dp" |
| 73 | 73 | android:requiresFadingEdge="horizontal" /> |
| 74 | 74 | |
| 75 | - <com.cnlive.demo.shortvideo.videorange.VideoRangeSeekBar xmlns:custom="http://schemas.android.com/apk/res-auto" | |
| 75 | + <com.cnlive.cnUploadDemo.videorange.VideoRangeSeekBar xmlns:custom="http://schemas.android.com/apk/res-auto" | |
| 76 | 76 | android:id="@+id/seekbar" |
| 77 | 77 | android:layout_width="match_parent" |
| 78 | 78 | android:layout_height="110dp" | ... | ... |