Skip to content

Commit

Permalink
Merge pull request #19 from isuyashpatel/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
isuyashpatel authored Jan 17, 2024
2 parents 15459ea + 8ec360e commit c2bce40
Show file tree
Hide file tree
Showing 72 changed files with 506 additions and 138 deletions.
8 changes: 7 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { StyleSheet, Text, View } from 'react-native'
import React from 'react'
import React, { useEffect } from 'react'
import HomeScreen from './src/screens/HomeScreen'
import DetailsScreen from './src/screens/DetailsScreen'
import PaymentScreen from './src/screens/PaymentScreen'
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { NavigationContainer } from '@react-navigation/native'
import TabNavigator from './src/navigators/TabNavigator'
import SplashScreen from 'react-native-splash-screen'

const Stack = createNativeStackNavigator();

const App = () => {
useEffect(() => {

SplashScreen.hide();

}, []);
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
Expand Down
11 changes: 10 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ android {
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
lintOptions {
baseline file("lint-baseline.xml")
}
buildTypes {
debug {
Expand All @@ -108,6 +111,12 @@ dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
implementation project(':react-native-vector-icons')
implementation project(':react-native-splash-screen')

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
Expand All @@ -118,4 +127,4 @@ dependencies {

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
168 changes: 168 additions & 0 deletions android/app/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.1.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.1)" variant="all" version="8.1.1">

<issue
id="RedundantLabel"
message="Redundant label can be removed"
errorLine1=" android:label=&quot;@string/app_name&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/AndroidManifest.xml"
line="14"
column="9"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of androidx.test.ext:junit than 1.1.3 is available: 1.1.5"
errorLine1=" androidTestImplementation &apos;androidx.test.ext:junit:1.1.3&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="117"
column="31"/>
</issue>

<issue
id="PrivateResource"
message="The resource `@dimen/abc_edit_text_inset_horizontal_material` is marked as private in androidx.appcompat:appcompat:1.6.1"
errorLine1=" android:insetLeft=&quot;@dimen/abc_edit_text_inset_horizontal_material&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/drawable/rn_edit_text_material.xml"
line="17"
column="27"/>
</issue>

<issue
id="PrivateResource"
message="The resource `@dimen/abc_edit_text_inset_horizontal_material` is marked as private in androidx.appcompat:appcompat:1.6.1"
errorLine1=" android:insetRight=&quot;@dimen/abc_edit_text_inset_horizontal_material&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/drawable/rn_edit_text_material.xml"
line="18"
column="28"/>
</issue>

<issue
id="PrivateResource"
message="The resource `@dimen/abc_edit_text_inset_top_material` is marked as private in androidx.appcompat:appcompat:1.6.1"
errorLine1=" android:insetTop=&quot;@dimen/abc_edit_text_inset_top_material&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/drawable/rn_edit_text_material.xml"
line="19"
column="26"/>
</issue>

<issue
id="PrivateResource"
message="The resource `@dimen/abc_edit_text_inset_bottom_material` is marked as private in androidx.appcompat:appcompat:1.6.1"
errorLine1=" android:insetBottom=&quot;@dimen/abc_edit_text_inset_bottom_material&quot;>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/drawable/rn_edit_text_material.xml"
line="20"
column="29"/>
</issue>

<issue
id="PrivateResource"
message="The resource `@drawable/abc_textfield_default_mtrl_alpha` is marked as private in androidx.appcompat:appcompat:1.6.1"
errorLine1=" &lt;item android:state_enabled=&quot;false&quot; android:drawable=&quot;@drawable/abc_textfield_default_mtrl_alpha&quot;/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/drawable/rn_edit_text_material.xml"
line="32"
column="63"/>
</issue>

<issue
id="PrivateResource"
message="The resource `@drawable/abc_textfield_activated_mtrl_alpha` is marked as private in androidx.appcompat:appcompat:1.6.1"
errorLine1=" &lt;item android:drawable=&quot;@drawable/abc_textfield_activated_mtrl_alpha&quot;/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/drawable/rn_edit_text_material.xml"
line="33"
column="33"/>
</issue>

<issue
id="DataExtractionRules"
message="The attribute `android:allowBackup` is deprecated from Android 12 and higher and may be removed in future versions. Consider adding the attribute `android:dataExtractionRules` specifying an `@xml` resource which configures cloud backups and device transfers on Android 12 and higher."
errorLine1=" android:allowBackup=&quot;false&quot;"
errorLine2=" ~~~~~">
<location
file="src/main/AndroidManifest.xml"
line="10"
column="28"/>
</issue>

<issue
id="UnusedResources"
message="The resource `R.integer.react_native_dev_server_port` appears to be unused">
<location
file="build.gradle"/>
</issue>

<issue
id="UnusedResources"
message="The resource `R.integer.react_native_inspector_proxy_port` appears to be unused">
<location
file="build.gradle"/>
</issue>

<issue
id="UnusedResources"
message="The resource `R.color.primary_dark` appears to be unused"
errorLine1=" &lt;color name=&quot;primary_dark&quot;>#000000&lt;/color>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/colors.xml"
line="3"
column="12"/>
</issue>

<issue
id="UnusedResources"
message="The resource `R.drawable.launch_screen` appears to be unused">
<location
file="src/main/res/drawable-hdpi/launch_screen.png"/>
</issue>

<issue
id="UnusedResources"
message="The resource `R.layout.launch_screen` appears to be unused"
errorLine1="&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;"
errorLine2="^">
<location
file="src/main/res/layout/launch_screen.xml"
line="2"
column="1"/>
</issue>

<issue
id="UnusedResources"
message="The resource `R.drawable.rn_edit_text_material` appears to be unused"
errorLine1="&lt;inset xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;"
errorLine2="^">
<location
file="src/main/res/drawable/rn_edit_text_material.xml"
line="16"
column="1"/>
</issue>

<issue
id="ContentDescription"
message="Missing `contentDescription` attribute on image"
errorLine1=" &lt;ImageView android:layout_width=&quot;match_parent&quot; android:layout_height=&quot;match_parent&quot; android:src=&quot;@drawable/launch_screen&quot; android:scaleType=&quot;centerCrop&quot; />"
errorLine2=" ~~~~~~~~~">
<location
file="src/main/res/layout/launch_screen.xml"
line="5"
column="6"/>
</issue>

</issues>
33 changes: 16 additions & 17 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:name=".MainApplication"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
4 changes: 3 additions & 1 deletion android/app/src/main/java/com/coffe/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
import android.os.Bundle;

// react-native-splash-screen >= 0.3.1
import org.devio.rn.splashscreen.SplashScreen;
class MainActivity : ReactActivity() {

/**
Expand All @@ -14,6 +15,7 @@ class MainActivity : ReactActivity() {
*/
override fun getMainComponentName(): String = "Coffe"
override fun onCreate(savedInstanceState: Bundle?) {
SplashScreen.show(this);
super.onCreate(null)
}
/**
Expand Down
44 changes: 22 additions & 22 deletions android/app/src/main/java/com/coffe/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader
import org.devio.rn.splashscreen.SplashScreenReactPackage
import com.oblador.vectoricons.VectorIconsPackage

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return PackageList(this).packages
}
override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> {
val packages = mutableListOf<ReactPackage>()
return PackageList(this).packages + packages
}

override fun getJSMainModuleName(): String = "index"
override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}

override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
load()
}
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
}
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.
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
8 changes: 8 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,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/launch_screen"
android:orientation="vertical">

</LinearLayout>
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary_dark">#0C0F14</color>
</resources>
9 changes: 4 additions & 5 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<!--设置透明背景-->
<item name="android:windowIsTranslucent">true</item>
</style>

</resources>
</resources>
4 changes: 4 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ rootProject.name = 'Coffe'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
Loading

0 comments on commit c2bce40

Please sign in to comment.