Archived
Added a layout shown when no events are available.
This commit is contained in:
1 parent
dedc927bb7
commit
f3dadacd4e
6 files changed
+48
-8
No files matched your search
@@ -1,8 +1,5 @@
|
||||
Prioriteringer fra 0-100.
|
||||
|
||||
Før lansering:
|
||||
[0] Dersom ingen billetter tilgjengelig for online kjøp, si ifra om dette.
|
||||
|
||||
Etter:
|
||||
[0] Ha med link til FB-event.
|
||||
[5] Åpningstidene er snodig plassert på større skjermer. Midtstille?
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingRight="30dp"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitCenter"
|
||||
android:adjustViewBounds="true"
|
||||
android:paddingBottom="10dp"
|
||||
android:src="@drawable/piggies" />
|
||||
|
||||
<TextView android:id="@+id/event_list_empty_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
@@ -20,4 +20,7 @@
|
||||
<string name="GB">Glassbaren</string>
|
||||
<string name="billettluka">Billettluka</string>
|
||||
<string name="event_image">Event-bilde</string>
|
||||
<string name="empty"/>
|
||||
<string name="no_events">Vi har ingen planlagte arrangementer akkurat nå. Prøv igjen senere. </string>
|
||||
<string name="no_ticket_events">Vi har ingen billetter liggende ute på Billettservice. Alle billetter kan kjøpes i billettluka.</string>
|
||||
</resources>
|
||||
@@ -127,15 +127,20 @@ public abstract class BaseListActivity extends BaseDnsActivity {
|
||||
if (result) {
|
||||
ListView list = (ListView)findViewById(idList);
|
||||
T[] objects = getObjects();
|
||||
|
||||
Log.i("DNSapp", "Showing " + objects.length +" objects.");
|
||||
ListAdapter adapter = createAdapter(objects);
|
||||
list.setAdapter(adapter);
|
||||
list.setVisibility(View.VISIBLE);
|
||||
|
||||
ProgressBar pb = (ProgressBar)findViewById(idProgressBar);
|
||||
if (pb != null)
|
||||
pb.setVisibility(View.GONE);
|
||||
|
||||
Log.i("DNSapp", "Showing " + objects.length +" objects.");
|
||||
ListAdapter adapter = createAdapter(objects);
|
||||
if (adapter == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
list.setAdapter(adapter);
|
||||
list.setVisibility(View.VISIBLE);
|
||||
|
||||
} else {
|
||||
Toast toast = Toast.makeText(context, R.string.error_noconnection_noupdate, Toast.LENGTH_LONG);
|
||||
toast.show();
|
||||
|
||||
@@ -81,6 +81,19 @@ public class EventListActivity extends BaseListActivity {
|
||||
protected <T> ListAdapter createAdapter(T[] objects) {
|
||||
Event[] events = (Event[])objects;
|
||||
|
||||
if (events.length == 0) {
|
||||
setContentView(R.layout.event_list_empty);
|
||||
TextView text = (TextView)findViewById(R.id.event_list_empty_text);
|
||||
|
||||
// Fuck it:
|
||||
if (this instanceof EventListTicketsActivity) {
|
||||
text.setText(R.string.no_ticket_events);
|
||||
} else {
|
||||
text.setText(R.string.no_events);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
ListAdapter adapter = new ArrayAdapter<Event>(this, R.layout.event_list_row, R.id.event_list_row_text, events) {
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
Reference in new issue
Block a user