Skip to content

Commit

Permalink
wrong tweets notification fixed.
Browse files Browse the repository at this point in the history
bsmall bug fixes.
  • Loading branch information
mariotaku committed Nov 28, 2012
1 parent 4cbfcde commit 5693a7d
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 44 deletions.
12 changes: 7 additions & 5 deletions AndroidManifest.xml
Expand Up @@ -423,20 +423,24 @@
android:label="@string/sign_in"/>
<activity
android:name=".activity.DataProfilingSettingsActivity"
android:label="@string/data_profiling">
</activity>
android:label="@string/data_profiling"/>

<service
android:name=".service.TwidereService"
android:label="@string/label_backend_service"
android:permission="org.mariotaku.twidere.ACCESS_SERVICE">
android:permission="org.mariotaku.twidere.ACCESS_SERVICE"
android:settingsActivity=".activity.SettingsActivity">
<intent-filter>
<action android:name="org.mariotaku.twidere.SERVICE"/>

<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</service>

<service
android:name="edu.ucdavis.earlybird.UCDService"
android:settingsActivity=".activity.DataProfilingSettingsActivity"/>

<provider
android:name=".provider.TweetStoreProvider"
android:authorities="org.mariotaku.twidere.provider.TweetStore"
Expand All @@ -455,8 +459,6 @@
</intent-filter>
</receiver>

<service android:name="edu.ucdavis.earlybird.UCDService"/>

