Browse Source

Maj about_dialog

pull/1/head
Samuel Vermeulen 7 months ago
parent
commit
afc78f0d9e
  1. 4
      app/src/main/java/fr/svpro/radiomercure/MainActivity.java
  2. 13
      app/src/main/res/layout/about_dialog.xml
  3. 1
      app/src/main/res/values/strings.xml

4
app/src/main/java/fr/svpro/radiomercure/MainActivity.java

@ -30,6 +30,8 @@ public class MainActivity extends AppCompatActivity {
private Menu menu;
private Dialog dialog;
private TextView tv_close;
private TextView tv_version;
private String versionName = BuildConfig.VERSION_NAME;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -86,7 +88,9 @@ public class MainActivity extends AppCompatActivity {
dialog.setContentView(R.layout.about_dialog);
tv_close= (TextView) dialog.findViewById(R.id.tv_close);
tv_version = (TextView) dialog.findViewById(R.id.tv_version);
tv_close.setOnClickListener(v -> dialog.dismiss());
tv_version.setText("RADIO MERCURE - Version " + versionName);
}

13
app/src/main/res/layout/about_dialog.xml

@ -14,8 +14,19 @@
android:padding="5dp"
app:srcCompat="@drawable/presentation_pstore" />
<TextView
android:id="@+id/tv_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="bold"
android:textAlignment="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/dialog_version" />
<ImageView
android:id="@+id/imageView"
android:id="@+id/iv_svpro"
android:layout_width="200dp"
android:layout_height="124dp"
android:layout_gravity="center_horizontal"

1
app/src/main/res/values/strings.xml

@ -4,4 +4,5 @@
<string name="menu_reload">Relancer...</string>
<string name="menu_about">A Propos...</string>
<string name="dialog_close">Fermer</string>
<string name="dialog_version">RADIO MERCURE - Version </string>
</resources>
Loading…
Cancel
Save