Feature: boton para actualizar eventos manualmente (v10.1.1)
This commit is contained in:
@@ -8,8 +8,8 @@ android {
|
||||
applicationId "com.streamplayer"
|
||||
minSdk 21
|
||||
targetSdk 35
|
||||
versionCode 100100
|
||||
versionName "10.1.0"
|
||||
versionCode 100101
|
||||
versionName "10.1.1"
|
||||
buildConfigField "String", "DEVICE_REGISTRY_URL", '"http://194.163.191.200:4000"'
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
@@ -32,6 +33,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
private ProgressBar loadingIndicator;
|
||||
private TextView messageView;
|
||||
private TextView contentTitle;
|
||||
private Button refreshButton;
|
||||
|
||||
private ChannelAdapter channelAdapter;
|
||||
private EventAdapter eventAdapter;
|
||||
@@ -57,6 +59,12 @@ public class MainActivity extends AppCompatActivity {
|
||||
loadingIndicator = findViewById(R.id.loading_indicator);
|
||||
messageView = findViewById(R.id.message_view);
|
||||
contentTitle = findViewById(R.id.content_title);
|
||||
refreshButton = findViewById(R.id.refresh_button);
|
||||
|
||||
refreshButton.setOnClickListener(v -> {
|
||||
loadEvents(true);
|
||||
Toast.makeText(this, "Actualizando eventos...", Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
|
||||
channelAdapter = new ChannelAdapter(
|
||||
channel -> openPlayer(channel.getName(), channel.getPageUrl()));
|
||||
@@ -158,6 +166,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private void showChannels(SectionEntry section) {
|
||||
contentTitle.setText(section.title);
|
||||
refreshButton.setVisibility(View.GONE);
|
||||
contentList.setLayoutManager(channelLayoutManager);
|
||||
contentList.setAdapter(channelAdapter);
|
||||
loadingIndicator.setVisibility(View.GONE);
|
||||
@@ -173,6 +182,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private void showEvents() {
|
||||
contentTitle.setText(currentSection != null ? currentSection.title : getString(R.string.section_events));
|
||||
refreshButton.setVisibility(View.VISIBLE);
|
||||
contentList.setLayoutManager(eventLayoutManager);
|
||||
contentList.setAdapter(eventAdapter);
|
||||
if (cachedEvents.isEmpty()) {
|
||||
|
||||
@@ -72,14 +72,34 @@
|
||||
app:layout_constraintStart_toEndOf="@id/divider"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_title"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Canales" />
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Canales" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/refresh_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="36dp"
|
||||
android:text="@string/action_refresh"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loading_indicator"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<string name="section_all_channels">Todos los canales</string>
|
||||
<string name="message_no_channels">No hay canales disponibles</string>
|
||||
<string name="message_no_events">No hay eventos disponibles</string>
|
||||
<string name="action_refresh">Actualizar</string>
|
||||
<string name="message_events_error">No se pudieron cargar los eventos: %1$s</string>
|
||||
<string name="update_required_title">Actualización obligatoria</string>
|
||||
<string name="update_available_title">Actualización disponible</string>
|
||||
|
||||
Reference in New Issue
Block a user