Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tips and tricks du rebranding de l'app Captain Train

Tips and tricks du rebranding de l'app Captain Train

Talk fait au PAUG le 12/12/16 en Français

Jeremie Martinez

December 12, 2016
Tweet

More Decks by Jeremie Martinez

Other Decks in Technology

Transcript

  1. Bonnes pratiques colors.xml Nommer vos couleurs selon le métier Garder

    votre palette la plus petite possible Toujours faire des alias
  2. <!-- Official colors -->
 <color name="accent">#01c3a7</color>
 <color name="primary">#21314d</color>
 <color name="primaryDark">#1a273d</color>


    
 <!-- Text variants -->
 <color name="ct_text_primary">#323e42</color>
 <color name="ct_text_secondary">#8c9da1</color>
 <color name="ct_text_accent">#14b69f</color>
 
 <!-- Status colors -->
 <color name="ct_error">#e02007</color>
 <color name="ct_info">#0375b6</color>
 <color name="ct_success">#90c25b</color>
 <color name="ct_warning">#e87619</color>
  3. <!-- Official colors -->
 <color name="accent">#01c3a7</color>
 <color name="primary">#21314d</color>
 <color name="primaryDark">#1a273d</color>


    
 <!-- Text variants -->
 <color name="ct_text_primary">#323e42</color>
 <color name="ct_text_secondary">#8c9da1</color>
 <color name="ct_text_accent">#14b69f</color>
 
 <!-- Status colors -->
 <color name="ct_error">#e02007</color>
 <color name="ct_info">#0375b6</color>
 <color name="ct_success">#90c25b</color>
 <color name="ct_warning">#e87619</color>
  4. <!-- Official colors -->
 <color name="accent">#01c3a7</color>
 <color name="primary">#21314d</color>
 <color name="primaryDark">#1a273d</color>


    
 <!-- Text variants -->
 <color name="ct_text_primary">#323e42</color>
 <color name="ct_text_secondary">#8c9da1</color>
 <color name="ct_text_accent">#14b69f</color>
 
 <!-- Status colors -->
 <color name="ct_error">#e02007</color>
 <color name="ct_info">#0375b6</color>
 <color name="ct_success">#90c25b</color>
 <color name="ct_warning">#e87619</color>
  5. Bonnes pratiques themes.xml Utiliser au maximum les thèmes Séparer vos

    fichiers de thèmes : themes.xml styles.xml text_styles.xml
  6. <style name="Theme.CaptainTrain" parent="Base.Theme.CaptainTrain">
 <item name="colorAccent">@color/accent</item>
 </style> 
 
 <style name="Theme.CaptainTrain.Cancellation">


    <item name="colorAccent">@color/cancellation</item>
 </style> 
 
 <style name="Theme.CaptainTrain.Exchange">
 <item name="colorAccent">@color/exchange</item>
 </style>
  7. <style name="Theme.CaptainTrain" parent="Base.Theme.CaptainTrain">
 <item name="colorAccent">@color/accent</item>
 <item name="ctColorTextAccent">@color/text_accent</item>
 </style>
 
 <style

    name="Theme.CaptainTrain.Cancellation">
 <item name="colorAccent">@color/cancellation</item>
 <item name="ctColorTextAccent">@color/text_cancellation</item>
 </style>
 
 <style name="Theme.CaptainTrain.Exchange">
 <item name="colorAccent">@color/exchange</item>
 <item name="ctColorTextAccent">@color/text_exchange</item>
 </style> themes.xml
  8. <style name="Theme.CaptainTrain" parent="Base.Theme.CaptainTrain">
 <item name="colorAccent">@color/accent</item>
 <item name="ctColorTextAccent">@color/text_accent</item> <item name="ctButtonStyle">@style/Button.Action</item>
 </style>


    
 <style name="Theme.CaptainTrain.Cancellation">
 <item name="colorAccent">@color/cancellation</item>
 <item name="ctColorTextAccent">@color/text_cancellation</item> <item name="ctButtonStyle">@style/Button.Action.Cancellation</item>
 </style>
 
 <style name="Theme.CaptainTrain.Exchange">
 <item name="colorAccent">@color/exchange</item>
 <item name="ctColorTextAccent">@color/text_exchange</item> <item name="ctButtonStyle">@style/Button.Action.Exchange</item>
 </style>
  9. No!

  10. ApplicationUpdatedReceiver public class ApplicationUpdatedReceiver extends BroadcastReceiver {
 
 
 …

    } }
 @Override
 public void onReceive(Context context, Intent intent) {
  11. ApplicationUpdatedReceiver String action = intent.getAction();
 if (TextUtils.isEmpty(action)) {
 return;
 }

    switch (action) {
 … break; } }
 @Override
 public void onReceive(Context context, Intent intent) { case Intent.ACTION_MY_PACKAGE_REPLACED:
  12. ApplicationUpdatedReceiver case Intent.ACTION_MY_PACKAGE_REPLACED: AppPreferences preferences = AppPreferences.from(context);
 int version =

    preferences. getInt(PREVIOUS_APP_VERSION, VERSION_CODES.NARIM); 
 if (version < VERSION_CODES.ONEILL) {
 bumpToOneill(context);
 version = VERSION_CODES.ONEILL;
 } 
 if (version < VERSION_CODES.PENDERGAST) {
 bumpToPendergast(context);
 version = VERSION_CODES.PENDERGAST;
 }
 
 preferences.edit().
 putInt(PREVIOUS_APP_VERSION, version).
 apply();
  13. ApplicationUpdatedReceiver case Intent.ACTION_MY_PACKAGE_REPLACED: AppPreferences preferences = AppPreferences.from(context);
 int version =

    preferences. getInt(PREVIOUS_APP_VERSION, VERSION_CODES.NARIM); 
 if (version < VERSION_CODES.ONEILL) {
 bumpToOneill(context);
 version = VERSION_CODES.ONEILL;
 } 
 if (version < VERSION_CODES.PENDERGAST) {
 bumpToPendergast(context);
 version = VERSION_CODES.PENDERGAST;
 }
 
 preferences.edit().
 putInt(PREVIOUS_APP_VERSION, version).
 apply();
  14. ApplicationUpdatedReceiver case Intent.ACTION_MY_PACKAGE_REPLACED: AppPreferences preferences = AppPreferences.from(context);
 int version =

    preferences. getInt(PREVIOUS_APP_VERSION, VERSION_CODES.NARIM); 
 if (version < VERSION_CODES.ONEILL) {
 bumpToOneill(context);
 version = VERSION_CODES.ONEILL;
 } 
 if (version < VERSION_CODES.PENDERGAST) {
 bumpToPendergast(context);
 version = VERSION_CODES.PENDERGAST;
 }
 
 preferences.edit().
 putInt(PREVIOUS_APP_VERSION, version).
 apply();
  15. ApplicationUpdatedReceiver case Intent.ACTION_MY_PACKAGE_REPLACED: AppPreferences preferences = AppPreferences.from(context);
 int version =

    preferences. getInt(PREVIOUS_APP_VERSION, VERSION_CODES.NARIM); 
 if (version < VERSION_CODES.ONEILL) {
 bumpToOneill(context);
 version = VERSION_CODES.ONEILL;
 } 
 if (version < VERSION_CODES.PENDERGAST) {
 bumpToPendergast(context);
 version = VERSION_CODES.PENDERGAST;
 }
 
 preferences.edit().
 putInt(PREVIOUS_APP_VERSION, version).
 apply();
  16. Conclusion Ça prend du temps Faire le minimum de changements

    possible Vous allez oublier des choses Il y aura forcément des déçus