android-ibc-forum

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit d8df64f1cf47a80dfdae5a84817ba2f02f53cd0e
parent 94a81eec7296653a626ea8fba02d6dd055ad034f
Author: Jan Dankert <devnull@localhost>
Date:   Wed, 10 Oct 2012 00:05:43 +0200

Methode 'isAutoScrolldown()' ├╝berschreiben.

Diffstat:
src/de/mtbnews/android/EndlessListActivity.java | 7++++++-
src/de/mtbnews/android/ForumActivity.java | 17++++++++++++++---
src/de/mtbnews/android/MailActivity.java | 10++++++++++
src/de/mtbnews/android/SearchActivity.java | 20++++++++++++++++----
src/de/mtbnews/android/SubscriptionTopicsActivity.java | 12+++++++++++-
5 files changed, 57 insertions(+), 9 deletions(-)

diff --git a/src/de/mtbnews/android/EndlessListActivity.java b/src/de/mtbnews/android/EndlessListActivity.java @@ -60,6 +60,11 @@ public abstract class EndlessListActivity<T> extends ListActivity */ protected abstract int getTotalSize(); + protected boolean isAutoScrolldown() + { + return prefs.getBoolean("scroll_down", false); + } + /** * Initiales Laden der ersten Listeneintr├Ąge. */ @@ -74,7 +79,7 @@ public abstract class EndlessListActivity<T> extends ListActivity else if (getIntent().getBooleanExtra(LAST_POST, false)) autoScrollDown = true; else - autoScrollDown = prefs.getBoolean("scroll_down", false); + autoScrollDown = isAutoScrolldown(); if (autoScrollDown) { diff --git a/src/de/mtbnews/android/ForumActivity.java b/src/de/mtbnews/android/ForumActivity.java @@ -49,17 +49,28 @@ public class ForumActivity extends EndlessListActivity<Topic> private TapatalkClient client; + /** + * Diese Liste immer von oben beginnen. + * + * @see de.mtbnews.android.EndlessListActivity#isAutoScrolldown() + */ + @Override + protected boolean isAutoScrolldown() + { + return false; + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + + setTheme(((IBCApplication) getApplication()).themeResId); setContentView(R.layout.listing); prefs = PreferenceManager.getDefaultSharedPreferences(this); - client = ((IBCApplication) getApplication()) - .getTapatalkClient(); + client = ((IBCApplication) getApplication()).getTapatalkClient(); if (!client.loggedIn && prefs.getBoolean("auto_login", false)) { diff --git a/src/de/mtbnews/android/MailActivity.java b/src/de/mtbnews/android/MailActivity.java @@ -28,6 +28,16 @@ public class MailActivity extends EndlessListActivity<Message> { private int totalMessageCount; private String boxId; + /** + * Diese Liste immer von oben beginnen. + * + * @see de.mtbnews.android.EndlessListActivity#isAutoScrolldown() + */ + @Override + protected boolean isAutoScrolldown() + { + return false; + } @Override protected void onCreate(Bundle savedInstanceState) diff --git a/src/de/mtbnews/android/SearchActivity.java b/src/de/mtbnews/android/SearchActivity.java @@ -3,8 +3,6 @@ */ package de.mtbnews.android; -import java.io.IOException; - import android.app.SearchManager; import android.content.Intent; import android.content.SharedPreferences; @@ -47,12 +45,25 @@ public class SearchActivity extends EndlessListActivity<Topic> private int searchType; private String username; + /** + * Diese Liste immer von oben beginnen. + * + * @see de.mtbnews.android.EndlessListActivity#isAutoScrolldown() + */ + @Override + protected boolean isAutoScrolldown() + { + return false; + } + @Override protected void onCreate(Bundle savedInstanceState) { - prefs = PreferenceManager.getDefaultSharedPreferences(this); super.onCreate(savedInstanceState); + setTheme(((IBCApplication) getApplication()).themeResId); + setContentView(R.layout.listing); + prefs = PreferenceManager.getDefaultSharedPreferences(this); username = prefs.getString("username", ""); @@ -174,7 +185,8 @@ public class SearchActivity extends EndlessListActivity<Topic> @Override protected void callServer() throws TapatalkException { - TapatalkClient client = ((IBCApplication) getApplication()).getTapatalkClient(); + TapatalkClient client = ((IBCApplication) getApplication()) + .getTapatalkClient(); search = client.searchTopics(searchType, query, username, from, to, searchId); diff --git a/src/de/mtbnews/android/SubscriptionTopicsActivity.java b/src/de/mtbnews/android/SubscriptionTopicsActivity.java @@ -38,13 +38,23 @@ public class SubscriptionTopicsActivity extends EndlessListActivity<Topic> { private int totalSize; private SharedPreferences prefs; - + /** + * Diese Liste immer von oben beginnen. + * + * @see de.mtbnews.android.EndlessListActivity#isAutoScrolldown() + */ + @Override + protected boolean isAutoScrolldown() + { + return false; + } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); prefs = PreferenceManager.getDefaultSharedPreferences(this); + setTheme(((IBCApplication) getApplication()).themeResId); setContentView(R.layout.listing); ListAdapter adapter = new ListEntryContentAdapter(