码迷,mamicode.com
首页 >  
搜索关键字:design patterns    ( 5715个结果
Material design之Views and Shadows
Views and Shadows: elevation是构成控件阴影的基本属性。通过设置较高的Z值可以接受更大的阴影,阴影只能投射到Z=0的平面上。View Elevation 控件的Z值,是由两个值组成的:高度和位移。高度是固有的属性,位移可以用于创建动画。 Z = elevation +...
分类:其他好文   时间:2014-07-14 21:47:09    阅读次数:257
Mediator Design Pattern 中介者模式
就是设计一个Mediator类,可以处理其他类的关系。 Mediator类: 1 拥有其他所有类的实例对象 2 设置一个接口供其他类使用,其他类也拥有一个Mediator类成员,只需调用这个Mediator接口函数使用,无需自己处理关系。 3 Mediator内部已经设置好各个类的关系了,其他类只要直接使用Mediator处理关系就可以了。 下面是一个聊天室聊天是处理关系的实例程序:...
分类:其他好文   时间:2014-07-14 12:49:41    阅读次数:179
How to add a button to PreferenceScreen
There is another solution for customizing the appearance of the preferences.Design a normal XML layout with buttons or whatever you want to add to the...
分类:其他好文   时间:2014-07-14 00:47:37    阅读次数:306
[LeetCode] Best Time to Buy and Sell Stock III
ay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete at...
分类:其他好文   时间:2014-07-13 23:22:16    阅读次数:294
App Widgets
http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#design http://developer.android.com/guide/topics/appwidgets/index.html http://developer.android.com/guide/topics/appwidg...
分类:移动开发   时间:2014-07-13 18:03:10    阅读次数:294
Proxy Design Pattern 代理设计模式
代理设计模式,这个模式很多用于服务器客户端之类的,上网也经常使用代理之类的,想起来感觉是很复杂的,不过这个设置模式本身是很简单的。 就是一个类调用另外一个类的函数,客户调用的是一个类,而实际的工作是由另外一个类做的。 体现这个设计模式的代码: #include class RealObj { public: virtual void handleReq() = 0; };...
分类:其他好文   时间:2014-07-13 17:30:48    阅读次数:188
Android:创建可穿戴应用 - 自定义布局
本文介绍如何创建自定义通知以及使用可穿戴UI库来创建自定义布局,同时还需要了解可穿戴设计准则(Wear Design Principles)。 除了屏幕尺寸和瞬读能力(Glance ability)外,为可穿戴应用创建布局大体和普通手机一样。...
分类:移动开发   时间:2014-07-13 17:25:03    阅读次数:284
LeetCode——Best Time to Buy and Sell Stock III
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions. Note: You ma...
分类:其他好文   时间:2014-07-13 13:55:14    阅读次数:305
Design Pattern Visitor 访问者模式
访问者模式,就是我们已经有一系列的对象了,那么就可以使用一个visitor对象一次性遍历所有的对象,就好像这个visitor访问了所有这些对象一样,所以就叫访问者模式。 实现起来也很简单,就是三个基类,其他类都是这些基类的衍生类。 下面的Action类就是访问者类了,而Person类就是被访问的对象类,而House是一个接待容器,可以接待不同的Action类。 #include #incl...
分类:其他好文   时间:2014-07-12 22:22:16    阅读次数:205
LeetCode——Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on...
分类:其他好文   时间:2014-07-12 16:31:50    阅读次数:192
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!