code nitpicks and color fix

This commit is contained in:
Ernir Erlingsson
2015-12-14 22:22:49 +01:00
parent 6ac999c113
commit cdf8392725
3 changed files with 23 additions and 25 deletions

View File

@@ -15,8 +15,12 @@
<color name="settings_title_text">#2D3E50</color> <color name="settings_title_text">#2D3E50</color>
<color name="settings_title_underline">#2D3E50</color> <color name="settings_title_underline">#2D3E50</color>
<color name="briar_primary">#2D3E50</color>
<color name="briar_primary_dark">#0f1720</color>
<color name="briar_text_link">#2D3E50</color> <color name="briar_text_link">#2D3E50</color>
<color name="briar_green_light">#95d220</color> <color name="briar_green_light">#95d220</color>
<color name="briar_green_dark">#75ab0d</color> <color name="briar_green_dark">#75ab0d</color>
<color name="briar_text_primary">#333333</color> <color name="briar_text_primary">#333333</color>
<color name="briar_text_primary_inverse">#ffffff</color>
</resources> </resources>

View File

@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="BriarTheme" parent="Theme.AppCompat.Light"> <style name="BriarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarStyle">@style/BriarActionBar</item> <item name="actionBarStyle">@style/BriarActionBar</item>
<item name="colorPrimary">@color/briar_green_light</item> <item name="colorPrimary">@color/briar_primary</item>
<item name="colorPrimaryDark">@color/briar_green_dark</item> <item name="colorPrimaryDark">@color/briar_primary_dark</item>
<item name="android:textColorPrimary">@color/briar_text_primary</item> <item name="android:textColorPrimary">@color/briar_text_primary</item>
<item name="android:textColorPrimaryInverse">@color/briar_text_primary_inverse</item>
<item name="android:textColorSecondary">@color/briar_text_primary</item>
<item name="android:textColorLink">@color/briar_text_link</item> <item name="android:textColorLink">@color/briar_text_link</item>
<!-- The rest of your attributes --> <!-- The rest of your attributes -->
@@ -15,14 +17,6 @@
<item name="elevation">1dp</item> <item name="elevation">1dp</item>
</style> </style>
<style name="WindowTitle">
<item name="android:paddingLeft">5dp</item>
<item name="android:textColor">@color/action_bar_text</item>
</style>
<style name="WindowTitleBackground">
<item name="android:background">@color/action_bar_background</item>
</style>
<style name="BriarButton"> <style name="BriarButton">
<item name="android:textSize">@dimen/text_size_medium</item> <item name="android:textSize">@dimen/text_size_medium</item>
<item name="android:padding">@dimen/margin_large</item> <item name="android:padding">@dimen/margin_large</item>

View File

@@ -47,42 +47,42 @@ public abstract class BaseActivity extends AppCompatActivity implements RoboCont
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
RoboInjector injector = RoboGuice.getInjector(this); RoboInjector injector = RoboGuice.getInjector(this);
this.eventManager = (EventManager) injector.getInstance(EventManager.class); eventManager = (EventManager) injector.getInstance(EventManager.class);
injector.injectMembersWithoutViews(this); injector.injectMembersWithoutViews(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
this.eventManager.fire(new OnCreateEvent(savedInstanceState)); eventManager.fire(new OnCreateEvent(savedInstanceState));
if (PREVENT_SCREENSHOTS) getWindow().addFlags(FLAG_SECURE); if (PREVENT_SCREENSHOTS) getWindow().addFlags(FLAG_SECURE);
} }
protected void onRestart() { protected void onRestart() {
super.onRestart(); super.onRestart();
this.eventManager.fire(new OnRestartEvent()); eventManager.fire(new OnRestartEvent());
} }
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
this.eventManager.fire(new OnStartEvent()); eventManager.fire(new OnStartEvent());
} }
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
this.eventManager.fire(new OnResumeEvent()); eventManager.fire(new OnResumeEvent());
} }
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
this.eventManager.fire(new OnPauseEvent()); eventManager.fire(new OnPauseEvent());
} }
protected void onNewIntent(Intent intent) { protected void onNewIntent(Intent intent) {
super.onNewIntent(intent); super.onNewIntent(intent);
this.eventManager.fire(new OnNewIntentEvent()); eventManager.fire(new OnNewIntentEvent());
} }
protected void onStop() { protected void onStop() {
try { try {
this.eventManager.fire(new OnStopEvent()); eventManager.fire(new OnStopEvent());
} finally { } finally {
super.onStop(); super.onStop();
} }
@@ -91,7 +91,7 @@ public abstract class BaseActivity extends AppCompatActivity implements RoboCont
protected void onDestroy() { protected void onDestroy() {
try { try {
this.eventManager.fire(new OnDestroyEvent()); eventManager.fire(new OnDestroyEvent());
} finally { } finally {
try { try {
RoboGuice.destroyInjector(this); RoboGuice.destroyInjector(this);
@@ -103,25 +103,25 @@ public abstract class BaseActivity extends AppCompatActivity implements RoboCont
} }
public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) {
Configuration currentConfig = this.getResources().getConfiguration(); Configuration currentConfig = getResources().getConfiguration();
super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig);
this.eventManager.fire(new OnConfigurationChangedEvent(currentConfig, newConfig)); eventManager.fire(new OnConfigurationChangedEvent(currentConfig, newConfig));
} }
public void onContentChanged() { public void onContentChanged() {
super.onContentChanged(); super.onContentChanged();
RoboGuice.getInjector(this).injectViewMembers(this); RoboGuice.getInjector(this).injectViewMembers(this);
this.eventManager.fire(new OnContentChangedEvent()); eventManager.fire(new OnContentChangedEvent());
} }
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
this.eventManager.fire(new OnActivityResultEvent(requestCode, resultCode, data)); eventManager.fire(new OnActivityResultEvent(requestCode, resultCode, data));
} }
@Override @Override
public Map<Key<?>, Object> getScopedObjectMap() { public Map<Key<?>, Object> getScopedObjectMap() {
return this.scopedObjects; return scopedObjects;
} }
private SharedPreferences getBriarPrefs(String prefsName) { private SharedPreferences getBriarPrefs(String prefsName) {