rewrite the player and recorder fragments into constraintlayouts

This commit is contained in:
tibbi 2020-11-05 16:37:51 +01:00
parent 767c59931f
commit d3abe3906d
5 changed files with 27 additions and 21 deletions

View file

@ -61,4 +61,5 @@ dependencies {
implementation 'com.github.Armen101:AudioRecordView:1.0.2'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
}

View file

@ -126,7 +126,8 @@ class MainActivity : SimpleActivity() {
val faqItems = arrayListOf(
FAQItem(R.string.faq_1_title, R.string.faq_1_text),
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons),
FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons)
FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons),
FAQItem(R.string.faq_9_title_commons, R.string.faq_9_text_commons)
)
startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true)

View file

@ -2,9 +2,9 @@ package com.simplemobiletools.voicerecorder.fragments
import android.content.Context
import android.util.AttributeSet
import android.widget.RelativeLayout
import androidx.constraintlayout.widget.ConstraintLayout
abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) : ConstraintLayout(context, attributeSet) {
abstract fun onResume()
abstract fun onDestroy()

View file

@ -10,7 +10,6 @@
android:id="@+id/recordings_placeholder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:alpha="0.8"
android:gravity="center"
android:lineSpacingExtra="@dimen/small_margin"
@ -23,20 +22,21 @@
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/recordings_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/player_controls_wrapper"
android:layout_height="0dp"
android:clipToPadding="false"
android:scrollbars="none"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"
app:layout_constraintBottom_toTopOf="@+id/player_controls_wrapper"
app:layout_constraintTop_toTopOf="parent" />
<com.simplemobiletools.commons.views.FastScroller
android:id="@+id/recordings_fastscroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/recordings_list"
android:layout_alignBottom="@+id/recordings_list"
android:layout_alignParentEnd="true"
android:paddingStart="@dimen/normal_margin">
android:layout_height="0dp"
android:paddingStart="@dimen/normal_margin"
app:layout_constraintBottom_toBottomOf="@+id/recordings_list"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/recordings_list">
<include layout="@layout/fastscroller_handle_vertical" />
@ -46,7 +46,8 @@
android:id="@+id/player_controls_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText">
<View

View file

@ -9,8 +9,7 @@
<com.visualizer.amplitude.AudioRecordView
android:id="@+id/recorder_visualizer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/recording_duration"
android:layout_height="0dp"
android:layout_margin="@dimen/big_margin"
android:background="@drawable/frame_background"
app:chunkAlignTo="center"
@ -19,28 +18,32 @@
app:chunkRoundedCorners="true"
app:chunkSoftTransition="true"
app:chunkSpace="1dp"
app:chunkWidth="3dp" />
app:chunkWidth="3dp"
app:layout_constraintBottom_toTopOf="@+id/recording_duration"
app:layout_constraintTop_toTopOf="parent" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/recording_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/toggle_recording_button"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/bigger_margin"
android:textSize="@dimen/extra_big_text_size"
app:layout_constraintBottom_toTopOf="@+id/toggle_recording_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="00:00" />
<ImageView
android:id="@+id/toggle_recording_button"
android:layout_width="@dimen/toggle_recording_button_size"
android:layout_height="@dimen/toggle_recording_button_size"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/big_margin"
android:background="@drawable/circle_background"
android:elevation="@dimen/medium_margin"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_microphone_vector" />
android:src="@drawable/ic_microphone_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</com.simplemobiletools.voicerecorder.fragments.RecorderFragment>