diff --git a/Android/.gitignore b/Android/.gitignore
index a840822..603b140 100644
--- a/Android/.gitignore
+++ b/Android/.gitignore
@@ -7,11 +7,8 @@
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
-/.idea/dictionaries
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
-/app/debug
-/app/release
diff --git a/Android/.idea/gradle.xml b/Android/.idea/gradle.xml
index 625b371..b9f8a5e 100644
--- a/Android/.idea/gradle.xml
+++ b/Android/.idea/gradle.xml
@@ -1,13 +1,12 @@
-
\ No newline at end of file
diff --git a/Android/.idea/misc.xml b/Android/.idea/misc.xml
index 340b192..37a7509 100644
--- a/Android/.idea/misc.xml
+++ b/Android/.idea/misc.xml
@@ -1,50 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Android/.idea/runConfigurations.xml b/Android/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/Android/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/app/build.gradle b/Android/app/build.gradle
index 22d225b..0b28b3d 100644
--- a/Android/app/build.gradle
+++ b/Android/app/build.gradle
@@ -1,105 +1,37 @@
-plugins {
- id 'com.android.application'
- id 'androidx.navigation.safeargs'
-}
-
-Properties properties = new Properties()
-def propertiesFile = project.rootProject.file('local.properties')
-if (propertiesFile.exists()) {
- properties.load(propertiesFile.newDataInputStream())
-}
-def appCenterLocalSecret = properties.getProperty('appCenter.localSecret')
-def appCenterEnvSecret = System.getenv('APPCENTER_SECRET')
-def appCenterSecret = appCenterLocalSecret != null ? appCenterLocalSecret : appCenterEnvSecret != null ? appCenterEnvSecret : ""
+apply plugin: 'com.android.application'
android {
- compileSdkVersion 31
- buildToolsVersion '30.0.3'
+ compileSdkVersion 29
+ buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.majinnaibu.monstercards"
minSdkVersion 22
- targetSdkVersion 31
+ targetSdkVersion 29
versionCode 1
versionName "1.0"
- buildConfigField "String", "APPCENTER_SECRET", "\"${appCenterSecret}\""
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
-
- javaCompileOptions {
- annotationProcessorOptions {
- arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
- }
- }
}
buildTypes {
release {
- // Enables code shrinking, obfuscation, and optimization for only
- // your project's release build type.
- minifyEnabled true
-
- // Enables resource shrinking, which is performed by the
- // Android Gradle plugin.
- shrinkResources true
-
- // Includes the default ProGuard rules files that are packaged with
- // the Android Gradle plugin. To learn more, go to the section about
- // R8 configuration files.
+ minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- buildFeatures {
- viewBinding true
- }
- lintOptions {
- checkDependencies true
- }
}
dependencies {
- // Included libs
implementation fileTree(dir: "libs", include: ["*.jar"])
-
- // Google
- 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.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
+ implementation 'androidx.navigation:navigation-fragment:2.3.0'
+ implementation 'androidx.navigation:navigation-ui:2.3.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
- implementation 'androidx.legacy:legacy-support-v4:1.0.0'
- implementation 'androidx.recyclerview:recyclerview:1.2.1'
- implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
- implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
- // Testing
- testImplementation 'junit:junit:4.13.2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.3'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
-
- // Room DB
- implementation 'io.reactivex.rxjava3:rxjava:3.1.0'
- implementation "io.reactivex.rxjava3:rxandroid:3.0.0"
- implementation "androidx.room:room-runtime:2.3.0"
- annotationProcessor "androidx.room:room-compiler:2.3.0"
- implementation "androidx.room:room-rxjava3:2.3.0"
- //testImplementation "androidx.room:room-testing:2.3.0"
-
- // AppCenter
- debugImplementation 'com.microsoft.appcenter:appcenter-analytics:4.2.0'
- debugImplementation 'com.microsoft.appcenter:appcenter-crashes:4.2.0'
-
- // Flipper
- debugImplementation 'com.facebook.flipper:flipper:0.102.0'
- debugImplementation "com.facebook.soloader:soloader:0.10.1"
- releaseImplementation 'com.facebook.flipper:flipper-noop:0.102.0'
-
- // Other 3rd Party
- implementation 'com.atlassian.commonmark:commonmark:0.17.0'
- implementation 'com.google.code.gson:gson:2.8.7'
-}
+}
\ No newline at end of file
diff --git a/Android/app/proguard-rules.pro b/Android/app/proguard-rules.pro
index 08e4fd6..481bb43 100644
--- a/Android/app/proguard-rules.pro
+++ b/Android/app/proguard-rules.pro
@@ -18,15 +18,4 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
-#-renamesourcefileattribute SourceFile
-
--keep enum com.majinnaibu.monstercards.data.enums.AbilityScore
--keep enum com.majinnaibu.monstercards.data.enums.ProficiencyType
--keep enum com.majinnaibu.monstercards.data.enums.AdvantageType
--keep enum com.majinnaibu.monstercards.data.enums.TraitType
--keep enum com.majinnaibu.monstercards.data.enums.StringType
--keepclassmembers,allowoptimization enum * {
- ;
- public static **[] values();
- public static ** valueOf(java.lang.String);
-}
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/Android/app/src/main/AndroidManifest.xml b/Android/app/src/main/AndroidManifest.xml
index 978b4c4..b1ebbf6 100644
--- a/Android/app/src/main/AndroidManifest.xml
+++ b/Android/app/src/main/AndroidManifest.xml
@@ -2,12 +2,8 @@
-
-
+ android:label="@string/app_name">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Android/app/src/main/java/com/majinnaibu/monstercards/MainActivity.java b/Android/app/src/main/java/com/majinnaibu/monstercards/MainActivity.java
index 31ba5a1..01551a5 100644
--- a/Android/app/src/main/java/com/majinnaibu/monstercards/MainActivity.java
+++ b/Android/app/src/main/java/com/majinnaibu/monstercards/MainActivity.java
@@ -1,156 +1,30 @@
package com.majinnaibu.monstercards;
-import android.content.ContentResolver;
-import android.content.Intent;
-import android.database.Cursor;
-import android.net.Uri;
import android.os.Bundle;
-import android.provider.DocumentsContract;
-import android.view.MenuItem;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.navigation.NavController;
-import androidx.navigation.NavDirections;
-import androidx.navigation.fragment.NavHostFragment;
-import androidx.navigation.ui.AppBarConfiguration;
-import androidx.navigation.ui.NavigationUI;
import com.google.android.material.bottomnavigation.BottomNavigationView;
-import com.majinnaibu.monstercards.helpers.StringHelper;
-import com.majinnaibu.monstercards.init.AppCenterInitializer;
-import com.majinnaibu.monstercards.init.FlipperInitializer;
-import com.majinnaibu.monstercards.utils.Logger;
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Objects;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.navigation.NavController;
+import androidx.navigation.Navigation;
+import androidx.navigation.ui.AppBarConfiguration;
+import androidx.navigation.ui.NavigationUI;
public class MainActivity extends AppCompatActivity {
- @Override
- public boolean onOptionsItemSelected(@NonNull MenuItem item) {
- if (item.getItemId() == android.R.id.home) {
- getOnBackPressedDispatcher().onBackPressed();
- return true;
- }
-
- return super.onOptionsItemSelected(item);
- }
-
- @SuppressWarnings("ConstantConditions")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- AppCenterInitializer.init(getApplication());
setContentView(R.layout.activity_main);
BottomNavigationView navView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
- R.id.navigation_search,
- R.id.navigation_dashboard,
- R.id.navigation_collections,
- R.id.navigation_library)
+ R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)
.build();
- NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment);
- NavController navController = navHostFragment.getNavController();
- navController.addOnDestinationChangedListener(FlipperInitializer::sendNavigationEvent);
+ NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
- onNewIntent(getIntent());
}
- @Override
- protected void onNewIntent(Intent intent) {
- super.onNewIntent(intent);
-
- String json = readMonsterJSONFromIntent(intent);
- if (!StringHelper.isNullOrEmpty(json)) {
- NavHostFragment navHostFragment = Objects.requireNonNull((NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment));
- NavController navController = navHostFragment.getNavController();
- NavDirections action = MobileNavigationDirections.actionGlobalMonsterImportFragment(json);
- navController.navigate(action);
- }
- }
-
- @Nullable
- private String readMonsterJSONFromIntent(@NonNull Intent intent) {
- String action = intent.getAction();
- Bundle extras = intent.getExtras();
- String type = intent.getType();
- String json;
- Uri uri = null;
- if ("android.intent.action.MAIN".equals(action)) {
- return null;
- } else if ("android.intent.action.SEND".equals(action) && "text/plain".equals(type)) {
- uri = extras.getParcelable("android.intent.extra.STREAM");
- } else if ("android.intent.action.VIEW".equals(action) && ("text/plain".equals(type) || "application/octet-stream".equals(type))) {
- uri = intent.getData();
- } else {
- Logger.logError(String.format("unexpected launch configuration action: %s, type: %s", action, type));
- }
- if (uri == null) {
- return null;
- }
- json = readContentsOfUri(uri);
- if (StringHelper.isNullOrEmpty(json)) {
- return null;
- }
- return json;
- }
-
- @Nullable
- private String readContentsOfUri(Uri uri) {
- StringBuilder builder = new StringBuilder();
- try (
- InputStream inputStream = openInputStream(uri);
- BufferedReader reader = new BufferedReader(new InputStreamReader(Objects.requireNonNull(inputStream)))
- ) {
- String line;
- while ((line = reader.readLine()) != null) {
- builder.append(line);
- }
- } catch (IOException e) {
- Logger.logError("error reading file", e);
- return null;
- }
- return builder.toString();
- }
-
- private boolean isVirtualFile(Uri uri) {
- if (!DocumentsContract.isDocumentUri(this, uri)) {
- return false;
- }
-
- Cursor cursor = getContentResolver().query(
- uri,
- new String[]{DocumentsContract.Document.COLUMN_FLAGS},
- null, null, null);
-
- int flags = 0;
- if (cursor.moveToFirst()) {
- flags = cursor.getInt(0);
- }
- cursor.close();
-
- return (flags & DocumentsContract.Document.FLAG_VIRTUAL_DOCUMENT) != 0;
- }
-
- private InputStream openInputStream(Uri uri) throws IOException {
- ContentResolver resolver = getContentResolver();
- if (isVirtualFile(uri)) {
- String[] openableMimeTypes = resolver.getStreamTypes(uri, "*/*");
- if (openableMimeTypes == null || openableMimeTypes.length <= 0) {
- throw new FileNotFoundException();
- }
- return resolver.openTypedAssetFileDescriptor(uri, openableMimeTypes[0], null).createInputStream();
- } else {
- return resolver.openInputStream(uri);
- }
- }
-}
+}
\ No newline at end of file
diff --git a/Android/app/src/main/java/com/majinnaibu/monstercards/ui/dashboard/DashboardFragment.java b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/dashboard/DashboardFragment.java
index 731df48..22ac979 100644
--- a/Android/app/src/main/java/com/majinnaibu/monstercards/ui/dashboard/DashboardFragment.java
+++ b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/dashboard/DashboardFragment.java
@@ -1,83 +1,35 @@
package com.majinnaibu.monstercards.ui.dashboard;
-import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.lifecycle.LiveData;
-import androidx.lifecycle.ViewModelProvider;
-import androidx.navigation.NavDirections;
-import androidx.navigation.Navigation;
-import androidx.recyclerview.widget.GridLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
import com.majinnaibu.monstercards.R;
-import com.majinnaibu.monstercards.models.Monster;
-import com.majinnaibu.monstercards.ui.shared.MCFragment;
-import com.majinnaibu.monstercards.utils.Logger;
-import java.util.List;
+public class DashboardFragment extends Fragment {
-import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
-import io.reactivex.rxjava3.schedulers.Schedulers;
-
-public class DashboardFragment extends MCFragment {
- private DashboardViewModel mViewModel;
- private ViewHolder mHolder;
- private DashboardRecyclerViewAdapter mAdapter;
+ private DashboardViewModel dashboardViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
- mViewModel = new ViewModelProvider(this).get(DashboardViewModel.class);
+ dashboardViewModel =
+ ViewModelProviders.of(this).get(DashboardViewModel.class);
View root = inflater.inflate(R.layout.fragment_dashboard, container, false);
- mHolder = new ViewHolder(root);
-
- setupRecyclerView(mHolder.list);
-
- // TODO: subscribe better
- getMonsterRepository()
- .getMonsters()
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(monsters -> mViewModel.setMonsters(monsters));
-
- return root;
- }
-
- private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
- int columnCount = Math.max(1, getResources().getConfiguration().screenWidthDp / 396);
- Context context = requireContext();
- GridLayoutManager layoutManager = new GridLayoutManager(context, columnCount);
- recyclerView.setLayoutManager(layoutManager);
-
- LiveData> monsterData = mViewModel.getMonsters();
- mAdapter = new DashboardRecyclerViewAdapter(monster -> {
- if (monster != null) {
- navigateToMonsterDetail(monster);
- } else {
- Logger.logError("Can't navigate to MonsterDetailFragment with a null monster");
+ final TextView textView = root.findViewById(R.id.text_dashboard);
+ dashboardViewModel.getText().observe(getViewLifecycleOwner(), new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
}
});
- if (monsterData != null) {
- monsterData.observe(getViewLifecycleOwner(), monsters -> mAdapter.submitList(monsters));
- }
- recyclerView.setAdapter(mAdapter);
+ return root;
}
-
- private void navigateToMonsterDetail(Monster monster) {
- NavDirections action = DashboardFragmentDirections.actionNavigationDashboardToNavigationMonster(monster.id.toString());
- Navigation.findNavController(requireView()).navigate(action);
- }
-
- private static class ViewHolder {
- final RecyclerView list;
-
- ViewHolder(View root) {
- list = root.findViewById(R.id.list);
- }
- }
-
-}
+}
\ No newline at end of file
diff --git a/Android/app/src/main/java/com/majinnaibu/monstercards/ui/dashboard/DashboardViewModel.java b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/dashboard/DashboardViewModel.java
index 98b6711..4748dd1 100644
--- a/Android/app/src/main/java/com/majinnaibu/monstercards/ui/dashboard/DashboardViewModel.java
+++ b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/dashboard/DashboardViewModel.java
@@ -4,23 +4,16 @@ import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
-import com.majinnaibu.monstercards.models.Monster;
-
-import java.util.ArrayList;
-import java.util.List;
-
public class DashboardViewModel extends ViewModel {
- private final MutableLiveData> mMonsters;
+
+ private MutableLiveData mText;
public DashboardViewModel() {
- mMonsters = new MutableLiveData<>(new ArrayList<>());
+ mText = new MutableLiveData<>();
+ mText.setValue("This is dashboard fragment");
}
- public LiveData> getMonsters() {
- return mMonsters;
+ public LiveData getText() {
+ return mText;
}
-
- public void setMonsters(List monsters) {
- mMonsters.setValue(monsters);
- }
-}
+}
\ No newline at end of file
diff --git a/Android/app/src/main/java/com/majinnaibu/monstercards/ui/home/HomeFragment.java b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/home/HomeFragment.java
new file mode 100644
index 0000000..938fa5f
--- /dev/null
+++ b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/home/HomeFragment.java
@@ -0,0 +1,35 @@
+package com.majinnaibu.monstercards.ui.home;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+
+import com.majinnaibu.monstercards.R;
+
+public class HomeFragment extends Fragment {
+
+ private HomeViewModel homeViewModel;
+
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ ViewGroup container, Bundle savedInstanceState) {
+ homeViewModel =
+ ViewModelProviders.of(this).get(HomeViewModel.class);
+ View root = inflater.inflate(R.layout.fragment_home, container, false);
+ final TextView textView = root.findViewById(R.id.text_home);
+ homeViewModel.getText().observe(getViewLifecycleOwner(), new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
+ }
+ });
+ return root;
+ }
+}
\ No newline at end of file
diff --git a/Android/app/src/main/java/com/majinnaibu/monstercards/ui/home/HomeViewModel.java b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/home/HomeViewModel.java
new file mode 100644
index 0000000..e27037e
--- /dev/null
+++ b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/home/HomeViewModel.java
@@ -0,0 +1,19 @@
+package com.majinnaibu.monstercards.ui.home;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class HomeViewModel extends ViewModel {
+
+ private MutableLiveData mText;
+
+ public HomeViewModel() {
+ mText = new MutableLiveData<>();
+ mText.setValue("This is home fragment");
+ }
+
+ public LiveData getText() {
+ return mText;
+ }
+}
\ No newline at end of file
diff --git a/Android/app/src/main/java/com/majinnaibu/monstercards/ui/notifications/NotificationsFragment.java b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/notifications/NotificationsFragment.java
new file mode 100644
index 0000000..0533fa9
--- /dev/null
+++ b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/notifications/NotificationsFragment.java
@@ -0,0 +1,35 @@
+package com.majinnaibu.monstercards.ui.notifications;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+
+import com.majinnaibu.monstercards.R;
+
+public class NotificationsFragment extends Fragment {
+
+ private NotificationsViewModel notificationsViewModel;
+
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ ViewGroup container, Bundle savedInstanceState) {
+ notificationsViewModel =
+ ViewModelProviders.of(this).get(NotificationsViewModel.class);
+ View root = inflater.inflate(R.layout.fragment_notifications, container, false);
+ final TextView textView = root.findViewById(R.id.text_notifications);
+ notificationsViewModel.getText().observe(getViewLifecycleOwner(), new Observer() {
+ @Override
+ public void onChanged(@Nullable String s) {
+ textView.setText(s);
+ }
+ });
+ return root;
+ }
+}
\ No newline at end of file
diff --git a/Android/app/src/main/java/com/majinnaibu/monstercards/ui/notifications/NotificationsViewModel.java b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/notifications/NotificationsViewModel.java
new file mode 100644
index 0000000..4384287
--- /dev/null
+++ b/Android/app/src/main/java/com/majinnaibu/monstercards/ui/notifications/NotificationsViewModel.java
@@ -0,0 +1,19 @@
+package com.majinnaibu.monstercards.ui.notifications;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class NotificationsViewModel extends ViewModel {
+
+ private MutableLiveData mText;
+
+ public NotificationsViewModel() {
+ mText = new MutableLiveData<>();
+ mText.setValue("This is notifications fragment");
+ }
+
+ public LiveData getText() {
+ return mText;
+ }
+}
\ No newline at end of file
diff --git a/Android/app/src/main/res/drawable/ic_home_black_24dp.xml b/Android/app/src/main/res/drawable/ic_home_black_24dp.xml
new file mode 100644
index 0000000..f8bb0b5
--- /dev/null
+++ b/Android/app/src/main/res/drawable/ic_home_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Android/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/Android/app/src/main/res/drawable/ic_notifications_black_24dp.xml
new file mode 100644
index 0000000..78b75c3
--- /dev/null
+++ b/Android/app/src/main/res/drawable/ic_notifications_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Android/app/src/main/res/layout/activity_main.xml b/Android/app/src/main/res/layout/activity_main.xml
index eec5652..38c0aa8 100644
--- a/Android/app/src/main/res/layout/activity_main.xml
+++ b/Android/app/src/main/res/layout/activity_main.xml
@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:paddingTop="?attr/actionBarSize">
-
\ No newline at end of file
diff --git a/Android/app/src/main/res/layout/fragment_dashboard.xml b/Android/app/src/main/res/layout/fragment_dashboard.xml
index bb08ff8..166ab0e 100644
--- a/Android/app/src/main/res/layout/fragment_dashboard.xml
+++ b/Android/app/src/main/res/layout/fragment_dashboard.xml
@@ -6,18 +6,17 @@
android:layout_height="match_parent"
tools:context=".ui.dashboard.DashboardFragment">
-
-
+ app:layout_constraintTop_toTopOf="parent" />
+
\ No newline at end of file
diff --git a/Android/app/src/main/res/layout/fragment_home.xml b/Android/app/src/main/res/layout/fragment_home.xml
new file mode 100644
index 0000000..f3d9b08
--- /dev/null
+++ b/Android/app/src/main/res/layout/fragment_home.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/app/src/main/res/layout/fragment_notifications.xml b/Android/app/src/main/res/layout/fragment_notifications.xml
new file mode 100644
index 0000000..d417935
--- /dev/null
+++ b/Android/app/src/main/res/layout/fragment_notifications.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android/app/src/main/res/menu/bottom_nav_menu.xml b/Android/app/src/main/res/menu/bottom_nav_menu.xml
index c613122..fb6d040 100644
--- a/Android/app/src/main/res/menu/bottom_nav_menu.xml
+++ b/Android/app/src/main/res/menu/bottom_nav_menu.xml
@@ -2,9 +2,9 @@
\ No newline at end of file
diff --git a/Android/app/src/main/res/navigation/mobile_navigation.xml b/Android/app/src/main/res/navigation/mobile_navigation.xml
index 0f7b0d2..6076f03 100644
--- a/Android/app/src/main/res/navigation/mobile_navigation.xml
+++ b/Android/app/src/main/res/navigation/mobile_navigation.xml
@@ -3,242 +3,23 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mobile_navigation"
- app:startDestination="@+id/navigation_dashboard">
+ app:startDestination="@+id/navigation_home">
-
-
+ android:id="@+id/navigation_home"
+ android:name="com.majinnaibu.monstercards.ui.home.HomeFragment"
+ android:label="@string/title_home"
+ tools:layout="@layout/fragment_home" />
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ tools:layout="@layout/fragment_dashboard" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:id="@+id/navigation_notifications"
+ android:name="com.majinnaibu.monstercards.ui.notifications.NotificationsFragment"
+ android:label="@string/title_notifications"
+ tools:layout="@layout/fragment_notifications" />
+
\ No newline at end of file
diff --git a/Android/app/src/main/res/values/colors.xml b/Android/app/src/main/res/values/colors.xml
index 196b818..4faecfa 100644
--- a/Android/app/src/main/res/values/colors.xml
+++ b/Android/app/src/main/res/values/colors.xml
@@ -1,26 +1,6 @@
-
- #9b2818
- #d25941
- #660000
- #ea7e00
- #ffae41
- #b15000
- #ffffff
- #000000
- #ffffff
- #000000
-
- #995500
-
-
- #FF3B30
- #FF9500
- #FFCC00
- #4CD964
- #5AC8FA
- #007AFF
- #5855D6
- #FF2D55
-
+ #6200EE
+ #3700B3
+ #03DAC5
+
\ No newline at end of file
diff --git a/Android/app/src/main/res/values/dimens.xml b/Android/app/src/main/res/values/dimens.xml
index ef75e89..e00c2dd 100644
--- a/Android/app/src/main/res/values/dimens.xml
+++ b/Android/app/src/main/res/values/dimens.xml
@@ -1,22 +1,5 @@
- 10sp
- 80dp
- 14sp
- 4dp
- 16dp
- 40dp
- 12sp
- 20sp
- 10sp
- 16sp
- 32dp
- 16dp
- 8dp
- 4dp
- 20sp
- 2dp
- 16sp
- 8sp
- 16dp
-
+ 16dp
+ 16dp
+
\ No newline at end of file
diff --git a/Android/app/src/main/res/values/strings.xml b/Android/app/src/main/res/values/strings.xml
index a03db83..facc835 100644
--- a/Android/app/src/main/res/values/strings.xml
+++ b/Android/app/src/main/res/values/strings.xml
@@ -1,140 +1,6 @@
- Add Ability
- Add Condition
- Add Damage Type
- Add Item
- Add Language
- Add monster
- Add Sense
- Add Skill
- Add Trait
- Edit
- Import Monster
MonsterCards
- CHA
- CON
- Unnamed Monster
- DEX
- %d ft.
- INT
- Ability Scores
- Abilities
- Actions
- Advantage
- Advantage
- Disadvantage
- None
- Alignment
- Armor
- Armor Class
- AC
- Base Speed
- Basic Info
- Burrow Speed
- Can Hover
- Can Speak
- Challenge Rating
- CR %s
- CR
- Charisma
- Climb Speed
- Condition Immunities
- Constitution
- Custom Armor
- Custom CR
- Custom HP
- Custom Proficiency Bonus
- Custom Speed
- Damage Immunities
- Damage Resistances
- Damage Type
- Damage Vulnerabilities
- -
- Description
- Dexterity
- Fly Speed
- Has Custom HP
- Has Custom Speed
- Has a Shield
- Hit Dice
- Hit Points
- HP
- +
- INIT
- Intelligence
- Lair Actions
- Languages
- Legendary Actions
- Natural Armor Bonus
- Name
- Understands But
- Proficiency
- Expertise
- None
- Proficient
- Reactions
- Regional Effects
- Saving Throws
- Query
- Senses
- Shield Bonus
- Size
- Skills
- Speed
- Strength
- Subtype
- Swim Speed
- Telepathy
- Type
- Wisdom
- section divider
- Failed to create monster
- %1$s created
- STR
- Collections
+ Home
Dashboard
- Ability
- Abilities
- Ability Scores
- Action
- Actions
- Armor
- Basic Info
- Challenge Rating
- Condition Immunities
- Condition Immunity
- Damage Immunities
- Damage Immunity
- Damage Resistance
- Damage Resistances
- Damage Vulnerabilities
- Damage Vulnerability
- Lair Action
- Lair Actions
- Language
- Languages
- Legendary Action
- Legendary Actions
- Edit Monster
- Edit %1$s
- Reaction
- Reactions
- Regional Action
- Regional Actions
- Speed
- Saving Throws
- Senses
- Senses
- Skill
- Skills
- String
- Strings
- Trait
- Traits
- Import Monster
- Library
- Monster Details
- %1$s Details
- Search
- WIS
-
+ Notifications
+
\ No newline at end of file
diff --git a/Android/app/src/main/res/values/styles.xml b/Android/app/src/main/res/values/styles.xml
index 391ec9a..fac9291 100644
--- a/Android/app/src/main/res/values/styles.xml
+++ b/Android/app/src/main/res/values/styles.xml
@@ -7,4 +7,4 @@
- @color/colorAccent
-
+
\ No newline at end of file
diff --git a/Android/build.gradle b/Android/build.gradle
index cd30a15..6754c23 100644
--- a/Android/build.gradle
+++ b/Android/build.gradle
@@ -2,11 +2,10 @@
buildscript {
repositories {
google()
- mavenCentral()
+ jcenter()
}
dependencies {
- classpath "com.android.tools.build:gradle:7.0.1"
- classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5"
+ classpath "com.android.tools.build:gradle:4.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -16,18 +15,10 @@ buildscript {
allprojects {
repositories {
google()
- mavenCentral()
- // maven { url "https://oss.jfrog.org/libs-snapshot" }
- // maven { url 'http://repo1.maven.org/maven2' }
- }
- // Temporary workaround until room 2.4.0 is released https://issuetracker.google.com/issues/174695268?pli=1#comment10
- configurations.configureEach {
- resolutionStrategy {
- force 'org.xerial:sqlite-jdbc:3.34.0'
- }
+ jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
-}
+}
\ No newline at end of file
diff --git a/Android/gradle/wrapper/gradle-wrapper.properties b/Android/gradle/wrapper/gradle-wrapper.properties
index 699e048..910e46e 100644
--- a/Android/gradle/wrapper/gradle-wrapper.properties
+++ b/Android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat May 01 23:00:30 PDT 2021
+#Mon Aug 31 21:50:22 PDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip