Commit Graph

37 Commits

Author SHA1 Message Date
cketti 93b94f58c8 Add support for 'theme packs'
Right now only replacing the icon in the action bar is supported.
That's why the term "Icon Pack" is used in the UI.

Known bug: In a PreferenceActivity the second level still shows the
default app icon in the action bar :(

Icon packs need to include an activity with an intent filter for
the action "org.k9mail.THEME_PACK".

Example:

<activity android:name=".SomeActivity">
  <intent-filter>
    <action android:name="org.k9mail.THEME_PACK" />
  </intent-filter>

  <!-- Version number for the theme pack format -->
  <meta-data android:name="version" android:value="1"/>

  <meta-data android:name="name" android:value="Fancy icon"/>
  <meta-data android:name="author" android:value="cketti"/>
  <meta-data android:name="icon_app"
             android:resource="@drawable/ic_app"/>
</activity>
2013-07-01 07:35:01 +02:00
m0viefreak a74d57cb71 MessageView: Theme fix when global and message view theme differ
- Since the split-view change, MessageView is only a fragment, so we
  can't call setTheme() anymore so easily.
  Instead, use a ContextThemeWrapper and use that to inflate the
  layout. This way the message header and attachment view
  are styled correctly.

- The HTC WebView fix in SingleMessageView was returning the wrong
  background color, when message view theme and global theme differ,
  because it always used the global theme to retrieve it.
  Fix: Specifically put the light/dark values in the themes.xml,
  and get them using getContext().getTheme().resolveAttribute().
  getContext() will use the ContextThemeWrapper from above, so
  even if the global and message view themes differ, it aleays
  returns the correct one.
  The getThemeBackgroundColor() method added to the K9ActivityMagic
  interface in 309eeb72ac is now not
  needed anymore, and was removed.
2013-02-04 19:30:40 +01:00
cketti 8a226972a5 Extracted functionality common to most activities to K9ActivityCommon 2012-10-05 18:14:07 +02:00
Sander Bogaert 4293914855 Initial actionbar integration. On top of every activity, no real integration yet. 2012-09-08 21:14:55 -07:00
cketti 68a6eddfb6 Avoid NullPointerException in the gesture detection code 2012-05-10 17:19:21 +02:00
cketti 8fdece4782 Use bezel swipe gestures to move to next/prev message in MessageView 2012-05-04 16:32:39 +02:00
m0viefreak 022940d4f5 Fix gesture detection
This commit addresses 2 issues:

1) Before, a general GestureDetector was registered on the highest level in K9Activity
   This resulted in EVERY inherited activity to have a useless, unused gesture detector.
   But more than that, in MessageList, a second GestureDetector was assigned to the ListView.
   On every fling gesture, both detectors called the onSwipe() methods,
   which technically did the following:
   - The one directly assigned to the ListView would work corectly by mapping the
     (local) event coordinates to the right entry in the ListView
   - The global one worked on screen coordinates, so the onSwipe() method would
     likely select the wrong ListView entry (system menu bar offset).
   - For some reason this "worked" fine, and only the correct entry was selected,
     despite two detectors used.

2) The gesture detection for the MessageView caused problems when the message
   itself was scrollable, i.e. wide HTML mails. A fling gesture inside the WebView
   would scroll the message, but also switch the message.

This commit fixes all those by doing the following:
- Don't register the GestureDetector in K9Activity, instead make the member variable
  accessible by subclasses.
- In the subclasses that need a detector register it
- In K9Activity.dispatchTouchEvent() check for mGestureDetector being null
- For MessageList:
  * Remove the duplicate gesture detector assigned to the ListView
  * in the handleSwipe() methods: calclulate pixel offset of the ListView to make
    it work using the global screen coordinates
- For MessageView: Limit sensitive area to the message header, to prevent interference
  with the WebView scrolling
- Respect current behavior:
  * Force-enable gestures for the MessageList
  * Respect user setting in MessageView
- Make sure that after a successful swipe gesture, any pending action is cancelled, to
  prevent unwanted things to happen (such as expanding the header after changing
  the message, or a context menu popping up in the MessageList).
  See http://code.google.com/p/android/issues/detail?id=8497
2012-05-01 03:00:15 +02:00
cketti 4612ceb3c8 Enabled dark theme for MessageCompose and MessageView 2012-04-03 07:55:51 +02:00
cketti d584492a6d Changed internal representation of the selected theme in the database 2012-03-29 06:33:01 +02:00
cketti 309eeb72ac Got rid of the ScrollView in MessageView
The ScrollView around the WebView caused all sorts of problems. This
change removes the ScrollView and uses the undocumented method
WebView.setEmbeddedTitleBar() to set the MessageHeader view as "title
bar" of the WebView. This allows MessageHeader to scroll away making
more room for the WebView.
All of the "magic title bar" code was originally implemented by Jesse
for Kaiten.

Because WebView doesn't support a scrolling footer we can no longer
support scrolling buttons or attachments at the end of the message. Now
users can switch from message view to attachment view via a button just
below the message headers.

I also copied some code for which I was too lazy to create a separate
commit. It allows to display attachments we didn't use to show by
clicking on a "More..." button in the attachment view. Those
attachments are mostly images referenced by the HTML part (e.g.
background images).

