diff --git a/app/build.gradle b/app/build.gradle index cad0f16..e52039d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,6 +32,9 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.android.material:material:1.4.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.0' + implementation 'androidx.navigation:navigation-fragment:2.3.5' + implementation 'androidx.navigation:navigation-ui:2.3.5' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 0000000..7ada6ee --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,47 @@ +{ + "project_info": { + "project_number": "469718637752", + "project_id": "karu-android-app", + "storage_bucket": "karu-android-app.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:469718637752:android:f3223a0399182f0e22e84d", + "android_client_info": { + "package_name": "com.example.karu_android_app" + } + }, + "oauth_client": [ + { + "client_id": "469718637752-luimkmi6fa864a4gfg9v6j31ca4tfddt.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.example.karu_android_app", + "certificate_hash": "dc158deb483a8a5d5ff2344690f9d094e28ac3c8" + } + }, + { + "client_id": "469718637752-arkn4cvddu4aa7u3hsqv44fhphioe45k.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyA4zg0Xli7HLZuoxSjUIlYWPiLqYso8jog" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "469718637752-arkn4cvddu4aa7u3hsqv44fhphioe45k.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ac4b816..2201ef4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,6 +9,9 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.Karu_Android_app"> + diff --git a/app/src/main/java/com/example/karu_android_app/dashboard.java b/app/src/main/java/com/example/karu_android_app/dashboard.java new file mode 100644 index 0000000..2de4d7c --- /dev/null +++ b/app/src/main/java/com/example/karu_android_app/dashboard.java @@ -0,0 +1,49 @@ +package com.example.karu_android_app; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; + +import android.bluetooth.le.ScanRecord; +import android.os.Bundle; +import android.view.MenuItem; + +import com.google.android.material.bottomnavigation.BottomNavigationView; + +public class dashboard extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_dashboard); + + BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav); + bottomNavigationView.setOnNavigationItemSelectedListener(navigationItemSelectedListener); + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new homeFragment()).commit(); + + + } + + private BottomNavigationView.OnNavigationItemSelectedListener navigationItemSelectedListener = new BottomNavigationView.OnNavigationItemSelectedListener() { + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem item) { + Fragment selectedFragment = null; + switch (item.getItemId()) { + case R.id.home: + selectedFragment = new homeFragment(); + break; + case R.id.search: + selectedFragment = new searchFragment(); + break; + case R.id.setting: + selectedFragment = new settingFragment(); + break; + + } + + + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, selectedFragment).commit(); + return true; + } + }; +} \ No newline at end of file diff --git a/app/src/main/java/com/example/karu_android_app/homeFragment.java b/app/src/main/java/com/example/karu_android_app/homeFragment.java new file mode 100644 index 0000000..55e22d5 --- /dev/null +++ b/app/src/main/java/com/example/karu_android_app/homeFragment.java @@ -0,0 +1,20 @@ +package com.example.karu_android_app; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + + +public class homeFragment extends Fragment { + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_home, container, false); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/karu_android_app/searchFragment.java b/app/src/main/java/com/example/karu_android_app/searchFragment.java new file mode 100644 index 0000000..a3f5d4f --- /dev/null +++ b/app/src/main/java/com/example/karu_android_app/searchFragment.java @@ -0,0 +1,20 @@ +package com.example.karu_android_app; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + + +public class searchFragment extends Fragment { + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_search, container, false); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/karu_android_app/settingFragment.java b/app/src/main/java/com/example/karu_android_app/settingFragment.java new file mode 100644 index 0000000..69d223a --- /dev/null +++ b/app/src/main/java/com/example/karu_android_app/settingFragment.java @@ -0,0 +1,21 @@ +package com.example.karu_android_app; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + + +public class settingFragment extends Fragment { + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_setting, container, false); + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/home.xml b/app/src/main/res/drawable/home.xml new file mode 100644 index 0000000..1741141 --- /dev/null +++ b/app/src/main/res/drawable/home.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/search.xml b/app/src/main/res/drawable/search.xml new file mode 100644 index 0000000..d6d3841 --- /dev/null +++ b/app/src/main/res/drawable/search.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/setting.xml b/app/src/main/res/drawable/setting.xml new file mode 100644 index 0000000..9f13454 --- /dev/null +++ b/app/src/main/res/drawable/setting.xml @@ -0,0 +1,19 @@ + + + + + + + diff --git a/app/src/main/res/layout/activity_dashboard.xml b/app/src/main/res/layout/activity_dashboard.xml new file mode 100644 index 0000000..beceb6a --- /dev/null +++ b/app/src/main/res/layout/activity_dashboard.xml @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000..d25d35b --- /dev/null +++ b/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml new file mode 100644 index 0000000..9da2a60 --- /dev/null +++ b/app/src/main/res/layout/fragment_search.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_setting.xml b/app/src/main/res/layout/fragment_setting.xml new file mode 100644 index 0000000..476d2ac --- /dev/null +++ b/app/src/main/res/layout/fragment_setting.xml @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/nav_menu.xml b/app/src/main/res/menu/nav_menu.xml new file mode 100644 index 0000000..273cf2f --- /dev/null +++ b/app/src/main/res/menu/nav_menu.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/dashboard_navigation.xml b/app/src/main/res/navigation/dashboard_navigation.xml new file mode 100644 index 0000000..858581e --- /dev/null +++ b/app/src/main/res/navigation/dashboard_navigation.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eaf2d30..33b3335 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -15,5 +15,7 @@ Password Email ID Sign Up + + Hello blank fragment \ No newline at end of file