@modhamanish/rn-mm-template 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/MMTemplate/.bundle/config +2 -0
  2. package/MMTemplate/.eslintrc.js +4 -0
  3. package/MMTemplate/.prettierrc.js +5 -0
  4. package/MMTemplate/.watchmanconfig +1 -0
  5. package/MMTemplate/App.tsx +41 -0
  6. package/MMTemplate/Gemfile +16 -0
  7. package/MMTemplate/README.md +109 -0
  8. package/MMTemplate/__tests__/App.test.tsx +13 -0
  9. package/MMTemplate/_gitignore +79 -0
  10. package/MMTemplate/android/app/build.gradle +119 -0
  11. package/MMTemplate/android/app/debug.keystore +0 -0
  12. package/MMTemplate/android/app/proguard-rules.pro +10 -0
  13. package/MMTemplate/android/app/src/main/AndroidManifest.xml +27 -0
  14. package/MMTemplate/android/app/src/main/java/com/mmtemplate/MainActivity.kt +22 -0
  15. package/MMTemplate/android/app/src/main/java/com/mmtemplate/MainApplication.kt +27 -0
  16. package/MMTemplate/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  17. package/MMTemplate/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  18. package/MMTemplate/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  19. package/MMTemplate/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  20. package/MMTemplate/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  21. package/MMTemplate/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  22. package/MMTemplate/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  23. package/MMTemplate/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  24. package/MMTemplate/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  25. package/MMTemplate/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  26. package/MMTemplate/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  27. package/MMTemplate/android/app/src/main/res/values/strings.xml +3 -0
  28. package/MMTemplate/android/app/src/main/res/values/styles.xml +9 -0
  29. package/MMTemplate/android/build.gradle +21 -0
  30. package/MMTemplate/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  31. package/MMTemplate/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  32. package/MMTemplate/android/gradle.properties +44 -0
  33. package/MMTemplate/android/gradlew +251 -0
  34. package/MMTemplate/android/gradlew.bat +99 -0
  35. package/MMTemplate/android/settings.gradle +6 -0
  36. package/MMTemplate/app.json +4 -0
  37. package/MMTemplate/babel.config.js +8 -0
  38. package/MMTemplate/index.js +9 -0
  39. package/MMTemplate/ios/.xcode.env +11 -0
  40. package/MMTemplate/ios/MMTemplate/AppDelegate.swift +48 -0
  41. package/MMTemplate/ios/MMTemplate/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  42. package/MMTemplate/ios/MMTemplate/Images.xcassets/Contents.json +6 -0
  43. package/MMTemplate/ios/MMTemplate/Info.plist +55 -0
  44. package/MMTemplate/ios/MMTemplate/LaunchScreen.storyboard +47 -0
  45. package/MMTemplate/ios/MMTemplate/PrivacyInfo.xcprivacy +37 -0
  46. package/MMTemplate/ios/MMTemplate.xcodeproj/project.pbxproj +480 -0
  47. package/MMTemplate/ios/MMTemplate.xcodeproj/xcshareddata/xcschemes/MMTemplate.xcscheme +88 -0
  48. package/MMTemplate/ios/Podfile +38 -0
  49. package/MMTemplate/jest.config.js +3 -0
  50. package/MMTemplate/metro.config.js +11 -0
  51. package/MMTemplate/package.json +55 -0
  52. package/MMTemplate/src/assets/images/index.ts +4 -0
  53. package/MMTemplate/src/assets/images/logo-dark.png +0 -0
  54. package/MMTemplate/src/assets/images/logo.png +0 -0
  55. package/MMTemplate/src/components/AnimationView.tsx +113 -0
  56. package/MMTemplate/src/components/CustomToast.tsx +46 -0
  57. package/MMTemplate/src/components/FeatureItem.tsx +59 -0
  58. package/MMTemplate/src/components/FullScreenContainer.tsx +60 -0
  59. package/MMTemplate/src/components/InfoCard.tsx +61 -0
  60. package/MMTemplate/src/components/LanguageSwitcher.tsx +80 -0
  61. package/MMTemplate/src/components/TextInput.tsx +74 -0
  62. package/MMTemplate/src/components/ThemeSwitcher.tsx +63 -0
  63. package/MMTemplate/src/context/AuthContext.tsx +76 -0
  64. package/MMTemplate/src/context/ThemeContext.tsx +67 -0
  65. package/MMTemplate/src/locales/en.json +83 -0
  66. package/MMTemplate/src/locales/hi.json +83 -0
  67. package/MMTemplate/src/mock/index.ts +5 -0
  68. package/MMTemplate/src/navigation/AppNavigator.tsx +45 -0
  69. package/MMTemplate/src/navigation/AppStack.tsx +27 -0
  70. package/MMTemplate/src/navigation/AuthCheck.tsx +50 -0
  71. package/MMTemplate/src/navigation/AuthStack.tsx +24 -0
  72. package/MMTemplate/src/navigation/MainTab.tsx +50 -0
  73. package/MMTemplate/src/navigation/routes.ts +17 -0
  74. package/MMTemplate/src/screens/HomeScreen.tsx +296 -0
  75. package/MMTemplate/src/screens/LoginScreen.tsx +199 -0
  76. package/MMTemplate/src/screens/ProfileScreen.tsx +171 -0
  77. package/MMTemplate/src/screens/SettingsScreen.tsx +96 -0
  78. package/MMTemplate/src/screens/WelcomeScreen.tsx +215 -0
  79. package/MMTemplate/src/theme/Colors.ts +25 -0
  80. package/MMTemplate/src/types/components.types.ts +13 -0
  81. package/MMTemplate/src/types/navigation.types.ts +35 -0
  82. package/MMTemplate/src/utils/i18n.ts +28 -0
  83. package/MMTemplate/src/utils/navigationUtils.ts +72 -0
  84. package/MMTemplate/src/utils/storageHelper.ts +51 -0
  85. package/MMTemplate/src/utils/utilsHelper.ts +34 -0
  86. package/MMTemplate/src/utils/validationSchemas.ts +58 -0
  87. package/MMTemplate/tsconfig.json +8 -0
  88. package/README.md +108 -0
  89. package/package.json +22 -0
  90. package/script.js +62 -0
  91. package/template.config.js +11 -0
