Skip to content

Commit 9538f14

Browse files
authored
Merge pull request #35 from aserbao/aserbao_1.0
Aserbao 1.0
2 parents 95a4960 + ada9032 commit 9538f14

File tree

21 files changed

+1387
-26
lines changed

21 files changed

+1387
-26
lines changed

app/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ android {
3636
path "CMakeLists.txt"
3737
}
3838
}
39+
40+
testOptions {
41+
unitTests.all {
42+
// All the usual Gradle options.
43+
jvmArgs '-XX:MaxPermSize=256m'
44+
}
45+
46+
unitTests.returnDefaultValues = true
47+
}
3948
}
4049

4150
dependencies {
@@ -57,6 +66,10 @@ dependencies {
5766
implementation 'com.googlecode.mp4parser:isoparser:1.1.21'
5867
implementation files('libs/fmod.jar')
5968
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
69+
70+
71+
testCompile 'junit:junit:4.12'
72+
testCompile "org.mockito:mockito-core:1.9.5"
6073
}
6174
repositories {
6275
mavenCentral()

app/src/main/AndroidManifest.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,25 @@
88
<uses-permission android:name="android.permission.RECORD_AUDIO" />
99

1010
<application
11-
android:debuggable="true"
1211
android:name=".base.MyApplication"
1312
android:allowBackup="true"
13+
android:debuggable="true"
1414
android:hardwareAccelerated="true"
15-
android:icon="@mipmap/ic_launcher"
15+
android:icon="@mipmap/ic_lanuch"
1616
android:label="@string/app_name"
1717
android:supportsRtl="true"
1818
android:theme="@style/MyTheme">
19-
<activity android:name=".blocks.others.changeVoice.ChangeVoiceActivity"></activity>
20-
<activity android:name=".blocks.mediaCodec.show.MediaCodecShowOnGlSurfaceView" />
21-
<activity android:name=".HomeActivity">
19+
<activity android:name=".WelcomeActivity">
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
2222

23+
<category android:name="android.intent.category.LAUNCHER" />
24+
</intent-filter>
2325
</activity>
26+
<activity android:name=".blocks.atestcases.TestCaseActivity" />
27+
<activity android:name=".blocks.others.changeVoice.ChangeVoiceActivity" />
28+
<activity android:name=".blocks.mediaCodec.show.MediaCodecShowOnGlSurfaceView" />
29+
<activity android:name=".HomeActivity"></activity>
2430
<activity android:name=".blocks.BlocksActivity" />
2531
<activity android:name=".blocks.mediaCodec.MediaCodecActivity" />
2632
<activity android:name=".whole.WholeActivity" />
@@ -34,12 +40,8 @@
3440
<activity android:name=".blocks.mediaCodec.bigflake.BigflakeActivity" />
3541
<activity
3642
android:name=".whole.record.RecorderActivity"
37-
android:screenOrientation="portrait" >
38-
<intent-filter>
39-
<action android:name="android.intent.action.MAIN" />
43+
android:screenOrientation="portrait">
4044

41-
<category android:name="android.intent.category.LAUNCHER" />
42-
</intent-filter>
4345
</activity>
4446
<activity android:name=".blocks.mediaCodec.bigflake.encodeDecode.EncodeDecodeActivity" />
4547
<activity android:name=".blocks.mediaCodec.bigflake.extractDecodeEditEncodeMux.ExtractDecodeEditEncodeMuxActivity" />
@@ -55,9 +57,7 @@
5557
<activity android:name=".blocks.others.OthersActivity" />
5658
<activity android:name=".blocks.others.audioStyle.AudioStyleActivity" />
5759
<activity android:name=".blocks.ffmpeg.FFmpegActivity" />
58-
59-
<activity android:name=".whole.createVideoByVoice.CreateVideoByAudioDbActivity">
60-
</activity>
60+
<activity android:name=".whole.createVideoByVoice.CreateVideoByAudioDbActivity" />
6161
<activity
6262
android:name=".whole.pickvideo.VideoPickActivity"
6363
android:screenOrientation="portrait" />
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.aserbao.androidcustomcamera
2+
3+
import android.animation.Animator
4+
import android.animation.AnimatorListenerAdapter
5+
import android.animation.ObjectAnimator
6+
import android.animation.PropertyValuesHolder
7+
import android.content.Intent
8+
import android.util.Log
9+
import com.aserbao.androidcustomcamera.base.activity.BaseActivity
10+
import com.aserbao.androidcustomcamera.utils.CheckPermissionUtil
11+
import com.aserbao.androidcustomcamera.whole.record.RecorderActivity
12+
import kotlinx.android.synthetic.main.activity_welcome.*
13+
14+
15+
class WelcomeActivity : BaseActivity() {
16+
17+
override fun setLayoutId(): Int {
18+
return R.layout.activity_welcome
19+
}
20+
21+
override fun initView() {
22+
super.initView()
23+
}
24+
25+
fun exectorAnimator(){
26+
val valuesHolder0 = PropertyValuesHolder.ofFloat("scaleX", 1.0f, 1.5f)
27+
val valuesHolder1 = PropertyValuesHolder.ofFloat("scaleY", 1.0f, 1.5f)
28+
val objectAnimator: ObjectAnimator = ObjectAnimator.ofPropertyValuesHolder(bgIV, valuesHolder0, valuesHolder1)
29+
objectAnimator.addListener(object : AnimatorListenerAdapter() {
30+
override fun onAnimationEnd(animation: Animator?) {
31+
super.onAnimationEnd(animation)
32+
startActivity(Intent(this@WelcomeActivity, RecorderActivity::class.java))
33+
finish()
34+
}
35+
})
36+
objectAnimator.setDuration(2000).start()
37+
}
38+
39+
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String?>, grantResults: IntArray) {
40+
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
41+
Log.e("TAG", "onRequestPermissionsResult: $requestCode")
42+
if(CheckPermissionUtil.isCameraGranted()) {
43+
exectorAnimator()
44+
}else{
45+
startRequestPermission()
46+
}
47+
}
48+
}

app/src/main/java/com/aserbao/androidcustomcamera/base/activity/BaseActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void onCreate(Bundle savedInstanceState) {
3030
initView();
3131
}
3232

33-
private void startRequestPermission() {
33+
protected void startRequestPermission() {
3434
ActivityCompat.requestPermissions(this,BASIC_PERMISSIONS,123);
3535
}
3636
public void initView(){

0 commit comments

Comments
 (0)