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
[ | |
{ | |
"suit": "hearts", | |
"value": 2 | |
}, | |
{ | |
"suit": "hearts", | |
"value": 9 | |
}, | |
{ |
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 class RunningClass { | |
public static void main(String [] args) | |
{ | |
List<String> list = new LinkedList<>(); | |
process(Collections.singletonList("2890"), list); | |
for (String element : list) { | |
System.out.println(element); | |
} |
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 loadChats() { | |
final User_ currentUser = authenticateManager.getCurrentUser(); | |
if (currentUser != null) { | |
//Fetch all the teachers associated to this student | |
$FirebaseDatabase("/associations/{currentUser.getUserId()}/teachers").model(User_.class).setKeyIntoField("userId"); | |
if ($FirebaseDatabase.MultipleValues) { | |
List<Chat_> chats = new LinkedList<>(); |
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 class CustomTimePickerDialog extends TimePickerDialog { | |
private final static int TIME_PICKER_INTERVAL = 15; | |
private TimePicker timePicker; | |
private final OnTimeSetListener callback; | |
public HorekoTimePicker(Context context, | |
OnTimeSetListener callBack, int hourOfDay, int minute, boolean is24HourView) { | |
super(context, callBack, hourOfDay, minute/TIME_PICKER_INTERVAL, is24HourView); | |
this.callback = callBack; |
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
String[] types= {"Select Date", "Select Time"} | |
$AlertDialog().items(types); | |
if ($AlertDialog.ItemSelected) { | |
int $position = 0; | |
if ($position == 0 ) { | |
$DateDialog(); | |
int $year = 0, $month = 0, $day = 0; | |
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
//Prepare the intent | |
Intent intent = $MainActivity().intent() | |
.flags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK) | |
.get(); | |
//Prepare pending intent | |
PendingIntent contentIntent = PendingIntent.getActivity( | |
this, 0, notificationIntent, | |
PendingIntent.FLAG_CANCEL_CURRENT); |
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
void selectDate() { | |
$DateDialog(); | |
int $year = 0, $month = 0, $day = 0; | |
String selectedDate = String.format(Locale.US, "Selected date is %02d-%02d-%02d", $year , $month+1, $day); | |
$Toast(selectedDate); | |
} | |
void selectTime() { | |
$TimeDialog(); |
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
//Showing AlertDialog with a message and a title | |
//---------------------------------------------- | |
$AlertDialog().title("Example") | |
.message("This is an example") | |
.positiveButton("OK"); | |
//Showing a "Rate this app" message using Strings resources | |
//--------------------------------------------------------- | |
$AlertDialog().message(R.string.rate_this_app) |
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
Dialog dialog = $ProgressDialog().message("Loading…").dialog(); | |
//Execute time consuming actions | |
dialog.dismiss(); |
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
@Model | |
User_ user; | |
@Click | |
void sayHelloToUser() { | |
$Toast("Hello {user.getName()}!"); | |
} |
NewerOlder