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
class LinkedList { | |
Node head; | |
static class Node { | |
int data; | |
Node next; | |
Node(int d) |
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 name="app_font">San-Francisco-Regular.ttf</string> |
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
<TextView | |
style="@style/QuoteMainTextStyle" | |
app:font="@{@string/app_font}" /> |
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
@BindingAdapter({"bind:font"}) | |
public static void setFont(TextView textView, String fontName) { | |
Typeface typeface = Typeface.createFromAsset(context.getAssets(), "fonts/" + fontName); | |
textView.setTypeface(typeface); | |
} |
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
<ImageView | |
android:layout_width="@dimen/place_item_image_size" | |
android:layout_height="@dimen/place_item_image_size" | |
app:imageUrl="@{viewModel.imageUrl}" /> |
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
@BindingAdapter({"bind:imageUrl"}) | |
public static void loadImage(ImageView imageView, String imageUrl) { | |
Glide.with(imageView.getContext()) | |
.load(imageUrl) | |
.diskCacheStrategy(DiskCacheStrategy.SOURCE) | |
.placeholder(R.color.lighter_gray) | |
.into(imageView); |
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
<code> | |
android:text= | |
"@{DateConverter.convertDateToDisplayTime(viewModel.updatedDate)}"/> | |
</code> |
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
@BindingConversion | |
public static String convertDateToDisplayedText(Date date) { | |
return new SimpleDateFormat("yyyy:MM:dd").format(date); | |
} |
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 final ObservableField<Date> updatedDate = new ObservableField<>(); |
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
<TextView | |
style="@style/Subtitle" | |
android:text="@{viewModel.updatedDate}"/> |
NewerOlder