Permalink
Browse files

stuff

  • Loading branch information...
1 parent b465036 commit 903b177a7e70a2ebe0a7ba04bacbd4e72cdd45f1 @jpblanco jpblanco committed Nov 11, 2011

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -23,11 +23,15 @@
public static final int icon=0x7f020009;
}
public static final class id {
- public static final int time=0x7f050000;
+ public static final int name=0x7f050002;
+ public static final int talk=0x7f050000;
+ public static final int talks=0x7f050003;
+ public static final int time=0x7f050001;
}
public static final class layout {
public static final int main=0x7f030000;
public static final int talk=0x7f030001;
+ public static final int talk_list=0x7f030002;
}
public static final class string {
public static final int app_name=0x7f040000;
Binary file not shown.
Binary file not shown.
@@ -4,12 +4,22 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
+ android:id="@+id/talk"
+ android:padding="6dip"
>
<TextView
android:id="@+id/time"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
-
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:textSize="35dip" >
</TextView>
+ <TextView
+ android:id="@+id/name"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:gravity="center_vertical"
+ android:textSize="15dip"
+ android:paddingLeft="10dip" >
+ </TextView>
</LinearLayout>
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <ListView android:id="@+id/talks"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ </ListView>
+</LinearLayout>
@@ -2,6 +2,7 @@
import android.app.Activity;
import android.os.Bundle;
+import android.widget.ListView;
import java.util.ArrayList;
import java.util.Date;
@@ -11,11 +12,17 @@
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ setContentView(R.layout.talk_list);
+
List<Talk> talks = new ArrayList<Talk>();
talks.add(new Talk(new Date(2011,11,11,9,0),new Date(2011,11,11,9,45),"lala"));
talks.add(new Talk(new Date(2011,11,11,9,45),new Date(2011,11,11,10,45),"lala2"));
+ ListView talks_list = (ListView) findViewById(R.id.talks);
+ talks_list.setAdapter(new TalkListAdapter(this, R.layout.talk, talks));
+
+
}
@@ -5,10 +5,14 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
+import android.widget.LinearLayout;
import android.widget.TextView;
+import java.util.Date;
import java.util.List;
+import static android.graphics.Color.parseColor;
+
public class TalkListAdapter extends ArrayAdapter<Talk> {
final Activity context;
@@ -26,13 +30,31 @@ public View getView(int position, View convertView, ViewGroup parent){
LayoutInflater vi = (LayoutInflater) LayoutInflater.from(context);
View view = vi.inflate(R.layout.talk, null, true);
- Talk issue = talks.get(position);
+ Talk talk = talks.get(position);
+
+
+
+ Date now = new Date(2011,11,11,9,20);
+
+ if(now.after(talk.getStart()) && now.before(talk.getEnd())){
+ LinearLayout talkLayout = (LinearLayout) view.findViewById(R.id.talk);
+ talkLayout.setBackgroundColor(parseColor("#aaaa00"));
+ }
+
+ TextView date = (TextView) view.findViewById(R.id.time);
+ String minutes = "";
+ if (talk.getStart().getMinutes() < 10){
+ minutes = "0" + talk.getStart().getMinutes();
+ }
+ else{
+ minutes = talk.getStart().getMinutes() + "";
+ }
+ date.setText(talk.getStart().getHours() + ":" + minutes);
+ //date.setText(talk.getStart().toLocaleString());
+
-// TextView issueKeyTextView = (TextView) view.findViewById(R.id.issue_key);
-// issueKeyTextView.setText(issue.getKey());
-//
-// TextView issueSummaryTextView = (TextView) view.findViewById(R.id.issue_summary);
-// issueSummaryTextView.setText(issue.getSummary());
+ TextView name = (TextView) view.findViewById(R.id.name);
+ name.setText(talk.getName());
return view;
}

0 comments on commit 903b177

Please sign in to comment.