commit fad4093f772369c977e6b849b03b3d82cda7e57c
parent d8df64f1cf47a80dfdae5a84817ba2f02f53cd0e
Author: Jan Dankert <devnull@localhost>
Date: Wed, 10 Oct 2012 00:05:59 +0200
Theme setzen.
Diffstat:
4 files changed, 64 insertions(+), 37 deletions(-)
diff --git a/src/de/mtbnews/android/CreateTopicActivity.java b/src/de/mtbnews/android/CreateTopicActivity.java
@@ -24,8 +24,11 @@ public class CreateTopicActivity extends Activity
@Override
protected void onCreate(Bundle savedInstanceState)
{
- setContentView(R.layout.post);
super.onCreate(savedInstanceState);
+
+ setTheme(((IBCApplication) getApplication()).themeResId);
+ setContentView(R.layout.post);
+
prefs = PreferenceManager.getDefaultSharedPreferences(this);
forumId = getIntent().getStringExtra("forum_id");
diff --git a/src/de/mtbnews/android/ForumOverviewActivity.java b/src/de/mtbnews/android/ForumOverviewActivity.java
@@ -45,7 +45,8 @@ public class ForumOverviewActivity extends ExpandableListActivity
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
-
+
+ setTheme(((IBCApplication) getApplication()).themeResId);
setContentView(R.layout.exp_listing);
prefs = PreferenceManager.getDefaultSharedPreferences(this);
@@ -86,8 +87,7 @@ public class ForumOverviewActivity extends ExpandableListActivity
private void loadForum()
{
- client = ((IBCApplication) getApplication())
- .getTapatalkClient();
+ client = ((IBCApplication) getApplication()).getTapatalkClient();
new ServerAsyncTask(this, R.string.waitingfor_forum)
{
@@ -95,6 +95,8 @@ public class ForumOverviewActivity extends ExpandableListActivity
@Override
protected void callServer() throws TapatalkException
{
+ forumList = ((IBCApplication) getApplication()).getForumList();
+
// Forumliste nur laden, wenn noch nicht vorhanden.
if (forumList == null)
{
@@ -105,8 +107,9 @@ public class ForumOverviewActivity extends ExpandableListActivity
.getString("password", ""));
forumList = client.getAllForum();
+ ((IBCApplication) getApplication()).setForumList(forumList);
+
unterforenFlachkloppen();
-
}
}
@@ -137,42 +140,56 @@ public class ForumOverviewActivity extends ExpandableListActivity
}
else if (!TextUtils.isEmpty(forum.url))
{
- if (!Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())) {
+ if (!Intent.ACTION_CREATE_SHORTCUT.equals(getIntent()
+ .getAction()))
+ {
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse(forum.url)));
- }
+ }
}
else
{
- if (Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())) {
+ if (Intent.ACTION_CREATE_SHORTCUT.equals(getIntent()
+ .getAction()))
+ {
- Intent shortcutIntent = new Intent(
+ Intent shortcutIntent = new Intent(
ForumOverviewActivity.this, ForumActivity.class);
-// Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
-// shortcutIntent.setClassName(ForumActivity.class.getPackage().getName(), "." + ForumActivity.class.getSimpleName());
-// shortcutIntent.setClassName(ForumActivity.class.getPackage().getName(), ForumActivity.class.getName());
- shortcutIntent.putExtra("forum_id", forum.getId());
-
- // Then, set up the container intent (the response to the caller)
-
- Intent intent = new Intent();
- intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
- intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, forum.getTitle());
- Parcelable iconResource = Intent.ShortcutIconResource.fromContext(
- ForumOverviewActivity.this, R.drawable.ibc_icon);
- intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
-
- // Now, return the result to the launcher
-
- setResult(RESULT_OK, intent);
- finish();
-
- } else {
+ // Intent shortcutIntent = new
+ // Intent(Intent.ACTION_MAIN);
+ // shortcutIntent.setClassName(ForumActivity.class.getPackage().getName(),
+ // "." + ForumActivity.class.getSimpleName());
+ // shortcutIntent.setClassName(ForumActivity.class.getPackage().getName(),
+ // ForumActivity.class.getName());
+ shortcutIntent.putExtra("forum_id", forum.getId());
+
+ // Then, set up the container intent (the response to
+ // the caller)
+
+ Intent intent = new Intent();
+ intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT,
+ shortcutIntent);
+ intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, forum
+ .getTitle());
+ Parcelable iconResource = Intent.ShortcutIconResource
+ .fromContext(ForumOverviewActivity.this,
+ R.drawable.ibc_icon);
+ intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
+ iconResource);
+
+ // Now, return the result to the launcher
+
+ setResult(RESULT_OK, intent);
+ finish();
+
+ }
+ else
+ {
final Intent intent = new Intent(
ForumOverviewActivity.this, ForumActivity.class);
intent.putExtra("forum_id", forum.getId());
startActivity(intent);
- }
+ }
}
return true;
}
@@ -217,6 +234,7 @@ public class ForumOverviewActivity extends ExpandableListActivity
/**
* {@inheritDoc}
+ *
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
*/
public boolean onOptionsItemSelected(MenuItem item)
@@ -260,7 +278,7 @@ public class ForumOverviewActivity extends ExpandableListActivity
case R.id.menu_logout:
logout();
-
+
// Forum-Übersicht neu laden.
forumList = null;
loadForum();
diff --git a/src/de/mtbnews/android/ReplyMailActivity.java b/src/de/mtbnews/android/ReplyMailActivity.java
@@ -23,9 +23,13 @@ public class ReplyMailActivity extends Activity
@Override
protected void onCreate(Bundle savedInstanceState)
{
+ super.onCreate(savedInstanceState);
+
client = ((IBCApplication) getApplication()).getTapatalkClient();
+
+ setTheme(((IBCApplication) getApplication()).themeResId);
setContentView(R.layout.post);
- super.onCreate(savedInstanceState);
+
final TextView recipient = (TextView) findViewById(R.id.recipient);
final TextView subject = (TextView) findViewById(R.id.subject);
diff --git a/src/de/mtbnews/android/TopicActivity.java b/src/de/mtbnews/android/TopicActivity.java
@@ -14,7 +14,6 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
-import android.widget.BaseAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.Toast;
@@ -46,14 +45,16 @@ public class TopicActivity extends EndlessListActivity<Post>
@Override
protected void onCreate(Bundle savedInstanceState)
{
- client = ((IBCApplication) getApplication()).getTapatalkClient();
super.onCreate(savedInstanceState);
+
+ setTheme(((IBCApplication) getApplication()).themeResId);
+ setContentView(R.layout.listing);
+
+ client = ((IBCApplication) getApplication()).getTapatalkClient();
topicId = TopicActivity.this.getIntent().getStringExtra(TOPIC_ID);
// forumId = TopicActivity.this.getIntent().getStringExtra("forum_id");
- setContentView(R.layout.listing);
-
ListAdapter adapter = new ListEntryContentAdapter(TopicActivity.this,
entries, true, false);
setListAdapter(adapter);
@@ -62,6 +63,7 @@ public class TopicActivity extends EndlessListActivity<Post>
final ListView list = getListView();
+ /*
list.setOnItemClickListener(new OnItemClickListener()
{
@Override
@@ -77,7 +79,7 @@ public class TopicActivity extends EndlessListActivity<Post>
// intent.putExtra("itemid", position);
// startActivity(intent);
}
- });
+ });*/
}
@Override