Improved UI (ListeningActivity) working fine "in-app" but not outside

This commit is contained in:
Mathieu 2021-10-14 22:02:42 +02:00
parent ade68294c1
commit d488d4e975
5 changed files with 48 additions and 8 deletions

View File

@ -22,11 +22,8 @@
android:enabled="true" android:enabled="true"
android:exported="false"/> android:exported="false"/>
<activity <activity android:name=".ListeningActivity"
android:name=".ListeningActivity" android:theme="@style/Theme.Transparent" />
android:exported="true"
android:label="Listening"
android:theme="@style/Theme.AppCompat.Transparent.NoActionBar"/>
<activity android:name=".Main" <activity android:name=".Main"
android:exported="false"> android:exported="false">

View File

@ -3,6 +3,7 @@ package ch.mathieubroillet.jarvis.android;
import android.app.KeyguardManager; import android.app.KeyguardManager;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
@ -30,4 +31,8 @@ public class ListeningActivity extends AppCompatActivity {
setContentView(R.layout.activity_listening); setContentView(R.layout.activity_listening);
} }
public void quit(View view) {
finish();
}
} }

View File

@ -3,13 +3,29 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayout" android:id="@+id/RelativeLayout"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:background="#66000000" android:background="#66000000"
tools:context="ch.mathieubroillet.jarvis.android.ListeningActivity"> tools:context="ch.mathieubroillet.jarvis.android.ListeningActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/button_quit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="300dp"
android:fontFamily="@font/google_bold"
android:alpha="0"
android:onClick="quit"
android:text="" />
</LinearLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="300dp"
@ -18,6 +34,17 @@
android:background="@drawable/rounded_white_on_top"> android:background="@drawable/rounded_white_on_top">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:fontFamily="@font/google_regular"
android:text="@string/listening"
android:textSize="30dp" />
<ProgressBar <ProgressBar
android:id="@+id/progressBar" android:id="@+id/progressBar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -27,5 +54,6 @@
android:layout_alignParentBottom="true" /> android:layout_alignParentBottom="true" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>

View File

@ -1,3 +1,4 @@
<resources> <resources>
<string name="app_name">Jarvis Client Android</string> <string name="app_name">Jarvis Client Android</string>
<string name="listening">Je vous écoute…</string>
</resources> </resources>

View File

@ -9,4 +9,13 @@
<item name="android:windowIsFloating">true</item> <item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item> <item name="android:backgroundDimEnabled">false</item>
</style> </style>
<style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="colorPrimaryDark">@android:color/transparent</item>
</style>
</resources> </resources>