Add WebBiew for stream metadata infos + Divers Optimisation
This commit is contained in:
8
.idea/deploymentTargetSelector.xml
generated
8
.idea/deploymentTargetSelector.xml
generated
@@ -4,6 +4,14 @@
|
|||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="app">
|
<SelectionState runConfigName="app">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
<DropdownSelection timestamp="2025-04-28T21:33:49.827573896Z">
|
||||||
|
<Target type="DEFAULT_BOOT">
|
||||||
|
<handle>
|
||||||
|
<DeviceId pluginId="LocalEmulator" identifier="path=/home/sam/.android/avd/Galaxy_Nexus_API_33.avd" />
|
||||||
|
</handle>
|
||||||
|
</Target>
|
||||||
|
</DropdownSelection>
|
||||||
|
<DialogSelection />
|
||||||
</SelectionState>
|
</SelectionState>
|
||||||
</selectionStates>
|
</selectionStates>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ android {
|
|||||||
applicationId "fr.svpro.radiomercure"
|
applicationId "fr.svpro.radiomercure"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 222
|
versionCode 230
|
||||||
versionName '2.2.2'
|
versionName '2.3.0'
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@@ -50,14 +50,14 @@ dependencies {
|
|||||||
implementation 'com.google.android.material:material:1.12.0'
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.7'
|
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.9.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7'
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.0'
|
||||||
implementation 'androidx.navigation:navigation-fragment:2.8.9'
|
implementation 'androidx.navigation:navigation-fragment:2.9.0'
|
||||||
implementation 'androidx.navigation:navigation-ui:2.8.9'
|
implementation 'androidx.navigation:navigation-ui:2.9.0'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||||
implementation platform('com.google.firebase:firebase-bom:33.13.0')
|
implementation platform('com.google.firebase:firebase-bom:33.14.0')
|
||||||
implementation 'com.google.firebase:firebase-analytics:22.4.0'
|
implementation 'com.google.firebase:firebase-analytics:22.4.0'
|
||||||
implementation 'com.google.firebase:firebase-messaging:24.1.1'
|
implementation 'com.google.firebase:firebase-messaging:24.1.1'
|
||||||
}
|
}
|
||||||
@@ -51,11 +51,10 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
private WebView web;
|
private WebView web;
|
||||||
private String url, userAgent, contentDisposition, mimeType;
|
private String url, userAgent, contentDisposition, mimeType;
|
||||||
private Dialog dialog;
|
private Dialog dialog;
|
||||||
private ImageView iv_svpro, iv_navHeader;
|
private static final String versionName;
|
||||||
private TextView tv_close, tv_version;
|
|
||||||
private static String versionName;
|
|
||||||
private static final String NUMERO_TEL_RADIO = "+33375411456";
|
private static final String NUMERO_TEL_RADIO = "+33375411456";
|
||||||
private static final String URL_PLATEFORM = "https://podcast.radiomercure.fr"; //"https://www.radiomercure.fr/?playerbar-pageinicial";
|
private static final String URL_PLATEFORM = "https://podcast.radiomercure.fr"; //"https://www.radiomercure.fr/?playerbar-pageinicial";
|
||||||
|
private static final String URL_STREAMINFO = "https://podcast.radiomercure.fr/live/index.html";
|
||||||
private static final String URL_ADMIN = "https://podcast.radiomercure.fr/cp-admin";
|
private static final String URL_ADMIN = "https://podcast.radiomercure.fr/cp-admin";
|
||||||
private static final String URL_STREAM = "https://live.radiomercure.fr/on-air/live";
|
private static final String URL_STREAM = "https://live.radiomercure.fr/on-air/live";
|
||||||
private static final String URL_SVPRO = "https://samuel.vermeulen.pro";
|
private static final String URL_SVPRO = "https://samuel.vermeulen.pro";
|
||||||
@@ -66,11 +65,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
versionName = BuildConfig.VERSION_NAME;
|
versionName = BuildConfig.VERSION_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Navigation
|
|
||||||
private NavigationView navigationView;
|
|
||||||
private DrawerLayout drawerLayout;
|
private DrawerLayout drawerLayout;
|
||||||
private Toolbar toolbar;
|
private ValueCallback mUploadMessage;
|
||||||
private ValueCallback<Uri> mUploadMessage;
|
|
||||||
private final static int FILECHOOSER_RESULTCODE = 1;
|
private final static int FILECHOOSER_RESULTCODE = 1;
|
||||||
|
|
||||||
@SuppressLint({"SetJavaScriptEnabled", "WrongViewCast", "JavascriptInterface", "MissingInflatedId"})
|
@SuppressLint({"SetJavaScriptEnabled", "WrongViewCast", "JavascriptInterface", "MissingInflatedId"})
|
||||||
@@ -79,10 +75,13 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
createDialog();
|
createDialog();
|
||||||
|
|
||||||
//menu latéral
|
//menu latéral
|
||||||
navigationView = findViewById(R.id.navigation_drawer);
|
//Navigation
|
||||||
|
NavigationView navigationView = findViewById(R.id.navigation_drawer);
|
||||||
|
|
||||||
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
|
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
|
||||||
|
@SuppressLint("NonConstantResourceId")
|
||||||
@Override
|
@Override
|
||||||
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||||
|
|
||||||
@@ -148,7 +147,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//toolbar
|
//toolbar
|
||||||
toolbar = findViewById(R.id.toolBar);
|
Toolbar toolbar = findViewById(R.id.toolBar);
|
||||||
drawerLayout = findViewById(R.id.drawer_layout);
|
drawerLayout = findViewById(R.id.drawer_layout);
|
||||||
toolbar.setTitle("Radio Mercure");
|
toolbar.setTitle("Radio Mercure");
|
||||||
|
|
||||||
@@ -175,13 +174,15 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
AlertDialog alertDialog = dialogOptBattery.create();
|
AlertDialog alertDialog = dialogOptBattery.create();
|
||||||
|
|
||||||
PowerManager powerManager = (PowerManager) getApplicationContext().getSystemService(POWER_SERVICE);
|
PowerManager powerManager = (PowerManager) getApplicationContext().getSystemService(POWER_SERVICE);
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (!powerManager.isIgnoringBatteryOptimizations(getApplication().getPackageName())) {
|
||||||
|
alertDialog.show();
|
||||||
if (!powerManager.isIgnoringBatteryOptimizations(getApplication().getPackageName())) {
|
|
||||||
alertDialog.show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------------------------//
|
//------------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
// WebView_top Stream info
|
||||||
|
WebView webViewTop = findViewById(R.id.wv_top);
|
||||||
|
webViewTop.getSettings().setJavaScriptEnabled(true);
|
||||||
|
webViewTop.loadUrl(URL_STREAMINFO);
|
||||||
|
|
||||||
//------WebBiew configuration-----------------------------------------------------------------//
|
//------WebBiew configuration-----------------------------------------------------------------//
|
||||||
web = findViewById(R.id.wv);
|
web = findViewById(R.id.wv);
|
||||||
@@ -261,6 +262,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NonConstantResourceId")
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
switch (id) {
|
switch (id) {
|
||||||
@@ -294,16 +296,17 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
private void createDialog()
|
private void createDialog()
|
||||||
{
|
{
|
||||||
dialog=new Dialog(this);
|
dialog=new Dialog(this);
|
||||||
dialog.setTitle(R.string.dialog_about_titre);
|
dialog.setTitle(R.string.dialog_about_titre);
|
||||||
dialog.setContentView(R.layout.about_dialog);
|
dialog.setContentView(R.layout.about_dialog);
|
||||||
|
|
||||||
tv_close= (TextView) dialog.findViewById(R.id.tv_close);
|
TextView tv_close = (TextView) dialog.findViewById(R.id.tv_close);
|
||||||
tv_version = (TextView) dialog.findViewById(R.id.tv_version);
|
TextView tv_version = (TextView) dialog.findViewById(R.id.tv_version);
|
||||||
iv_navHeader = (ImageView) dialog.findViewById(R.id.iv_navHeader);
|
ImageView iv_navHeader = (ImageView) dialog.findViewById(R.id.iv_navHeader);
|
||||||
iv_svpro = (ImageView) dialog.findViewById(R.id.iv_svpro);
|
ImageView iv_svpro = (ImageView) dialog.findViewById(R.id.iv_svpro);
|
||||||
tv_close.setOnClickListener(v -> dialog.dismiss());
|
tv_close.setOnClickListener(v -> dialog.dismiss());
|
||||||
tv_version.setText(getString(R.string.app_version) + versionName);
|
tv_version.setText(getString(R.string.app_version) + versionName);
|
||||||
|
|
||||||
|
|||||||
@@ -30,12 +30,20 @@
|
|||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<WebView
|
<WebView
|
||||||
android:id="@+id/wv"
|
android:id="@+id/wv_top"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="55dp">
|
android:layout_marginTop="55dp">
|
||||||
|
|
||||||
</WebView>
|
</WebView>
|
||||||
|
|
||||||
|
<WebView
|
||||||
|
android:id="@+id/wv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="175dp">
|
||||||
|
|
||||||
|
</WebView>
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
<com.google.android.material.navigation.NavigationView
|
<com.google.android.material.navigation.NavigationView
|
||||||
android:id="@+id/navigation_drawer"
|
android:id="@+id/navigation_drawer"
|
||||||
|
|||||||
Reference in New Issue
Block a user