Permalink
Browse files

formatted code.

  • Loading branch information...
1 parent de8d667 commit 4ff3a621975465bc3ae19f2c1807e2e6f437c3bd @mariotaku committed Nov 13, 2012
Showing with 281 additions and 257 deletions.
  1. +6 −7 src/android/support/v4/app/FragmentManagerTrojan.java
  2. +6 −3 src/org/mariotaku/twidere/activity/ComposeActivity.java
  3. +8 −13 src/org/mariotaku/twidere/activity/FiltersActivity.java
  4. +1 −7 src/org/mariotaku/twidere/activity/HomeActivity.java
  5. +6 −5 src/org/mariotaku/twidere/activity/InternalSettingsActivity.java
  6. +5 −5 src/org/mariotaku/twidere/activity/InternalSettingsDetailsActivity.java
  7. +4 −8 src/org/mariotaku/twidere/activity/SearchActivity.java
  8. +2 −6 src/org/mariotaku/twidere/activity/SettingsActivity.java
  9. +15 −15 src/org/mariotaku/twidere/activity/SettingsDetailsActivity.java
  10. +5 −5 src/org/mariotaku/twidere/adapter/CursorStatusesAdapter.java
  11. +6 −5 src/org/mariotaku/twidere/adapter/ParcelableStatusesAdapter.java
  12. +8 −8 src/org/mariotaku/twidere/adapter/TabsAdapter.java
  13. +21 −17 src/org/mariotaku/twidere/fragment/ActivityHostFragment.java
  14. +10 −10 src/org/mariotaku/twidere/fragment/BaseFiltersFragment.java
  15. +1 −3 src/org/mariotaku/twidere/fragment/BaseUsersListFragment.java
  16. +20 −15 src/org/mariotaku/twidere/fragment/DirectMessagesConversationFragment.java
  17. +9 −10 src/org/mariotaku/twidere/fragment/ParcelableStatusesListFragment.java
  18. +1 −3 src/org/mariotaku/twidere/fragment/SearchTweetsFragment.java
  19. +2 −2 src/org/mariotaku/twidere/fragment/StatusFragment.java
  20. +1 −3 src/org/mariotaku/twidere/fragment/UserFavoritesFragment.java
  21. +1 −3 src/org/mariotaku/twidere/fragment/UserListTimelineFragment.java
  22. +1 −3 src/org/mariotaku/twidere/fragment/UserMentionsFragment.java
  23. +1 −3 src/org/mariotaku/twidere/fragment/UserTimelineFragment.java
  24. +1 −2 src/org/mariotaku/twidere/loader/DummyParcelableStatusesLoader.java
  25. +2 −2 src/org/mariotaku/twidere/loader/ParcelableStatusesLoader.java
  26. +3 −3 src/org/mariotaku/twidere/loader/TweetSearchLoader.java
  27. +1 −1 src/org/mariotaku/twidere/loader/Twitter4JStatusLoader.java
  28. +4 −4 src/org/mariotaku/twidere/loader/UserFavoritesLoader.java
  29. +3 −3 src/org/mariotaku/twidere/loader/UserListTimelineLoader.java
  30. +2 −2 src/org/mariotaku/twidere/loader/UserTimelineLoader.java
  31. +20 −13 src/org/mariotaku/twidere/model/ParcelableLocation.java
  32. +9 −6 src/org/mariotaku/twidere/model/ParcelableStatus.java
  33. +6 −1 src/org/mariotaku/twidere/model/ParcelableUser.java
  34. +6 −1 src/org/mariotaku/twidere/model/ParcelableUserList.java
  35. +1 −3 src/org/mariotaku/twidere/service/TwidereService.java
  36. +7 −7 src/org/mariotaku/twidere/util/NoDuplicatesArrayList.java
  37. +1 −1 src/org/mariotaku/twidere/util/SerializationUtil.java
  38. +1 −2 src/org/mariotaku/twidere/util/ServiceInterface.java
  39. +65 −38 src/org/mariotaku/twidere/util/SynchronizedStateSavedList.java
  40. +9 −9 src/org/mariotaku/twidere/view/TabPageIndicator.java
