Skip to content

Commit

Permalink
android
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed Jun 5, 2020
1 parent c7631c8 commit 56aafc6
Show file tree
Hide file tree
Showing 22 changed files with 61 additions and 8 deletions.
17 changes: 13 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import com.android.build.OutputFile
*/

project.ext.react = [
enableHermes: false, // clean and rebuild if changing
enableHermes: true, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down Expand Up @@ -144,6 +144,12 @@ android {
}
}
signingConfigs {
release {
storeFile file('conduitrn.keystore')
storePassword 'testrn'
keyAlias 'conduitrnkey'
keyPassword 'testrn'
}
debug {
storeFile file('debug.keystore')
storePassword 'android'
Expand All @@ -156,9 +162,7 @@ android {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
Expand Down Expand Up @@ -222,4 +226,9 @@ task copyDownloadableDepsToLibs(type: Copy) {
into 'libs'
}

project.ext.vectoricons = [
iconFontNames: [ 'Ionicons.ttf' ] // Name of the font files you want to copy
]

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
7 changes: 7 additions & 0 deletions android/app/src/main/java/com/conduitrn/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package com.conduitrn;

import android.os.Bundle;
import com.facebook.react.ReactActivity;
import org.devio.rn.splashscreen.SplashScreen;

public class MainActivity extends ReactActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this, R.style.SplashTheme);
super.onCreate(savedInstanceState);
}
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
Expand Down
18 changes: 18 additions & 0 deletions android/app/src/main/res/layout/launch_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:textSize="32dp"
android:textColor="#5cb85c"
android:text="conduit" />

</FrameLayout>
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:textColor">#000000</item>
<item name="colorPrimaryDark">#FFFFFF</item>
</style>

<style name="SplashTheme" parent="SplashScreen_SplashTheme">
<item name="colorPrimaryDark">#FFFFFF</item>
</style>
</resources>
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
rootProject.name = 'conduitrn'
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
reagent {:mvn/version "0.10.0"}
re-frame {:mvn/version "0.10.7"}
superstructor/re-frame-fetch-fx {:mvn/version "0.0.2"}
rn-shadow-steroid {:mvn/version "0.2.5"}
rn-shadow-steroid {:mvn/version "0.2.7"}
re-frame-steroid {:mvn/version "0.1.1"}
cljs-bean {:mvn/version "1.3.0"}}}
2 changes: 2 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ target 'conduitrn' do
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'

target 'conduitrnTests' do
inherit! :complete
# Pods for testing
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"private": true,
"scripts": {
"dev": "shadow-cljs watch app",
"release": "shadow-cljs release app",
"android": "react-native run-android",
"release-android-bundle": "react-native bundle --platform android --dev false --entry-file app/index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/",
"release-android": "cd android && gradlew assembleRelease",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
Expand Down
2 changes: 1 addition & 1 deletion shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[re-frame "0.12.0"]
[superstructor/re-frame-fetch-fx "0.0.2"]
[re-frisk-remote "1.3.3"]
[rn-shadow-steroid "0.2.5"]
[rn-shadow-steroid "0.2.7"]
[re-frame-steroid "0.1.1"]
[cljs-bean "1.3.0"]]

Expand Down
3 changes: 2 additions & 1 deletion src/conduit/ui/components.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
style))])

(defn button [props]
[ui/button (merge {:color "#5cb85c"} props)])
[rn/view {:style {:align-items :center :margin-vertical 5}}
[ui/button (merge {:color "#5cb85c"} props)]])

(defn keyboard-avoiding-view [props & children]
(into [other/keyboard-avoiding-view
Expand Down
8 changes: 7 additions & 1 deletion src/conduit/ui/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
[conduit.ui.edit.views :as editor]
[conduit.ui.settings.views :as settings]
[conduit.ui.article.views :as article]
[conduit.ui.tags.views :as tags]))
[conduit.ui.tags.views :as tags]
[steroid.rn.components.platform :as platform]
[steroid.rn.components.status-bar :as status-bar]))

(when platform/android?
(status-bar/set-bar-style "dark-content")
(status-bar/set-translucent true))

(def tab-icons
{"home" "md-home"
Expand Down

0 comments on commit 56aafc6

Please sign in to comment.