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 { 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
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
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
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
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
def getApiKey(){ | |
def Properties props = new Properties() | |
props.load(new FileInputStream(new File('secrets.properties'))) | |
return props['GOOGLE_MAPS_API_KEY'] | |
} |
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
defaultConfig { | |
defaultPublishConfig 'debug' | |
applicationId "YOUR_APPLICATION_ID" | |
minSdkVersion 19 | |
targetSdkVersion 27 | |
versionCode 1000 | |
versionName '0.1.0' | |
manifestPlaceholders = [ GOOGLE_MAPS_API_KEY:getApiKey()] | |
} |
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
<meta-data | |
android:name="com.google.android.geo.API_KEY" | |
android:value="${GOOGLE_MAPS_API_KEY}" /> |
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
buildTypes { | |
release { | |
minifyEnabled false | |
proguardFiles getDefaultProguardFile('proguard-android.txt') | |
, 'proguard-rules.pro' | |
} | |
applicationVariants.all { variant -> | |
variant.buildConfigField "String", "GOOGLE_MAPS_API_KEY" |