Fixes issue 3291
2012-02-21 05:07:01 +01:00
Andrew Chen 3c5a63adeb Issue 3875: Revert to the old way of determining minimum swipe distance.
Fix my logic bug when determining left to right vs. right to left.
2012-01-03 21:58:36 -08:00
Andrew Chen 11ebc1b262 Issue 3875: Add a bit more debug data for swiping. 2012-01-03 21:19:59 -08:00
Andrew Chen fc5ea05e48 Issue 3875: Add more debugging lines to figure out what might be wrong with the new swipe algorithm.
Fix some variable names.
2012-01-03 21:06:20 -08:00
Andrew Chen 81f0cb510a Remove unused date formatter. 2012-01-03 21:04:27 -08:00
cketti 88a2dd6289 Merge branch 'issue549'
Conflicts:
	src/com/fsck/k9/Account.java
	src/com/fsck/k9/mail/store/WebDavStore.java
2011-11-05 18:47:55 +01:00
Andrew Chen 30151f1a70 Add parameter to MyGestureDetector to enable gestures for a specific detector, even if system-wide gestures are disabled. 2011-11-01 17:25:49 -07:00
Andrew Chen edd78ea10c Make the K9Activity GestureDetector more generic so that it can be used by both MessageList and MessageView.
Make the mTopView a ToggleScrollView.  The only consumer is currently the MessageView, which uses a ToggleScrollView anyway.  This should make it easier to reuse the anti-scrolling features in ToggleScrollView for ListView later on.
2011-11-01 16:55:13 -07:00
cketti fc8d2e9979 Merge branch 'master' into issue549
Conflicts:
	res/menu/accounts_context.xml
	res/menu/accounts_option.xml
	res/values/strings.xml
	src/com/fsck/k9/Account.java
	src/com/fsck/k9/activity/Accounts.java
	src/com/fsck/k9/activity/AsyncUIProcessor.java
	src/com/fsck/k9/activity/FolderList.java
	src/com/fsck/k9/activity/ImportListener.java
	src/com/fsck/k9/activity/K9Activity.java
	src/com/fsck/k9/activity/K9ListActivity.java
	src/com/fsck/k9/activity/MessageView.java
	src/com/fsck/k9/mail/store/ImapStore.java
	src/com/fsck/k9/mail/store/Pop3Store.java
	src/com/fsck/k9/mail/store/WebDavStore.java
	src/com/fsck/k9/mail/transport/SmtpTransport.java
2011-10-14 20:33:25 +02:00
cketti 26258d7666 Removed unused imports 2011-03-26 06:43:39 +01:00
Jesse Vincent b8949abaca Kill some now-dead and duplicate code 2011-03-25 15:56:25 +11:00
danapple 8e5c50a8ef astyle 2011-03-20 15:21:24 -05:00
danapple 89bdbdce94 Build a structure to allow for more easily creating new versions of
preferences Storage importers/exporters.  Password/encryption key
prompting is now down in centralized place.  On import, the password
prompt is given if the file to be imported uses an importer
implementation that requires a password and no password is provided.
On export, the password prompt is given if the chosen version is for
an exporter that requires a password and no password was provided.

For instance, for automatic backups, a password could be stored in
preferences and provided to the exporter, so no password prompt would
be given.
2011-03-20 11:52:13 -05:00
cketti 203dab5c64 Revert changes for issue 549 (import/export settings).
The feature will be polished in branch "issue549".
2011-02-28 22:55:34 +01:00
danapple ad3dd07a7a astyle-d 2011-02-26 18:39:06 -06:00
danapple 6dc94fb78e First mostly working copy of export/import. Committing while I sort
out how to use git.
2011-02-26 11:31:56 -06:00
Jesse Vincent 0ca6adfbf8 move DateFormatter from Activity to Helper 2011-01-10 17:47:16 +00:00
Jesse Vincent db02383d4a whitespace cleanups 2010-12-26 03:49:16 +00:00
Jesse Vincent 76fd8e9939 extract animation code from MessageView 2010-12-25 22:30:22 +00:00
Jesse Vincent 2451dde1bc simplify our "should we animate" checks in messageview (also, we now
honor the animation preference when using the volume keys to navigate)
2010-12-13 00:37:31 +00:00
Fiouz 1e67fc4cde Update issue 1290
Update issue 1916
Added support for country/region specific locales
2010-08-12 11:03:19 +00:00
Thialfihar 19ca87a2d5 removed the initiation of "select text" via long press again
Update issue 662
We tried out the long press for a bit and deemed it too sensitive for general usage. It can cause problems with gestures and such, so I removed it again. I hope using the option menu is not too much overhead.
If you want to include it in your custom build or anything, then r 1976 and r1977 should be enough.
2010-07-15 21:35:57 +00:00
Jesse Vincent a58d91f7c7 astyle 2010-07-15 03:42:17 +00:00
Thialfihar 91599ae963 ignore gestures during text selection
Fixes issue 662
2010-07-14 18:20:10 +00:00
Thialfihar 510e9acc83 added text selection via "long press" in MessageView, also giving a notification for when text selection starts
Update issue 662
Added the long press initiation of text selection. I also noticed we'll have to make sure text selection is not recognized as a gesture (or at least ignored as gesture).
2010-07-14 18:12:40 +00:00
Jesse Vincent ab8cdb3522 minor astyling 2010-07-10 16:41:48 +00:00
Thialfihar 67b23fc797 added a setting for language, overriding the system locale settings
Update issue 1290
2010-07-09 00:27:47 +00:00
cketti 58b8479612 Code refactoring:
- Created "controller" and "mail.filter" package
- Moved a lot of classes to new/other packages
- Removed unused classes: NoSuchProviderException, MessageDateComparator
2010-05-19 18:17:06 +00:00