From 3c8303a158c4bcf373d7c55dadd1e219f0277c99 Mon Sep 17 00:00:00 2001 From: stom79 Date: Fri, 26 Oct 2018 17:00:38 +0200 Subject: [PATCH] Fix color for light theme --- .../gouv/etalab/mastodon/activities/AboutActivity.java | 9 --------- .../etalab/mastodon/activities/EditProfileActivity.java | 4 +--- .../gouv/etalab/mastodon/activities/LoginActivity.java | 3 --- .../etalab/mastodon/activities/RemoteFollowActivity.java | 4 +--- .../fr/gouv/etalab/mastodon/activities/TootActivity.java | 4 +--- .../etalab/mastodon/drawers/ConversationDecoration.java | 9 +++++---- .../etalab/mastodon/fragments/DisplayStatusFragment.java | 5 +++++ .../main/res/layout/fragment_settings_notifications.xml | 1 - app/src/main/res/values/styles.xml | 2 +- 9 files changed, 14 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/AboutActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/AboutActivity.java index ab091175b..5260cda70 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/AboutActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/AboutActivity.java @@ -173,15 +173,6 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou } }); - if( theme == Helper.THEME_LIGHT) { - about_code.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - about_thekinrar.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - about_trunk.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - about_translation.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - about_license.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - about_support.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - paypal.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } TextView about_website = findViewById(R.id.about_website); about_website.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/EditProfileActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/EditProfileActivity.java index 83d516183..40291b793 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/EditProfileActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/EditProfileActivity.java @@ -206,9 +206,7 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou set_lock_account.setEnabled(false); new RetrieveAccountInfoAsyncTask(getApplicationContext(), EditProfileActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - if( theme == Helper.THEME_LIGHT) { - set_profile_save.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } + } @Override diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/LoginActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/LoginActivity.java index b2fbbdc91..e686ab9be 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/LoginActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/LoginActivity.java @@ -140,9 +140,6 @@ public class LoginActivity extends BaseActivity { login_passwd = findViewById(R.id.login_passwd); - if (theme == Helper.THEME_LIGHT) { - connectionButton.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } login_instance.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick (AdapterView parent, View view, int position, long id) { diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/RemoteFollowActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/RemoteFollowActivity.java index 7f8434b24..5f2f6d1a7 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/RemoteFollowActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/RemoteFollowActivity.java @@ -122,9 +122,7 @@ public class RemoteFollowActivity extends BaseActivity implements OnRetrieveRemo loader = findViewById(R.id.loader); lv_account = findViewById(R.id.lv_account); rf_no_result = findViewById(R.id.rf_no_result); - if( theme == Helper.THEME_LIGHT) { - rf_search.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } + isLoadingInstance = false; ActionBar actionBar = getSupportActionBar(); if( actionBar != null) { diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java index 5a3f3f4a0..fb99aaa94 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java @@ -656,9 +656,7 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount if( restored != -1 ){ restoreToot(restored); } - if( theme == Helper.THEME_LIGHT) { - toot_it.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } + } @Override diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/ConversationDecoration.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/ConversationDecoration.java index 4060572ee..8575a1bf6 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/ConversationDecoration.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/ConversationDecoration.java @@ -57,10 +57,10 @@ public class ConversationDecoration extends RecyclerView.ItemDecoration{ StatusListAdapter adapter = (StatusListAdapter) parent.getAdapter(); int position = parent.getChildAdapterPosition(child); + assert adapter != null; Status status = adapter.getItem(position); - int top = 0; - int bottom = 0; + int top, bottom; if( status != null){ Status statusBefore = null; if( position > 0) @@ -74,9 +74,10 @@ public class ConversationDecoration extends RecyclerView.ItemDecoration{ child.getBottom():child.getTop()+offSet; if( position == 0 && childCount > 1) top = bottom - (int)Helper.convertDpToPixel(28, context); + divider.setBounds(left, top, right, bottom); + divider.draw(canvas); } - divider.setBounds(left, top, right, bottom); - divider.draw(canvas); + } } diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java index 9740064ca..68e830729 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java @@ -570,6 +570,11 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn if( statuses != null && statuses.size() > 0) retrieveMissingToots(statuses.get(0).getId()); } + }else if (type == RetrieveFeedsAsyncTask.Type.DIRECT){ + if( getUserVisibleHint() ){ + if( statuses != null && statuses.size() > 0) + retrieveMissingToots(statuses.get(0).getId()); + } }else if (type == RetrieveFeedsAsyncTask.Type.HOME){ statusListAdapter.updateMuted(mutedAccount); if( statuses != null && statuses.size() > 0) diff --git a/app/src/main/res/layout/fragment_settings_notifications.xml b/app/src/main/res/layout/fragment_settings_notifications.xml index dbdf991c4..f9da4113a 100644 --- a/app/src/main/res/layout/fragment_settings_notifications.xml +++ b/app/src/main/res/layout/fragment_settings_notifications.xml @@ -65,7 +65,6 @@ android:gravity="center" style="@style/Base.Widget.AppCompat.Button.Colored" android:tint="@android:color/white" - android:textColor="@color/white" android:text="@string/set_notif_sound" android:layout_width="wrap_content" android:layout_height="wrap_content"/> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index bacead113..190d3e347 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -91,7 +91,7 @@ @drawable/menu_selector