Here's list of things you might be interested
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 | |
internal fun Text(/* params */) { | |
/* a lot of magic */ | |
val children = @Composable { | |
Draw { canvas, _ -> | |
internalSelection.value?.let { renderParagraph.paintSelection(canvas, it) } | |
renderParagraph.paint(canvas, Offset(0.0f, 0.0f)) | |
} | |
} | |
/* a lot more magic */ |
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
import androidx.compose.* | |
import androidx.ui.core.* | |
@Composable | |
fun Greeting(name: String) { | |
Text ("Hello $name!") | |
} |
- What Google said Jetpack Compose is
- A really really quick recap of how Android draw stuff on screen right now
- A quick look at the example code (i.e. how to use it)
- Dig into how it actually works
- What is it made of
- Runtime
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 PresenterWithDI( | |
private val networking: NetworkWrapper, | |
private val crashReporting: CrashReporting | |
) { | |
fun onSaveClicked() { | |
val (response, error) = networking.callTheApi() | |
if (error != null) | |
crashReporting.log("Oh no") | |
else | |
Log.d("DI", "Yay") |
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
val currentLocation: Observable<LatLong> = TODO("the platform API keeps sending signal to this object") | |
currentLocation.subscribeBy( | |
onNext -> { latLong -> moveThePin(latLong) }, | |
onError -> { throwable -> TODO("tell user that current location is not retrievable or something") }, | |
onComplete -> { TODO("this is the end of the transmission, turn it off or something") }) | |
fun moveThePin(latLong: LatLong) { TODO("move the Pin") } |
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
interface ViewHolderFactory { | |
fun createViewHolder(parent: ViewGroup, onClick: () -> Unit): ViewHolder | |
} | |
class ViewHolderFactoryImpl1 : ViewHolderFactory { | |
override fun createViewHolder(parent: ViewGroup, onClick: () -> Unit): ViewHolder = TODO("") | |
} | |
class ViewHolderFactoryImpl2 : ViewHolderFactory { | |
override fun createViewHolder(parent: ViewGroup, onClick: () -> Unit): ViewHolder = TODO("") |
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 SomeAdapter( | |
val factory1: ViewHolderFactory1, | |
val factory2: ViewHOlderFactory2 | |
): RecyclerView.Adapter<RecyclerView.ViewHolder>() { | |
override fun getItemViewType(position: Int) = if (position == 0) 1 else 2 | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = when (viewType) { | |
1 -> factory1.createViewHolder(parent) | |
2 -> factory2.createViewHolder(parent) | |
else -> error("This should not be possible") |
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 SomethingActivity extends AppCompatActivity { | |
@Override | |
void onCreate() { | |
super.onCreate(); | |
setContentView(R.layout.activity_something); | |
} | |
@Override | |
void onResume() { | |
retrofitService.someApiEndpoint().enqueue(this); |
NewerOlder