Skip to content

Commit 32b4203

Browse files
Support Edge to edge
1 parent fe7b15e commit 32b4203

File tree

62 files changed

+363
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+363
-59
lines changed

app/src/main/java/com/simform/videoimageeditor/MainActivity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package com.simform.videoimageeditor
22

33
import android.view.View
4+
import androidx.activity.enableEdgeToEdge
45
import com.simform.videoimageeditor.databinding.ActivityMainBinding
56
import com.simform.videoimageeditor.middlewareActivity.OtherFFMPEGProcessActivity
67
import com.simform.videoimageeditor.middlewareActivity.VideoProcessActivity
8+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
79

810
class MainActivity : BaseActivity(R.layout.activity_main, R.string.ffpmeg_title) {
911

@@ -12,8 +14,8 @@ class MainActivity : BaseActivity(R.layout.activity_main, R.string.ffpmeg_title)
1214
override fun initialization() {
1315
binding = ActivityMainBinding.inflate(layoutInflater)
1416
setContentView(binding.root)
15-
16-
supportActionBar?.title = getString(R.string.ffpmeg_title)
17+
enableEdgeToEdge(binding.toolbar.root)
18+
binding.toolbar.textTitle.text = getString(R.string.ffpmeg_title)
1719
supportActionBar?.setDisplayHomeAsUpEnabled(false)
1820
supportActionBar?.setDisplayShowHomeEnabled(false)
1921
binding.videoOperation.setOnClickListener(this)

app/src/main/java/com/simform/videoimageeditor/middlewareActivity/OtherFFMPEGProcessActivity.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.simform.videoimageeditor.middlewareActivity
22

33
import android.view.View
4+
import androidx.activity.enableEdgeToEdge
45
import com.simform.videoimageeditor.BaseActivity
56
import com.simform.videoimageeditor.R
67
import com.simform.videoimageeditor.databinding.ActivityOtherFfmpegProcessBinding
@@ -10,6 +11,7 @@ import com.simform.videoimageeditor.otherFFMPEGProcessActivity.CompressAudioActi
1011
import com.simform.videoimageeditor.otherFFMPEGProcessActivity.CropAudioActivity
1112
import com.simform.videoimageeditor.otherFFMPEGProcessActivity.FastAndSlowAudioActivity
1213
import com.simform.videoimageeditor.otherFFMPEGProcessActivity.MergeGIFActivity
14+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
1315

1416
class OtherFFMPEGProcessActivity : BaseActivity(R.layout.activity_other_ffmpeg_process, R.string.other_ffmpeg_operations) {
1517

@@ -18,7 +20,8 @@ class OtherFFMPEGProcessActivity : BaseActivity(R.layout.activity_other_ffmpeg_p
1820
override fun initialization() {
1921
binding = ActivityOtherFfmpegProcessBinding.inflate(layoutInflater)
2022
setContentView(binding.root)
21-
supportActionBar?.title = getString(R.string.other_ffmpeg_operations)
23+
enableEdgeToEdge(binding.toolbar.root)
24+
binding.toolbar.textTitle.text = getString(R.string.other_ffmpeg_operations)
2225
binding.apply {
2326
btnMergeGIF.setOnClickListener(this@OtherFFMPEGProcessActivity)
2427
btnMergeAudios.setOnClickListener(this@OtherFFMPEGProcessActivity)

app/src/main/java/com/simform/videoimageeditor/middlewareActivity/VideoProcessActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.view.View
44
import com.simform.videoimageeditor.BaseActivity
55
import com.simform.videoimageeditor.R
66
import com.simform.videoimageeditor.databinding.ActivityVideoProcessBinding
7+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
78
import com.simform.videoimageeditor.videoProcessActivity.*
89

910
/**
@@ -16,8 +17,8 @@ class VideoProcessActivity : BaseActivity(R.layout.activity_video_process, R.str
1617
override fun initialization() {
1718
binding = ActivityVideoProcessBinding.inflate(layoutInflater)
1819
setContentView(binding.root)
19-
20-
supportActionBar?.title = getString(R.string.video_operations)
20+
enableEdgeToEdge(binding.toolbar.root)
21+
binding.toolbar.textTitle.text = getString(R.string.video_operations)
2122
binding.btnCutVideo.setOnClickListener(this)
2223
binding.btnImageToVideo.setOnClickListener(this)
2324
binding.btnAddWaterMarkOnVideo.setOnClickListener(this)

app/src/main/java/com/simform/videoimageeditor/otherFFMPEGProcessActivity/AudiosMergeActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.jaiselrahman.filepicker.model.MediaFile
88
import com.simform.videoimageeditor.BaseActivity
99
import com.simform.videoimageeditor.R
1010
import com.simform.videoimageeditor.databinding.ActivityAudiosMergeBinding
11+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
1112
import com.simform.videooperations.CallBackOfQuery
1213
import com.simform.videooperations.Common
1314
import com.simform.videooperations.Common.DURATION_FIRST
@@ -22,7 +23,8 @@ class AudiosMergeActivity : BaseActivity(R.layout.activity_audios_merge, R.strin
2223
override fun initialization() {
2324
binding = ActivityAudiosMergeBinding.inflate(layoutInflater)
2425
setContentView(binding.root)
25-
26+
enableEdgeToEdge(binding.toolbar.root)
27+
binding.toolbar.textTitle.text = getString(R.string.merge_audios)
2628
binding.btnAudioPath.setOnClickListener(this)
2729
binding.btnMerge.setOnClickListener(this)
2830
}

app/src/main/java/com/simform/videoimageeditor/otherFFMPEGProcessActivity/ChangeAudioVolumeActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.jaiselrahman.filepicker.model.MediaFile
88
import com.simform.videoimageeditor.BaseActivity
99
import com.simform.videoimageeditor.R
1010
import com.simform.videoimageeditor.databinding.ActivityChangeAudioValumeBinding
11+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
1112
import com.simform.videooperations.CallBackOfQuery
1213
import com.simform.videooperations.Common
1314
import com.simform.videooperations.FFmpegCallBack
@@ -20,7 +21,8 @@ class ChangeAudioVolumeActivity : BaseActivity(R.layout.activity_change_audio_va
2021
override fun initialization() {
2122
binding = ActivityChangeAudioValumeBinding.inflate(layoutInflater)
2223
setContentView(binding.root)
23-
24+
enableEdgeToEdge(binding.toolbar.root)
25+
binding.toolbar.textTitle.text = getString(R.string.change_audio_volume)
2426
binding.btnAudioPath.setOnClickListener(this)
2527
binding.btnChange.setOnClickListener(this)
2628
}

app/src/main/java/com/simform/videoimageeditor/otherFFMPEGProcessActivity/CompressAudioActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.jaiselrahman.filepicker.model.MediaFile
88
import com.simform.videoimageeditor.BaseActivity
99
import com.simform.videoimageeditor.R
1010
import com.simform.videoimageeditor.databinding.ActivityCompressAudioBinding
11+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
1112
import com.simform.videooperations.CallBackOfQuery
1213
import com.simform.videooperations.Common
1314
import com.simform.videooperations.Common.BITRATE_128
@@ -22,7 +23,8 @@ class CompressAudioActivity : BaseActivity(R.layout.activity_compress_audio, R.s
2223
override fun initialization() {
2324
binding = ActivityCompressAudioBinding.inflate(layoutInflater)
2425
setContentView(binding.root)
25-
26+
enableEdgeToEdge(binding.toolbar.root)
27+
binding.toolbar.textTitle.text = getString(R.string.compress_audio)
2628
binding.btnAudioPath.setOnClickListener(this)
2729
binding.btnChange.setOnClickListener(this)
2830
}

app/src/main/java/com/simform/videoimageeditor/otherFFMPEGProcessActivity/CropAudioActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import com.simform.videoimageeditor.BaseActivity
1111
import com.simform.videoimageeditor.R
1212
import com.simform.videoimageeditor.databinding.ActivityCropAudioBinding
1313
import com.simform.videoimageeditor.ikovac.timepickerwithseconds.MyTimePickerDialog
14+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
1415
import com.simform.videooperations.CallBackOfQuery
1516
import com.simform.videooperations.Common
1617
import com.simform.videooperations.Common.stringForTime
@@ -31,7 +32,8 @@ class CropAudioActivity : BaseActivity(R.layout.activity_crop_audio, R.string.cr
3132
override fun initialization() {
3233
binding = ActivityCropAudioBinding.inflate(layoutInflater)
3334
setContentView(binding.root)
34-
35+
enableEdgeToEdge(binding.toolbar.root)
36+
binding.toolbar.textTitle.text = getString(R.string.crop_audio_using_time)
3537
binding.apply {
3638
btnAudioPath.setOnClickListener(this@CropAudioActivity)
3739
btnSelectStartTime.setOnClickListener(this@CropAudioActivity)

app/src/main/java/com/simform/videoimageeditor/otherFFMPEGProcessActivity/FastAndSlowAudioActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.jaiselrahman.filepicker.model.MediaFile
77
import com.simform.videoimageeditor.BaseActivity
88
import com.simform.videoimageeditor.R
99
import com.simform.videoimageeditor.databinding.ActivityFastAndSlowAudioBinding
10+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
1011
import com.simform.videooperations.CallBackOfQuery
1112
import com.simform.videooperations.Common
1213
import com.simform.videooperations.FFmpegCallBack
@@ -20,7 +21,8 @@ class FastAndSlowAudioActivity : BaseActivity(R.layout.activity_fast_and_slow_au
2021
override fun initialization() {
2122
binding = ActivityFastAndSlowAudioBinding.inflate(layoutInflater)
2223
setContentView(binding.root)
23-
24+
enableEdgeToEdge(binding.toolbar.root)
25+
binding.toolbar.textTitle.text = getString(R.string.fast_slow_motion_video)
2426
binding.btnAudioPath.setOnClickListener(this)
2527
binding.btnMotion.setOnClickListener(this)
2628
}

app/src/main/java/com/simform/videoimageeditor/otherFFMPEGProcessActivity/MergeGIFActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import com.simform.videooperations.Paths
2424
import java.io.File
2525
import androidx.activity.result.PickVisualMediaRequest
2626
import androidx.activity.result.contract.ActivityResultContracts
27+
import com.simform.videoimageeditor.utils.enableEdgeToEdge
2728

2829

2930
class MergeGIFActivity : BaseActivity(R.layout.activity_merge_gif, R.string.merge_gif) {
@@ -33,7 +34,8 @@ class MergeGIFActivity : BaseActivity(R.layout.activity_merge_gif, R.string.merg
3334
override fun initialization() {
3435
binding = ActivityMergeGifBinding.inflate(layoutInflater)
3536
setContentView(binding.root)
36-
37+
enableEdgeToEdge(binding.toolbar.root)
38+
binding.toolbar.textTitle.text = getString(R.string.merge_gif)
3739
binding.btnGifPath.setOnClickListener(this)
3840
binding.btnMerge.setOnClickListener(this)
3941
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.simform.videoimageeditor.utils
2+
3+
import android.view.View
4+
import androidx.appcompat.app.AppCompatActivity
5+
import androidx.core.view.ViewCompat
6+
import androidx.core.view.WindowInsetsCompat
7+
8+
fun AppCompatActivity.enableEdgeToEdge(view: View?) {
9+
view?.let {
10+
ViewCompat.setOnApplyWindowInsetsListener(it) { view, windowInsets ->
11+
val systemBarInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
12+
view.setPadding(
13+
systemBarInsets.left,
14+
systemBarInsets.top,
15+
systemBarInsets.right,
16+
0
17+
)
18+
windowInsets
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)