Skip to content

Commit

Permalink
#202 Added "My Blue" Action bar color, which is the same as AndStatus…
Browse files Browse the repository at this point in the history
… icon. First screen logo changed.
  • Loading branch information
yvolk committed Jul 14, 2015
1 parent a2afbdb commit da57dec
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 20 deletions.
15 changes: 9 additions & 6 deletions app/src/main/java/org/andstatus/app/HelpActivity.java
Expand Up @@ -35,7 +35,6 @@
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
Expand All @@ -62,7 +61,7 @@ public class HelpActivity extends MyActivity implements SwipeInterface {
*/
public static final String EXTRA_IS_FIRST_ACTIVITY = ClassInApplicationPackage.PACKAGE_NAME + ".IS_FIRST_ACTIVITY";

public static final int PAGE_INDEX_DEFAULT = 0;
public static final int PAGE_INDEX_LOGO = 0;
public static final int PAGE_INDEX_USER_GUIDE = 1;
public static final int PAGE_INDEX_CHANGELOG = 2;

Expand All @@ -73,6 +72,7 @@ public class HelpActivity extends MyActivity implements SwipeInterface {
*/
private boolean mIsFirstActivity = false;
private boolean wasPaused = false;
private static boolean isFirstTimeRun = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -84,7 +84,8 @@ protected void onCreate(Bundle savedInstanceState) {
if (MyPreferences.shouldSetDefaultValues()) {
MyLog.e(this, "Default values were not set?!");
} else {
MyLog.i(this, "Default values has been set");
MyLog.i(this, "Default values has been set");
isFirstTimeRun = true;
}
}

Expand Down Expand Up @@ -295,9 +296,11 @@ public static boolean startFromActivity(Activity activity) {
intent.putExtra(HelpActivity.EXTRA_IS_FIRST_ACTIVITY, true);
}

int pageIndex = PAGE_INDEX_DEFAULT;
if (MyContextHolder.get().isReady() && MyContextHolder.get().persistentAccounts().isEmpty()) {
pageIndex = PAGE_INDEX_USER_GUIDE;
int pageIndex = PAGE_INDEX_LOGO;
if (MyContextHolder.get().persistentAccounts().isEmpty()) {
if (!isFirstTimeRun) {
pageIndex = PAGE_INDEX_USER_GUIDE;
}
} else if (showChangeLog) {
pageIndex = PAGE_INDEX_CHANGELOG;
}
Expand Down
Expand Up @@ -238,8 +238,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
switch (key) {
case MyPreferences.KEY_CUSTOM_LOCALE:
MyPreferences.setLocale(getActivity());
getActivity().finish();
startActivity(getActivity().getIntent());
restartMe();
break;
case MyPreferences.KEY_THEME_COLOR:
showThemeColor();
Expand Down Expand Up @@ -283,6 +282,11 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
}
}

private void restartMe() {
getActivity().finish();
startActivity(getActivity().getIntent());
}

@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
switch (preference.getKey()) {
Expand Down
Binary file modified app/src/main/res/drawable/splash_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/src/main/res/values/arrays_international.xml
Expand Up @@ -168,6 +168,9 @@
<item>@string/color_green</item>
<item>@string/color_teal</item>
<item>@string/color_blue</item>
<item>@string/color_light_blue</item>
<item>@string/color_material_blue</item>
<item>@string/color_my_blue</item>
<item>@string/color_grey</item>
</string-array>
<string-array name="background_color_entries">
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/colors.xml
Expand Up @@ -26,6 +26,12 @@
<color name="teal_700">#00796B</color>
<color name="blue_500">#2196F3</color>
<color name="blue_700">#1976D2</color>
<color name="light_blue_500">#03A9F4</color>
<color name="light_blue_700">#0288D1</color>
<color name="material_blue_500">#577AF3</color>
<color name="material_blue_700">#485CD4</color>
<color name="my_blue_500">#0073be</color>
<color name="my_blue_700">#005B97</color>
<color name="grey_500">#9E9E9E</color>
<color name="grey_700">#616161</color>

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Expand Up @@ -68,6 +68,9 @@
<string name="color_black">Black</string>
<string name="color_black_cat">Black Cat</string>
<string name="color_blue">Blue</string>
<string name="color_light_blue">Light Blue</string>
<string name="color_material_blue">Material Blue</string>
<string name="color_my_blue">My Blue</string>
<string name="color_carbon_grey">Carbon Grey</string>
<string name="color_charcoal">Charcoal</string>
<string name="color_grey">Grey</string>
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/values/styles.xml
Expand Up @@ -6,6 +6,9 @@
<item>ActionBarGreen</item>
<item>ActionBarTeal</item>
<item>ActionBarBlue</item>
<item>ActionBarLightBlue</item>
<item>ActionBarMaterialBlue</item>
<item>ActionBarMyBlue</item>
<item>ActionBarGrey</item>
</string-array>
<style name="ActionBarRed">
Expand All @@ -28,6 +31,18 @@
<item name="actionBarColor">@color/blue_500</item>
<item name="actionBarColorDark">@color/blue_700</item>
</style>
<style name="ActionBarLightBlue">
<item name="actionBarColor">@color/light_blue_500</item>
<item name="actionBarColorDark">@color/light_blue_700</item>
</style>
<style name="ActionBarMaterialBlue">
<item name="actionBarColor">@color/material_blue_500</item>
<item name="actionBarColorDark">@color/material_blue_700</item>
</style>
<style name="ActionBarMyBlue">
<item name="actionBarColor">@color/my_blue_500</item>
<item name="actionBarColorDark">@color/my_blue_700</item>
</style>
<style name="ActionBarGrey">
<item name="actionBarColor">@color/grey_500</item>
<item name="actionBarColorDark">@color/grey_700</item>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/preferences.xml
Expand Up @@ -58,7 +58,7 @@
<org.andstatus.app.context.MultilineListPreference android:key="action_bar_color"
android:entries="@array/action_bar_color_entries"
android:entryValues="@array/action_bar_color_values"
android:defaultValue="ActionBarTeal"
android:defaultValue="ActionBarMyBlue"
android:title="@string/action_bar_color_preference_title" />
<org.andstatus.app.context.MultilineListPreference android:key="background_color"
android:entries="@array/background_color_entries"
Expand Down
22 changes: 11 additions & 11 deletions res-src/icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit da57dec

Please sign in to comment.