This file contains hidden or 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 SwiftUI | |
struct CorrectRepresentableExample: View { | |
@State private var clickCount: Int = 0 | |
var body: some View { | |
VStack { | |
TopView { | |
self.clickCount += 1 | |
} | |
.frame(maxHeight: .infinity) |
This file contains hidden or 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 SomeRepo { | |
val selectedProfileFlow: Flow<String> | |
} | |
// iosMain | |
interface ProfileObserver { | |
fun startObserving(onChange: (String) -> Unit) | |
fun stopObserving() | |
} |
This file contains hidden or 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 apiKey = BuildConfig.API_KEY |
This file contains hidden or 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
/** | |
* Analog of RxJava's Observable.scan operator. | |
* | |
* Returns a LiveData that applies the [accumulator] function to the fist item in the source LiveData, | |
* and an initial value, then feeds the result of that function along with the second item emitted by | |
* the source LiveData into the same function, and so on until all items have been emitted by the source | |
* LiveData, emitting the result of each of these iterations. | |
*/ | |
fun <T, R> LiveData<T>.scan(initialValue: R, accumulator: (R, T) -> R): LiveData<R> { | |
val returnLiveData = MediatorLiveData<R>() |
This file contains hidden or 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
/** | |
* An enhanced {@code CheckBox} that differentiates between user clicks and | |
* programmatic clicks. In particular, the {@code OnCheckedChangeListener} is | |
* <strong>not</strong> triggered when the state of the checkbox is changed | |
* programmatically. | |
* | |
*/ | |
public class EnhancedCheckBox extends CheckBox implements ProgrammaticallyCheckable{ | |
private CompoundButton.OnCheckedChangeListener mListener = null; | |
public EnhancedCheckBox(Context context) { |
This file contains hidden or 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
package com.github.curioustechizen.safereg; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.support.v4.util.ArrayMap; | |
/** | |
* Helper class to keep track of what {@code BroadcastReceiver}s have been |
This file contains hidden or 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 'package:flutter/material.dart'; | |
const kSelectedColor = Colors.blueAccent; | |
const kUnselectedColor = Colors.transparent; | |
const kSelectedShadowOffset = Offset(0.0, 4.0); | |
final kSelectedBorderRadius = BorderRadius.circular(32.0); | |
void main() { | |
runApp(MyApp()); | |
} |
This file contains hidden or 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 'package:flutter/material.dart'; | |
const kSelectedColor = Colors.blueAccent; | |
const kUnselectedColor = Colors.transparent; | |
const kSelectedShadowOffset = Offset(0.0, 4.0); | |
final kSelectedBorderRadius = BorderRadius.circular(32.0); | |
void main() { | |
runApp(MyApp()); | |
} |
This file contains hidden or 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 'package:flutter/material.dart'; | |
const kSelectedColor = Colors.blueAccent; | |
const kUnselectedColor = Colors.transparent; | |
const kSelectedShadowOffset = Offset(0.0, 4.0); | |
final kSelectedBorderRadius = BorderRadius.circular(32.0); | |
void main() { | |
runApp(MyApp()); | |
} |
This file contains hidden or 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 EspressoTextInputLayoutUtils{ | |
/* | |
* Use this method to find the EditText within the TextInputLayout. Useful for typing into the TextInputLayout | |
*/ | |
public static ViewInteraction onEditTextWithinTilWithId(@IdRes int textInputLayoutId) { | |
//Note, if you have specified an ID for the EditText that you place inside | |
//the TextInputLayout, use that instead - i.e, onView(withId(R.id.my_edit_text)); | |
return onView(allOf(isDescendantOfA(withId(textInputLayoutId)), isAssignableFrom(EditText.class))); | |
} | |
NewerOlder