Skip to content
Browse files

inga olästa ser tiden

  • Loading branch information...
1 parent f3484fd commit 2824efebecb46d79bcc46c6f337b212d585f5e11 @jonasgit jonasgit committed
View
7 res/layout/conflistconf.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView android:id="@+id/text1"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="16sp" />
+
View
20 res/layout/main.xml
@@ -1,7 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="10dp"
+ >
+<ListView
+ android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:padding="10dp"
- android:textSize="16sp" >
-</TextView>
+ />
+<TextView
+ android:id="@+id/android:empty"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:gravity="center"
+ android:text="@string/no_unreads"/>
+</LinearLayout>
View
2 res/values-sv/strings.xml
@@ -23,6 +23,8 @@
<string name="does_not_exist">" finns inte"</string>
<string name="no_presentation_error">Presentation saknas</string>
<string name="no_recipient_error">Ingen mottagare</string>
+ <string name="no_unreads">Inga olästa</string>
+ <string name="local_time">(lokal)</string>
<string name="login_name">Användarnamn:</string>
<string name="login_id">AnvändarID: (vid behov)</string>
View
4 res/values/strings.xml
@@ -23,7 +23,9 @@
<string name="does_not_exist">" does not exist"</string>
<string name="no_presentation_error">Presentation missing</string>
<string name="no_recipient_error">No such recipient</string>
-
+ <string name="no_unreads">Nothing to read</string>
+ <string name="local_time">(local)</string>
+
<string name="login_name">Username:</string>
<string name="login_id">UserID: (optional)</string>
<string name="login_password">Password:</string>
View
17 src/org/lindev/androkom/ConferenceList.java
@@ -1,5 +1,6 @@
package org.lindev.androkom;
+import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
@@ -9,6 +10,7 @@
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
+import android.text.format.DateFormat;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
@@ -37,10 +39,15 @@
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
-
+
+ // Use a custom layout file
+ setContentView(R.layout.main);
+
+ emptyview = (TextView) findViewById(android.R.id.empty);
+
mTimer = new Timer();
- mAdapter = new ArrayAdapter<ConferenceInfo>(this, R.layout.main);
+ mAdapter = new ArrayAdapter<ConferenceInfo>(this, R.layout.conflistconf);
setListAdapter(mAdapter);
ListView lv = getListView();
@@ -205,6 +212,11 @@ private void populateConferences()
if(mConferences!=null) {
Log.d(TAG, "mConferences is empty:"+mConferences.isEmpty());
}
+ String currentDateTimeString = new Date().toLocaleString();
+ emptyview.setText(getString(R.string.no_unreads)+"\n"+
+ currentDateTimeString+"\n"+
+ getString(R.string.local_time)
+ );
}
}
@@ -242,4 +254,5 @@ App getApp()
private List<ConferenceInfo> mConferences;
private ArrayAdapter<ConferenceInfo> mAdapter;
private Timer mTimer;
+ TextView emptyview;
}

0 comments on commit 2824efe

Please sign in to comment.
Something went wrong with that request. Please try again.