Merge remote-tracking branch 'origin/master'

This commit is contained in:
Samuel Vermeulen 2023-02-02 19:24:52 +01:00
commit 973e9c619f
5 changed files with 21 additions and 17 deletions

View File

@ -44,12 +44,12 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

View File

@ -2,6 +2,7 @@ package fr.svpro.radiomercure;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DownloadManager;
@ -10,6 +11,8 @@ import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@ -27,6 +30,7 @@ import android.webkit.WebViewClient;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.ActionBarDrawerToggle;
@ -184,19 +188,18 @@ public class MainActivity extends AppCompatActivity {
web.getSettings().setAllowFileAccess(true);
web.getSettings().setAllowFileAccessFromFileURLs(true);
web.getSettings().setAllowUniversalAccessFromFileURLs(true);
web.getSettings().setAppCacheEnabled(true);
web.getSettings().setDatabaseEnabled(true);
web.getSettings().setDomStorageEnabled(true);
web.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
web.getSettings().setAppCachePath(web.getContext().getCacheDir().getAbsolutePath());
// web.getSettings().setAppCachePath(web.getContext().getCacheDir().getAbsolutePath());
web.getSettings().setUseWideViewPort(true);
web.getSettings().setLoadWithOverviewMode(true);
web.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
web.getSettings().setAllowFileAccessFromFileURLs(true);
//Log.w("AGENT", web.getSettings().getUserAgentString());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
web.getSettings().setAllowFileAccessFromFileURLs(true);
}
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
// web.getSettings().setAllowFileAccessFromFileURLs(true);
//}
web.loadUrl(URL_PLATEFORM);
web.setDownloadListener((url, userAgent, contentDisposition, mimeType, contentLength) -> {
@ -220,10 +223,10 @@ public class MainActivity extends AppCompatActivity {
}
/*public boolean onCreateOptionsMenu(Menu menuOpt) {
public boolean onCreateOptionsMenu(Menu menuOpt) {
getMenuInflater().inflate(R.menu.option,menuOpt);
return super.onCreateOptionsMenu(menuOpt);
}*/
}
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int id = item.getItemId();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -14,7 +14,7 @@
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
style="@style/Widget.Material3.AppBarLayout"
style="@style/Widget.Material3.DrawerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:pointerIcon="copy"
@ -48,6 +48,7 @@
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/white"
app:itemTextColor="#FF5722"
android:fitsSystemWindows="true"
app:headerLayout="@layout/drawer_header"
app:menu="@menu/menu_drawer">

View File

@ -1,16 +1,16 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.RadioMercure" parent="Theme.Material3.Light.NoActionBar">
<style name="Theme.RadioMercure" parent="Theme.Material3.Light">
<!-- Primary brand color. -->
<item name="colorPrimary">#FF5722</item>
<item name="colorPrimaryVariant">#FF5722</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorOnPrimary">#FF5722</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<item name="colorOnSecondary">#FF5722</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>