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