updated l icons

improved compose screen
This commit is contained in:
Mariotaku Lee 2014-10-29 23:36:46 +08:00
parent 582a9e221f
commit 9b329b22cc
175 changed files with 193 additions and 145 deletions

View File

@ -3,7 +3,7 @@
<item
android:id="@id/center"
android:icon="@drawable/ic_action_mylocation"
android:icon="@drawable/ic_action_my_location"
android:showAsAction="always"
android:title="@string/center"/>

View File

@ -3,7 +3,7 @@
<item
android:id="@id/center"
android:icon="@drawable/ic_action_mylocation"
android:icon="@drawable/ic_action_my_location"
android:showAsAction="always"
android:title="@string/center"/>

View File

@ -109,6 +109,7 @@ public interface Constants extends TwidereConstants {
public static final int MENU_OPEN_WITH_ACCOUNT = R.id.open_with_account;
public static final int MENU_ACCOUNTS = R.id.accounts;
public static final int MENU_INVERSE_SELECTION = R.id.inverse_selection;
public static final int MENU_EDIT_MEDIAS = R.id.edit_medias;
public static final int LINK_ID_STATUS = 1;
public static final int LINK_ID_USER = 2;

View File

@ -100,6 +100,7 @@ import org.mariotaku.twidere.util.ParseUtils;
import org.mariotaku.twidere.util.SharedPreferencesWrapper;
import org.mariotaku.twidere.util.ThemeUtils;
import org.mariotaku.twidere.util.TwidereValidator;
import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.accessor.ViewAccessor;
import org.mariotaku.twidere.view.StatusTextCountView;
import org.mariotaku.twidere.view.holder.StatusViewHolder;
@ -222,11 +223,13 @@ public class ComposeActivity extends BaseSupportDialogActivity implements TextWa
public boolean handleMenuItem(final MenuItem item) {
switch (item.getItemId()) {
case MENU_TAKE_PHOTO: {
case MENU_TAKE_PHOTO:
case R.id.take_photo_sub_item: {
takePhoto();
break;
}
case MENU_ADD_IMAGE: {
case MENU_ADD_IMAGE:
case R.id.add_image_sub_item: {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT || !openDocument()) {
pickImage();
}
@ -647,7 +650,10 @@ public class ComposeActivity extends BaseSupportDialogActivity implements TextWa
final Intent composeExtensionsIntent = new Intent(INTENT_ACTION_EXTENSION_COMPOSE);
addIntentToMenu(this, menu, composeExtensionsIntent, MENU_GROUP_COMPOSE_EXTENSION);
final Intent imageExtensionsIntent = new Intent(INTENT_ACTION_EXTENSION_EDIT_IMAGE);
addIntentToMenu(this, menu, imageExtensionsIntent, MENU_GROUP_IMAGE_EXTENSION);
final MenuItem mediasMenuItem = menu.findItem(R.id.medias_menu);
if (mediasMenuItem != null && mediasMenuItem.hasSubMenu()) {
addIntentToMenu(this, mediasMenuItem.getSubMenu(), imageExtensionsIntent, MENU_GROUP_IMAGE_EXTENSION);
}
setMenu();
updateAccountSelection();
updateMediasPreview();
@ -881,6 +887,10 @@ public class ComposeActivity extends BaseSupportDialogActivity implements TextWa
return !mMediaPreviewAdapter.isEmpty();
}
private int getMediaCount() {
return mMediaPreviewAdapter.getCount();
}
private boolean isQuotingProtectedStatus() {
if (INTENT_ACTION_QUOTE.equals(getIntent().getAction()) && mInReplyToStatus != null)
return mInReplyToStatus.user_is_protected && mInReplyToStatus.account_id != mInReplyToStatus.user_id;
@ -936,29 +946,7 @@ public class ComposeActivity extends BaseSupportDialogActivity implements TextWa
// iconAddImage.clearColorFilter();
// }
// }
final MenuItem itemAttachLocation = menu.findItem(MENU_ADD_LOCATION);
if (itemAttachLocation != null) {
final boolean attachLocation = mPreferences.getBoolean(KEY_ATTACH_LOCATION, false);
if (attachLocation && getLocation()) {
itemAttachLocation.setChecked(true);
} else {
setProgressVisibility(false);
mPreferences.edit().putBoolean(KEY_ATTACH_LOCATION, false).apply();
itemAttachLocation.setChecked(false);
}
}
final MenuItem viewItem = menu.findItem(MENU_VIEW);
if (viewItem != null) {
viewItem.setVisible(mInReplyToStatus != null);
}
menu.setGroupEnabled(MENU_GROUP_IMAGE_EXTENSION, hasMedia);
menu.setGroupVisible(MENU_GROUP_IMAGE_EXTENSION, hasMedia);
final MenuItem itemToggleSensitive = menu.findItem(MENU_TOGGLE_SENSITIVE);
if (itemToggleSensitive != null) {
itemToggleSensitive.setVisible(hasMedia);
itemToggleSensitive.setEnabled(hasMedia);
itemToggleSensitive.setChecked(hasMedia && mIsPossiblySensitive);
}
}
private boolean setComposeTitle(final Intent intent) {
@ -995,8 +983,43 @@ public class ComposeActivity extends BaseSupportDialogActivity implements TextWa
private void setMenu() {
if (mMenuBar == null) return;
final Menu bottomMenu = mMenuBar.getMenu();
setCommonMenu(bottomMenu);
final Menu menu = mMenuBar.getMenu();
final MenuItem itemAttachLocation = menu.findItem(MENU_ADD_LOCATION);
if (itemAttachLocation != null) {
final boolean attachLocation = mPreferences.getBoolean(KEY_ATTACH_LOCATION, false);
if (attachLocation && getLocation()) {
itemAttachLocation.setChecked(true);
} else {
setProgressVisibility(false);
mPreferences.edit().putBoolean(KEY_ATTACH_LOCATION, false).apply();
itemAttachLocation.setChecked(false);
}
}
final MenuItem viewItem = menu.findItem(MENU_VIEW);
if (viewItem != null) {
viewItem.setVisible(mInReplyToStatus != null);
}
final boolean hasMedia = hasMedia(), hasInReplyTo = mInReplyToStatus != null;
/*
* No media & Not reply: [Take photo][Add image][Attach location][Drafts]
* Has media & Not reply: [Take photo][Medias menu][Attach location][Drafts]
* Is reply: [Medias menu][View status][Attach location][Drafts]
*/
Utils.setMenuItemAvailability(menu, MENU_TAKE_PHOTO, !hasInReplyTo);
Utils.setMenuItemAvailability(menu, R.id.take_photo_sub_item, hasInReplyTo);
Utils.setMenuItemAvailability(menu, MENU_ADD_IMAGE, !hasMedia && !hasInReplyTo);
Utils.setMenuItemAvailability(menu, MENU_VIEW, hasInReplyTo);
Utils.setMenuItemAvailability(menu, R.id.medias_menu, hasMedia || hasInReplyTo);
Utils.setMenuItemAvailability(menu, MENU_TOGGLE_SENSITIVE, hasMedia);
Utils.setMenuItemAvailability(menu, MENU_EDIT_MEDIAS, hasMedia);
menu.setGroupEnabled(MENU_GROUP_IMAGE_EXTENSION, hasMedia);
menu.setGroupVisible(MENU_GROUP_IMAGE_EXTENSION, hasMedia);
final MenuItem itemToggleSensitive = menu.findItem(MENU_TOGGLE_SENSITIVE);
if (itemToggleSensitive != null) {
itemToggleSensitive.setChecked(hasMedia && mIsPossiblySensitive);
}
mMenuBar.show();
}

View File

@ -470,7 +470,7 @@ public class AccountsDrawerFragment extends BaseSupportListFragment implements L
add(new OptionItem(R.string.accounts, R.drawable.ic_action_accounts, MENU_ACCOUNTS));
add(new OptionItem(R.string.drafts, R.drawable.ic_action_draft, MENU_DRAFTS));
add(new OptionItem(R.string.filters, R.drawable.ic_action_speaker_muted, MENU_FILTERS));
add(new OptionItem(R.string.settings, R.drawable.ic_action_preferences, MENU_SETTINGS));
add(new OptionItem(R.string.settings, R.drawable.ic_action_settings, MENU_SETTINGS));
}
}

View File

@ -103,7 +103,7 @@ public class CustomTabUtils implements Constants {
if (Utils.hasStaggeredTimeline()) {
CUSTOM_TABS_CONFIGURATION_MAP.put(TAB_TYPE_STAGGERED_HOME_TIMELINE, new CustomTabConfiguration(
StaggeredHomeTimelineFragment.class, R.string.staggered_home_timeline,
R.drawable.ic_action_staggered, CustomTabConfiguration.ACCOUNT_OPTIONAL,
R.drawable.ic_action_view_quilt, CustomTabConfiguration.ACCOUNT_OPTIONAL,
CustomTabConfiguration.FIELD_TYPE_NONE, 11, false));
}
@ -116,7 +116,7 @@ public class CustomTabUtils implements Constants {
CUSTOM_TABS_ICON_NAME_MAP.put("message", R.drawable.ic_action_message);
CUSTOM_TABS_ICON_NAME_MAP.put("quote", R.drawable.ic_action_quote);
CUSTOM_TABS_ICON_NAME_MAP.put("search", R.drawable.ic_action_search);
CUSTOM_TABS_ICON_NAME_MAP.put("staggered", R.drawable.ic_action_staggered);
CUSTOM_TABS_ICON_NAME_MAP.put("staggered", R.drawable.ic_action_view_quilt);
CUSTOM_TABS_ICON_NAME_MAP.put("star", R.drawable.ic_action_star);
CUSTOM_TABS_ICON_NAME_MAP.put("trends", R.drawable.ic_action_trends);
CUSTOM_TABS_ICON_NAME_MAP.put("twidere", R.drawable.ic_action_twidere);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 828 B

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 513 B

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 B

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 B

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

After

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 B

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 517 B

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 890 B

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B

Some files were not shown because too many files have changed in this diff Show More