<receiver
android:name="edu.ucdavis.earlybird.UploadReceiver"
android:exported="false">
Expand Down
Binary file modified res/drawable-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-ldpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-xhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 21 additions & 21 deletions src/org/mariotaku/twidere/activity/ComposeActivity.java
Expand Up @@ -157,7 +157,6 @@ public void invalidateSupportOptionsMenu() {

@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent intent) {

switch (requestCode) {
case REQUEST_TAKE_PHOTO: {
if (resultCode == Activity.RESULT_OK) {
Expand All @@ -170,7 +169,7 @@ public void onActivityResult(final int requestCode, final int resultCode, final
} else {
mIsPhotoAttached = false;
}
setMenu(mMenuBar.getMenu());
setMenu();
} else {
mImageUri = null;
}
Expand All @@ -189,7 +188,7 @@ public void onActivityResult(final int requestCode, final int resultCode, final
} else {
mIsImageAttached = false;
}
setMenu(mMenuBar.getMenu());
setMenu();
}
break;
}
Expand Down Expand Up @@ -223,7 +222,7 @@ public void onActivityResult(final int requestCode, final int resultCode, final
} else {
break;
}
setMenu(mMenuBar.getMenu());
setMenu();
}
break;
}
Expand All @@ -248,7 +247,7 @@ public void onActivityResult(final int requestCode, final int resultCode, final
mImageUri = Uri.fromFile(file);
reloadAttachedImageThumbnail(file);
}
setMenu(mMenuBar.getMenu());
setMenu();
}
break;
}
Expand Down Expand Up @@ -431,7 +430,6 @@ public void onCreate(final Bundle savedInstanceState) {
mImageThumbnailPreview.setOnLongClickListener(this);
mMenuBar.setOnMenuItemClickListener(this);
mMenuBar.inflate(R.menu.menu_compose);
setMenu(mMenuBar.getMenu());
mMenuBar.show();
if (mPreferences.getBoolean(PREFERENCE_KEY_QUICK_SEND, false)) {
mEditText.setOnEditorActionListener(this);
Expand All @@ -448,7 +446,7 @@ public void onCreate(final Bundle savedInstanceState) {
mEditText.setSelection(mEditText.length());
}
}
invalidateSupportOptionsMenu();
setMenu();
mColorIndicator.setOrientation(ColorView.VERTICAL);
mColorIndicator.setColor(getAccountColors(this, mAccountIds));
mContentModified = savedInstanceState != null ? savedInstanceState.getBoolean(INTENT_KEY_CONTENT_MODIFIED)
Expand Down Expand Up @@ -494,7 +492,6 @@ public void onLoadFinished(final Loader<Bitmap> loader, final Bitmap data) {

}

/** Sets the mRecentLocation object to the current location of the device **/
@Override
public void onLocationChanged(final Location location) {
if (mRecentLocation == null) {
Expand Down Expand Up @@ -531,7 +528,7 @@ public boolean onMenuItemClick(final MenuItem item) {
getLocation();
}
mPreferences.edit().putBoolean(PREFERENCE_KEY_ATTACH_LOCATION, !attach_location).commit();
setMenu(mMenuBar.getMenu());
setMenu();
break;
}
case MENU_DRAFTS: {
Expand All @@ -540,21 +537,18 @@ public boolean onMenuItemClick(final MenuItem item) {
}
case MENU_DELETE: {
if (mImageUri == null) return false;
if (mIsImageAttached && !mIsPhotoAttached) {
mImageUri = null;

} else if (mIsPhotoAttached && !mIsImageAttached) {
final File image_file = mImageUri != null && "file".equals(mImageUri.getScheme()) ? new File(
mImageUri.getPath()) : null;
if (mIsPhotoAttached && !mIsImageAttached) {
final File image_file = "file".equals(mImageUri.getScheme()) ? new File(mImageUri.getPath())
: null;
if (image_file != null) {
image_file.delete();
}
mImageUri = null;
}
mImageUri = null;
mIsPhotoAttached = false;
mIsImageAttached = false;
reloadAttachedImageThumbnail(null);
setMenu(mMenuBar.getMenu());
setMenu();
break;
}
case MENU_EDIT: {
Expand Down Expand Up @@ -725,7 +719,7 @@ protected void onStart() {
final String uploader_component = mPreferences.getString(PREFERENCE_KEY_IMAGE_UPLOADER, null);
mUploadUseExtension = !isEmpty(uploader_component);
if (mMenuBar != null) {
setMenu(mMenuBar.getMenu());
setMenu();
}
final int text_size = mPreferences.getInt(PREFERENCE_KEY_TEXT_SIZE, PREFERENCE_DEFAULT_TEXT_SIZE);
mEditText.setTextSize(text_size * 1.25f);
Expand All @@ -751,7 +745,12 @@ private boolean getLocation() {
final String provider = mLocationManager.getBestProvider(criteria, true);

if (provider != null) {
final Location location = mLocationManager.getLastKnownLocation(provider);
final Location location;
if (mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
location = mLocationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
} else {
location = mLocationManager.getLastKnownLocation(provider);
}
if (location == null) {
mLocationManager.requestLocationUpdates(provider, 0, 0, this);
setSupportProgressBarIndeterminateVisibility(true);
Expand Down Expand Up @@ -796,7 +795,8 @@ private void send() {
finish();
}

private void setMenu(final Menu menu) {
private void setMenu() {
final Menu menu = mMenuBar.getMenu();
final int activated_color = getResources().getColor(R.color.holo_blue_bright);
final MenuItem itemAddImage = menu.findItem(MENU_ADD_IMAGE);
final Drawable iconAddImage = itemAddImage.getIcon().mutate();
Expand Down Expand Up @@ -842,8 +842,8 @@ private void setMenu(final Menu menu) {
}
drafts_cur.close();
}
invalidateSupportOptionsMenu();
mMenuBar.invalidate();
invalidateSupportOptionsMenu();
}

private void takePhoto() {
Expand Down
6 changes: 5 additions & 1 deletion src/org/mariotaku/twidere/activity/FiltersActivity.java
Expand Up @@ -61,7 +61,6 @@ public void onCreate(final Bundle savedInstanceState) {
mAdapter.addTab(FilteredKeywordsFragment.class, null, getString(R.string.keywords), null, 1);
mAdapter.addTab(FilteredSourcesFragment.class, null, getString(R.string.sources), null, 2);
mViewPager.setAdapter(mAdapter);
// mViewPager.setPagingEnabled(false);
mIndicator.setViewPager(mViewPager);
mIndicator.setDisplayLabel(true);
mIndicator.setDisplayIcon(false);
Expand All @@ -75,6 +74,11 @@ public boolean onCreateOptionsMenu(final Menu menu) {

@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case MENU_HOME:
finish();
return true;
}
return false;
}
}
18 changes: 3 additions & 15 deletions src/org/mariotaku/twidere/activity/HomeActivity.java
Expand Up @@ -187,10 +187,7 @@ public void onCreate(final Bundle savedInstanceState) {
if (bundle != null) {
final long[] refreshed_ids = bundle.getLongArray(INTENT_KEY_IDS);
if (refreshed_ids != null && !refresh_on_start && savedInstanceState == null) {
mService.getHomeTimeline(refreshed_ids, null);
mService.getMentions(refreshed_ids, null);
mService.getReceivedDirectMessages(account_ids, null);
mService.getSentDirectMessages(account_ids, null);
mService.refreshAll();
}
initial_tab = bundle.getInt(INTENT_KEY_INITIAL_TAB, -1);
switch (initial_tab) {
Expand Down Expand Up @@ -246,15 +243,7 @@ public void onCreate(final Bundle savedInstanceState) {
}
}
if (refresh_on_start && savedInstanceState == null) {
mService.getHomeTimelineWithSinceIds(activated_ids, null, null);
if (mPreferences.getBoolean(PREFERENCE_KEY_HOME_REFRESH_MENTIONS, false)) {
mService.getMentionsWithSinceIds(account_ids, null, null);
}
if (mPreferences.getBoolean(PREFERENCE_KEY_HOME_REFRESH_DIRECT_MESSAGES, false)) {
mService.getReceivedDirectMessagesWithSinceIds(account_ids, null,
getNewestMessageIdsFromDatabase(this, Inbox.CONTENT_URI));
mService.getSentDirectMessagesWithSinceIds(account_ids, null, null);
}
mService.refreshAll();
}
if (!mPreferences.getBoolean(PREFERENCE_KEY_API_UPGRADE_CONFIRMED, false)) {
final FragmentManager fm = getSupportFragmentManager();
Expand Down Expand Up @@ -478,8 +467,7 @@ protected void onNewIntent(final Intent intent) {
final long[] refreshed_ids = bundle.getLongArray(INTENT_KEY_IDS);
if (refreshed_ids != null) {
// TODO should I refresh inbox too?
mService.getHomeTimelineWithSinceIds(refreshed_ids, null, null);
mService.getMentionsWithSinceIds(refreshed_ids, null, null);
mService.refreshAll();
}
final int initial_tab = bundle.getInt(INTENT_KEY_INITIAL_TAB, -1);
if (initial_tab != -1 && mViewPager != null) {
Expand Down
Expand Up @@ -41,7 +41,7 @@ public HomeRefreshContentPreference(final Context context, final AttributeSet at

@Override
protected boolean[] getDefaults() {
return new boolean[] { false, false };
return new boolean[] { true, false };
}

@Override
Expand Down
Expand Up @@ -41,7 +41,7 @@ public NotificationContentPreference(final Context context, final AttributeSet a

@Override
protected boolean[] getDefaults() {
return new boolean[] { false, false, false };
return new boolean[] { false, true, true };
}

@Override
Expand Down

0 comments on commit 5693a7d

Please sign in to comment.