-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2556de1
commit 906936c
Showing
53 changed files
with
1,192 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
plugins { | ||
alias(libs.plugins.android.application) | ||
alias(libs.plugins.kotlin.android) | ||
} | ||
|
||
android { | ||
namespace = "com.learning.ad.arisue" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
applicationId = "com.learning.ad.arisue" | ||
minSdk = 26 | ||
targetSdk = 34 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
buildFeatures { | ||
viewBinding = true | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.androidx.appcompat) | ||
implementation(libs.material) | ||
implementation(libs.androidx.constraintlayout) | ||
implementation(libs.androidx.lifecycle.livedata.ktx) | ||
implementation(libs.androidx.lifecycle.viewmodel.ktx) | ||
implementation(libs.androidx.navigation.fragment.ktx) | ||
implementation(libs.androidx.navigation.ui.ktx) | ||
testImplementation(libs.junit) | ||
androidTestImplementation(libs.androidx.junit) | ||
androidTestImplementation(libs.androidx.espresso.core) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
ARISUe/app/src/androidTest/java/com/learning/ad/arisue/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.learning.ad.arisue | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.learning.ad.arisue", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:dataExtractionRules="@xml/data_extraction_rules" | ||
android:fullBackupContent="@xml/backup_rules" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.ARISUe" | ||
tools:targetApi="31"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true" | ||
android:label="@string/app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
35 changes: 35 additions & 0 deletions
35
ARISUe/app/src/main/java/com/learning/ad/arisue/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.learning.ad.arisue | ||
|
||
import android.os.Bundle | ||
import com.google.android.material.bottomnavigation.BottomNavigationView | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.navigation.findNavController | ||
import androidx.navigation.ui.AppBarConfiguration | ||
import androidx.navigation.ui.setupActionBarWithNavController | ||
import androidx.navigation.ui.setupWithNavController | ||
import com.learning.ad.arisue.databinding.ActivityMainBinding | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
private lateinit var binding: ActivityMainBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
binding = ActivityMainBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
val navView: BottomNavigationView = binding.navView | ||
|
||
val navController = findNavController(R.id.nav_host_fragment_activity_main) | ||
// Passing each menu ID as a set of Ids because each | ||
// menu should be considered as top level destinations. | ||
val appBarConfiguration = AppBarConfiguration( | ||
setOf( | ||
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications | ||
) | ||
) | ||
setupActionBarWithNavController(navController, appBarConfiguration) | ||
navView.setupWithNavController(navController) | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
ARISUe/app/src/main/java/com/learning/ad/arisue/ui/dashboard/DashboardFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.learning.ad.arisue.ui.dashboard | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.TextView | ||
import androidx.fragment.app.Fragment | ||
import androidx.lifecycle.ViewModelProvider | ||
import com.learning.ad.arisue.databinding.FragmentDashboardBinding | ||
|
||
class DashboardFragment : Fragment() { | ||
|
||
private var _binding: FragmentDashboardBinding? = null | ||
|
||
// This property is only valid between onCreateView and | ||
// onDestroyView. | ||
private val binding get() = _binding!! | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
val dashboardViewModel = | ||
ViewModelProvider(this).get(DashboardViewModel::class.java) | ||
|
||
_binding = FragmentDashboardBinding.inflate(inflater, container, false) | ||
val root: View = binding.root | ||
|
||
val textView: TextView = binding.textDashboard | ||
dashboardViewModel.text.observe(viewLifecycleOwner) { | ||
textView.text = it | ||
} | ||
return root | ||
} | ||
|
||
override fun onDestroyView() { | ||
super.onDestroyView() | ||
_binding = null | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
ARISUe/app/src/main/java/com/learning/ad/arisue/ui/dashboard/DashboardViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.learning.ad.arisue.ui.dashboard | ||
|
||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
|
||
class DashboardViewModel : ViewModel() { | ||
|
||
private val _text = MutableLiveData<String>().apply { | ||
value = "This is dashboard Fragment" | ||
} | ||
val text: LiveData<String> = _text | ||
} |
42 changes: 42 additions & 0 deletions
42
ARISUe/app/src/main/java/com/learning/ad/arisue/ui/home/HomeFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.learning.ad.arisue.ui.home | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.TextView | ||
import androidx.fragment.app.Fragment | ||
import androidx.lifecycle.ViewModelProvider | ||
import com.learning.ad.arisue.databinding.FragmentHomeBinding | ||
|
||
class HomeFragment : Fragment() { | ||
|
||
private var _binding: FragmentHomeBinding? = null | ||
|
||
// This property is only valid between onCreateView and | ||
// onDestroyView. | ||
private val binding get() = _binding!! | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
val homeViewModel = | ||
ViewModelProvider(this).get(HomeViewModel::class.java) | ||
|
||
_binding = FragmentHomeBinding.inflate(inflater, container, false) | ||
val root: View = binding.root | ||
|
||
val textView: TextView = binding.textHome | ||
homeViewModel.text.observe(viewLifecycleOwner) { | ||
textView.text = it | ||
} | ||
return root | ||
} | ||
|
||
override fun onDestroyView() { | ||
super.onDestroyView() | ||
_binding = null | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
ARISUe/app/src/main/java/com/learning/ad/arisue/ui/home/HomeViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.learning.ad.arisue.ui.home | ||
|
||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
|
||
class HomeViewModel : ViewModel() { | ||
|
||
private val _text = MutableLiveData<String>().apply { | ||
value = "This is home Fragment" | ||
} | ||
val text: LiveData<String> = _text | ||
} |
42 changes: 42 additions & 0 deletions
42
ARISUe/app/src/main/java/com/learning/ad/arisue/ui/notifications/NotificationsFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.learning.ad.arisue.ui.notifications | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.TextView | ||
import androidx.fragment.app.Fragment | ||
import androidx.lifecycle.ViewModelProvider | ||
import com.learning.ad.arisue.databinding.FragmentNotificationsBinding | ||
|
||
class NotificationsFragment : Fragment() { | ||
|
||
private var _binding: FragmentNotificationsBinding? = null | ||
|
||
// This property is only valid between onCreateView and | ||
// onDestroyView. | ||
private val binding get() = _binding!! | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
val notificationsViewModel = | ||
ViewModelProvider(this).get(NotificationsViewModel::class.java) | ||
|
||
_binding = FragmentNotificationsBinding.inflate(inflater, container, false) | ||
val root: View = binding.root | ||
|
||
val textView: TextView = binding.textNotifications | ||
notificationsViewModel.text.observe(viewLifecycleOwner) { | ||
textView.text = it | ||
} | ||
return root | ||
} | ||
|
||
override fun onDestroyView() { | ||
super.onDestroyView() | ||
_binding = null | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
ARISUe/app/src/main/java/com/learning/ad/arisue/ui/notifications/NotificationsViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.learning.ad.arisue.ui.notifications | ||
|
||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
|
||
class NotificationsViewModel : ViewModel() { | ||
|
||
private val _text = MutableLiveData<String>().apply { | ||
value = "This is notifications Fragment" | ||
} | ||
val text: LiveData<String> = _text | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24.0" | ||
android:viewportHeight="24.0"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24.0" | ||
android:viewportHeight="24.0"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" /> | ||
</vector> |
Oops, something went wrong.