Permalink
Browse files

changed line length from 80 to 120 chars

  • Loading branch information...
1 parent c820fea commit 0f580e5dcd154f951b8633b0b5ae78100cb7813d @tbshobbits tbshobbits committed May 16, 2012
Showing with 385 additions and 683 deletions.
  1. +7 −12 src/de/tum/in/tumcampus/Cafeterias.java
  2. +10 −13 src/de/tum/in/tumcampus/Events.java
  3. +3 −5 src/de/tum/in/tumcampus/EventsDetails.java
  4. +8 −11 src/de/tum/in/tumcampus/Feeds.java
  5. +5 −7 src/de/tum/in/tumcampus/Gallery.java
  6. +2 −4 src/de/tum/in/tumcampus/GalleryDetails.java
  7. +7 −11 src/de/tum/in/tumcampus/Hours.java
  8. +13 −20 src/de/tum/in/tumcampus/Lectures.java
  9. +6 −9 src/de/tum/in/tumcampus/News.java
  10. +7 −10 src/de/tum/in/tumcampus/Plans.java
  11. +4 −6 src/de/tum/in/tumcampus/Settings.java
  12. +21 −37 src/de/tum/in/tumcampus/Transports.java
  13. +23 −43 src/de/tum/in/tumcampus/TumCampus.java
  14. +1 −2 src/de/tum/in/tumcampus/models/Cafeteria.java
  15. +8 −15 src/de/tum/in/tumcampus/models/CafeteriaManager.java
  16. +4 −6 src/de/tum/in/tumcampus/models/CafeteriaMenu.java
  17. +22 −40 src/de/tum/in/tumcampus/models/CafeteriaMenuManager.java
  18. +2 −2 src/de/tum/in/tumcampus/models/DatabaseManager.java
  19. +5 −7 src/de/tum/in/tumcampus/models/Event.java
  20. +27 −52 src/de/tum/in/tumcampus/models/EventManager.java
  21. +2 −4 src/de/tum/in/tumcampus/models/FeedItem.java
  22. +20 −38 src/de/tum/in/tumcampus/models/FeedItemManager.java
  23. +4 −8 src/de/tum/in/tumcampus/models/FeedManager.java
  24. +2 −3 src/de/tum/in/tumcampus/models/Gallery.java
  25. +12 −21 src/de/tum/in/tumcampus/models/GalleryManager.java
  26. +7 −12 src/de/tum/in/tumcampus/models/LectureItem.java
  27. +24 −50 src/de/tum/in/tumcampus/models/LectureItemManager.java
  28. +2 −4 src/de/tum/in/tumcampus/models/LectureManager.java
  29. +12 −24 src/de/tum/in/tumcampus/models/LinkManager.java
  30. +4 −7 src/de/tum/in/tumcampus/models/Location.java
  31. +8 −15 src/de/tum/in/tumcampus/models/LocationManager.java
  32. +2 −2 src/de/tum/in/tumcampus/models/News.java
  33. +21 −34 src/de/tum/in/tumcampus/models/NewsManager.java
  34. +3 −6 src/de/tum/in/tumcampus/models/SyncManager.java
  35. +12 −22 src/de/tum/in/tumcampus/models/TransportManager.java
  36. +17 −34 src/de/tum/in/tumcampus/models/Utils.java
  37. +10 −20 src/de/tum/in/tumcampus/services/DownloadService.java
  38. +15 −28 src/de/tum/in/tumcampus/services/ImportService.java
  39. +3 −3 src/de/tum/in/tumcampus/test/DebugTest.java
  40. +2 −4 src/de/tum/in/tumcampus/test/EventsTest.java
  41. +2 −4 src/de/tum/in/tumcampus/test/FeedsTest.java
  42. +4 −7 src/de/tum/in/tumcampus/test/ImportTest.java
  43. +6 −9 src/de/tum/in/tumcampus/test/InterfacesTest.java
  44. +3 −6 src/de/tum/in/tumcampus/test/LecturesTest.java
  45. +1 −2 src/de/tum/in/tumcampus/test/NewsTest.java
  46. +2 −4 src/de/tum/in/tumcampus/test/SilenceTest.java