@@ -4,15 +4,14 @@
public class FragmentManagerTrojan {
- public static boolean isStateSaved(final FragmentManager fm) {
- if (fm instanceof FragmentManagerImpl) return ((FragmentManagerImpl) fm).mStateSaved;
+ public static boolean dispatchOptionsItemSelected(final FragmentManager fm, final MenuItem item) {
+ if (fm instanceof FragmentManagerImpl) return ((FragmentManagerImpl) fm).dispatchOptionsItemSelected(item);
return false;
}
-
- public static boolean dispatchOptionsItemSelected(final FragmentManager fm, final MenuItem item) {
- if (fm instanceof FragmentManagerImpl)
- return ((FragmentManagerImpl) fm).dispatchOptionsItemSelected(item);
+
+ public static boolean isStateSaved(final FragmentManager fm) {
+ if (fm instanceof FragmentManagerImpl) return ((FragmentManagerImpl) fm).mStateSaved;
return false;
}
-
+
}
@@ -39,6 +39,7 @@
import org.mariotaku.popupmenu.PopupMenu;
import org.mariotaku.twidere.R;
import org.mariotaku.twidere.fragment.BaseDialogFragment;
+import org.mariotaku.twidere.model.ParcelableLocation;
import org.mariotaku.twidere.provider.TweetStore.Drafts;
import org.mariotaku.twidere.util.ArrayUtils;
import org.mariotaku.twidere.util.BitmapDecodeHelper;
@@ -94,7 +95,6 @@
import android.widget.Toast;
import com.twitter.Validator;
-import org.mariotaku.twidere.model.ParcelableLocation;
public class ComposeActivity extends BaseActivity implements TextWatcher, LocationListener, OnMenuItemClickListener,
OnClickListener, OnLongClickListener, PopupMenu.OnMenuItemClickListener, OnEditorActionListener,
@@ -600,9 +600,12 @@ public boolean onPrepareOptionsMenu(final Menu menu) {
FAKE_IMAGE_LINK, text_orig) : text_orig + " " + FAKE_IMAGE_LINK : text_orig;
if (mTextCount != null) {
final int count = mValidator.getTweetLength(text);
- final float hue = count < Validator.MAX_TWEET_LENGTH ? count >= Validator.MAX_TWEET_LENGTH - 10 ? 5 * (Validator.MAX_TWEET_LENGTH - count) : 50 : 0;
+ final float hue = count < Validator.MAX_TWEET_LENGTH ? count >= Validator.MAX_TWEET_LENGTH - 10 ? 5 * (Validator.MAX_TWEET_LENGTH - count)
+ : 50
+ : 0;
final float[] hsv = new float[] { hue, 1.0f, 1.0f };
- mTextCount.setTextColor(count >= Validator.MAX_TWEET_LENGTH - 10 ? Color.HSVToColor(0x80, hsv) : 0x80808080);
+ mTextCount
+ .setTextColor(count >= Validator.MAX_TWEET_LENGTH - 10 ? Color.HSVToColor(0x80, hsv) : 0x80808080);
mTextCount.setText(parseString(Validator.MAX_TWEET_LENGTH - count));
}
final MenuItem sendItem = menu.findItem(MENU_SEND);
@@ -29,23 +29,26 @@
import android.os.Bundle;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
-import android.view.LayoutInflater;
import android.view.Menu;
-import android.view.MenuInflater;
import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
public class FiltersActivity extends BaseActivity {
private ActionBar mActionBar;
-
+
private ViewPager mViewPager;
private PagerTabStrip mPagerTab;
private TabsAdapter mAdapter;
@Override
+ public void onContentChanged() {
+ super.onContentChanged();
+ mViewPager = (ViewPager) findViewById(R.id.pager);
+ mPagerTab = (PagerTabStrip) findViewById(R.id.pager_tab);
+ }
+
+ @Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.filters);
@@ -61,14 +64,6 @@ public void onCreate(final Bundle savedInstanceState) {
mPagerTab.setTabIndicatorColorResource(R.color.holo_blue_light);
}
-
- @Override
- public void onContentChanged() {
- super.onContentChanged();
- mViewPager = (ViewPager) findViewById(R.id.pager);
- mPagerTab = (PagerTabStrip) findViewById(R.id.pager_tab);
- }
-
@Override
public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.menu_filter, menu);
@@ -73,7 +73,6 @@
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ProgressBar;
-import android.widget.Toast;
import edu.ucdavis.earlybird.ProfilingUtil;
public class HomeActivity extends MultiSelectActivity implements OnClickListener, OnPageChangeListener {
@@ -93,7 +92,6 @@
private boolean mProgressBarIndeterminateVisible = false;
- private boolean mIsNavigateToDefaultAccount = false;
private boolean mDisplayAppIcon;
public static final int TAB_POSITION_HOME = 0;
@@ -230,7 +228,7 @@ public void onCreate(final Bundle savedInstanceState) {
mProgress = (ProgressBar) view.findViewById(android.R.id.progress);
mIndicator = (TabPageIndicator) view.findViewById(android.R.id.tabs);
final boolean tab_display_label = res.getBoolean(R.bool.tab_display_label);
- mAdapter = new TabsAdapter(this, getSupportFragmentManager(), mIndicator);
+ mAdapter = new TabsAdapter(this, getSupportFragmentManager(), mIndicator);
mShowHomeTab = mPreferences.getBoolean(PREFERENCE_KEY_SHOW_HOME_TAB, true);
mShowMentionsTab = mPreferences.getBoolean(PREFERENCE_KEY_SHOW_MENTIONS_TAB, true);
mShowMessagesTab = mPreferences.getBoolean(PREFERENCE_KEY_SHOW_MESSAGES_TAB, true);
@@ -451,10 +449,6 @@ protected void onActivityResult(final int requestCode, final int resultCode, fin
super.onActivityResult(requestCode, resultCode, intent);
}
- protected void onDefaultAccountSet() {
- mIsNavigateToDefaultAccount = false;
- }
-
@Override
protected void onDestroy() {
// Delete unused items in databases.
@@ -26,15 +26,15 @@
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
+import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.KeyEvent;
-import android.view.ViewGroup;
import android.view.View;
-import android.widget.ListView;
+import android.view.ViewGroup;
import android.widget.FrameLayout;
-import android.content.res.Resources;
+import android.widget.ListView;
@SuppressWarnings("deprecation")
public class InternalSettingsActivity extends PreferenceActivity implements Constants {
@@ -69,7 +69,8 @@ public void setContentView(final int layoutRes) {
@Override
public void setContentView(final View view) {
- setContentView(null, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
+ setContentView(null, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT));
}
@Override
@@ -79,7 +80,7 @@ public void setContentView(final View view, final ViewGroup.LayoutParams params)
final float density = res.getDisplayMetrics().density;
final int padding = (int) density * 16;
lv.setId(android.R.id.list);
- lv.setPadding(padding, 0, padding ,0);
+ lv.setPadding(padding, 0, padding, 0);
super.setContentView(lv, params);
}
@@ -7,15 +7,15 @@
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
+import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.KeyEvent;
import android.view.View;
-import android.widget.FrameLayout;
import android.view.ViewGroup;
+import android.widget.FrameLayout;
import android.widget.ListView;
-import android.content.res.Resources;
public class InternalSettingsDetailsActivity extends PreferenceActivity implements Constants {
@@ -47,7 +47,6 @@ public boolean onKeyUp(final int keyCode, final KeyEvent event) {
}
return super.onKeyUp(keyCode, event);
}
-
@Override
public void setContentView(final int layoutRes) {
@@ -56,7 +55,8 @@ public void setContentView(final int layoutRes) {
@Override
public void setContentView(final View view) {
- setContentView(null, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
+ setContentView(null, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT));
}
@Override
@@ -66,7 +66,7 @@ public void setContentView(final View view, final ViewGroup.LayoutParams params)
final float density = res.getDisplayMetrics().density;
final int padding = (int) density * 16;
lv.setId(android.R.id.list);
- lv.setPadding(padding, 0, padding ,0);
+ lv.setPadding(padding, 0, padding, 0);
super.setContentView(lv, params);
}
@@ -31,7 +31,6 @@
import org.mariotaku.twidere.fragment.SearchUsersFragment;
import org.mariotaku.twidere.provider.RecentSearchProvider;
import org.mariotaku.twidere.view.ExtendedViewPager;
-import org.mariotaku.twidere.view.TabPageIndicator;
import android.app.SearchManager;
import android.content.Intent;
@@ -42,10 +41,8 @@
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentManagerTrojan;
import android.support.v4.app.NavUtils;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.ProgressBar;
import android.support.v4.view.PagerTabStrip;
+import android.view.MenuItem;
public class SearchActivity extends MultiSelectActivity {
@@ -125,10 +122,9 @@ public void onCreate(final Bundle savedInstanceState) {
mActionBar = getSupportActionBar();
mActionBar.setDisplayHomeAsUpEnabled(true);
mAdapter = new TabsAdapter(this, getSupportFragmentManager(), null);
- mAdapter.addTab(SearchTweetsFragment.class, mArguments, getString(R.string.tweets),
- R.drawable.ic_tab_twitter, 0);
- mAdapter.addTab(SearchUsersFragment.class, mArguments, getString(R.string.users),
- R.drawable.ic_tab_person, 1);
+ mAdapter.addTab(SearchTweetsFragment.class, mArguments, getString(R.string.tweets), R.drawable.ic_tab_twitter,
+ 0);
+ mAdapter.addTab(SearchUsersFragment.class, mArguments, getString(R.string.users), R.drawable.ic_tab_person, 1);
mViewPager.setAdapter(mAdapter);
mViewPager.setCurrentItem(is_search_user ? 1 : 0);
mPagerTab.setTabIndicatorColorResource(R.color.holo_blue_light);
@@ -25,6 +25,7 @@
import org.mariotaku.twidere.fragment.ActivityHostFragment;
import org.mariotaku.twidere.fragment.CustomTabsFragment;
import org.mariotaku.twidere.fragment.ExtensionsListFragment;
+import org.mariotaku.twidere.fragment.FiltersListFragment;
import org.mariotaku.twidere.fragment.InternalSettingsFragment;
import org.mariotaku.twidere.fragment.SettingsDetailsFragment;
@@ -39,11 +40,6 @@
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.MenuItem;
-import org.mariotaku.twidere.fragment.FiltersListFragment;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ListView;
-import android.widget.FrameLayout;
public class SettingsActivity extends DualPaneActivity implements OnSharedPreferenceChangeListener,
OnPreferenceClickListener {
@@ -136,7 +132,7 @@ public boolean onPreferenceClick(final Preference preference) {
startActivity(intent);
}
return true;
- }else if (KEY_FILTERS.equals(key)) {
+ } else if (KEY_FILTERS.equals(key)) {
if (isDualPaneMode()) {
final Fragment fragment = new FiltersListFragment();
showFragment(fragment, false);
@@ -1,12 +1,12 @@
package org.mariotaku.twidere.activity;
+import android.content.res.Resources;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
-import android.widget.FrameLayout;
import android.view.ViewGroup;
+import android.widget.FrameLayout;
import android.widget.ListView;
-import android.content.res.Resources;
public class SettingsDetailsActivity extends BasePreferenceActivity {
@@ -23,7 +23,16 @@ public void onCreate(final Bundle savedInstanceState) {
}
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
-
+
+ @Override
+ public boolean onOptionsItemSelected(final MenuItem item) {
+ switch (item.getItemId()) {
+ case MENU_HOME:
+ finish();
+ break;
+ }
+ return super.onOptionsItemSelected(item);
+ }
@Override
public void setContentView(final int layoutRes) {
@@ -32,7 +41,8 @@ public void setContentView(final int layoutRes) {
@Override
public void setContentView(final View view) {
- setContentView(null, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
+ setContentView(null, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT));
}
@Override
@@ -42,17 +52,7 @@ public void setContentView(final View view, final ViewGroup.LayoutParams params)
final float density = res.getDisplayMetrics().density;
final int padding = (int) density * 16;
lv.setId(android.R.id.list);
- lv.setPadding(padding, 0, padding ,0);
+ lv.setPadding(padding, 0, padding, 0);
super.setContentView(lv, params);
}
-
- @Override
- public boolean onOptionsItemSelected(final MenuItem item) {
- switch (item.getItemId()) {
- case MENU_HOME:
- finish();
- break;
- }
- return super.onOptionsItemSelected(item);
- }
}
@@ -106,7 +106,7 @@ public void bindView(final View view, final Context context, final Cursor cursor
final String name = cursor.getString(mIndices.name);
final String in_reply_to_screen_name = cursor.getString(mIndices.in_reply_to_screen_name);
final String account_screen_name = getAccountScreenName(mContext, account_id);
-
+
final boolean is_favorite = cursor.getShort(mIndices.is_favorite) == 1;
final boolean is_protected = cursor.getShort(mIndices.is_protected) == 1;
final boolean is_verified = cursor.getShort(mIndices.is_verified) == 1;
@@ -126,8 +126,8 @@ public void bindView(final View view, final Context context, final Cursor cursor
holder.setUserColor(getUserColor(mContext, user_id));
if (text != null) {
- holder.setHighlightColor(getStatusBackground(
- mMentionsHighlightDisabled ? false : is_mention, is_favorite, is_retweet));
+ holder.setHighlightColor(getStatusBackground(mMentionsHighlightDisabled ? false : is_mention,
+ is_favorite, is_retweet));
}
holder.setAccountColorEnabled(mShowAccountColor);
@@ -246,8 +246,8 @@ public View newView(final Context context, final Cursor cursor, final ViewGroup
view.setTag(holder);
holder.profile_image.setOnClickListener(mMultiSelectEnabled ? null : this);
holder.image_preview.setOnClickListener(mMultiSelectEnabled ? null : this);
- //holder.image_preview.setClickable(!mMultiSelectEnabled);
- //holder.profile_image.setClickable(!mMultiSelectEnabled);
+ // holder.image_preview.setClickable(!mMultiSelectEnabled);
+ // holder.profile_image.setClickable(!mMultiSelectEnabled);
}
return view;
}
Oops, something went wrong.

0 comments on commit 4ff3a62

Please sign in to comment.