@@ -0,0 +1,2 @@
1
+ BUNDLE_PATH: "vendor/bundle"
2
+ BUNDLE_FORCE_RUBY_PLATFORM: 1
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: '@react-native',
4
+ };
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ arrowParens: 'avoid',
3
+ singleQuote: true,
4
+ trailingComma: 'all',
5
+ };
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
3
+ import { ThemeProvider } from './src/context/ThemeContext';
4
+ import AppNavigator from './src/navigation/AppNavigator';
5
+ import { KeyboardProvider } from 'react-native-keyboard-controller';
6
+
7
+ import Toast, { ToastConfigParams } from 'react-native-toast-message';
8
+ import { CustomToast } from './src/components/CustomToast';
9
+ import { AuthProvider } from './src/context/AuthContext';
10
+ import './src/utils/i18n';
11
+
12
+ const toastConfig = {
13
+ error: ({
14
+ text1,
15
+ props,
16
+ }: ToastConfigParams<{
17
+ onPress?: () => void;
18
+ }>) => <CustomToast text1={text1} onPress={props?.onPress} type="error" />,
19
+ success: ({
20
+ text1,
21
+ props,
22
+ }: ToastConfigParams<{
23
+ onPress?: () => void;
24
+ }>) => <CustomToast text1={text1} onPress={props?.onPress} type="success" />,
25
+ };
26
+ const App = () => {
27
+ return (
28
+ <KeyboardProvider>
29
+ <SafeAreaProvider>
30
+ <ThemeProvider>
31
+ <AuthProvider>
32
+ <AppNavigator />
33
+ </AuthProvider>
34
+ </ThemeProvider>
35
+ <Toast config={toastConfig} />
36
+ </SafeAreaProvider>
37
+ </KeyboardProvider>
38
+ );
39
+ };
40
+
41
+ export default App;
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
+ ruby ">= 2.6.10"
5
+
6
+ # Exclude problematic versions of cocoapods and activesupport that causes build failures.
7
+ gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8
+ gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9
+ gem 'xcodeproj', '< 1.26.0'
10
+ gem 'concurrent-ruby', '< 1.3.4'
11
+
12
+ # Ruby 3.4.0 has removed some libraries from the standard library.
13
+ gem 'bigdecimal'
14
+ gem 'logger'
15
+ gem 'benchmark'
16
+ gem 'mutex_m'
@@ -0,0 +1,109 @@
1
+ # MMTemplate - React Native TypeScript Boilerplate
2
+
3
+ Welcome to **MMTemplate**! This is a robust and modern React Native template built with TypeScript, designed to jumpstart your mobile application development. It comes pre-configured with essential libraries and best practices to save you setup time.
4
+
5
+ ## 🚀 Features
6
+
7
+ This template includes the following key libraries and configurations:
8
+
9
+ * **Core**: React Native (0.83.1), React (19.2.0)
10
+ * **Language**: TypeScript (v5) for static type checking
11
+ * **Navigation**: [React Navigation v7](https://reactnavigation.org/) (Native Stack)
12
+ * **Internationalization**: [react-i18next](https://react.i18next.com/) with multi-language support (English/Hindi)
13
+ * **Storage**: [react-native-mmkv](https://github.com/mrousavy/react-native-mmkv) for high-performance persistence
14
+ * **Animations**: [React Native Reanimated v4](https://docs.swmansion.com/react-native-reanimated/) & Worklets
15
+ * **UI/UX**:
16
+ * **Theme Support**: Light/Dark mode with persistence
17
+ * **Authentication**: Pre-configured login and profile flow
18
+ * [React Native Safe Area Context](https://github.com/th3rdwave/react-native-safe-area-context) for handling safe areas
19
+ * [React Native Keyboard Controller](https://github.com/kirillzyusko/react-native-keyboard-controller) for advanced keyboard handling
20
+ * [React Native Toast Message](https://github.com/calintamas/react-native-toast-message) for in-app notifications
21
+ * **Testing**: Jest & React Test Renderer
22
+
23
+ ## 📂 Project Structure
24
+
25
+ The project is organized in the `src` directory to keep clean separation of concerns:
26
+
27
+ ```
28
+ src/
29
+ ├── assets/ # Images, fonts, and other static assets
30
+ ├── components/ # Reusable UI components
31
+ ├── context/ # React Context definitions (Global State)
32
+ ├── locales/ # Translation files (i18n)
33
+ ├── mock/ # Mock data for testing and development
34
+ ├── navigation/ # Navigation configuration (Stacks, Stacks, etc.)
35
+ ├── screens/ # Screen components (Views)
36
+ ├── theme/ # Theme configuration (Colors, Typography, Spacing)
37
+ ├── types/ # Global TypeScript types and interfaces
38
+ └── utils/ # Helper functions and utilities
39
+ ```
40
+
41
+ ## 🛠 Prerequisites
42
+
43
+ Before you begin, ensure you have the following installed on your machine:
44
+
45
+ * [Node.js](https://nodejs.org/) (>= 20)
46
+ * [Watchman](https://facebook.github.io/watchman/)
47
+ * [Ruby](https://www.ruby-lang.org/en/) (for iOS CocoaPods)
48
+ * **Android Studio** (for Android development)
49
+ * **Xcode** (for iOS development, macOS only)
50
+
51
+ > **Note**: For a detailed environment setup guide, refer to the [official React Native documentation](https://reactnative.dev/docs/set-up-your-environment).
52
+
53
+ ## 📦 Installation
54
+
55
+ 1. **Install Dependencies**:
56
+ ```bash
57
+ yarn install
58
+ # OR
59
+ npm install
60
+ ```
61
+
62
+ 2. **Install iOS Pods** (macOS only):
63
+ ```bash
64
+ cd ios
65
+ bundle install # First time only, to install Cocoapods
66
+ bundle exec pod install
67
+ cd ..
68
+ ```
69
+
70
+ ## 🏃‍♂️ Running the App
71
+
72
+ ### Start Metro Bundler
73
+ First, start the Metro bundler in a dedicated terminal:
74
+ ```bash
75
+ yarn start
76
+ ```
77
+
78
+ ### Run on Android
79
+ ```bash
80
+ yarn android
81
+ ```
82
+
83
+ ### Run on iOS
84
+ ```bash
85
+ yarn ios
86
+ ```
87
+
88
+ ## 🔧 Customization
89
+
90
+ ### Renaming the App
91
+ To rename the application from "MMTemplate" to your own project name, you can use `react-native-rename` or manually rename the files.
92
+
93
+ **Using `react-native-rename`:**
94
+ 1. `npx react-native-rename "YourAppName" -b com.yourcompany.yourappname`
95
+ 2. Edit `package.json` to update the name.
96
+ 3. Delete `ios/Pods` and `node_modules`.
97
+ 4. Re-run installation steps.
98
+
99
+ ## 📝 Scripts
100
+
101
+ * `yarn start`: Starts the Metro Bundler.
102
+ * `yarn android`: Builds and runs the Android app.
103
+ * `yarn ios`: Builds and runs the iOS app.
104
+ * `yarn lint`: Lints the project files.
105
+ * `yarn test`: Runs Jest tests.
106
+
107
+ ---
108
+
109
+ Made with ❤️ using **MMTemplate**.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import React from 'react';
6
+ import ReactTestRenderer from 'react-test-renderer';
7
+ import App from '../App';
8
+
9
+ test('renders correctly', async () => {
10
+ await ReactTestRenderer.act(() => {
11
+ ReactTestRenderer.create(<App />);
12
+ });
13
+ });
@@ -0,0 +1,79 @@
1
+ # OSX
2
+ #
3
+ .DS_Store
4
+
5
+ # Xcode
6
+ #
7
+ build/
8
+ *.pbxuser
9
+ !default.pbxuser
10
+ *.mode1v3
11
+ !default.mode1v3
12
+ *.mode2v3
13
+ !default.mode2v3
14
+ *.perspectivev3
15
+ !default.perspectivev3
16
+ xcuserdata
17
+ *.xccheckout
18
+ *.moved-aside
19
+ DerivedData
20
+ *.hmap
21
+ *.ipa
22
+ *.xcuserstate
23
+ **/.xcode.env.local
24
+
25
+ # Android/IntelliJ
26
+ #
27
+ build/
28
+ .idea
29
+ .gradle
30
+ local.properties
31
+ *.iml
32
+ *.hprof
33
+ .cxx/
34
+ *.keystore
35
+ !debug.keystore
36
+ .kotlin/
37
+
38
+ # node.js
39
+ #
40
+ node_modules/
41
+ npm-debug.log
42
+ yarn-error.log
43
+
44
+ # fastlane
45
+ #
46
+ # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47
+ # screenshots whenever they are needed.
48
+ # For more information about the recommended setup visit:
49
+ # https://docs.fastlane.tools/best-practices/source-control/
50
+
51
+ **/fastlane/report.xml
52
+ **/fastlane/Preview.html
53
+ **/fastlane/screenshots
54
+ **/fastlane/test_output
55
+
56
+ # Bundle artifact
57
+ *.jsbundle
58
+
59
+ # Ruby / CocoaPods
60
+ **/Pods/
61
+ /vendor/bundle/
62
+ **/Podfile.lock
63
+ */Podfile.lock
64
+
65
+ # Temporary files created by Metro to check the health of the file watcher
66
+ .metro-health-check*
67
+
68
+ # testing
69
+ /coverage
70
+
71
+ # Yarn
72
+ .yarn/*
73
+ !.yarn/patches
74
+ !.yarn/plugins
75
+ !.yarn/releases
76
+ !.yarn/sdks
77
+ !.yarn/versions
78
+ **/yarn.lock
79
+ */yarn.lock
@@ -0,0 +1,119 @@
1
+ apply plugin: "com.android.application"
2
+ apply plugin: "org.jetbrains.kotlin.android"
3
+ apply plugin: "com.facebook.react"
4
+
5
+ /**
6
+ * This is the configuration block to customize your React Native Android app.
7
+ * By default you don't need to apply any configuration, just uncomment the lines you need.
8
+ */
9
+ react {
10
+ /* Folders */
11
+ // The root of your project, i.e. where "package.json" lives. Default is '../..'
12
+ // root = file("../../")
13
+ // The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14
+ // reactNativeDir = file("../../node_modules/react-native")
15
+ // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16
+ // codegenDir = file("../../node_modules/@react-native/codegen")
17
+ // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18
+ // cliFile = file("../../node_modules/react-native/cli.js")
19
+
20
+ /* Variants */
21
+ // The list of variants to that are debuggable. For those we're going to
22
+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
23
+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
24
+ // debuggableVariants = ["liteDebug", "prodDebug"]
25
+
26
+ /* Bundling */
27
+ // A list containing the node command and its flags. Default is just 'node'.
28
+ // nodeExecutableAndArgs = ["node"]
29
+ //
30
+ // The command to run when bundling. By default is 'bundle'
31
+ // bundleCommand = "ram-bundle"
32
+ //
33
+ // The path to the CLI configuration file. Default is empty.
34
+ // bundleConfig = file(../rn-cli.config.js)
35
+ //
36
+ // The name of the generated asset file containing your JS bundle
37
+ // bundleAssetName = "MyApplication.android.bundle"
38
+ //
39
+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
40
+ // entryFile = file("../js/MyApplication.android.js")
41
+ //
42
+ // A list of extra flags to pass to the 'bundle' commands.
43
+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
44
+ // extraPackagerArgs = []
45
+
46
+ /* Hermes Commands */
47
+ // The hermes compiler command to run. By default it is 'hermesc'
48
+ // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
49
+ //
50
+ // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
51
+ // hermesFlags = ["-O", "-output-source-map"]
52
+
53
+ /* Autolinking */
54
+ autolinkLibrariesWithApp()
55
+ }
56
+
57
+ /**
58
+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
59
+ */
60
+ def enableProguardInReleaseBuilds = false
61
+
62
+ /**
63
+ * The preferred build flavor of JavaScriptCore (JSC)
64
+ *
65
+ * For example, to use the international variant, you can use:
66
+ * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
67
+ *
68
+ * The international variant includes ICU i18n library and necessary data
69
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
70
+ * give correct results when using with locales other than en-US. Note that
71
+ * this variant is about 6MiB larger per architecture than default.
72
+ */
73
+ def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
74
+
75
+ android {
76
+ ndkVersion rootProject.ext.ndkVersion
77
+ buildToolsVersion rootProject.ext.buildToolsVersion
78
+ compileSdk rootProject.ext.compileSdkVersion
79
+
80
+ namespace "com.mmtemplate"
81
+ defaultConfig {
82
+ applicationId "com.mmtemplate"
83
+ minSdkVersion rootProject.ext.minSdkVersion
84
+ targetSdkVersion rootProject.ext.targetSdkVersion
85
+ versionCode 1
86
+ versionName "1.0"
87
+ }
88
+ signingConfigs {
89
+ debug {
90
+ storeFile file('debug.keystore')
91
+ storePassword 'android'
92
+ keyAlias 'androiddebugkey'
93
+ keyPassword 'android'
94
+ }
95
+ }
96
+ buildTypes {
97
+ debug {
98
+ signingConfig signingConfigs.debug
99
+ }
100
+ release {
101
+ // Caution! In production, you need to generate your own keystore file.
102
+ // see https://reactnative.dev/docs/signed-apk-android.
103
+ signingConfig signingConfigs.debug
104
+ minifyEnabled enableProguardInReleaseBuilds
105
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
106
+ }
107
+ }
108
+ }
109
+
110
+ dependencies {
111
+ // The version of react-native is set by the React Native Gradle Plugin
112
+ implementation("com.facebook.react:react-android")
113
+
114
+ if (hermesEnabled.toBoolean()) {
115
+ implementation("com.facebook.react:hermes-android")
116
+ } else {
117
+ implementation jscFlavor
118
+ }
119
+ }
@@ -0,0 +1,10 @@
1
+ # Add project specific ProGuard rules here.
2
+ # By default, the flags in this file are appended to flags specified
3
+ # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
+ # You can edit the include path and order by changing the proguardFiles
5
+ # directive in build.gradle.
6
+ #
7
+ # For more details, see
8
+ # http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+ # Add any project specific keep options here:
@@ -0,0 +1,27 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <uses-permission android:name="android.permission.INTERNET" />
4
+
5
+ <application
6
+ android:name=".MainApplication"
7
+ android:label="@string/app_name"
8
+ android:icon="@mipmap/ic_launcher"
9
+ android:roundIcon="@mipmap/ic_launcher_round"
10
+ android:allowBackup="false"
11
+ android:theme="@style/AppTheme"
12
+ android:usesCleartextTraffic="${usesCleartextTraffic}"
13
+ android:supportsRtl="true">
14
+ <activity
15
+ android:name=".MainActivity"
16
+ android:label="@string/app_name"
17
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
18
+ android:launchMode="singleTask"
19
+ android:windowSoftInputMode="adjustResize"
20
+ android:exported="true">
21
+ <intent-filter>
22
+ <action android:name="android.intent.action.MAIN" />
23
+ <category android:name="android.intent.category.LAUNCHER" />
24
+ </intent-filter>
25
+ </activity>
26
+ </application>
27
+ </manifest>
@@ -0,0 +1,22 @@
1
+ package com.mmtemplate
2
+
3
+ import com.facebook.react.ReactActivity
4
+ import com.facebook.react.ReactActivityDelegate
5
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6
+ import com.facebook.react.defaults.DefaultReactActivityDelegate
7
+
8
+ class MainActivity : ReactActivity() {
9
+
10
+ /**
11
+ * Returns the name of the main component registered from JavaScript. This is used to schedule
12
+ * rendering of the component.
13
+ */
14
+ override fun getMainComponentName(): String = "MMTemplate"
15
+
16
+ /**
17
+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18
+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19
+ */
20
+ override fun createReactActivityDelegate(): ReactActivityDelegate =
21
+ DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22
+ }
@@ -0,0 +1,27 @@
1
+ package com.mmtemplate
2
+
3
+ import android.app.Application
4
+ import com.facebook.react.PackageList
5
+ import com.facebook.react.ReactApplication
6
+ import com.facebook.react.ReactHost
7
+ import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
8
+ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
9
+
10
+ class MainApplication : Application(), ReactApplication {
11
+
12
+ override val reactHost: ReactHost by lazy {
13
+ getDefaultReactHost(
14
+ context = applicationContext,
15
+ packageList =
16
+ PackageList(this).packages.apply {
17
+ // Packages that cannot be autolinked yet can be added manually here, for example:
18
+ // add(MyReactNativePackage())
19
+ },
20
+ )
21
+ }
22
+
23
+ override fun onCreate() {
24
+ super.onCreate()
25
+ loadReactNative(this)
26
+ }
27
+ }
@@ -0,0 +1,37 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Copyright (C) 2014 The Android Open Source Project
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ -->
16
+ <inset xmlns:android="http://schemas.android.com/apk/res/android"
17
+ android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
18
+ android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
19
+ android:insetTop="@dimen/abc_edit_text_inset_top_material"
20
+ android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
21
+ >
22
+
23
+ <selector>
24
+ <!--
25
+ This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
26
+ The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
27
+ NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
28
+
29
+ <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
30
+
31
+ For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
32
+ -->
33
+ <item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
34
+ <item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
35
+ </selector>
36
+
37
+ </inset>
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <string name="app_name">MMTemplate</string>
3
+ </resources>
@@ -0,0 +1,9 @@
1
+ <resources>
2
+
3
+ <!-- Base application theme. -->
4
+ <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
5
+ <!-- Customize your theme here. -->
6
+ <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
7
+ </style>
8
+
9
+ </resources>
@@ -0,0 +1,21 @@
1
+ buildscript {
2
+ ext {
3
+ buildToolsVersion = "36.0.0"
4
+ minSdkVersion = 24
5
+ compileSdkVersion = 36
6
+ targetSdkVersion = 36
7
+ ndkVersion = "27.1.12297006"
8
+ kotlinVersion = "2.1.20"
9
+ }
10
+ repositories {
11
+ google()
12
+ mavenCentral()
13
+ }
14
+ dependencies {
15
+ classpath("com.android.tools.build:gradle")
16
+ classpath("com.facebook.react:react-native-gradle-plugin")
17
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
18
+ }
19
+ }
20
+
21
+ apply plugin: "com.facebook.react.rootproject"
@@ -0,0 +1,7 @@
1
+ distributionBase=GRADLE_USER_HOME
2
+ distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
4
+ networkTimeout=10000
5
+ validateDistributionUrl=true
6
+ zipStoreBase=GRADLE_USER_HOME
7
+ zipStorePath=wrapper/dists
@@ -0,0 +1,44 @@
1
+ # Project-wide Gradle settings.
2
+
3
+ # IDE (e.g. Android Studio) users:
4
+ # Gradle settings configured through the IDE *will override*
5
+ # any settings specified in this file.
6
+
7
+ # For more details on how to configure your build environment visit
8
+ # http://www.gradle.org/docs/current/userguide/build_environment.html
9
+
10
+ # Specifies the JVM arguments used for the daemon process.
11
+ # The setting is particularly useful for tweaking memory settings.
12
+ # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13
+ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14
+
15
+ # When configured, Gradle will run in incubating parallel mode.
16
+ # This option should only be used with decoupled projects. More details, visit
17
+ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18
+ # org.gradle.parallel=true
19
+
20
+ # AndroidX package structure to make it clearer which packages are bundled with the
21
+ # Android operating system, and which are packaged with your app's APK
22
+ # https://developer.android.com/topic/libraries/support-library/androidx-rn
23
+ android.useAndroidX=true
24
+
25
+ # Use this property to specify which architecture you want to build.
26
+ # You can also override it from the CLI using
27
+ # ./gradlew <task> -PreactNativeArchitectures=x86_64
28
+ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
29
+
30
+ # Use this property to enable support to the new architecture.
31
+ # This will allow you to use TurboModules and the Fabric render in
32
+ # your application. You should enable this flag either if you want
33
+ # to write custom TurboModules/Fabric components OR use libraries that
34
+ # are providing them.
35
+ newArchEnabled=true
36
+
37
+ # Use this property to enable or disable the Hermes JS engine.
38
+ # If set to false, you will be using JSC instead.
39
+ hermesEnabled=true
40
+
41
+ # Use this property to enable edge-to-edge display support.
42
+ # This allows your app to draw behind system bars for an immersive UI.
43
+ # Note: Only works with ReactActivity and should not be used with custom Activity.
44
+ edgeToEdgeEnabled=false