From b07a363f102d196470c9e0c57f45fb271889786a Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Fri, 13 Mar 2015 04:32:54 +0800 Subject: [PATCH] theme fixes --- .../support/OpenStreetMapViewerActivity.java | 2 +- .../support/GoogleMapViewerActivity.java | 2 +- .../twidere/activity/FiltersActivity.java | 4 +-- .../support/AccountsManagerActivity.java | 2 +- ...tivity.java => BaseActionBarActivity.java} | 2 +- .../activity/support/BrowserActivity.java | 2 +- .../activity/support/ComposeActivity.java | 18 +++++++++--- .../activity/support/DataExportActivity.java | 2 +- .../activity/support/DataImportActivity.java | 2 +- .../activity/support/DraftsActivity.java | 2 +- .../activity/support/HomeActivity.java | 2 +- .../activity/support/LinkHandlerActivity.java | 2 +- .../support/QuickSearchBarActivity.java | 28 ++++++++++++++++--- .../activity/support/SignInActivity.java | 4 +-- .../support/UserProfileEditorActivity.java | 2 +- .../twidere/fragment/BaseFragment.java | 6 ++-- .../fragment/support/AbsStatusesFragment.java | 6 ++-- .../fragment/support/BaseSupportFragment.java | 6 ++-- .../DirectMessagesConversationFragment.java | 6 ++-- .../twidere/util/MultiSelectEventHandler.java | 6 ++-- .../divider_compose_vertical_dark.xml | 25 +++++++++++++++++ .../divider_compose_vertical_light.xml | 25 +++++++++++++++++ .../src/main/res/layout/activity_compose.xml | 4 +-- .../res/layout/activity_quick_search_bar.xml | 5 ++-- twidere/src/main/res/values/themes.xml | 4 +++ 25 files changed, 127 insertions(+), 42 deletions(-) rename twidere/src/main/java/org/mariotaku/twidere/activity/support/{BaseSupportActivity.java => BaseActionBarActivity.java} (98%) create mode 100644 twidere/src/main/res/drawable/divider_compose_vertical_dark.xml create mode 100644 twidere/src/main/res/drawable/divider_compose_vertical_light.xml diff --git a/twidere/src/fdroid/java/org/mariotaku/twidere/activity/support/OpenStreetMapViewerActivity.java b/twidere/src/fdroid/java/org/mariotaku/twidere/activity/support/OpenStreetMapViewerActivity.java index 418276c41..85d24260d 100644 --- a/twidere/src/fdroid/java/org/mariotaku/twidere/activity/support/OpenStreetMapViewerActivity.java +++ b/twidere/src/fdroid/java/org/mariotaku/twidere/activity/support/OpenStreetMapViewerActivity.java @@ -43,7 +43,7 @@ import org.osmdroid.views.overlay.OverlayItem; import java.util.ArrayList; import java.util.List; -public class OpenStreetMapViewerActivity extends BaseSupportActivity implements Constants { +public class OpenStreetMapViewerActivity extends BaseActionBarActivity implements Constants { private MapView mMapView; private double mLatitude, mLongitude; diff --git a/twidere/src/google/java/org/mariotaku/twidere/activity/support/GoogleMapViewerActivity.java b/twidere/src/google/java/org/mariotaku/twidere/activity/support/GoogleMapViewerActivity.java index 17ab48af3..8d883c3a9 100644 --- a/twidere/src/google/java/org/mariotaku/twidere/activity/support/GoogleMapViewerActivity.java +++ b/twidere/src/google/java/org/mariotaku/twidere/activity/support/GoogleMapViewerActivity.java @@ -38,7 +38,7 @@ import org.mariotaku.twidere.fragment.support.WebMapFragment; import org.mariotaku.twidere.util.ParseUtils; import org.mariotaku.twidere.util.ThemeUtils; -public class GoogleMapViewerActivity extends BaseSupportActivity implements Constants { +public class GoogleMapViewerActivity extends BaseActionBarActivity implements Constants { @Override public int getThemeResourceId() { diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/FiltersActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/FiltersActivity.java index 32ff71f5b..7185fdcd4 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/FiltersActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/FiltersActivity.java @@ -49,7 +49,7 @@ import android.widget.AutoCompleteTextView; import org.mariotaku.querybuilder.Expression; import org.mariotaku.twidere.R; -import org.mariotaku.twidere.activity.support.BaseSupportActivity; +import org.mariotaku.twidere.activity.support.BaseActionBarActivity; import org.mariotaku.twidere.activity.support.UserListSelectorActivity; import org.mariotaku.twidere.adapter.SourceAutoCompleteAdapter; import org.mariotaku.twidere.adapter.UserHashtagAutoCompleteAdapter; @@ -68,7 +68,7 @@ import org.mariotaku.twidere.util.ThemeUtils; import static org.mariotaku.twidere.util.Utils.getDefaultAccountId; -public class FiltersActivity extends BaseSupportActivity implements TabListener, OnPageChangeListener { +public class FiltersActivity extends BaseActionBarActivity implements TabListener, OnPageChangeListener { private static final String EXTRA_AUTO_COMPLETE_TYPE = "auto_complete_type"; private static final int AUTO_COMPLETE_TYPE_SOURCES = 2; diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/AccountsManagerActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/AccountsManagerActivity.java index cee0afb72..e4b513586 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/AccountsManagerActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/AccountsManagerActivity.java @@ -15,7 +15,7 @@ import org.mariotaku.twidere.fragment.support.AccountsManagerFragment; /** * Created by mariotaku on 14/10/26. */ -public class AccountsManagerActivity extends BaseSupportActivity { +public class AccountsManagerActivity extends BaseActionBarActivity { @Override public boolean onOptionsItemSelected(final MenuItem item) { diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/BaseSupportActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/BaseActionBarActivity.java similarity index 98% rename from twidere/src/main/java/org/mariotaku/twidere/activity/support/BaseSupportActivity.java rename to twidere/src/main/java/org/mariotaku/twidere/activity/support/BaseActionBarActivity.java index 03bd14336..bf734f6b1 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/BaseSupportActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/BaseActionBarActivity.java @@ -39,7 +39,7 @@ import org.mariotaku.twidere.view.MainFrameLayout.FitSystemWindowsCallback; import java.util.ArrayList; @SuppressLint("Registered") -public class BaseSupportActivity extends ThemedActionBarActivity implements Constants, +public class BaseActionBarActivity extends ThemedActionBarActivity implements Constants, FitSystemWindowsCallback, SystemWindowsInsetsCallback, IControlBarActivity { private boolean mInstanceStateSaved, mIsVisible, mIsOnTop; diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/BrowserActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/BrowserActivity.java index a8948ea66..ae85c8b19 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/BrowserActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/BrowserActivity.java @@ -30,7 +30,7 @@ import android.widget.Toast; import org.mariotaku.twidere.R; import org.mariotaku.twidere.fragment.BaseWebViewFragment; -public class BrowserActivity extends BaseSupportActivity { +public class BrowserActivity extends BaseActionBarActivity { private Uri mUri = Uri.parse("about:blank"); diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/ComposeActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/ComposeActivity.java index 3b5de4a9d..e95d541c0 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/ComposeActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/ComposeActivity.java @@ -68,6 +68,7 @@ import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; +import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; @@ -148,7 +149,7 @@ import static org.mariotaku.twidere.util.Utils.getShareStatus; import static org.mariotaku.twidere.util.Utils.showErrorMessage; import static org.mariotaku.twidere.util.Utils.showMenuItemToast; -public class ComposeActivity extends ThemedActionBarActivity implements TextWatcher, LocationListener, +public class ComposeActivity extends ThemedFragmentActivity implements TextWatcher, LocationListener, OnMenuItemClickListener, View.OnClickListener, OnEditorActionListener, OnLongClickListener { private static final String FAKE_IMAGE_LINK = "https://www.example.com/fake_image.jpg"; @@ -511,6 +512,15 @@ public class ComposeActivity extends ThemedActionBarActivity implements TextWatc public void onProviderEnabled(final String provider) { } + @NonNull + @Override + public MenuInflater getMenuInflater() { + if (mMenuInflater == null) { + mMenuInflater = new SupportMenuInflater(this); + } + return mMenuInflater; + } + @Override public void onProviderDisabled(final String provider) { } @@ -547,8 +557,8 @@ public class ComposeActivity extends ThemedActionBarActivity implements TextWatc } @Override - public void onSupportContentChanged() { - super.onSupportContentChanged(); + public void onContentChanged() { + super.onContentChanged(); mEditText = (EditText) findViewById(R.id.edit_text); mMediaPreviewGrid = (GridView) findViewById(R.id.media_thumbnail_preview); mMenuBar = (ActionMenuView) findViewById(R.id.menu_bar); @@ -600,7 +610,7 @@ public class ComposeActivity extends ThemedActionBarActivity implements TextWatc mValidator = new TwidereValidator(this); mImageLoader = app.getImageLoaderWrapper(); setContentView(R.layout.activity_compose); - setSupportProgressBarIndeterminateVisibility(false); +// setSupportProgressBarIndeterminateVisibility(false); setFinishOnTouchOutside(false); final long[] defaultAccountIds = getAccountIds(this); if (defaultAccountIds.length <= 0) { diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/DataExportActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/DataExportActivity.java index 808c1fb2e..b8b0ef15d 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/DataExportActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/DataExportActivity.java @@ -20,7 +20,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; -public class DataExportActivity extends BaseSupportActivity implements FileSelectorDialogFragment.Callback, +public class DataExportActivity extends BaseActionBarActivity implements FileSelectorDialogFragment.Callback, DataExportImportTypeSelectorDialogFragment.Callback { private ExportSettingsTask mTask; diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/DataImportActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/DataImportActivity.java index d502cc171..80c56c25d 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/DataImportActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/DataImportActivity.java @@ -18,7 +18,7 @@ import org.mariotaku.twidere.util.ThemeUtils; import java.io.File; import java.io.IOException; -public class DataImportActivity extends BaseSupportActivity implements FileSelectorDialogFragment.Callback, +public class DataImportActivity extends BaseActionBarActivity implements FileSelectorDialogFragment.Callback, DataExportImportTypeSelectorDialogFragment.Callback { private ImportSettingsTask mImportSettingsTask; diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/DraftsActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/DraftsActivity.java index 65b01815b..e13787fcf 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/DraftsActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/DraftsActivity.java @@ -71,7 +71,7 @@ import java.util.List; import static org.mariotaku.twidere.util.Utils.getDefaultTextSize; -public class DraftsActivity extends BaseSupportActivity implements LoaderCallbacks, OnItemClickListener, +public class DraftsActivity extends BaseActionBarActivity implements LoaderCallbacks, OnItemClickListener, MultiChoiceModeListener { private ContentResolver mResolver; diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/HomeActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/HomeActivity.java index cb5865c50..7d8353d0b 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/HomeActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/HomeActivity.java @@ -128,7 +128,7 @@ import static org.mariotaku.twidere.util.Utils.openMessageConversation; import static org.mariotaku.twidere.util.Utils.openSearch; import static org.mariotaku.twidere.util.Utils.showMenuItemToast; -public class HomeActivity extends BaseSupportActivity implements OnClickListener, OnPageChangeListener, +public class HomeActivity extends BaseActionBarActivity implements OnClickListener, OnPageChangeListener, SupportFragmentCallback, OnOpenedListener, OnClosedListener, OnLongClickListener, AnimatorListener { diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/LinkHandlerActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/LinkHandlerActivity.java index 0246f79b3..a1a7862ec 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/LinkHandlerActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/LinkHandlerActivity.java @@ -54,7 +54,7 @@ import org.mariotaku.twidere.view.TintedStatusFrameLayout; import static org.mariotaku.twidere.util.Utils.createFragmentForIntent; import static org.mariotaku.twidere.util.Utils.matchLinkId; -public class LinkHandlerActivity extends BaseSupportActivity implements OnClickListener, +public class LinkHandlerActivity extends BaseActionBarActivity implements OnClickListener, OnLongClickListener, SystemWindowsInsetsCallback, IControlBarActivity { private MultiSelectEventHandler mMultiSelectHandler; diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/QuickSearchBarActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/QuickSearchBarActivity.java index c0d5a37af..527c6699a 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/QuickSearchBarActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/QuickSearchBarActivity.java @@ -25,6 +25,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.database.Cursor; import android.graphics.PorterDuff.Mode; +import android.graphics.Rect; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.LoaderManager.LoaderCallbacks; @@ -74,6 +75,8 @@ import org.mariotaku.twidere.util.SwipeDismissListViewTouchListener.DismissCallb import org.mariotaku.twidere.util.ThemeUtils; import org.mariotaku.twidere.util.Utils; import org.mariotaku.twidere.util.content.ContentResolverUtils; +import org.mariotaku.twidere.view.ExtendedRelativeLayout; +import org.mariotaku.twidere.view.iface.IExtendedView.OnFitSystemWindowsListener; import java.util.ArrayList; import java.util.List; @@ -83,14 +86,17 @@ import static org.mariotaku.twidere.util.UserColorNameUtils.getUserNickname; /** * Created by mariotaku on 15/1/6. */ -public class QuickSearchBarActivity extends BaseSupportActivity implements OnClickListener, - OnEditorActionListener, LoaderCallbacks>, TextWatcher, OnItemSelectedListener, OnItemClickListener, DismissCallbacks { +public class QuickSearchBarActivity extends ThemedFragmentActivity implements OnClickListener, + OnEditorActionListener, LoaderCallbacks>, TextWatcher, + OnItemSelectedListener, OnItemClickListener, DismissCallbacks, OnFitSystemWindowsListener { private Spinner mAccountSpinner; private EditText mSearchQuery; private View mSearchSubmit; private ListView mSuggestionsList; private SuggestionsAdapter mUsersSearchAdapter; + private ExtendedRelativeLayout mMainContent; + private Rect mSystemWindowsInsets = new Rect(); @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -118,6 +124,12 @@ public class QuickSearchBarActivity extends BaseSupportActivity implements OnCli getSupportLoaderManager().restartLoader(0, null, this); } + @Override + public void onFitSystemWindows(Rect insets) { + mSystemWindowsInsets.set(insets); + updateWindowAttributes(); + } + @Override public void onItemClick(AdapterView parent, View view, int position, long id) { final SuggestionItem item = mUsersSearchAdapter.getItem(position); @@ -134,6 +146,11 @@ public class QuickSearchBarActivity extends BaseSupportActivity implements OnCli } + @Override + public int getThemeColor() { + return ThemeUtils.getUserAccentColor(this, getThemeResourceId()); + } + @Override public int getThemeResourceId() { return ThemeUtils.getQuickSearchBarThemeResource(this); @@ -156,6 +173,7 @@ public class QuickSearchBarActivity extends BaseSupportActivity implements OnCli mAccountSpinner.setSelection(index); } } + mMainContent.setOnFitSystemWindowsListener(this); mUsersSearchAdapter = new SuggestionsAdapter(this); mSuggestionsList.setAdapter(mUsersSearchAdapter); mSuggestionsList.setOnItemClickListener(this); @@ -186,8 +204,9 @@ public class QuickSearchBarActivity extends BaseSupportActivity implements OnCli } @Override - public void onSupportContentChanged() { - super.onSupportContentChanged(); + public void onContentChanged() { + super.onContentChanged(); + mMainContent = (ExtendedRelativeLayout) findViewById(R.id.main_content); mAccountSpinner = (Spinner) findViewById(R.id.account_spinner); mSearchQuery = (EditText) findViewById(R.id.search_query); mSearchSubmit = findViewById(R.id.search_submit); @@ -248,6 +267,7 @@ public class QuickSearchBarActivity extends BaseSupportActivity implements OnCli final Window window = getWindow(); final WindowManager.LayoutParams attributes = window.getAttributes(); attributes.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL; + attributes.y = mSystemWindowsInsets.top; window.setAttributes(attributes); } diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/SignInActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/SignInActivity.java index 3e08f320b..09a22f0df 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/SignInActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/SignInActivity.java @@ -84,7 +84,7 @@ import static org.mariotaku.twidere.util.Utils.isUserLoggedIn; import static org.mariotaku.twidere.util.Utils.showErrorMessage; import static org.mariotaku.twidere.util.Utils.trim; -public class SignInActivity extends BaseSupportActivity implements TwitterConstants, OnClickListener, +public class SignInActivity extends BaseActionBarActivity implements TwitterConstants, OnClickListener, TextWatcher { private static final String TWITTER_SIGNUP_URL = "https://twitter.com/signup"; @@ -138,7 +138,7 @@ public class SignInActivity extends BaseSupportActivity implements TwitterConsta break; } case REQUEST_BROWSER_SIGN_IN: { - if (resultCode == BaseSupportActivity.RESULT_OK && data != null) { + if (resultCode == BaseActionBarActivity.RESULT_OK && data != null) { doLogin(data); } break; diff --git a/twidere/src/main/java/org/mariotaku/twidere/activity/support/UserProfileEditorActivity.java b/twidere/src/main/java/org/mariotaku/twidere/activity/support/UserProfileEditorActivity.java index 7a49f85b6..482203922 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/activity/support/UserProfileEditorActivity.java +++ b/twidere/src/main/java/org/mariotaku/twidere/activity/support/UserProfileEditorActivity.java @@ -69,7 +69,7 @@ import static org.mariotaku.twidere.util.Utils.getTwitterInstance; import static org.mariotaku.twidere.util.Utils.isMyAccount; import static org.mariotaku.twidere.util.Utils.showErrorMessage; -public class UserProfileEditorActivity extends BaseSupportActivity implements OnSizeChangedListener, TextWatcher, +public class UserProfileEditorActivity extends BaseActionBarActivity implements OnSizeChangedListener, TextWatcher, OnClickListener, LoaderCallbacks> { private static final int LOADER_ID_USER = 1; diff --git a/twidere/src/main/java/org/mariotaku/twidere/fragment/BaseFragment.java b/twidere/src/main/java/org/mariotaku/twidere/fragment/BaseFragment.java index 59171ee71..b96172343 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/fragment/BaseFragment.java +++ b/twidere/src/main/java/org/mariotaku/twidere/fragment/BaseFragment.java @@ -27,7 +27,7 @@ import android.content.IntentFilter; import android.content.SharedPreferences; import org.mariotaku.twidere.Constants; -import org.mariotaku.twidere.activity.support.BaseSupportActivity; +import org.mariotaku.twidere.activity.support.BaseActionBarActivity; import org.mariotaku.twidere.app.TwidereApplication; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.MultiSelectManager; @@ -82,8 +82,8 @@ public class BaseFragment extends Fragment implements Constants { public void setProgressBarIndeterminateVisibility(final boolean visible) { final Activity activity = getActivity(); - if (activity instanceof BaseSupportActivity) { - ((BaseSupportActivity) activity).setProgressBarIndeterminateVisibility(visible); + if (activity instanceof BaseActionBarActivity) { + ((BaseActionBarActivity) activity).setProgressBarIndeterminateVisibility(visible); } } diff --git a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/AbsStatusesFragment.java b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/AbsStatusesFragment.java index e037afe40..692ad90c7 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/AbsStatusesFragment.java +++ b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/AbsStatusesFragment.java @@ -28,7 +28,7 @@ import com.squareup.otto.Subscribe; import org.mariotaku.twidere.R; import org.mariotaku.twidere.activity.iface.IControlBarActivity; import org.mariotaku.twidere.activity.iface.IControlBarActivity.ControlBarOffsetListener; -import org.mariotaku.twidere.activity.support.BaseSupportActivity; +import org.mariotaku.twidere.activity.support.BaseActionBarActivity; import org.mariotaku.twidere.adapter.AbsStatusesAdapter; import org.mariotaku.twidere.adapter.AbsStatusesAdapter.StatusAdapterListener; import org.mariotaku.twidere.adapter.decorator.DividerItemDecoration; @@ -424,8 +424,8 @@ public abstract class AbsStatusesFragment extends BaseSupportFragment impl private void setControlVisible(boolean visible) { final FragmentActivity activity = getActivity(); - if (activity instanceof BaseSupportActivity) { - ((BaseSupportActivity) activity).setControlBarVisibleAnimate(visible); + if (activity instanceof BaseActionBarActivity) { + ((BaseActionBarActivity) activity).setControlBarVisibleAnimate(visible); } } diff --git a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/BaseSupportFragment.java b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/BaseSupportFragment.java index a5b806f1b..443779a42 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/BaseSupportFragment.java +++ b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/BaseSupportFragment.java @@ -32,7 +32,7 @@ import android.support.v4.app.FragmentActivity; import android.view.View; import org.mariotaku.twidere.Constants; -import org.mariotaku.twidere.activity.support.BaseSupportActivity; +import org.mariotaku.twidere.activity.support.BaseActionBarActivity; import org.mariotaku.twidere.app.TwidereApplication; import org.mariotaku.twidere.fragment.iface.IBaseFragment; import org.mariotaku.twidere.fragment.iface.SupportFragmentCallback; @@ -98,8 +98,8 @@ public class BaseSupportFragment extends Fragment implements IBaseFragment, Cons public void setProgressBarIndeterminateVisibility(final boolean visible) { final Activity activity = getActivity(); - if (activity instanceof BaseSupportActivity) { - ((BaseSupportActivity) activity).setProgressBarIndeterminateVisibility(visible); + if (activity instanceof BaseActionBarActivity) { + ((BaseActionBarActivity) activity).setProgressBarIndeterminateVisibility(visible); } } diff --git a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/DirectMessagesConversationFragment.java b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/DirectMessagesConversationFragment.java index 06b1481ba..f12f52e8f 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/DirectMessagesConversationFragment.java +++ b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/DirectMessagesConversationFragment.java @@ -68,7 +68,7 @@ import org.mariotaku.querybuilder.Expression; import org.mariotaku.querybuilder.OrderBy; import org.mariotaku.querybuilder.RawItemArray; import org.mariotaku.twidere.R; -import org.mariotaku.twidere.activity.support.BaseSupportActivity; +import org.mariotaku.twidere.activity.support.BaseActionBarActivity; import org.mariotaku.twidere.activity.support.ImagePickerActivity; import org.mariotaku.twidere.adapter.AccountsSpinnerAdapter; import org.mariotaku.twidere.adapter.MessageConversationAdapter; @@ -196,7 +196,7 @@ public class DirectMessagesConversationFragment extends BaseSupportFragment impl if (view == null) throw new AssertionError(); final Context viewContext = view.getContext(); setHasOptionsMenu(true); - final BaseSupportActivity activity = (BaseSupportActivity) getActivity(); + final BaseActionBarActivity activity = (BaseActionBarActivity) getActivity(); final ActionBar actionBar = activity.getSupportActionBar(); if (actionBar == null) throw new NullPointerException(); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, @@ -632,7 +632,7 @@ public class DirectMessagesConversationFragment extends BaseSupportFragment impl } private void updateActionBar() { - final BaseSupportActivity activity = (BaseSupportActivity) getActivity(); + final BaseActionBarActivity activity = (BaseActionBarActivity) getActivity(); final ActionBar actionBar = activity.getSupportActionBar(); if (actionBar == null) return; actionBar.setDisplayOptions(mRecipient != null ? ActionBar.DISPLAY_SHOW_TITLE : ActionBar.DISPLAY_SHOW_CUSTOM, diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/MultiSelectEventHandler.java b/twidere/src/main/java/org/mariotaku/twidere/util/MultiSelectEventHandler.java index 209dfeed4..d2f146065 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/MultiSelectEventHandler.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/MultiSelectEventHandler.java @@ -33,7 +33,7 @@ import com.twitter.Extractor; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere.R; -import org.mariotaku.twidere.activity.support.BaseSupportActivity; +import org.mariotaku.twidere.activity.support.BaseActionBarActivity; import org.mariotaku.twidere.app.TwidereApplication; import org.mariotaku.twidere.menu.AccountActionProvider; import org.mariotaku.twidere.model.ParcelableAccount; @@ -64,13 +64,13 @@ public class MultiSelectEventHandler implements Constants, ActionMode.Callback, private ActionMode mActionMode; - private final BaseSupportActivity mActivity; + private final BaseActionBarActivity mActivity; private AccountActionProvider mAccountActionProvider; public static final int MENU_GROUP = 201; - public MultiSelectEventHandler(final BaseSupportActivity activity) { + public MultiSelectEventHandler(final BaseActionBarActivity activity) { mActivity = activity; } diff --git a/twidere/src/main/res/drawable/divider_compose_vertical_dark.xml b/twidere/src/main/res/drawable/divider_compose_vertical_dark.xml new file mode 100644 index 000000000..49af11833 --- /dev/null +++ b/twidere/src/main/res/drawable/divider_compose_vertical_dark.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/twidere/src/main/res/drawable/divider_compose_vertical_light.xml b/twidere/src/main/res/drawable/divider_compose_vertical_light.xml new file mode 100644 index 000000000..a5b234d52 --- /dev/null +++ b/twidere/src/main/res/drawable/divider_compose_vertical_light.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/twidere/src/main/res/layout/activity_compose.xml b/twidere/src/main/res/layout/activity_compose.xml index df655f1db..28c06900f 100644 --- a/twidere/src/main/res/layout/activity_compose.xml +++ b/twidere/src/main/res/layout/activity_compose.xml @@ -121,8 +121,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0" - android:background="?android:colorBackground" - android:divider="?dividerVertical" + android:background="?android:panelColorBackground" + android:divider="?android:dividerVertical" android:orientation="vertical" android:showDividers="beginning"> diff --git a/twidere/src/main/res/layout/activity_quick_search_bar.xml b/twidere/src/main/res/layout/activity_quick_search_bar.xml index 09b544a92..c7ba70ddf 100644 --- a/twidere/src/main/res/layout/activity_quick_search_bar.xml +++ b/twidere/src/main/res/layout/activity_quick_search_bar.xml @@ -18,12 +18,13 @@ ~ along with this program. If not, see . --> - - \ No newline at end of file + \ No newline at end of file diff --git a/twidere/src/main/res/values/themes.xml b/twidere/src/main/res/values/themes.xml index bf8c7382f..d08989504 100644 --- a/twidere/src/main/res/values/themes.xml +++ b/twidere/src/main/res/values/themes.xml @@ -187,12 +187,16 @@ false false true + #3c3c3c + @drawable/divider_compose_vertical_dark