This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (CKComponent *)layoutComponentThatFits:(CGSize)constrainedSize | |
{ | |
return [CKInsetComponent | |
newWithInsets:UIEdgeInsetsMake(kOuterPadding, kOuterPadding, kOuterPadding, kOuterPadding) | |
component: | |
[CKStackLayoutComponent | |
newWithSize:{.maxWidth = constrainedSize.width, .maxHeight = constrainedSize.height} | |
style:{.direction = CKStackLayoutDirectionHorizontal, .spacing = kInnerPadding} // Change to CKStackLayoutDirectionVertical it will just work!!! | |
children:{ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UISearchBar+AFNetworking.h | |
// | |
// Created by Huy Nguyen on 7/15/14. | |
// Copyright (c) 2014 Huy Nguyen. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <Availability.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void setStringSet(int keyResId, Set<String> values) { | |
String key = mContext.getString(keyResId); | |
SharedPreferences.Editor editor = mSharedPreferences.edit(); | |
if (Build.VERSION.SDK_INT >= 11) { | |
editor.putStringSet(key, values); | |
} else { | |
Gson gson = new Gson(); | |
String jsonValue = gson.toJson(values); | |
editor.putString(key, value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private BadgeView mBadgeView; | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getSupportMenuInflater().inflate(R.menu.badge_demo, menu); | |
MenuItem menuItem = menu.findItem(R.id.item_id); | |
ImageButton iconView = new ImageButton(this, null, | |
com.actionbarsherlock.R.style.Widget_Sherlock_ActionButton); | |
iconView.setImageDrawable(menuItem.getIcon()); |