@@ -78,15 +78,13 @@ public void onCreate(Bundle savedInstanceState) {
}
// initialize listview footer for opening hours
- footer = getLayoutInflater().inflate(
- android.R.layout.two_line_list_item, null, false);
+ footer = getLayoutInflater().inflate(android.R.layout.two_line_list_item, null, false);
ListView lv3 = (ListView) findViewById(R.id.listView3);
lv3.addFooterView(footer);
// get toast feedback and resume activity
- registerReceiver(DownloadService.receiver, new IntentFilter(
- DownloadService.broadcast));
+ registerReceiver(DownloadService.receiver, new IntentFilter(DownloadService.broadcast));
}
@Override
@@ -105,9 +103,8 @@ protected void onResume() {
CafeteriaManager cm = new CafeteriaManager(this, Const.db);
Cursor c2 = cm.getAllFromDb("%" + filter + "%");
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
- android.R.layout.two_line_list_item, c2, c2.getColumnNames(),
- new int[] { android.R.id.text1, android.R.id.text2 });
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.two_line_list_item, c2,
+ c2.getColumnNames(), new int[] { android.R.id.text1, android.R.id.text2 });
ListView lv2 = (ListView) findViewById(R.id.listView2);
lv2.setAdapter(adapter);
@@ -117,8 +114,7 @@ protected void onResume() {
CafeteriaMenuManager cmm = new CafeteriaMenuManager(this, Const.db);
Cursor c = cmm.getDatesFromDb();
- adapter = new SimpleCursorAdapter(this,
- android.R.layout.simple_list_item_1, c, c.getColumnNames(),
+ adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, c, c.getColumnNames(),
new int[] { android.R.id.text1 });
ListView lv = (ListView) findViewById(R.id.listView);
@@ -176,9 +172,8 @@ public void onItemClick(AdapterView<?> av, View v, int position, long id) {
}
// no onclick for items, no separator line
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
- android.R.layout.two_line_list_item, c, c.getColumnNames(),
- new int[] { android.R.id.text1, android.R.id.text2 }) {
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.two_line_list_item, c,
+ c.getColumnNames(), new int[] { android.R.id.text1, android.R.id.text2 }) {
@Override
public boolean areAllItemsEnabled() {
@@ -30,8 +30,7 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.events);
// get toast feedback and resume activity
- registerReceiver(DownloadService.receiver, new IntentFilter(
- DownloadService.broadcast));
+ registerReceiver(DownloadService.receiver, new IntentFilter(DownloadService.broadcast));
}
@Override
@@ -48,9 +47,9 @@ protected void onResume() {
EventManager em = new EventManager(this, Const.db);
Cursor c = em.getNextFromDb();
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
- R.layout.events_listview, c, c.getColumnNames(), new int[] {
- R.id.icon, R.id.name, R.id.infos });
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.events_listview, c, c.getColumnNames(),
+ new int[] { R.id.icon, R.id.name, R.id.infos });
+
adapter.setViewBinder(this);
ListView lv = (ListView) findViewById(R.id.listView);
@@ -64,10 +63,9 @@ public void onDrawerOpened() {
// get past events from database
EventManager em = new EventManager(Events.this, Const.db);
Cursor c = em.getPastFromDb();
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(
- Events.this, R.layout.events_listview, c, c
- .getColumnNames(), new int[] { R.id.icon,
- R.id.name, R.id.infos });
+
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(Events.this, R.layout.events_listview, c, c
+ .getColumnNames(), new int[] { R.id.icon, R.id.name, R.id.infos });
adapter.setViewBinder(Events.this);
ListView lv2 = (ListView) findViewById(R.id.listView2);
@@ -104,10 +102,9 @@ public boolean setViewValue(View view, Cursor c, int index) {
String[] weekDays = "So,Mo,Di,Mi,Do,Fr,Sa".split(",");
TextView infos = (TextView) view;
- infos.setText(weekDays[c.getInt(c.getColumnIndex("weekday"))]
- + ", " + c.getString(c.getColumnIndex("start_de")) + " - "
- + c.getString(c.getColumnIndex("end_de")) + "\n"
- + c.getString(c.getColumnIndex("location")));
+ infos.setText(weekDays[c.getInt(c.getColumnIndex("weekday"))] + ", "
+ + c.getString(c.getColumnIndex("start_de")) + " - " + c.getString(c.getColumnIndex("end_de"))
+ + "\n" + c.getString(c.getColumnIndex("location")));
return true;
}
return false;
@@ -41,9 +41,8 @@ public void onCreate(Bundle savedInstanceState) {
* Link
* </pre>
*/
- String infos = weekDays[c.getInt(c.getColumnIndex("weekday"))];
- infos += ", " + c.getString(c.getColumnIndex("start_de")) + " - "
- + c.getString(c.getColumnIndex("end_de")) + "\n";
+ String infos = weekDays[c.getInt(c.getColumnIndex("weekday"))] + ", ";
+ infos += c.getString(c.getColumnIndex("start_de")) + " - " + c.getString(c.getColumnIndex("end_de")) + "\n";
infos += c.getString(c.getColumnIndex("location")) + "\n";
infos += c.getString(c.getColumnIndex("link"));
@@ -55,7 +54,6 @@ public void onCreate(Bundle savedInstanceState) {
ImageView iv = (ImageView) findViewById(R.id.image);
Bitmap b = BitmapFactory.decodeFile(image);
- iv.setImageBitmap(Bitmap.createScaledBitmap(b, 360,
- (b.getHeight() * 360) / b.getWidth(), true));
+ iv.setImageBitmap(Bitmap.createScaledBitmap(b, 360, (b.getHeight() * 360) / b.getWidth(), true));
}
}
@@ -30,8 +30,8 @@
/**
* Activity to show RSS-feeds and their news items
*/
-public class Feeds extends Activity implements OnItemClickListener, ViewBinder,
- OnItemLongClickListener, View.OnClickListener {
+public class Feeds extends Activity implements OnItemClickListener, ViewBinder, OnItemLongClickListener,
+ View.OnClickListener {
/**
* Current selected feed (ID)
@@ -62,13 +62,11 @@ public void onCreate(Bundle savedInstanceState) {
FeedManager fm = new FeedManager(this, Const.db);
Cursor c = fm.getAllFromDb();
- adapter = new SimpleCursorAdapter(this,
- android.R.layout.simple_list_item_1, c, c.getColumnNames(),
+ adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, c, c.getColumnNames(),
new int[] { android.R.id.text1 });
// add a footer to the list for adding new feeds
- View view = getLayoutInflater().inflate(R.layout.feeds_footer, null,
- false);
+ View view = getLayoutInflater().inflate(R.layout.feeds_footer, null, false);
ListView lv = (ListView) findViewById(R.id.listView);
lv.addFooterView(view);
@@ -134,9 +132,8 @@ public void onItemClick(AdapterView<?> av, View v, int position, long id) {
FeedItemManager fim = new FeedItemManager(this, Const.db);
Cursor c2 = fim.getAllFromDb(feedId);
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
- R.layout.feeds_listview, c2, c2.getColumnNames(), new int[] {
- R.id.icon, R.id.title, R.id.description });
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.feeds_listview, c2, c2.getColumnNames(),
+ new int[] { R.id.icon, R.id.title, R.id.description });
adapter.setViewBinder(this);
ListView lv2 = (ListView) findViewById(R.id.listView2);
@@ -158,14 +155,14 @@ public boolean setViewValue(View view, Cursor cursor, int index) {
}
@Override
- public boolean onItemLongClick(final AdapterView<?> av, View v,
- final int position, long id) {
+ public boolean onItemLongClick(final AdapterView<?> av, View v, final int position, long id) {
if (id == -1) {
return false;
}
// confirm delete
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
+
@Override
public void onClick(DialogInterface dialog, int id) {
@@ -28,8 +28,7 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.gallery);
// get toast feedback and resume activity
- registerReceiver(DownloadService.receiver, new IntentFilter(
- DownloadService.broadcast));
+ registerReceiver(DownloadService.receiver, new IntentFilter(DownloadService.broadcast));
}
@Override
@@ -46,8 +45,7 @@ protected void onResume() {
GalleryManager gm = new GalleryManager(this, Const.db);
Cursor c = gm.getFromDb();
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
- R.layout.gallery_image, c, c.getColumnNames(),
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.gallery_image, c, c.getColumnNames(),
new int[] { R.id.image });
GridView gridview = (GridView) findViewById(R.id.gridview);
@@ -61,9 +59,9 @@ protected void onResume() {
public void onDrawerOpened() {
GalleryManager gm = new GalleryManager(Gallery.this, Const.db);
Cursor c = gm.getFromDbArchive();
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(
- Gallery.this, R.layout.gallery_image, c, c
- .getColumnNames(), new int[] { R.id.image });
+
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(Gallery.this, R.layout.gallery_image, c, c
+ .getColumnNames(), new int[] { R.id.image });
GridView gridview2 = (GridView) findViewById(R.id.gridview2);
gridview2.setAdapter(adapter);
@@ -36,9 +36,7 @@ public void onCreate(Bundle savedInstanceState) {
browser.getSettings().setBuiltInZoomControls(true);
browser.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR);
- String data = "<body style='margin:0px;'><img src='" + image
- + "'/></body>";
- browser.loadDataWithBaseURL("file:///android_asset/", data,
- "text/html", "UTF-8", null);
+ String data = "<body style='margin:0px;'><img src='" + image + "'/></body>";
+ browser.loadDataWithBaseURL("file:///android_asset/", data, "text/html", "UTF-8", null);
}
}
@@ -22,13 +22,11 @@
*/
public class Hours extends Activity implements OnItemClickListener, ViewBinder {
- private String[] names = new String[] { "Bibliotheken", "Information",
- "Mensa Garching", "Mensa Großhadern", "Mensa Innenstadt",
- "Mensa Pasing", "Mensa Weihenstephan" };
+ private String[] names = new String[] { "Bibliotheken", "Information", "Mensa Garching", "Mensa Großhadern",
+ "Mensa Innenstadt", "Mensa Pasing", "Mensa Weihenstephan" };
- private String[] categories = new String[] { "library", "info",
- "cafeteria_gar", "cafeteria_grh", "cafeteria", "cafeteria_pas",
- "cafeteria_wst" };
+ private String[] categories = new String[] { "library", "info", "cafeteria_gar", "cafeteria_grh", "cafeteria",
+ "cafeteria_pas", "cafeteria_wst" };
private static int position = -1;
@@ -39,8 +37,7 @@ public void onCreate(Bundle savedInstanceState) {
// show all categories
ListView lv = (ListView) findViewById(R.id.listView);
- lv.setAdapter(new ArrayAdapter<String>(this,
- android.R.layout.simple_list_item_1, names));
+ lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, names));
lv.setOnItemClickListener(this);
if (position == -1) {
@@ -73,9 +70,8 @@ public void onItemClick(AdapterView<?> av, View v, int pos, long id) {
LocationManager lm = new LocationManager(this, Const.db);
Cursor c = lm.getAllHoursFromDb(categories[position]);
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
- android.R.layout.two_line_list_item, c, c.getColumnNames(),
- new int[] { android.R.id.text1, android.R.id.text2 }) {
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.two_line_list_item, c,
+ c.getColumnNames(), new int[] { android.R.id.text1, android.R.id.text2 }) {
@Override
public boolean isEnabled(int position) {
@@ -26,8 +26,7 @@
/**
* Activity to show lectures and lecture units
*/
-public class Lectures extends Activity implements OnItemClickListener,
- OnItemLongClickListener, ViewBinder {
+public class Lectures extends Activity implements OnItemClickListener, OnItemLongClickListener, ViewBinder {
/**
* Current lecture selected
@@ -48,9 +47,9 @@ public void onCreate(Bundle savedInstanceState) {
LectureItemManager lim = new LectureItemManager(this);
Cursor c = lim.getRecentFromDb();
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
- android.R.layout.two_line_list_item, c, c.getColumnNames(),
- new int[] { android.R.id.text1, android.R.id.text2 });
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.two_line_list_item, c,
+ c.getColumnNames(), new int[] { android.R.id.text1, android.R.id.text2 });
+
adapter.setViewBinder(this);
ListView lv = (ListView) findViewById(R.id.listView);
@@ -62,9 +61,9 @@ public void onCreate(Bundle savedInstanceState) {
LectureManager lm = new LectureManager(this, Const.db);
Cursor c2 = lm.getAllFromDb();
- SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,
- android.R.layout.simple_list_item_1, c2, c2.getColumnNames(),
- new int[] { android.R.id.text1 });
+ SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, c2,
+ c2.getColumnNames(), new int[] { android.R.id.text1 });
+
adapter2.setViewBinder(new ViewBinder() {
@Override
@@ -120,17 +119,15 @@ public boolean setViewValue(View view, Cursor c, int index) {
String lectureId = c.getString(c.getColumnIndex("lectureId"));
if (lectureId.equals("vacation")) {
- info = c.getString(c.getColumnIndex("start_dt")) + " - "
- + c.getString(c.getColumnIndex("end_dt"));
+ info = c.getString(c.getColumnIndex("start_dt")) + " - " + c.getString(c.getColumnIndex("end_dt"));
} else if (lectureId.equals("holiday")) {
info = weekDays[c.getInt(c.getColumnIndex("weekday"))] + ", "
+ c.getString(c.getColumnIndex("start_dt"));
} else {
info = weekDays[c.getInt(c.getColumnIndex("weekday"))] + ", "
- + c.getString(c.getColumnIndex("start_de")) + " - "
- + c.getString(c.getColumnIndex("end_de"));
+ + c.getString(c.getColumnIndex("start_de")) + " - " + c.getString(c.getColumnIndex("end_de"));
String location = c.getString(c.getColumnIndex("location"));
if (location.indexOf(",") != -1) {
@@ -170,12 +167,10 @@ public void onItemClick(AdapterView<?> av, View v, int position, long id) {
tv.setText(Utils.trunc(name + ":", 35));
// Link to lecture module homepage (e.g. contains ECTS)
- String moduleUrl = "https://drehscheibe.in.tum.de/myintum/kurs_verwaltung/cm.html.de?id="
- + module;
+ String moduleUrl = "https://drehscheibe.in.tum.de/myintum/kurs_verwaltung/cm.html.de?id=" + module;
TextView tv2 = (TextView) findViewById(R.id.moduleText);
- tv2.setText(Html.fromHtml("<a href='" + moduleUrl + "'>" + module
- + "</a>"));
+ tv2.setText(Html.fromHtml("<a href='" + moduleUrl + "'>" + module + "</a>"));
tv2.setMovementMethod(LinkMovementMethod.getInstance());
return;
}
@@ -193,8 +188,7 @@ public void onItemClick(AdapterView<?> av, View v, int position, long id) {
// 1593 = WS2011/12
if (url.length() == 0) {
url = "https://campus.tum.de/tumonline/wbSuche.LVSucheSimple?"
- + "pLVNrFlag=J&pSjNr=1593&pSemester=A&pSuchbegriff="
- + c.getString(c.getColumnIndex("lectureId"));
+ + "pLVNrFlag=J&pSjNr=1593&pSemester=A&pSuchbegriff=" + c.getString(c.getColumnIndex("lectureId"));
}
// Connection to browser
@@ -264,8 +258,7 @@ public void deleteLecture(String itemId) {
}
@Override
- public boolean onItemLongClick(final AdapterView<?> av, View v,
- final int position, long id) {
+ public boolean onItemLongClick(final AdapterView<?> av, View v, final int position, long id) {
// confirm deleting lectures or lecture units
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
@@ -31,8 +31,7 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.news);
// get toast feedback and resume activity
- registerReceiver(DownloadService.receiver, new IntentFilter(
- DownloadService.broadcast));
+ registerReceiver(DownloadService.receiver, new IntentFilter(DownloadService.broadcast));
}
@Override
@@ -49,9 +48,9 @@ protected void onResume() {
NewsManager nm = new NewsManager(this, Const.db);
Cursor c = nm.getAllFromDb();
- SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
- R.layout.news_listview, c, c.getColumnNames(), new int[] {
- R.id.image, R.id.message, R.id.date });
+ SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.news_listview, c, c.getColumnNames(),
+ new int[] { R.id.image, R.id.message, R.id.date });
+
adapter.setViewBinder(this);
ListView lv = (ListView) findViewById(R.id.listView);
@@ -63,15 +62,13 @@ protected void onResume() {
}
@Override
- public void onItemClick(AdapterView<?> aview, View view, int position,
- long id) {
+ public void onItemClick(AdapterView<?> aview, View view, int position, long id) {
ListView lv = (ListView) findViewById(R.id.listView);
Cursor c = (Cursor) lv.getAdapter().getItem(position);
String url = c.getString(c.getColumnIndex("link"));
if (url.length() == 0) {
- Toast.makeText(this, "Kein Link vorhanden.", Toast.LENGTH_LONG)
- .show();
+ Toast.makeText(this, "Kein Link vorhanden.", Toast.LENGTH_LONG).show();
return;
}
Oops, something went wrong.

0 comments on commit 0f580e5

Please sign in to comment.