録音ボタンを、画像に変更しました。
fragment_mapsのレイアウトを少しだけ修正しました。
1 parent dde2169 commit e62b99a4694b42d846333591bcb53329142dca74
Ninja Team authored on 14 Jul 2020
Showing 2 changed files
View
6
app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java
 
//録音開始&録音終了
private void startRecord(){
File wavFile = new File(filePath);
final ImageView R_Stoping = getView().findViewById(R.id.R_Stoping);
final ImageView R_Playing = getView().findViewById(R.id.R_Playing);
if(StartChange == 0) {
try {
TextView textView1 = (TextView)getView().findViewById(R.id.Notice);
textView1.setText("Record End!");
mr.stop();
mr.reset();
mr.release();
StartChange = 1;
R_Stoping.setAlpha(1.0f);
R_Playing.setAlpha(0.0f);
} catch (Exception e) {
e.printStackTrace();
}
}else {
 
mr.prepare();
mr.start();
StartChange = 0;
R_Stoping.setAlpha(0.0f);
R_Playing.setAlpha(1.0f);
} catch (Exception e) {
e.printStackTrace();
}
}
View
52
app/src/main/res/layout/fragment_maps.xml
tools:context=".fragment.MapsFragment"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />
 
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="548dp"
android:text="録音"
app:layout_constraintStart_toStartOf="@+id/map"
app:layout_constraintTop_toTopOf="@+id/map" />
 
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="83dp"
android:layout_height="65dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/map"
app:layout_constraintHorizontal_bias="0.35"
app:layout_constraintHorizontal_bias="0.362"
app:layout_constraintStart_toStartOf="@+id/map"
app:layout_constraintTop_toTopOf="@+id/map"
app:layout_constraintVertical_bias="0.915">
app:layout_constraintVertical_bias="0.902">
 
<Button
android:id="@+id/button2"
android:layout_width="52dp"
android:text="再生" />
 
<ImageView
android:id="@+id/Stoping"
android:layout_width="46dp"
android:layout_height="42dp"
android:layout_width="52dp"
android:layout_height="52dp"
android:src="@android:drawable/ic_media_play" />
 
<ImageView
android:id="@+id/Playing"
android:layout_width="45dp"
android:layout_height="40dp"
android:layout_width="52dp"
android:layout_height="52dp"
android:alpha="0"
android:src="@android:drawable/ic_media_pause" />
 
</FrameLayout>
app:layout_constraintStart_toStartOf="@+id/map"
app:layout_constraintTop_toTopOf="@+id/map"
app:layout_constraintVertical_bias="0.934" />
 
<FrameLayout
android:layout_width="83dp"
android:layout_height="65dp"
android:layout_marginStart="16dp"
android:layout_marginTop="544dp"
app:layout_constraintStart_toStartOf="@+id/map"
app:layout_constraintTop_toTopOf="@+id/map">
 
<Button
android:id="@+id/button"
android:layout_width="52dp"
android:layout_height="45dp"
android:alpha="0"
android:text="録音" />
 
<ImageView
android:id="@+id/R_Stoping"
android:layout_width="52dp"
android:layout_height="52dp"
app:srcCompat="@android:drawable/stat_notify_call_mute" />
 
<ImageView
android:id="@+id/R_Playing"
android:layout_width="52dp"
android:layout_height="52dp"
android:alpha="0"
app:srcCompat="@android:drawable/ic_btn_speak_now" />
 
</FrameLayout>
 
 
</androidx.constraintlayout.widget.ConstraintLayout>