Questions tagged [design-guidelines]
89 questions
69
votes
5 answers
What should be the color of the Ripple, colorPrimary or colorAccent? (Material Design)
I have reading Material Design Guidelines but I don't know what should be the color of the Ripple if it isn't black (with alpha).
For example, I have an app with colorPrimary = blue, and colorAccent = red. Actually I am using the colorAccent (with…

JavierSegoviaCordoba
- 6,531
- 9
- 37
- 51
60
votes
2 answers
namespace naming conventions
For those of you out there writing reusable components, what do you consider to be best practice if you're extending the functionality of the .NET framework?
For example, I'm creating a Pop3 library at the moment as one doesn't exist in .NET. Do I…

Razor
- 17,271
- 25
- 91
- 138
31
votes
2 answers
Best practice for keeping data in memory and database at same time on Android
We're designing an Android app that has a lot of data ("customers", "products", "orders"...), and we don't want to query SQLite every time we need some record. We want to avoid to query the database as most as we can, so we decided to keep certain…

Christian
- 7,062
- 9
- 53
- 79
19
votes
1 answer
How can I disable Android Lollipop ripple's alpha value?
I have a ripple working with a custom color. However, the color is never fully opaque. According to the answers from What should be the color of the Ripple, colorPrimary or colorAccent? (Material Design) it always has an alpha of 40%. Looking at the…

Grzegorz Adam Hankiewicz
- 7,349
- 1
- 36
- 78
18
votes
1 answer
How to write testable code in Swift
So this question of mine all began when I started to do unit testing for a simple 2 line of postNotification and addObserver. From this similar question here you can see that to make it testable you need to add ~20 lines & part away from the common…

mfaani
- 33,269
- 19
- 164
- 293
14
votes
5 answers
When is it correct to create an extension method?
I have a piece of code like the following:
public class ActivityHelper
{
public void SetDate(IList anActivityList)
{
foreach(Activity current in anActivityList)
{
current.Date = DateTime.Now;
}
…

brainimus
- 10,586
- 12
- 42
- 64
12
votes
1 answer
Can I package entire iOS app as a Framework?
I have an app implemented in native iOS (Swift). There is a web version of the app as well. A client wants to embed my app to its own app and suggested I use an iFrame and load the web version.
I understand this is a tricky solution as Apple might…

PoolHallJunkie
- 1,345
- 14
- 33
12
votes
2 answers
Pros and Cons of implementing functionality as functor
I'm having a discussion with a colleague about the API of a simple class that has only one public method. I initially went for:
class CalculateSomething
{
public:
void operator()(const SomeObject &obj) const;
private:
// ...
}
However, my…

dgrine
- 702
- 6
- 15
11
votes
8 answers
Code "internationalization"
I worked on different projects in different countries and remarked that sometimes the code became internationalized, like
SetLargeurEtHauteur() (for SetWidthAndHeight, fr)
Dim _ListaDeObiecte as List(Of Object) (for…

serhio
- 28,010
- 62
- 221
- 374
11
votes
8 answers
Creating a single SmartTV app for multiple platforms?
I want to develop a SmartTV application for the GoogleTV platform and i've been browsing trough the GoogleTV Guidelines (https://developers.google.com/tv/android/).
However, i don't want GoogleTV to be my only platform. I also want the same app to…

K120
- 341
- 2
- 3
- 6
9
votes
8 answers
Pass by reference: Which is more readable/right?
I have the following class:
public class Person
{
public String Name { get; set; }
}
I have a method that takes in Person and a String as parameters:
public void ChangeName(Person p, String name)
{
p.Name = name;
}
Since Person was…

Ian
- 5,625
- 11
- 57
- 93
9
votes
2 answers
Google Style Guide (Section Forward Decleration)
Preface
The Google Style Guide includes a list of disadvantages of forward declaration
Forward declarations can hide a dependency, allowing user code to skip necessary recompilation when headers change.
A forward declaration may be broken by…
user4290866
9
votes
2 answers
What is the FDG for naming boolean properties?
What is the Framework Design Guideline for naming boolean properties? If there isn't one, then what's your recommendation?
Let's say I have a User class, and I need a property that specifies if the user is enabled or not. These are the options I can…

Max Toro
- 28,282
- 11
- 76
- 114
7
votes
1 answer
When do you violate SRP (Single Reponsibility Principle)?
SRP(PDF version; HTML version) states that
There should never be more than one reason for a class to change
When you take a look at Outlook, Calendar Event window, it has "Save and Close" button.
So when the functionalities of either or both Save…

dance2die
- 35,807
- 39
- 131
- 194
6
votes
1 answer
Display error dialog (MessageBox) with Only "Close" or "Cancel" buttons?
I read in Windows Experience Guidelines: Error Messages that "OK" is an incorrect button to display on an error dialog.
...provide a Close button. Don't use OK for error messages, because this wording implies that problems are OK.
So, how can I…
user166390