updating commons with some initial ui changes

This commit is contained in:
tibbi 2022-12-19 15:53:59 +01:00
parent 8d1db2655e
commit f832c289cb
5 changed files with 27 additions and 24 deletions

View File

@ -63,7 +63,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:9795366108'
implementation 'com.github.SimpleMobileTools:Simple-Commons:f38bfd22d5'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation "androidx.exifinterface:exifinterface:1.3.5"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"

View File

@ -21,10 +21,14 @@ import kotlin.system.exitProcess
class SettingsActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
setupOptionsMenu()
refreshMenuItems()
updateMaterialActivityViews(settings_coordinator, settings_holder)
setupMaterialScrollListener(settings_nested_scrollview, settings_toolbar)
}
override fun onResume() {

View File

@ -47,10 +47,15 @@ class MediaActionSound(private val context: Context) {
var state: Int = STATE_NOT_LOADED
)
private var soundPool: SoundPool? = SoundPool.Builder().setMaxStreams(NUM_MEDIA_SOUND_STREAMS).setAudioAttributes(
AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION).setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION).build()
).build()
private var soundPool: SoundPool? = SoundPool.Builder().setMaxStreams(NUM_MEDIA_SOUND_STREAMS)
.setAudioAttributes(
AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
.setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build()
).build()
private var mediaPlayer: MediaPlayer? = null
private var playCompletionRunnable: Runnable? = null
@ -62,6 +67,7 @@ class MediaActionSound(private val context: Context) {
if (sound.loadId != sampleId) {
continue
}
var soundToBePlayed: SoundState? = null
synchronized(sound) {
if (status != 0) {
@ -79,6 +85,7 @@ class MediaActionSound(private val context: Context) {
else -> Log.e(TAG, "OnLoadCompleteListener() called in wrong state: ${sound.state} for sound: ${sound.mediaSound}")
}
}
if (soundToBePlayed != null) {
playWithSoundPool(soundToBePlayed!!)
}

View File

@ -6,30 +6,22 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/settings_app_bar_layout"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/settings_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/settings_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:layout_scrollFlags="scroll|enterAlways"
app:menu="@menu/menu"
app:title="@string/settings"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.google.android.material.appbar.AppBarLayout>
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:menu="@menu/menu"
app:title="@string/settings"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
<androidx.core.widget.NestedScrollView
android:id="@+id/settings_nested_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:scrollbars="none">
<LinearLayout
android:id="@+id/settings_holder"

View File

@ -5,9 +5,9 @@
tools:ignore="AppCompatResource">
<item
android:id="@+id/more_apps_from_us"
android:showAsAction="never"
android:icon="@drawable/ic_google_play_vector"
android:title="@string/more_apps_from_us"
app:showAsAction="never" />
app:showAsAction="ifRoom" />
<item
android:id="@+id/about"
android:icon="@drawable/ic_info_vector"