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
extern "C" { | |
#include <libavutil/timestamp.h> | |
#include <libavformat/avformat.h> | |
#include <libavutil/display.h> | |
} |
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
export default function loginReducer(state, action = {}) { | |
switch (action.type) { | |
case actions.ACTION_LIST_ERROR: | |
return state.withMutations(state => state.set('loginError', action.error)); | |
case actions.ACTION_LIST_SUCCESS: | |
const data = action.page === 1 ? action.list : state.get('data').concat(action.list); | |
return state.withMutations(state => state.set('data', data)); | |
default: | |
return state | |
} |
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
function todoApp(state = initialState, action) { | |
switch (action.type) { | |
case SET_VISIBILITY_FILTER: | |
return { ...state, visibilityFilter: action.filter } | |
default: | |
return state | |
} | |
} |
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
export function* loginFlow() { | |
while (true) { | |
const {username, password} = yield take(actions.LOGIN_ACTION); | |
yield put({type: actions.PROGRESS, progress: true}); | |
yield call(authorize, username, password); | |
yield put({type: actions.PROGRESS, progress: false}); | |
} | |
} |
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
export default class RepositoryListItem extends React.PureComponent { | |
_onPress = () => { | |
const {navigate} = this.props.navigation; | |
navigate(consts.REPOSITORY_DETAILS_SCREEN, {repository: this.props.repository}) | |
}; | |
render() { | |
return ( | |
<TouchableHighlight onPress={this._onPress}> |
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
@Test | |
fun storeListener() { | |
val valueInt = 3 | |
val keyInt = "integer" | |
val valueString = "value" | |
val keyString = "string" | |
store.listeners.add(object : StoreListener { | |
override fun onIntegerSet(key: String, value: Int) { | |
assertEquals(keyInt, 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
JNIEXPORT void JNICALL | |
Java_com_ihorkucherenko_storage_Store_setString( | |
JNIEnv* pEnv, | |
jobject pThis, | |
jstring pKey, | |
jstring pString) { | |
// Turns the Java string into a temporary C string. | |
StoreEntry* entry = allocateEntry(pEnv, &gStore, pKey); | |
if (entry != NULL) { | |
entry->mType = StoreType_String; |
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 StoreListener { | |
fun onIntegerSet(key: String, value: Int) | |
fun onStringSet(key: String, value: String) | |
} | |
class Store : StoreListener { | |
val listeners = mutableListOf<StoreListener>() |
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
jclass clazz = env->FindClass("com/ihorkucherenko/storage/Store"); | |
jmethodID constructor = env->GetMethodID(clazz, "<init>", "()V"); | |
jobject storeObject = env->NewObject(clazz, constructor); | |
jmethodID methodId = env->GetMethodID(clazz, "getSomething", "()I"); | |
jint value = env->CallIntMethod(storeObject, methodId); | |
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, "value: %d ", value); //value: 3 |
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
jclass clazz = env->FindClass("com/ihorkucherenko/storage/Store"); | |
jmethodID constructor = env->GetMethodID(clazz, "<init>", "()V"); | |
jobject storeObject = env->NewObject(clazz, constructor); | |
jfieldID fieldId = env->GetFieldID(clazz, "property", "I"); | |
jint value = env->GetIntField(storeObject, fieldId); | |
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, "Property value: %d ", value); //Property value: 3 |