android-ibc-forum

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

commit 91db3105351b29f95ff435b531dc1c89f5baae45
parent 859dba9dc7a57e90f056b7a02b6a13d7bbe2d040
Author: Jan Dankert <devnull@localhost>
Date:   Wed, 10 Oct 2012 01:00:25 +0200

In jeder Activity den Theme setzen.

Diffstat:
src/de/mtbnews/android/Configuration.java | 2+-
src/de/mtbnews/android/MailActivity.java | 1+
src/de/mtbnews/android/MailboxActivity.java | 67++++++++++++++++++++++++++++++++++++++++---------------------------
src/de/mtbnews/android/MessageActivity.java | 11+++--------
src/de/mtbnews/android/NewsDetailActivity.java | 6++++--
src/de/mtbnews/android/PhotoActivity.java | 1+
src/de/mtbnews/android/ReplyPostActivity.java | 4+++-
src/de/mtbnews/android/SubscriptionForenActivity.java | 3++-
8 files changed, 55 insertions(+), 40 deletions(-)

diff --git a/src/de/mtbnews/android/Configuration.java b/src/de/mtbnews/android/Configuration.java @@ -6,7 +6,6 @@ import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.os.Bundle; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; -import android.text.AndroidCharacter; import android.widget.Toast; import de.mtbnews.android.service.SubscriptionService; @@ -17,6 +16,7 @@ public class Configuration extends PreferenceActivity @Override protected void onCreate(Bundle savedInstanceState) { + setTheme(((IBCApplication) getApplication()).themeResId); prefs = PreferenceManager.getDefaultSharedPreferences(this); OnSharedPreferenceChangeListener listener = new SharedPreferences.OnSharedPreferenceChangeListener() diff --git a/src/de/mtbnews/android/MailActivity.java b/src/de/mtbnews/android/MailActivity.java @@ -42,6 +42,7 @@ public class MailActivity extends EndlessListActivity<Message> @Override protected void onCreate(Bundle savedInstanceState) { + setTheme(((IBCApplication) getApplication()).themeResId); setContentView(R.layout.listing); super.onCreate(savedInstanceState); diff --git a/src/de/mtbnews/android/MailboxActivity.java b/src/de/mtbnews/android/MailboxActivity.java @@ -32,9 +32,11 @@ public class MailboxActivity extends ListActivity @Override protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setTheme(((IBCApplication) getApplication()).themeResId); setContentView(R.layout.listing); - super.onCreate(savedInstanceState); prefs = PreferenceManager.getDefaultSharedPreferences(this); new ServerAsyncTask(this, R.string.waitingforcontent) @@ -75,35 +77,46 @@ public class MailboxActivity extends ListActivity int position, long id) { final Mailbox mailbox = mailboxList.get(position); - - if (Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())) { - - Intent shortcutIntent = new Intent( - MailboxActivity.this, MailActivity.class); -// Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); - shortcutIntent.setClassName(MailboxActivity.this, MailActivity.class.getName()); - shortcutIntent.putExtra("box_id", mailbox.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, mailbox.getTitle()); - Parcelable iconResource = Intent.ShortcutIconResource.fromContext( - MailboxActivity.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 i = new Intent(MailboxActivity.this, MailActivity.class); + if (Intent.ACTION_CREATE_SHORTCUT.equals(getIntent() + .getAction())) + { + + Intent shortcutIntent = new Intent(MailboxActivity.this, + MailActivity.class); + // Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); + shortcutIntent.setClassName(MailboxActivity.this, + MailActivity.class.getName()); + shortcutIntent.putExtra("box_id", mailbox.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, mailbox + .getTitle()); + Parcelable iconResource = Intent.ShortcutIconResource + .fromContext(MailboxActivity.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 i = new Intent(MailboxActivity.this, + MailActivity.class); i.putExtra("box_id", mailbox.getId()); startActivity(i); - } + } } }); diff --git a/src/de/mtbnews/android/MessageActivity.java b/src/de/mtbnews/android/MessageActivity.java @@ -1,20 +1,14 @@ package de.mtbnews.android; -import java.io.IOException; - import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.text.TextUtils; import android.text.format.DateFormat; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; import android.widget.TextView; -import android.widget.Toast; import de.mtbnews.android.tapatalk.TapatalkClient; import de.mtbnews.android.tapatalk.TapatalkException; import de.mtbnews.android.tapatalk.wrapper.Message; @@ -28,9 +22,10 @@ public class MessageActivity extends Activity @Override protected void onCreate(Bundle savedInstanceState) { - setContentView(R.layout.newsdetail); - super.onCreate(savedInstanceState); + + setTheme(((IBCApplication) getApplication()).themeResId); + setContentView(R.layout.newsdetail); boxId = getIntent().getStringExtra("box_id"); messageId = getIntent().getStringExtra("message_id"); diff --git a/src/de/mtbnews/android/NewsDetailActivity.java b/src/de/mtbnews/android/NewsDetailActivity.java @@ -24,10 +24,12 @@ public class NewsDetailActivity extends Activity @Override protected void onCreate(Bundle savedInstanceState) { - prefs = PreferenceManager.getDefaultSharedPreferences(this); + super.onCreate(savedInstanceState); + + setTheme(((IBCApplication) getApplication()).themeResId); setContentView(R.layout.detail); - super.onCreate(savedInstanceState); + prefs = PreferenceManager.getDefaultSharedPreferences(this); final WebView webView = (WebView) findViewById(R.id.webView); diff --git a/src/de/mtbnews/android/PhotoActivity.java b/src/de/mtbnews/android/PhotoActivity.java @@ -32,6 +32,7 @@ public class PhotoActivity extends ListActivity @Override protected void onCreate(Bundle savedInstanceState) { + setTheme(((IBCApplication) getApplication()).themeResId); setContentView(R.layout.listing); super.onCreate(savedInstanceState); diff --git a/src/de/mtbnews/android/ReplyPostActivity.java b/src/de/mtbnews/android/ReplyPostActivity.java @@ -25,8 +25,10 @@ public class ReplyPostActivity 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); topicId = getIntent().getStringExtra("topic_id"); diff --git a/src/de/mtbnews/android/SubscriptionForenActivity.java b/src/de/mtbnews/android/SubscriptionForenActivity.java @@ -45,11 +45,12 @@ public class SubscriptionForenActivity extends ListActivity @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(); prefs = PreferenceManager.getDefaultSharedPreferences(this); ListAdapter adapter = new ListEntryContentAdapter(