~ marked steps will be replaced with dependency injection in the following steps.
Start to move all business logic from view controller into view models.
~ Initialize view models in the view controllers.
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!--https://raw.githubusercontent.com/wada811/Android-Material-Design-Colors/master/library/src/main/res/values/colors.xml--> | |
<!-- red --> | |
<color name="md_red_50">#ffebee</color> | |
<color name="md_red_100">#ffcdd2</color> | |
<color name="md_red_200">#ef9a9a</color> | |
<color name="md_red_300">#e57373</color> |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.ScaleGestureDetector; | |
import android.view.View; | |
import android.widget.FrameLayout; | |
/** | |
* Layout that provides pinch-zooming of content. This view should have exactly one child | |
* view containing the content. |
public static String getRelativeTimeSpanString(Context context, Date fromdate) { | |
long then; | |
then = fromdate.getTime(); | |
Date date = new Date(then); | |
StringBuilder dateStr = new StringBuilder(); | |
Calendar calendar = Calendar.getInstance(); | |
calendar.setTime(date); |
import { Directive, ElementRef, Output, HostListener, EventEmitter } from '@angular/core'; | |
@Directive({ | |
selector: '[appClickOutside]' | |
}) | |
export class ClickOutsideDirective { | |
constructor(private elementRef: ElementRef) { } | |
@Output() |
fun getShortenedCount(count: Int): String { | |
return if (count < 1000) { | |
count.toString() | |
} else if (count < 1000000) { | |
val firstPart = count / 1000 | |
val secondPart = count % 1000 / 100 | |
if (secondPart > 0) { | |
"$firstPart,${secondPart}k}" | |
} else { | |
"${firstPart}k" |
Clone the seed project https://github.com/kerimovscreations/cicdworkshop1
Check the classes and tests work correctly
BookingService
,