-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from aserbao/aserbao_1.0
Aserbao 1.0
- Loading branch information
Showing
21 changed files
with
1,387 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/src/main/java/com/aserbao/androidcustomcamera/WelcomeActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.aserbao.androidcustomcamera | ||
|
||
import android.animation.Animator | ||
import android.animation.AnimatorListenerAdapter | ||
import android.animation.ObjectAnimator | ||
import android.animation.PropertyValuesHolder | ||
import android.content.Intent | ||
import android.util.Log | ||
import com.aserbao.androidcustomcamera.base.activity.BaseActivity | ||
import com.aserbao.androidcustomcamera.utils.CheckPermissionUtil | ||
import com.aserbao.androidcustomcamera.whole.record.RecorderActivity | ||
import kotlinx.android.synthetic.main.activity_welcome.* | ||
|
||
|
||
class WelcomeActivity : BaseActivity() { | ||
|
||
override fun setLayoutId(): Int { | ||
return R.layout.activity_welcome | ||
} | ||
|
||
override fun initView() { | ||
super.initView() | ||
} | ||
|
||
fun exectorAnimator(){ | ||
val valuesHolder0 = PropertyValuesHolder.ofFloat("scaleX", 1.0f, 1.5f) | ||
val valuesHolder1 = PropertyValuesHolder.ofFloat("scaleY", 1.0f, 1.5f) | ||
val objectAnimator: ObjectAnimator = ObjectAnimator.ofPropertyValuesHolder(bgIV, valuesHolder0, valuesHolder1) | ||
objectAnimator.addListener(object : AnimatorListenerAdapter() { | ||
override fun onAnimationEnd(animation: Animator?) { | ||
super.onAnimationEnd(animation) | ||
startActivity(Intent(this@WelcomeActivity, RecorderActivity::class.java)) | ||
finish() | ||
} | ||
}) | ||
objectAnimator.setDuration(2000).start() | ||
} | ||
|
||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String?>, grantResults: IntArray) { | ||
super.onRequestPermissionsResult(requestCode, permissions, grantResults) | ||
Log.e("TAG", "onRequestPermissionsResult: $requestCode") | ||
if(CheckPermissionUtil.isCameraGranted()) { | ||
exectorAnimator() | ||
}else{ | ||
startRequestPermission() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.