Skip to content

Commit

Permalink
Theme overrides (#8)
Browse files Browse the repository at this point in the history
* Remove foreground notification from jobs

* Remove dynamic theming

* Change fixed color setting on new conversation fab

* Change default theme colors

* Consolidate style colors. Build dev style variant.
  • Loading branch information
jlewis13 authored Oct 3, 2019
1 parent 3f260b9 commit b811e80
Show file tree
Hide file tree
Showing 41 changed files with 343 additions and 795 deletions.
7 changes: 7 additions & 0 deletions app/src/dev/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#37474f</color>
<color name="colorPrimaryDark">#102027</color>
<color name="colorAccent">#62727b</color>
<color name="colorPop">#F47D20</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:theme="@style/Application.LightTheme"
android:allowBackup="false"
tools:replace="android:allowBackup">
<activity-alias
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,12 @@
import android.support.v4.app.FragmentTransaction;
import android.support.v4.preference.PreferenceFragment;

import io.forsta.relay.AuthenticationRequiredActionBarActivity;
import io.forsta.relay.ConversationListActivity;
import io.forsta.relay.DeviceActivity;

import io.forsta.librelay.LocalUserFragment;
import io.forsta.librelay.LogSubmitActivity;
import io.forsta.librelay.preferences.AdvancedPreferenceFragment;
import io.forsta.librelay.preferences.AppearancePreferenceFragment;
import io.forsta.librelay.preferences.ChatsPreferenceFragment;
import io.forsta.librelay.preferences.NotificationsPreferenceFragment;
import io.forsta.librelay.util.DynamicLanguage;
import io.forsta.librelay.util.DynamicTheme;
import io.forsta.librelay.util.TextSecurePreferences;

/**
Expand All @@ -52,18 +46,15 @@ public class ApplicationPreferencesActivity extends AuthenticationRequiredAction
private static final String TAG = ApplicationPreferencesActivity.class.getSimpleName();

private static final String PREFERENCE_CATEGORY_NOTIFICATIONS = "preference_category_notifications";
private static final String PREFERENCE_CATEGORY_APPEARANCE = "preference_category_appearance";
private static final String PREFERENCE_CATEGORY_CHATS = "preference_category_chats";
private static final String PREFERENCE_CATEGORY_ADVANCED = "preference_category_advanced";
private static final String PREFERENCE_CATEGORY_DEVICES = "preference_category_devices";

private final DynamicTheme dynamicTheme = new DynamicTheme();
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
private AdvancedPreferenceFragment advancedPreferenceFragment;

@Override
protected void onPreCreate() {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this);
}

Expand All @@ -84,7 +75,6 @@ protected void onCreate(Bundle icicle) {
@Override
public void onResume() {
super.onResume();
dynamicTheme.onResume(this);
dynamicLanguage.onResume(this);
}

Expand Down Expand Up @@ -128,8 +118,6 @@ public void onCreate(Bundle icicle) {

this.findPreference(PREFERENCE_CATEGORY_NOTIFICATIONS)
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_NOTIFICATIONS));
this.findPreference(PREFERENCE_CATEGORY_APPEARANCE)
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_APPEARANCE));
this.findPreference(PREFERENCE_CATEGORY_CHATS)
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_CHATS));
this.findPreference(PREFERENCE_CATEGORY_ADVANCED)
Expand All @@ -148,8 +136,6 @@ public void onResume() {
private void setCategorySummaries() {
this.findPreference(PREFERENCE_CATEGORY_NOTIFICATIONS)
.setSummary(NotificationsPreferenceFragment.getSummary(getActivity()));
this.findPreference(PREFERENCE_CATEGORY_APPEARANCE)
.setSummary(AppearancePreferenceFragment.getSummary(getActivity()));
this.findPreference(PREFERENCE_CATEGORY_CHATS)
.setSummary(ChatsPreferenceFragment.getSummary(getActivity()));
}
Expand All @@ -169,9 +155,6 @@ public boolean onPreferenceClick(Preference preference) {
case PREFERENCE_CATEGORY_NOTIFICATIONS:
fragment = new NotificationsPreferenceFragment();
break;
case PREFERENCE_CATEGORY_APPEARANCE:
fragment = new AppearancePreferenceFragment();
break;
case PREFERENCE_CATEGORY_CHATS:
fragment = new ChatsPreferenceFragment();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
import io.forsta.librelay.contacts.ContactSelectionListFragment;
import io.forsta.librelay.recipients.DirectoryHelper;
import io.forsta.librelay.util.DynamicLanguage;
import io.forsta.librelay.util.DynamicNoActionBarTheme;
import io.forsta.librelay.util.DynamicTheme;
import io.forsta.librelay.util.ViewUtil;

/**
Expand All @@ -55,7 +53,6 @@ public abstract class ContactSelectionActivity extends AuthenticationRequiredAct
{
private static final String TAG = ContactSelectionActivity.class.getSimpleName();

private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();

protected ContactSelectionListFragment contactsFragment;
Expand All @@ -66,7 +63,7 @@ public abstract class ContactSelectionActivity extends AuthenticationRequiredAct

@Override
protected void onPreCreate() {
dynamicTheme.onCreate(this);
setTheme(R.style.Application_LightNoActionBar);
dynamicLanguage.onCreate(this);
}

Expand All @@ -91,7 +88,6 @@ protected void onCreate(Bundle icicle) {
@Override
public void onResume() {
super.onResume();
dynamicTheme.onResume(this);
dynamicLanguage.onResume(this);
}

Expand Down
7 changes: 2 additions & 5 deletions app/src/main/java/io/forsta/relay/ConversationActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
import io.forsta.librelay.database.model.MessageRecord;
import io.forsta.librelay.database.model.ThreadRecord;
import io.forsta.librelay.media.PartAuthority;
import io.forsta.librelay.preferences.ThreadPreferenceFragment;
import io.forsta.relay.AttachmentManager.MediaType;
import io.forsta.librelay.media.AttachmentTypeSelectorAdapter;
import io.forsta.librelay.media.AudioSlide;
Expand All @@ -122,7 +123,6 @@
import io.forsta.librelay.recipients.Recipients.RecipientsModifiedListener;
import io.forsta.librelay.service.WebRtcCallService;
import io.forsta.librelay.util.DynamicLanguage;
import io.forsta.librelay.util.DynamicTheme;
import io.forsta.librelay.util.ExpirationUtil;
import io.forsta.librelay.util.MediaUtil;
import io.forsta.librelay.util.TextSecurePreferences;
Expand Down Expand Up @@ -193,12 +193,10 @@ public class ConversationActivity extends AuthenticationRequiredActionBarActivit
private Handler handler = new Handler();
private ContentObserver threadObserver;

private DynamicTheme dynamicTheme = new DynamicTheme();
private DynamicLanguage dynamicLanguage = new DynamicLanguage();

@Override
protected void onPreCreate() {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this);
}

Expand Down Expand Up @@ -244,7 +242,6 @@ protected void onNewIntent(Intent intent) {
@Override
protected void onResume() {
super.onResume();
dynamicTheme.onResume(this);
dynamicLanguage.onResume(this);
quickAttachmentDrawer.onResume();

Expand Down Expand Up @@ -846,7 +843,7 @@ private void initializeViews() {
public void onClick(View v) {
if (threadId != -1) {
Intent intent = new Intent(ConversationActivity.this, ThreadPreferenceActivity.class);
intent.putExtra(ThreadPreferenceActivity.THREAD_ID_EXTRA, threadId);
intent.putExtra(ThreadPreferenceFragment.THREAD_ID_EXTRA, threadId);

startActivitySceneTransition(intent, titleView.findViewById(io.forsta.librelay.R.id.title), "thread_preferences");
}
Expand Down
13 changes: 0 additions & 13 deletions app/src/main/java/io/forsta/relay/ConversationListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,14 @@

import org.json.JSONObject;

import io.forsta.relay.ApplicationContext;
import io.forsta.relay.AuthenticationRequiredActionBarActivity;
import io.forsta.relay.ConversationActivity;
import io.forsta.relay.ConversationListArchiveActivity;
import io.forsta.relay.LoginActivity;
import io.forsta.relay.ApplicationPreferencesActivity;

import io.forsta.librelay.ConversationListFragment;
import io.forsta.librelay.atlas.AtlasApi;
import io.forsta.librelay.atlas.AtlasPreferences;
import io.forsta.librelay.atlas.AtlasSyncAdapter;
import io.forsta.librelay.atlas.model.AtlasOrg;
import io.forsta.librelay.database.DbFactory;
import io.forsta.librelay.jobs.DirectoryRefreshJob;
import io.forsta.librelay.notifications.MessageNotifier;
import io.forsta.librelay.recipients.Recipients;
import io.forsta.librelay.util.DynamicLanguage;
import io.forsta.librelay.util.DynamicTheme;

public class ConversationListActivity extends AuthenticationRequiredActionBarActivity
implements ConversationListFragment.ConversationSelectedListener, ConversationListFragment.NewConversationClickListener
Expand All @@ -65,15 +55,13 @@ public class ConversationListActivity extends AuthenticationRequiredActionBarAct
private static IntentFilter syncIntentFilter = new IntentFilter(AtlasSyncAdapter.ATLAS_SYNC_COMPLETE);
private BroadcastReceiver syncReceiver;

private final DynamicTheme dynamicTheme = new DynamicTheme ();
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();

private ConversationListFragment fragment;
private LinearLayout syncIndicator;

@Override
protected void onPreCreate() {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this);
}

Expand Down Expand Up @@ -110,7 +98,6 @@ protected void onCreate(Bundle savedState) {
@Override
public void onResume() {
super.onResume();
dynamicTheme.onResume(this);
dynamicLanguage.onResume(this);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@
import io.forsta.librelay.ConversationListFragment;
import io.forsta.librelay.recipients.Recipients;
import io.forsta.librelay.util.DynamicLanguage;
import io.forsta.librelay.util.DynamicTheme;

public class ConversationListArchiveActivity extends AuthenticationRequiredActionBarActivity
implements ConversationListFragment.ConversationSelectedListener
{

private final DynamicTheme dynamicTheme = new DynamicTheme();
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();

@Override
protected void onPreCreate() {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this);
}

Expand All @@ -40,7 +37,6 @@ protected void onCreate(Bundle icicle) {
@Override
public void onResume() {
super.onResume();
dynamicTheme.onResume(this);
dynamicLanguage.onResume(this);
}

Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/io/forsta/relay/DeviceActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@

import io.forsta.librelay.DeviceListFragment;
import io.forsta.librelay.util.DynamicLanguage;
import io.forsta.librelay.util.DynamicTheme;

public class DeviceActivity extends AuthenticationRequiredActionBarActivity {
private static final String TAG = DeviceActivity.class.getSimpleName();

private final DynamicTheme dynamicTheme = new DynamicTheme();
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();

private DeviceListFragment deviceListFragment;

@Override
public void onPreCreate() {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this);
}

Expand All @@ -35,7 +32,6 @@ public void onCreate(Bundle bundle) {
@Override
public void onResume() {
super.onResume();
dynamicTheme.onResume(this);
dynamicLanguage.onResume(this);
}

Expand Down
17 changes: 5 additions & 12 deletions app/src/main/java/io/forsta/relay/MediaOverviewActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ public class MediaOverviewActivity extends AuthenticationRequiredActionBarActivi

@Override
protected void onPreCreate() {
this.setTheme(io.forsta.librelay.R.style.TextSecure_DarkTheme);
this.setTheme(R.style.Application_LightNoActionBar);
dynamicLanguage.onCreate(this);
}

@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setFullscreenIfPossible();

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);

getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.media_overview_activity);
Expand All @@ -98,16 +101,6 @@ public void onConfigurationChanged(Configuration newConfig) {
if (gridManager != null) gridManager.setSpanCount(getResources().getInteger(R.integer.media_overview_cols));
}

@TargetApi(VERSION_CODES.JELLY_BEAN)
private void setFullscreenIfPossible() {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}
}

@Override
public void onResume() {
super.onResume();
Expand Down
11 changes: 2 additions & 9 deletions app/src/main/java/io/forsta/relay/MediaPreviewActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public class MediaPreviewActivity extends AuthenticationRequiredActionBarActivit
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.setTheme(io.forsta.librelay.R.style.TextSecure_DarkTheme);
this.setTheme(R.style.Application_LightNoActionBar);
dynamicLanguage.onCreate(this);

setFullscreenIfPossible();
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

Expand All @@ -80,13 +80,6 @@ protected void onCreate(Bundle bundle) {
initializeActionBar();
}

@TargetApi(VERSION_CODES.JELLY_BEAN)
private void setFullscreenIfPossible() {
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}
}

@Override
public void onModified(Recipient recipient) {
initializeActionBar();
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/io/forsta/relay/MessageDetailsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import io.forsta.librelay.recipients.Recipients;
import io.forsta.librelay.util.DateUtils;
import io.forsta.librelay.util.DynamicLanguage;
import io.forsta.librelay.util.DynamicTheme;
import io.forsta.librelay.util.ExpirationUtil;
import io.forsta.librelay.util.Util;

Expand Down Expand Up @@ -84,14 +83,12 @@ public class MessageDetailsActivity extends AuthenticationRequiredActionBarActiv
private ListView recipientsList;
private LayoutInflater inflater;

private DynamicTheme dynamicTheme = new DynamicTheme();
private DynamicLanguage dynamicLanguage = new DynamicLanguage();

private boolean running;

@Override
protected void onPreCreate() {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this);
}

Expand All @@ -109,7 +106,6 @@ public void onCreate(Bundle bundle) {
@Override
protected void onResume() {
super.onResume();
dynamicTheme.onResume(this);
dynamicLanguage.onResume(this);
getSupportActionBar().setTitle(R.string.AndroidManifest__message_details);

Expand Down
Loading

0 comments on commit b811e80

Please sign in to comment.