Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Commit

Permalink
some small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
heruoxin committed Mar 7, 2015
1 parent dafffa8 commit 2acbcb6
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ public void onFocusChange(View v, boolean hasFocus) {
}

//set activity title and icon.
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.ic_action_edit);
String titleText = getString(R.string.title_activity_activity_editor);
if (oldText.isEmpty()) {
titleText = getString(R.string.title_activity_editor);
}
getSupportActionBar().setTitle(titleText);
getSupportActionBar().setTitle(" "+titleText);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setTaskDescription(new ActivityManager.TaskDescription(
titleText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.action_search:
return super.onOptionsItemSelected(item);
case R.id.action_star:
isStarred = !isStarred;
mFabRotation(isStarred, TRANSLATION_SLOW);
setStarredIcon();
setView();
onStarredMenuClicked();
break;
// case R.id.action_refresh:
// setView(queryText);
Expand Down Expand Up @@ -320,6 +317,23 @@ public void onAnimationRepeat(Animator animation) {
}, 200);
}

private void onStarredMenuClicked() {
isStarred = !isStarred;
mFabRotation(isStarred, TRANSLATION_SLOW);
setStarredIcon();
setView();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mFAB.setImageResource(isStarred ?
R.drawable.ic_action_star_white
:
R.drawable.ic_action_add
);
}
}, TRANSLATION_SLOW / 3 * 2);
}

private void mFabRotation(boolean clockwise, long time) {
if (isRotating) return;
mFAB.setRotation(0);
Expand Down
Binary file added app/src/main/res/drawable-hdpi/ic_action_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_action_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/ic_action_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/ic_switch_star_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified release-files/screenshot-phone/en-US/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2acbcb6

Please sign in to comment.