From d07fbfff292ef43b23c5d84935c214a1001e0573 Mon Sep 17 00:00:00 2001 From: Harry Gale Date: Fri, 17 Feb 2017 17:02:28 -0800 Subject: [PATCH 1/8] Add listview, change background to not be transparent --- js/Background.js | 9 ++------- js/HomeScreen.js | 31 ++++++++++++++++++++++++++++--- js/ImageRow.js | 14 ++++++++++++++ js/Style.js | 14 +++----------- 4 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 js/ImageRow.js diff --git a/js/Background.js b/js/Background.js index 34ea749..6f5cd48 100644 --- a/js/Background.js +++ b/js/Background.js @@ -1,7 +1,7 @@ import React from 'react' import { Image, View } from 'react-native' -import bgImage from './assets/bg_transparent.png' -//import bgImage from './assets/bg_solid.png' + +import bgImage from './assets/bg_solid.png' import style from './Style' @@ -14,16 +14,11 @@ export const BaseView = (props) => { } export const BgView = (props) => { - const propStyle = { - backgroundColor: 'transparent' - } - return ( ) diff --git a/js/HomeScreen.js b/js/HomeScreen.js index a5eef5a..a051d8d 100644 --- a/js/HomeScreen.js +++ b/js/HomeScreen.js @@ -1,12 +1,22 @@ import React from 'react' -import { Text, View, Button, Dimensions, Image, ScrollView } from 'react-native' +import { Text, View, Button, Dimensions, Image, ScrollView, ListView } from 'react-native' import { CatImages } from './GiphyImages' +import ImageRow from './ImageRow' import { BgView } from './Background' import style from './Style' class HomeScreen extends React.Component { + constructor(props) { + super(props) + + const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1.small !== r2.small}) + this.state = { + dataSource: ds.cloneWithRows(CatImages) + } + } + renderCells (data) { return data.map((cell, index) => { const {title, subTitle, small} = cell @@ -31,17 +41,32 @@ class HomeScreen extends React.Component { ) } - + /* render() { const { height } = Dimensions.get('window') let cells = this.renderImageCells('Cats', CatImages) + return ( {cells} - ); + ) + } + */ + + render () { + return ( + + } + /> + + ) } } diff --git a/js/ImageRow.js b/js/ImageRow.js new file mode 100644 index 0000000..c588560 --- /dev/null +++ b/js/ImageRow.js @@ -0,0 +1,14 @@ +import React from 'react' +import { View, Text, Image } from 'react-native' + +import style from './Style' + +const ImageRow = (props) => ( + + + {props.title} + {props.subTitle} + + +) +export default ImageRow diff --git a/js/Style.js b/js/Style.js index 7a8aa6b..9553414 100644 --- a/js/Style.js +++ b/js/Style.js @@ -5,7 +5,6 @@ export default StyleSheet.create({ flexDirection: 'column', flex:1, justifyContent:'center', - backgroundColor: 'transparent', paddingTop: 20, paddingLeft: 24, paddingRight: 24, @@ -20,13 +19,12 @@ export default StyleSheet.create({ imageContainer: { height: 200, flex: 0.8, - resizeMode: 'cover', - justifyContent:'flex-end' + //resizeMode: 'cover', + // justifyContent:'flex-end' }, imageText: { width: 100, height: 50, - backgroundColor: 'transparent', flexDirection: 'column', justifyContent:'flex-end' }, @@ -48,18 +46,12 @@ export default StyleSheet.create({ baseView: { flex: 1, flexDirection: 'column', - justifyContent: 'flex-start', - alignItems: 'stretch', - backgroundColor: '#2B2C2C', paddingTop: 80, paddingRight: 12, paddingBottom: 20, paddingLeft: 12 }, pageBackground: { - flex: 1, - width: null, - height: null, - backgroundColor: '#2B2C2C' + flex: 1 } }) From 83289b66b0940a3c72e1fb570eebb6ca5f71075e Mon Sep 17 00:00:00 2001 From: Harry Gale Date: Sat, 18 Feb 2017 16:02:05 -0800 Subject: [PATCH 2/8] More perf experimenting --- js/HomeScreen.js | 27 ++++++++++++++++++++++++--- package.json | 5 +++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/js/HomeScreen.js b/js/HomeScreen.js index a051d8d..a2190ab 100644 --- a/js/HomeScreen.js +++ b/js/HomeScreen.js @@ -1,12 +1,15 @@ import React from 'react' import { Text, View, Button, Dimensions, Image, ScrollView, ListView } from 'react-native' - +//import { SGListView } from 'react-native-sglistview' +var SGListView = require('react-native-sglistview'); import { CatImages } from './GiphyImages' import ImageRow from './ImageRow' import { BgView } from './Background' import style from './Style' +var LIST_VIEW = "listview"; + class HomeScreen extends React.Component { constructor(props) { super(props) @@ -55,12 +58,30 @@ class HomeScreen extends React.Component { ) } */ - render () { + /* return ( - } + /> + + ) +*/ + + return ( + + } diff --git a/package.json b/package.json index a19fd99..4166c5a 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,13 @@ }, "dependencies": { "react": "15.4.2", - "react-native": "0.41.2" + "react-native": "0.41.2", + "react-native-sglistview": "^0.3.2" }, "devDependencies": { "babel-jest": "18.0.0", "babel-preset-react-native": "1.9.1", - "react-addons-perf": "^15.4.2", + "react-addons-perf": "^15.4.2", "jest": "18.1.0", "react-test-renderer": "15.4.2" }, From fe3a0e836bbad56180e02351a72641b404949e59 Mon Sep 17 00:00:00 2001 From: Harry Gale Date: Sat, 18 Feb 2017 16:02:05 -0800 Subject: [PATCH 3/8] More perf experimenting --- js/HomeScreen.js | 26 ++++++++++++++++++++++++-- package.json | 5 +++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/js/HomeScreen.js b/js/HomeScreen.js index a051d8d..5cdcf39 100644 --- a/js/HomeScreen.js +++ b/js/HomeScreen.js @@ -1,12 +1,15 @@ import React from 'react' import { Text, View, Button, Dimensions, Image, ScrollView, ListView } from 'react-native' - +//import { SGListView } from 'react-native-sglistview' +var SGListView = require('react-native-sglistview'); import { CatImages } from './GiphyImages' import ImageRow from './ImageRow' import { BgView } from './Background' import style from './Style' +var LIST_VIEW = "listview"; + class HomeScreen extends React.Component { constructor(props) { super(props) @@ -55,12 +58,31 @@ class HomeScreen extends React.Component { ) } */ - render () { + /* + return ( + + } + /> + + ) +*/ + return ( } diff --git a/package.json b/package.json index a19fd99..4166c5a 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,13 @@ }, "dependencies": { "react": "15.4.2", - "react-native": "0.41.2" + "react-native": "0.41.2", + "react-native-sglistview": "^0.3.2" }, "devDependencies": { "babel-jest": "18.0.0", "babel-preset-react-native": "1.9.1", - "react-addons-perf": "^15.4.2", + "react-addons-perf": "^15.4.2", "jest": "18.1.0", "react-test-renderer": "15.4.2" }, From f357acd7196b09e687aff2684ff841dff69bee35 Mon Sep 17 00:00:00 2001 From: Harry Gale Date: Mon, 20 Feb 2017 16:12:39 -0800 Subject: [PATCH 4/8] Add android listview --- .../com/performanceexample/CustomAdapter.java | 51 ++++++++++++ .../com/performanceexample/ListViewCell.java | 17 ++++ .../performanceexample/ListViewPackage.java | 33 ++++++++ .../performanceexample/MainApplication.java | 6 +- .../com/performanceexample/MyViewHolder.java | 17 ++++ .../ReactListViewManager.java | 79 +++++++++++++++++++ .../src/main/res/layout/movie_list_row.xml | 15 ++++ js/AndroidImageList.js | 12 +++ js/HomeScreen.js | 24 +++++- 9 files changed, 251 insertions(+), 3 deletions(-) create mode 100755 android/app/src/main/java/com/performanceexample/CustomAdapter.java create mode 100755 android/app/src/main/java/com/performanceexample/ListViewCell.java create mode 100755 android/app/src/main/java/com/performanceexample/ListViewPackage.java create mode 100755 android/app/src/main/java/com/performanceexample/MyViewHolder.java create mode 100755 android/app/src/main/java/com/performanceexample/ReactListViewManager.java create mode 100755 android/app/src/main/res/layout/movie_list_row.xml create mode 100644 js/AndroidImageList.js diff --git a/android/app/src/main/java/com/performanceexample/CustomAdapter.java b/android/app/src/main/java/com/performanceexample/CustomAdapter.java new file mode 100755 index 0000000..f659b7b --- /dev/null +++ b/android/app/src/main/java/com/performanceexample/CustomAdapter.java @@ -0,0 +1,51 @@ +package com.performanceexample; + +import android.graphics.Color; +import android.support.v7.widget.RecyclerView; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.facebook.react.bridge.ReadableMap; +import com.facebook.drawee.backends.pipeline.Fresco; +import com.facebook.drawee.view.SimpleDraweeView; +import com.facebook.drawee.interfaces.DraweeController; + +import java.util.List; + +import static android.support.v7.widget.RecyclerView.*; + +public class CustomAdapter extends RecyclerView.Adapter { + String TAG = "react"; + private List list; + + public CustomAdapter(List list) { + this.list = list; + } + + + @Override + public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + View itemView = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.movie_list_row, parent, false); + return new MyViewHolder(itemView); + } + + @Override + public void onBindViewHolder(MyViewHolder holder, int position) { + ListViewCell listViewCell = list.get(position); + DraweeController controller = Fresco.newDraweeControllerBuilder() + .setUri(listViewCell.getUri()) + .setAutoPlayAnimations(true) + .build(); + holder.gifView.setController(controller); + } + + @Override + public int getItemCount() { + return list.size(); + } + + +} diff --git a/android/app/src/main/java/com/performanceexample/ListViewCell.java b/android/app/src/main/java/com/performanceexample/ListViewCell.java new file mode 100755 index 0000000..81b0051 --- /dev/null +++ b/android/app/src/main/java/com/performanceexample/ListViewCell.java @@ -0,0 +1,17 @@ +package com.performanceexample; + +import android.net.Uri; + +public class ListViewCell { + private Uri uri; + + public ListViewCell(String uri) { + this.uri = Uri.parse(uri); + } + + + public Uri getUri() { + return uri; + } + +} diff --git a/android/app/src/main/java/com/performanceexample/ListViewPackage.java b/android/app/src/main/java/com/performanceexample/ListViewPackage.java new file mode 100755 index 0000000..850f8eb --- /dev/null +++ b/android/app/src/main/java/com/performanceexample/ListViewPackage.java @@ -0,0 +1,33 @@ +package com.performanceexample; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +public class ListViewPackage implements ReactPackage { + + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } + + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Arrays.asList( + new ReactListViewManager() + ); + } +} diff --git a/android/app/src/main/java/com/performanceexample/MainApplication.java b/android/app/src/main/java/com/performanceexample/MainApplication.java index 51799ea..b3c4128 100644 --- a/android/app/src/main/java/com/performanceexample/MainApplication.java +++ b/android/app/src/main/java/com/performanceexample/MainApplication.java @@ -10,6 +10,8 @@ import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; +import com.performanceexample.ListViewPackage; + import java.util.Arrays; import java.util.List; @@ -24,8 +26,8 @@ public boolean getUseDeveloperSupport() { @Override protected List getPackages() { return Arrays.asList( - new MainReactPackage() - ); + new MainReactPackage(), + new ListViewPackage()); } }; diff --git a/android/app/src/main/java/com/performanceexample/MyViewHolder.java b/android/app/src/main/java/com/performanceexample/MyViewHolder.java new file mode 100755 index 0000000..d10d457 --- /dev/null +++ b/android/app/src/main/java/com/performanceexample/MyViewHolder.java @@ -0,0 +1,17 @@ +package com.performanceexample; + +import android.graphics.Color; +import android.support.v7.widget.RecyclerView; +import android.view.View; + +import com.facebook.drawee.view.SimpleDraweeView; + +public class MyViewHolder extends RecyclerView.ViewHolder { + public SimpleDraweeView gifView; + + public MyViewHolder(View view) { + super(view); + gifView = (SimpleDraweeView) view.findViewById(R.id.my_image_view); + + } +} \ No newline at end of file diff --git a/android/app/src/main/java/com/performanceexample/ReactListViewManager.java b/android/app/src/main/java/com/performanceexample/ReactListViewManager.java new file mode 100755 index 0000000..af00012 --- /dev/null +++ b/android/app/src/main/java/com/performanceexample/ReactListViewManager.java @@ -0,0 +1,79 @@ +package com.performanceexample; + +import android.support.annotation.Nullable; +import android.support.v7.widget.DefaultItemAnimator; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.util.Log; + +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.uimanager.SimpleViewManager; +import com.facebook.react.uimanager.ThemedReactContext; +import com.facebook.react.uimanager.ViewProps; +import com.facebook.react.uimanager.annotations.ReactProp; + +import com.facebook.drawee.backends.pipeline.Fresco; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import static com.facebook.react.common.ReactConstants.TAG; + +/** + * Created by root on 25/10/16. + */ + +public class ReactListViewManager extends SimpleViewManager { + private List list = new ArrayList<>(); + private RecyclerView recyclerView; + private CustomAdapter mAdapter; + + @Override + public String getName() { + return "RCTListView"; + } + + @Override + protected RecyclerView createViewInstance(ThemedReactContext reactContext) { + // This probably needs to happen in another place or maybe not at all because of react native, consider commenting out + Fresco.initialize(reactContext); + mAdapter = new CustomAdapter(list); + return new RecyclerView(reactContext); + } + + @ReactProp(name = "src") + public void setSrc(RecyclerView view,@Nullable ReadableMap src) { + view.setHasFixedSize(true); + RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(view.getContext()); + view.setLayoutManager(mLayoutManager); + view.setItemAnimator(new DefaultItemAnimator()); + view.setAdapter(mAdapter); + prepareMovieData(src); + + + + } + + private void prepareMovieData(ReadableMap map){ + + ReadableArray obj = map.getArray("images"); + for(int i = 0; i + + + + + diff --git a/js/AndroidImageList.js b/js/AndroidImageList.js new file mode 100644 index 0000000..62243ff --- /dev/null +++ b/js/AndroidImageList.js @@ -0,0 +1,12 @@ +import { PropTypes } from 'react'; +import { requireNativeComponent, View } from 'react-native'; + +var iface = { + name: 'ImageView', + propTypes: { + src: PropTypes.object, + ...View.propTypes // include the default view properties + }, +} + +module.exports = requireNativeComponent('RCTListView', iface) diff --git a/js/HomeScreen.js b/js/HomeScreen.js index 5cdcf39..02c1506 100644 --- a/js/HomeScreen.js +++ b/js/HomeScreen.js @@ -8,16 +8,27 @@ import ImageRow from './ImageRow' import { BgView } from './Background' import style from './Style' +import ListViewCustom from './AndroidImageList' + var LIST_VIEW = "listview"; class HomeScreen extends React.Component { constructor(props) { super(props) - +/* const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1.small !== r2.small}) this.state = { dataSource: ds.cloneWithRows(CatImages) } + */ + var array = []; + for(var i = 0; i < CatImages.length; i++){ + catImage = CatImages[i] + array.push({"uri" : catImage.small}) + } + this.state = { + dataSource:{"images": array} + }; } renderCells (data) { @@ -77,6 +88,7 @@ class HomeScreen extends React.Component { ) */ +/* return ( ) +*/ + +return ( + + + + +) } } From 9be1613d4b2b22c203b440e651d2dcc73872839e Mon Sep 17 00:00:00 2001 From: Harry Gale Date: Mon, 20 Feb 2017 16:30:21 -0800 Subject: [PATCH 5/8] Refactor --- .../java/com/performanceexample/CustomAdapter.java | 2 +- .../com/performanceexample/ReactListViewManager.java | 11 ++--------- .../layout/{movie_list_row.xml => image_list_row.xml} | 0 3 files changed, 3 insertions(+), 10 deletions(-) rename android/app/src/main/res/layout/{movie_list_row.xml => image_list_row.xml} (100%) diff --git a/android/app/src/main/java/com/performanceexample/CustomAdapter.java b/android/app/src/main/java/com/performanceexample/CustomAdapter.java index f659b7b..e40be76 100755 --- a/android/app/src/main/java/com/performanceexample/CustomAdapter.java +++ b/android/app/src/main/java/com/performanceexample/CustomAdapter.java @@ -28,7 +28,7 @@ public CustomAdapter(List list) { @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.movie_list_row, parent, false); + .inflate(R.layout.image_list_row, parent, false); return new MyViewHolder(itemView); } diff --git a/android/app/src/main/java/com/performanceexample/ReactListViewManager.java b/android/app/src/main/java/com/performanceexample/ReactListViewManager.java index af00012..0211bca 100755 --- a/android/app/src/main/java/com/performanceexample/ReactListViewManager.java +++ b/android/app/src/main/java/com/performanceexample/ReactListViewManager.java @@ -13,8 +13,6 @@ import com.facebook.react.uimanager.ViewProps; import com.facebook.react.uimanager.annotations.ReactProp; -import com.facebook.drawee.backends.pipeline.Fresco; - import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -42,8 +40,6 @@ public String getName() { @Override protected RecyclerView createViewInstance(ThemedReactContext reactContext) { - // This probably needs to happen in another place or maybe not at all because of react native, consider commenting out - Fresco.initialize(reactContext); mAdapter = new CustomAdapter(list); return new RecyclerView(reactContext); } @@ -55,13 +51,10 @@ public void setSrc(RecyclerView view,@Nullable ReadableMap src) { view.setLayoutManager(mLayoutManager); view.setItemAnimator(new DefaultItemAnimator()); view.setAdapter(mAdapter); - prepareMovieData(src); - - - + prepareImageData(src); } - private void prepareMovieData(ReadableMap map){ + private void prepareImageData(ReadableMap map){ ReadableArray obj = map.getArray("images"); for(int i = 0; i Date: Mon, 20 Feb 2017 16:33:10 -0800 Subject: [PATCH 6/8] Clean up --- js/HomeScreen.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/HomeScreen.js b/js/HomeScreen.js index 2bf98cd..ab57dec 100644 --- a/js/HomeScreen.js +++ b/js/HomeScreen.js @@ -71,7 +71,6 @@ class HomeScreen extends React.Component { */ render () { /* -<<<<<<< HEAD return ( Date: Mon, 20 Feb 2017 19:03:18 -0800 Subject: [PATCH 7/8] Test with smaller images --- js/GiphyImages.js | 93 +++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/js/GiphyImages.js b/js/GiphyImages.js index 063f0e9..954b0cc 100644 --- a/js/GiphyImages.js +++ b/js/GiphyImages.js @@ -1,92 +1,65 @@ export const CatImages = [ { - title: 'Cat 1', - subTitle: 'meow 1', - small: 'https://media0.giphy.com/media/iuHaJ0D7macZq/100.gif', - big: 'https://media0.giphy.com/media/iuHaJ0D7macZq/200.gif' + small: 'http://media3.giphy.com/media/iuHaJ0D7macZq/giphy-preview.gif',//'http://media3.giphy.com/media/iuHaJ0D7macZq/200_d.gif', + big: 'https://media0.giphy.com/media/iuHaJ0D7macZq/100.gif' }, + { - title: 'Cat 2', - subTitle: 'meow 2', - small: 'https://media3.giphy.com/media/Z1kpfgtHmpWHS/100.gif', - big: 'https://media3.giphy.com/media/Z1kpfgtHmpWHS/200.gif' + small: 'http://media4.giphy.com/media/Z1kpfgtHmpWHS/giphy-preview.gif',//'http://media3.giphy.com/media/Z1kpfgtHmpWHS/200_d.gif', + big: 'https://media3.giphy.com/media/Z1kpfgtHmpWHS/100.gif' }, { - title: 'Cat 3', - subTitle: 'meow 3', - small: 'https://media3.giphy.com/media/mAzfiSQub2jEA/100.gif', - big: 'https://media3.giphy.com/media/mAzfiSQub2jEA/200.gif' + small: 'http://media2.giphy.com/media/mAzfiSQub2jEA/giphy-preview.gif',//'http://media2.giphy.com/media/mAzfiSQub2jEA/200_d.gif', + big: 'https://media3.giphy.com/media/mAzfiSQub2jEA/100.gif' }, { - title: 'Cat 4', - subTitle: 'meow 4', - small: 'https://media0.giphy.com/media/tVmthN5Mf8lGg/100.gif', - big: 'https://media0.giphy.com/media/tVmthN5Mf8lGg/200.gif' + small: 'http://media3.giphy.com/media/tVmthN5Mf8lGg/giphy-preview.gif',//'http://media3.giphy.com/media/tVmthN5Mf8lGg/200_d.gif', + big: 'https://media0.giphy.com/media/tVmthN5Mf8lGg/100.gif' }, { - title: 'Cat 5', - subTitle: 'meow 5', - small: 'https://media2.giphy.com/media/uI1wAzSiJN3Rm/100.gif', - big: 'https://media2.giphy.com/media/uI1wAzSiJN3Rm/200.gif' + small: 'http://media2.giphy.com/media/uI1wAzSiJN3Rm/giphy-preview.gif',//'http://media2.giphy.com/media/uI1wAzSiJN3Rm/200_d.gif', + big: 'https://media2.giphy.com/media/uI1wAzSiJN3Rm/100.gif' }, { - title: 'Cat 6', - subTitle: 'meow 6', - small: 'https://media1.giphy.com/media/q1cm3LOOb5QVq/100.gif', - big: 'https://media1.giphy.com/media/q1cm3LOOb5QVq/200.gif' + small: 'http://media2.giphy.com/media/q1cm3LOOb5QVq/giphy-preview.gif',//'http://media2.giphy.com/media/q1cm3LOOb5QVq/200_d.gif', + big: 'https://media1.giphy.com/media/q1cm3LOOb5QVq/100.gif' }, { - title: 'Cat 7', - subTitle: 'meow 7', - small: 'https://media4.giphy.com/media/loDak9WVj8DYc/100.gif', - big: 'https://media4.giphy.com/media/loDak9WVj8DYc/200.gif' + small: 'http://media4.giphy.com/media/loDak9WVj8DYc/giphy-preview.gif',//'http://media4.giphy.com/media/loDak9WVj8DYc/200_d.gif', + big: 'https://media4.giphy.com/media/loDak9WVj8DYc/100.gif' }, { - title: 'Cat 8', - subTitle: 'meow 8', - small: 'https://media0.giphy.com/media/rIFc8qJD19lPG/100.gif', - big: 'https://media0.giphy.com/media/rIFc8qJD19lPG/200.gif' + small: 'http://media0.giphy.com/media/rIFc8qJD19lPG/giphy-preview.gif',//'http://media0.giphy.com/media/rIFc8qJD19lPG/200_d.gif', + big: 'https://media0.giphy.com/media/rIFc8qJD19lPG/100.gif' }, { - title: 'Cat 9', - subTitle: 'meow 9', - small: 'https://media0.giphy.com/media/jr12H86OeFWhy/100.gif', - big: 'https://media0.giphy.com/media/jr12H86OeFWhy/200.gif' + small: 'http://media2.giphy.com/media/jr12H86OeFWhy/giphy-preview.gif',//'http://media2.giphy.com/media/jr12H86OeFWhy/200_d.gif', + big: 'https://media0.giphy.com/media/jr12H86OeFWhy/100.gif' }, + /* { - title: 'Cat 10', - subTitle: 'meow 10', - small: 'https://media2.giphy.com/media/oPsg8so2uamXe/100.gif', - big: 'https://media2.giphy.com/media/oPsg8so2uamXe/200.gif' + small: 'http://media2.giphy.com/media/oPsg8so2uamXe/200_d.gif', + big: 'https://media2.giphy.com/media/oPsg8so2uamXe/100.gif' }, { - title: 'Cat 11', - subTitle: 'meow 11', - small: 'https://media2.giphy.com/media/mw1sOcRNbtlbq/100.gif', - big: 'https://media2.giphy.com/media/mw1sOcRNbtlbq/200.gif' + small: '', + big: 'https://media2.giphy.com/media/mw1sOcRNbtlbq/100.gif' }, { - title: 'Cat 12', - subTitle: 'meow 12', - small: 'https://media4.giphy.com/media/mlvseq9yvZhba/100.gif', - big: 'https://media4.giphy.com/media/mlvseq9yvZhba/200.gif' + small: 'http://media4.giphy.com/media/mw1sOcRNbtlbq/200_d.gif', + big: 'https://media4.giphy.com/media/mlvseq9yvZhba/100.gif' }, { - title: 'Cat 13', - subTitle: 'meow 13', - small: 'https://media2.giphy.com/media/jTnGaiuxvvDNK/100.gif', - big: 'https://media2.giphy.com/media/jTnGaiuxvvDNK/200.gif' + small: 'http://media0.giphy.com/media/jTnGaiuxvvDNK/200_d.gif', + big: 'https://media2.giphy.com/media/jTnGaiuxvvDNK/100.gif' }, { - title: 'Cat 14', - subTitle: 'meow 14', - small: 'https://media3.giphy.com/media/k2xbaNGSnQkzC/100.gif', - big: 'https://media3.giphy.com/media/k2xbaNGSnQkzC/200.gif' + small: 'http://media4.giphy.com/media/k2xbaNGSnQkzC/200_d.gif', + big: 'https://media3.giphy.com/media/k2xbaNGSnQkzC/100.gif' }, { - title: 'Cat 15', - subTitle: 'meow 15', - small: 'https://media3.giphy.com/media/ZpWJhFSusGSac/100.gif', - big: 'https://media3.giphy.com/media/ZpWJhFSusGSac/200.gif' + small: 'http://media2.giphy.com/media/ZpWJhFSusGSac/200_d.gif', + big: 'https://media3.giphy.com/media/ZpWJhFSusGSac/100.gif' } + */ ] From e8ce45b284bfbd76c04361e09f6b678161962def Mon Sep 17 00:00:00 2001 From: Harry Gale Date: Thu, 23 Feb 2017 11:25:43 -0800 Subject: [PATCH 8/8] More tweaks --- android/app/build.gradle | 13 +++++++ android/app/my-release-key.keystore | Bin 0 -> 2220 bytes .../com/performanceexample/CustomAdapter.java | 36 ++++++++++++++++++ android/gradle.properties | 4 ++ js/GiphyImages.js | 33 ++++++++-------- js/HomeScreen.js | 9 +++-- js/ImageRow.js | 4 +- 7 files changed, 78 insertions(+), 21 deletions(-) create mode 100644 android/app/my-release-key.keystore diff --git a/android/app/build.gradle b/android/app/build.gradle index 613f5e1..fac1f08 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -96,6 +96,19 @@ android { abiFilters "armeabi-v7a", "x86" } } + signingConfigs { + release { + storeFile file(MYAPP_RELEASE_STORE_FILE) + storePassword MYAPP_RELEASE_STORE_PASSWORD + keyAlias MYAPP_RELEASE_KEY_ALIAS + keyPassword MYAPP_RELEASE_KEY_PASSWORD + } + } + buildTypes { + release { + signingConfig signingConfigs.release + } + } splits { abi { reset() diff --git a/android/app/my-release-key.keystore b/android/app/my-release-key.keystore new file mode 100644 index 0000000000000000000000000000000000000000..5ef8ba01b32ab9c4482906ca91e78e0c742e0c3f GIT binary patch literal 2220 zcmcJQc{J1w7sux}ix}%z(qyu0!qCVV#8@(x?BcOYBx6g~YAnSlAv}7>zAud|i7XXj za%MEhlCnqE$Ci36V<~#ndEaxM)Bo>1=l=2e{&Ua$-h1vn_90x<2nNPdpa)nUHn=<+00rd02mpYApcLqGdQ62`Ax(?9UFc;6 z(ODN9LL?INMi-(_LuDJSY4{vJ=?@e(%tdJnQK#BOAFmi?k>?9=99IiWb+`)JI$>1! zQM0X!-(uH&przLW|4y7GslQ*K68JG{VoE|_+v)SDGp4DOy53vr=O11x zrNNQ?f)F89S*A}xptjF5{6oE~9BAb1 zn!UORX4EBH$r=-+Y17vxR&EwR)k(N~rzlr~9+XhLq><*ge90WA>Bw|$?u_wfCI#|^ zijwI|Rz6X~28zw5z16neb{l2^+*!mbe47XgR#HQ3G6{2f;_=8uov-|KJ@FQF96i00 z(%RM&{Ymwl@+P#WVfan0qW~PIl65$RHre372*e*KoGOUp;Vm+JK8wa8>5|oR4!78$AZCYYX%UEZyP&7#&y;vUND55~#S6+Es9B3(% z!Wygae~~vkFJY@IxWzgO-|+1<^yK(NmekU3zmHa8Dtv{JrmYI(IvN@}H??o*?)B@v zYo_u>xTMFeH+uZ-(dye?U1IfI#@s)os4sm`FYEbkxb5$idWlcAXL%YF9k>!CazFKfsmBV&z|zz7vfygv%zSO+>-xuazAWX>E+5 z4zT=&sREFxo3-ezyHTYTo3=65-em_PFltEruKk-ShF!tkHlh2(+YCn8UdCCv z!P=t9jJ)aj0lj>31FSNDyBfgrpAk;%13T~#9F+J9$P70tkjXY(2um;br{fGLY+%#J zU2QXJR=hmOx;20^6khM1=5cAL*8VNDyZB_A?!hru(o2hh#Az{6`ZVLLo3q|q@J>+cXQXqVu&61lF^9U<6KgkOxKn;DQ+B!XaSa)Xmfjs_kOGv;j}1m=lxT=G zp{zJ|(N2W-dhCh;Xs71uvrT23S@@i6cmJOCkC$~h-%kQ@;%%%~v|slTX0ND%RR@6} zE?5f00ZRev7DB)P7!3UbR4az%X5)~HHHzKl1^`YN2LIHR|SPB3KQvd)I`vkwShl=2ou(~N88JfqI{WUSq@YE*x7kd9Jc&ni7p0zt}fuz`&R!+Eh}rpjlHto405(A0q#|%Ix@1rnKzQ z2Pv-xr}Qrrs)Hc_2q=-jieXP2j{O7=^e9x23K^)rv7_e2zlQkwf*>5@FO?GUZxau< z=Fmg{gn%h>fga4Mf1D@|gPK7xihAtNVFG+F`$0Ogo&7m2c0R)=c1P{M3Iy}JEwant zaXyJ13!&7pNSG)@_uL@YyV(MXKw~KNRkq5`Mc9T%yH8zG*O6L_x&Hfs<|9ibx9$cD z!GYD*@zjXKoalhB0CkD{5=B&F$W)wEoUl|Wmr*m89|U8$iLG&A1y7L&*5+ ) */ - /* return ( @@ -100,7 +100,7 @@ class HomeScreen extends React.Component { /> ) -*/ + */ return ( @@ -110,6 +110,7 @@ return ( ) + } } diff --git a/js/ImageRow.js b/js/ImageRow.js index c588560..93cff32 100644 --- a/js/ImageRow.js +++ b/js/ImageRow.js @@ -2,10 +2,10 @@ import React from 'react' import { View, Text, Image } from 'react-native' import style from './Style' - +//renderToHardwareTextureAndroid const ImageRow = (props) => ( - + {props.title} {props.subTitle}