mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-17 07:30:16 -05:00
astyle
This commit is contained in:
parent
de142b7faa
commit
ff5024eaec
@ -224,10 +224,12 @@ public class ChooseFolder extends K9ListActivity
|
||||
}
|
||||
}
|
||||
|
||||
private void setDisplayMode(FolderMode aMode) {
|
||||
private void setDisplayMode(FolderMode aMode)
|
||||
{
|
||||
mMode = aMode;
|
||||
// invalidate the current filter as it is working on an inval
|
||||
if (myFilter != null) {
|
||||
if (myFilter != null)
|
||||
{
|
||||
myFilter.invalidate();
|
||||
}
|
||||
//re-populate the list
|
||||
|
@ -136,7 +136,8 @@ public class FolderListFilter<T> extends Filter
|
||||
mFolders.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
public void invalidate()
|
||||
{
|
||||
mOriginalValues = null;
|
||||
}
|
||||
}
|
||||
|
@ -1964,7 +1964,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
// Inline parts with a content-id are almost certainly components of an HTML message
|
||||
// not attachments. Don't show attachment download buttons for them.
|
||||
|
||||
if ( contentDisposition != null &&
|
||||
if (contentDisposition != null &&
|
||||
MimeUtility.getHeaderParameter(contentDisposition, null).matches("^(?i:inline)")
|
||||
&& part.getHeader("Content-ID") != null)
|
||||
{
|
||||
@ -2552,7 +2552,9 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
}
|
||||
mCryptoSignatureLayout.setVisibility(View.VISIBLE);
|
||||
mDecryptLayout.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
mCryptoSignatureLayout.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ public class MessagingController implements Runnable
|
||||
*/
|
||||
public void listFolders(final Account account, final boolean refreshRemote, final MessagingListener listener)
|
||||
{
|
||||
new Thread (new Runnable()
|
||||
new Thread(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
|
@ -31,7 +31,8 @@ public class ContactsSdk3_4 extends com.fsck.k9.helper.Contacts
|
||||
* {@link com.fsck.k9.EmailAddressAdapter} or more specificly by
|
||||
* {@link android.widget.ResourceCursorAdapter}.
|
||||
*/
|
||||
private static final String PROJECTION[] = {
|
||||
private static final String PROJECTION[] =
|
||||
{
|
||||
Contacts.People.ContactMethods._ID,
|
||||
Contacts.People.ContactMethods.NAME,
|
||||
Contacts.People.ContactMethods.DATA
|
||||
|
@ -34,7 +34,8 @@ public class ContactsSdk5 extends com.fsck.k9.helper.Contacts
|
||||
* {@link com.fsck.k9.EmailAddressAdapter} or more specificly by
|
||||
* {@link android.widget.ResourceCursorAdapter}.
|
||||
*/
|
||||
private static final String PROJECTION[] = {
|
||||
private static final String PROJECTION[] =
|
||||
{
|
||||
Contacts._ID,
|
||||
Contacts.DISPLAY_NAME,
|
||||
Email.DATA
|
||||
|
@ -1219,7 +1219,7 @@ public class ImapStore extends Store
|
||||
int messageNumber = 0;
|
||||
|
||||
ImapResponseParser.IImapResponseCallback callback = null;
|
||||
if (fp.contains(FetchProfile.Item.BODY) || fp.contains(FetchProfile.Item.BODY_SANE) )
|
||||
if (fp.contains(FetchProfile.Item.BODY) || fp.contains(FetchProfile.Item.BODY_SANE))
|
||||
{
|
||||
callback = new FetchBodyCallback(messageMap);
|
||||
}
|
||||
|
@ -1437,7 +1437,7 @@ public class LocalStore extends Store implements Serializable
|
||||
String contentDisposition = cursor.getString(7);
|
||||
Body body = null;
|
||||
|
||||
if (contentDisposition == null )
|
||||
if (contentDisposition == null)
|
||||
{
|
||||
contentDisposition = "attachment";
|
||||
}
|
||||
|
@ -412,7 +412,8 @@ public class MailService extends CoreService
|
||||
}
|
||||
else
|
||||
{
|
||||
if (K9.DEBUG) {
|
||||
if (K9.DEBUG)
|
||||
{
|
||||
Log.i(K9.LOG_TAG, "Not scheduling pushers: connectivity? "+hasConnectivity + " -- doBackground? "+doBackground);
|
||||
|
||||
}
|
||||
|
@ -24,8 +24,10 @@ import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.widget.ArrayAdapter;
|
||||
|
||||
public class AccessibleEmailContentActivity extends ListActivity {
|
||||
String[] listItems = {
|
||||
public class AccessibleEmailContentActivity extends ListActivity
|
||||
{
|
||||
String[] listItems =
|
||||
{
|
||||
""
|
||||
};
|
||||
|
||||
@ -35,7 +37,8 @@ public class AccessibleEmailContentActivity extends ListActivity {
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
htmlSource = getIntent().getStringExtra("content");
|
||||
@ -43,8 +46,10 @@ public class AccessibleEmailContentActivity extends ListActivity {
|
||||
String[] rawListItems = parsedHtml.toString().split("\n");
|
||||
|
||||
cleanedList = new ArrayList<String>();
|
||||
for (int i = 0; i < rawListItems.length; i++) {
|
||||
if (rawListItems[i].trim().length() > 0) {
|
||||
for (int i = 0; i < rawListItems.length; i++)
|
||||
{
|
||||
if (rawListItems[i].trim().length() > 0)
|
||||
{
|
||||
addToCleanedList(rawListItems[i]);
|
||||
}
|
||||
}
|
||||
@ -55,21 +60,30 @@ public class AccessibleEmailContentActivity extends ListActivity {
|
||||
setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, listItems));
|
||||
}
|
||||
|
||||
private void addToCleanedList(String line) {
|
||||
if (line.length() < 80) {
|
||||
private void addToCleanedList(String line)
|
||||
{
|
||||
if (line.length() < 80)
|
||||
{
|
||||
cleanedList.add(line);
|
||||
} else {
|
||||
while (line.length() > 80) {
|
||||
}
|
||||
else
|
||||
{
|
||||
while (line.length() > 80)
|
||||
{
|
||||
int cutPoint = line.indexOf(" ", 80);
|
||||
if ((cutPoint > 0) && (cutPoint < line.length())) {
|
||||
if ((cutPoint > 0) && (cutPoint < line.length()))
|
||||
{
|
||||
cleanedList.add(line.substring(0, cutPoint));
|
||||
line = line.substring(cutPoint).trim();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
cleanedList.add(line);
|
||||
line = "";
|
||||
}
|
||||
}
|
||||
if (line.length() > 0) {
|
||||
if (line.length() > 0)
|
||||
{
|
||||
cleanedList.add(line);
|
||||
}
|
||||
}
|
||||
|
@ -26,84 +26,101 @@ import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class AccessibleWebView extends TextView {
|
||||
public class AccessibleWebView extends TextView
|
||||
{
|
||||
private Activity parent;
|
||||
|
||||
private String htmlSource;
|
||||
|
||||
private WebView dummyWebView;
|
||||
|
||||
public AccessibleWebView(Context context) {
|
||||
public AccessibleWebView(Context context)
|
||||
{
|
||||
super(context);
|
||||
parent = (Activity) context;
|
||||
dummyWebView = new WebView(context);
|
||||
setFocusable(true);
|
||||
setFocusableInTouchMode(true);
|
||||
setOnClickListener(new OnClickListener() {
|
||||
setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
public void onClick(View arg0)
|
||||
{
|
||||
diveIn();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public AccessibleWebView(Context context, AttributeSet attributes) {
|
||||
public AccessibleWebView(Context context, AttributeSet attributes)
|
||||
{
|
||||
super(context, attributes);
|
||||
parent = (Activity) context;
|
||||
dummyWebView = new WebView(context);
|
||||
setFocusable(true);
|
||||
setFocusableInTouchMode(true);
|
||||
setOnClickListener(new OnClickListener() {
|
||||
setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
public void onClick(View arg0)
|
||||
{
|
||||
diveIn();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void loadData(String data, String mimeType, String encoding) {
|
||||
public void loadData(String data, String mimeType, String encoding)
|
||||
{
|
||||
htmlSource = data;
|
||||
this.setText(Html.fromHtml(htmlSource, null, null));
|
||||
}
|
||||
|
||||
public WebSettings getSettings() {
|
||||
public WebSettings getSettings()
|
||||
{
|
||||
return dummyWebView.getSettings();
|
||||
}
|
||||
|
||||
public void setVerticalScrollbarOverlay(boolean booleanValue) {
|
||||
public void setVerticalScrollbarOverlay(boolean booleanValue)
|
||||
{
|
||||
// Do nothing here; dummy stub method to maintain compatibility with
|
||||
// standard WebView.
|
||||
}
|
||||
|
||||
public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding,
|
||||
String historyUrl) {
|
||||
String historyUrl)
|
||||
{
|
||||
htmlSource = data;
|
||||
this.setText(Html.fromHtml(htmlSource, null, null));
|
||||
}
|
||||
|
||||
public void loadUrl(String url) {
|
||||
public void loadUrl(String url)
|
||||
{
|
||||
// Do nothing here; dummy stub method to maintain compatibility with
|
||||
// standard WebView.
|
||||
}
|
||||
|
||||
public boolean zoomIn() {
|
||||
if (getTextSize() < 100) {
|
||||
public boolean zoomIn()
|
||||
{
|
||||
if (getTextSize() < 100)
|
||||
{
|
||||
setTextSize(getTextSize() + 5);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean zoomOut() {
|
||||
if (getTextSize() > 5) {
|
||||
public boolean zoomOut()
|
||||
{
|
||||
if (getTextSize() > 5)
|
||||
{
|
||||
setTextSize(getTextSize() - 5);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void diveIn() {
|
||||
private void diveIn()
|
||||
{
|
||||
Intent i = new Intent();
|
||||
i.setClass(parent, AccessibleEmailContentActivity.class);
|
||||
i.putExtra("content", htmlSource);
|
||||
|
Loading…
Reference in New Issue
Block a user