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
final ParseRelation parseRelation = eachParseObject.getRelation("orgRelation"); | |
ParseQuery<ParseObject> relationQuery = parseRelation.getQuery(); | |
relationQuery.findInBackground(new FindCallback<ParseObject>() { | |
@Override | |
public void done(List<ParseObject> parseObjects, ParseException e) { | |
if (parseObjects.size() == 0) { | |
ParseQuery orgQuery = new ParseQuery("Organizer"); | |
try { | |
ParseObject orgObject = orgQuery.getFirst(); | |
Log.d(DailyKind.TAG, "orgObject: " + orgObject.getObjectId()); |
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
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | |
LHIdeaGroupCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IdeaGroupCell"]; | |
CGFloat labelWidth = cell.descriptionLabel.width; | |
LHIdeaGroup *currentGroup = [self.objects objectAtIndex:indexPath.row]; | |
CGRect r = [currentGroup.Description boundingRectWithSize:CGSizeMake(labelWidth, 0) | |
options:NSStringDrawingUsesLineFragmentOrigin | |
attributes:@{NSFontAttributeName: cell.descriptionLabel.font} | |
context:nil]; |
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
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { | |
if (!connectionError) { | |
NSError *error = nil; | |
NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; | |
if (!error) { | |
for (NSDictionary *eachPark in jsonArray) { | |
NSString *title = [eachPark objectForKey:@"stitle"]; | |
NSString *body = [eachPark objectForKey:@"xbody"]; | |
NSLog(@"Park info: %@, %@", title, body); |
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
final ImageView dreamImageView = (ImageView)rootView.findViewById(R.id.dream_image_view); | |
DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics(); | |
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)dreamImageView.getLayoutParams(); | |
params.height = displayMetrics.widthPixels; | |
dreamImageView.setLayoutParams(params); |
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
@Override | |
protected void loadStories(final boolean more) { | |
final ParseQuery<ParseObject> parseQuery = ParseQuery.getQuery("Story"); | |
parseQuery.include("StoryTeller"); | |
parseQuery.orderByDescending("createdAt"); | |
parseQuery.include("ideaPointer"); | |
parseQuery.include("graphicPointer"); | |
ParseQuery<Flag> flagQuery = ParseQuery.getQuery(Flag.class); | |
flagQuery.whereEqualTo("Object", "Story"); |
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
@Override | |
protected void onPostCreate(Bundle savedInstanceState) { | |
super.onPostCreate(savedInstanceState); | |
ideaQuery = ParseQuery.getQuery("Idea"); | |
ideaQuery.whereEqualTo("objectId", ideaId); | |
ideaQuery.getFirstInBackground(new GetCallback<ParseObject>() { | |
@Override | |
public void done(ParseObject parseObject, ParseException e) { |
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
@Override | |
public void onCreate() { | |
super.onCreate(); | |
// UserVoice | |
Config config = new Config("lovingheart.uservoice.com"); | |
config.setForumId(244034); | |
config.setTopicId(50280); | |
UserVoice.init(config, this); |
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
package tw.alphacamp.tripphotoapp.object; | |
import com.parse.ParseClassName; | |
import com.parse.ParseFile; | |
import com.parse.ParseGeoPoint; | |
import com.parse.ParseObject; | |
/** | |
* Created by edward_chiang on 15/1/24. | |
*/ |
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
// Create ParseFile | |
final ParseFile file = new ParseFile(ParseUser.getCurrentUser().getUsername() + "_"+ Calendar.getInstance().getTimeInMillis() + ".jpg", image); | |
if (progressDialog!=null && !progressDialog.isShowing()) { | |
progressDialog.show(); | |
} | |
file.saveInBackground(new SaveCallback() { | |
@Override | |
public void done(ParseException e) { | |
final ParseObject imageObject = new ParseObject("GraphicImage"); | |
imageObject.put("imageType", "file"); |
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
final TextView userErrorTextView = (TextView)rootView.findViewById(R.id.user_login_exception_text_view); | |
rootView.findViewById(R.id.user_login_button).setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
if (userIdLoginEditText.getText() != null | |
&& userIdLoginEditText.getText().length() > 0 | |
&& userPasswordLoginEditText.getText() != null | |
&& userPasswordLoginEditText.getText().length() > 0) { |
OlderNewer