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 A { | |
public int doSomeWork() { | |
B objectB = new B(); | |
int result = objectB.getResult(); | |
int finalResult = result * 2; | |
return finalResult; | |
} | |
} |
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 A { | |
public int doSomeWork(int p1, int p2, String p3) { | |
B objectB = new B(p1, p2, p3); | |
int result = objectB.getResult(); | |
int finalResult = result * 2; | |
return finalResult; | |
} | |
} |
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 A { | |
private B objectB; | |
public A(B objectB) { | |
this.objectB = objectB; | |
} | |
public int doSomeWork() { | |
int result = objectB.getResult(); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:layoutDescription="@xml/scene_2"> | |
<View | |
android:id="@+id/rectangle" | |
android:layout_width="0dp" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:motion="http://schemas.android.com/apk/res-auto"> | |
<Transition | |
motion:constraintSetEnd="@id/state_top" | |
motion:constraintSetStart="@id/state_mid" | |
motion:duration="300"> | |
<OnSwipe | |
motion:dragDirection="dragUp" |
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 fun <T> viewProperty(default: T) = object : ObservableProperty<T>(default) { | |
override fun beforeChange(property: KProperty<*>, oldValue: T, newValue: T): Boolean = | |
newValue != oldValue | |
override fun afterChange(property: KProperty<*>, oldValue: T, newValue: T) { | |
postInvalidateOnAnimation() | |
} | |
} |
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 fun onDraw(canvas: Canvas) { | |
super.onDraw(canvas) | |
canvas.drawCircle(centerX, centerCircleY, radius, circlePaint) | |
val textCenterY = centerY - ((textPaint.descent() + textPaint.ascent()) / 2) | |
canvas.drawText(label, centerX, textCenterY, textPaint) | |
} |
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
@Composable | |
fun TweetList(state: TweetListState) { | |
val context = LocalContext.current | |
val listState = rememberLazyListState() | |
val exoPlayer = remember { | |
SimpleExoPlayer.Builder(context).build().apply { | |
repeatMode = Player.REPEAT_MODE_ALL | |
} | |
} |