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
mAdapter.SetOnItemClickListener(new RecyclerViewAdapter.OnItemClickListener() { | |
@Override | |
public void onItemClick(View view, int position, AbstractModel model) { | |
//Do your stuff | |
} | |
}); |
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 Button extends Component { | |
state = { | |
text: 'Failure' | |
} | |
updateButtonText = () ⇒ this.setState({ text: 'Success' }) | |
render() { | |
return ( | |
<View> |
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
JAVA React Native | |
1. public class App { class App extends Component { | |
Props probs = new Props(); render() { | |
props.setTitle("Awesome React"); return ( | |
Toolbar toolbar = new Toolbar(props); <Toolbar | |
title='Awesome React' /> | |
//Do your stuff ); | |
} } | |
} |
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
JAVA React Native | |
1. public class Toolbar { const Toolbar = (props) => { | |
private String mTitle; return ( | |
public Toolbar(Props props){ <Text>{props.title} </Text> | |
this.mTitle = props.getTitle(); ); | |
}; | |
} | |
} |
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 React from 'react'; | |
import { AppRegistry } from 'react-native'; | |
import App from './src/components/importcomponentdemo'; | |
const App = () => ( | |
<Title /> | |
); | |
AppRegistry.registerComponent('ComponentDemo', () => App); |
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 React from 'react'; | |
import { Text } from 'react-native'; | |
const Title = () => ( | |
<Text>Hello Title</Text> | |
); | |
export default Title; |
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 React from 'react'; | |
import { Text, AppRegistry } from 'react-native'; | |
const App = () => ( | |
<Text>Hello Component!</Text> | |
); | |
AppRegistry.registerComponent('ComponentDemo', () => App); |
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
<#if layoutmanager == 'grid'> | |
GridLayoutManager layoutManager = new GridLayoutManager(${activityClass}.this, 2); | |
recyclerView.addItemDecoration(new GridMarginDecoration(${activityClass}.this, 2, 2, 2, 2)); | |
<#else> | |
LinearLayoutManager layoutManager = new LinearLayoutManager(this); | |
</#if> | |
recyclerView.setLayoutManager(layoutManager); | |
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
<#if features == 'banner'> | |
<#include "YOUR_LAYOUT_FOR_BANNER_RECYCLERVIEW.xml.ftl"/> | |
<#elseif features == 'section'> | |
<#include "YOUR_LAYOUT_FOR_SECTION_RECYCLERVIEW.xml.ftl"/> | |
<#else> | |
<#include "YOUR_DEFAULT_LAYOUT_TO_REMAINING_RECYCLERVIEW_STYLES.xml.ftl"/></#if> |