Initial commit: Notes App with text and checklist support
Features: - Create, edit, and delete notes (text or checklist) - Sort notes by date or alphabetically - Dark theme UI with Material Design components - Checklist items with checkboxes and progress tracking - Floating action buttons for adding/deleting checklist items - Auto-save functionality - Swipe to delete from list Technical: - Android Studio project with Gradle build system - SQLite database via Room-like storage (SharedPreferences) - RecyclerView for efficient note/item lists - Fragment-based navigation Bug Fixes: - Fixed new notes not appearing in main view after creation - Added onResume() refresh to NotesListFragment - Corrected ID assignment and counter logic in NotesStorage
This commit is contained in:
commit
0c69cd11c5
|
|
@ -0,0 +1,86 @@
|
|||
# Built application files
|
||||
*.apk
|
||||
*.aar
|
||||
*.ap_
|
||||
*.aab
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
# Uncomment the following line in case you need and you don't have the release build type files in your app
|
||||
# release/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
# Android Studio 3 in .gitignore file.
|
||||
.idea/caches
|
||||
.idea/modules.xml
|
||||
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
|
||||
.idea/navEditor.xml
|
||||
|
||||
# Keystore files
|
||||
# Uncomment the following lines if you do not want to check your keystore files in.
|
||||
#*.jks
|
||||
#*.keystore
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
.cxx/
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.yml
|
||||
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
|
||||
# Version control
|
||||
vcs.xml
|
||||
|
||||
# lint
|
||||
lint/intermediates/
|
||||
lint/reports/
|
||||
lint/generated/
|
||||
|
||||
# Android Profiling
|
||||
*.hprof
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
# Notes App
|
||||
|
||||
A lightweight personal notes app for Android with plain text and checklist note types.
|
||||
|
||||
## Features
|
||||
|
||||
- **Two Note Types**: Plain text notes and checklists
|
||||
- **Dark Mode Only**: Optimized for low-light usage
|
||||
- **Sortable List**: Sort by date (most/oldest) or alphabetically (A-Z/Z-A)
|
||||
- **Swipe to Delete**: Swipe any note left/right to delete with confirmation
|
||||
- **Auto-save**: Notes are automatically saved as you type
|
||||
- **Checklist Features**:
|
||||
- Add/remove items
|
||||
- Toggle checkboxes
|
||||
- Progress indicator (X/Y completed)
|
||||
- **"Delete All Checked" button** - Remove all checked items at once
|
||||
|
||||
## Requirements
|
||||
|
||||
- Android Studio Hedgehog or later
|
||||
- JDK 17
|
||||
- Minimum SDK: API 24 (Android 7.0)
|
||||
- Target SDK: API 34 (Android 14)
|
||||
|
||||
## How to Build
|
||||
|
||||
1. Open Android Studio
|
||||
2. Select **File > Open** and navigate to the `NotesApp` folder
|
||||
3. Wait for Gradle sync to complete
|
||||
4. Connect an Android device or start an emulator (API 24+)
|
||||
5. Click **Run** (Shift+F10) or select **Run > Run 'app'**
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
NotesApp/
|
||||
├── app/src/main/java/com/notesapp/
|
||||
│ ├── MainActivity.java # Main activity hosting fragments
|
||||
│ ├── fragments/
|
||||
│ │ ├── NotesListFragment.java # Note list with sorting & swipe-to-delete
|
||||
│ │ └── NoteEditorFragment.java # Editor for text and checklist notes
|
||||
│ ├── adapters/
|
||||
│ │ ├── NotesAdapter.java # RecyclerView adapter for note cards
|
||||
│ │ └── ChecklistAdapter.java # RecyclerView adapter for checklist items
|
||||
│ ├── models/
|
||||
│ │ ├── Note.java # Data model with JSON serialization
|
||||
│ │ └── ChecklistItem.java # Checklist item data model
|
||||
│ └── utils/
|
||||
│ └── NotesStorage.java # SharedPreferences storage layer
|
||||
├── app/src/main/res/
|
||||
│ ├── layout/ # XML layouts
|
||||
│ ├── drawable/ # Vector icons
|
||||
│ └── values/ # Colors, strings, themes
|
||||
└── build.gradle # App configuration
|
||||
```
|
||||
|
||||
## Storage
|
||||
|
||||
Notes are stored in SharedPreferences with the following structure:
|
||||
- `note_count`: Next available ID
|
||||
- `sort_order`: Current sort preference
|
||||
- Per-note data (JSON serialized): type, title, content/items, timestamp
|
||||
|
||||
## License
|
||||
|
||||
Personal use only.
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.notesapp'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.notesapp"
|
||||
minSdk 24
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
-keepattributes *Annotation*
|
||||
-keepclassmembers class * {
|
||||
@android.webkit.JavascriptInterface <methods>;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.NotesApp">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.notesapp;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.notesapp.fragments.NotesListFragment;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
Fragment fragment = new NotesListFragment();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.fragment_container, fragment)
|
||||
.commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
package com.notesapp.adapters;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.notesapp.R;
|
||||
import com.notesapp.models.ChecklistItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ChecklistAdapter extends RecyclerView.Adapter<ChecklistAdapter.ChecklistViewHolder> {
|
||||
private List<ChecklistItem> items;
|
||||
private OnItemChangeListener listener;
|
||||
|
||||
public interface OnItemChangeListener {
|
||||
void onTextChange(ChecklistItem item, String text);
|
||||
void onCheckedChange(ChecklistItem item, boolean checked);
|
||||
void onDeleteClick(int position, ChecklistItem item);
|
||||
}
|
||||
|
||||
public ChecklistAdapter(OnItemChangeListener listener) {
|
||||
this.listener = listener;
|
||||
this.items = new java.util.ArrayList<>();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ChecklistViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_checklist_row, parent, false);
|
||||
return new ChecklistViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ChecklistViewHolder holder, int position) {
|
||||
final ChecklistItem item = items.get(position);
|
||||
|
||||
holder.editText.setText(item.getText());
|
||||
holder.checkBox.setChecked(item.isChecked());
|
||||
|
||||
holder.editText.addTextChangedListener(new android.text.TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
item.setText(s.toString());
|
||||
if (listener != null) {
|
||||
listener.onTextChange(item, s.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(android.text.Editable s) {}
|
||||
});
|
||||
|
||||
holder.checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
item.setChecked(isChecked);
|
||||
if (listener != null) {
|
||||
listener.onCheckedChange(item, isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
holder.deleteButton.setOnClickListener(v -> {
|
||||
if (listener != null) {
|
||||
listener.onDeleteClick(position, item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public void setItems(List<ChecklistItem> items) {
|
||||
this.items = items;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<ChecklistItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
static class ChecklistViewHolder extends RecyclerView.ViewHolder {
|
||||
CheckBox checkBox;
|
||||
EditText editText;
|
||||
ImageButton deleteButton;
|
||||
|
||||
public ChecklistViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
checkBox = itemView.findViewById(R.id.check_box);
|
||||
editText = itemView.findViewById(R.id.item_text);
|
||||
deleteButton = itemView.findViewById(R.id.delete_button);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.notesapp.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
import com.notesapp.R;
|
||||
import com.notesapp.models.Note;
|
||||
import com.notesapp.models.Note.NoteType;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class NotesAdapter extends RecyclerView.Adapter<NotesAdapter.NotesViewHolder> {
|
||||
private List<Note> notes;
|
||||
private Context context;
|
||||
private OnNoteClickListener listener;
|
||||
private SimpleDateFormat dateFormat;
|
||||
|
||||
public interface OnNoteClickListener {
|
||||
void onNoteClick(Note note);
|
||||
void onDeleteNote(int position, Note note);
|
||||
}
|
||||
|
||||
public NotesAdapter(Context context, OnNoteClickListener listener) {
|
||||
this.context = context;
|
||||
this.listener = listener;
|
||||
this.dateFormat = new SimpleDateFormat("MMM dd, yyyy HH:mm", Locale.getDefault());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public NotesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_note_card, parent, false);
|
||||
return new NotesViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull NotesViewHolder holder, int position) {
|
||||
Note note = notes.get(position);
|
||||
|
||||
holder.titleText.setText(note.getTitle().isEmpty() ? "Untitled" : note.getTitle());
|
||||
holder.previewText.setText(note.getPreview());
|
||||
holder.timestampText.setText(dateFormat.format(new Date(note.getModifiedTimestamp())));
|
||||
|
||||
if (note.getType() == NoteType.TEXT) {
|
||||
holder.typeIcon.setImageResource(R.drawable.ic_text);
|
||||
} else {
|
||||
holder.typeIcon.setImageResource(R.drawable.ic_checklist);
|
||||
}
|
||||
|
||||
holder.cardView.setOnClickListener(v -> listener.onNoteClick(note));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return notes == null ? 0 : notes.size();
|
||||
}
|
||||
|
||||
public void setNotes(List<Note> notes) {
|
||||
this.notes = notes;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public Note getNoteAt(int position) {
|
||||
if (notes != null && position >= 0 && position < notes.size()) {
|
||||
return notes.get(position);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static class NotesViewHolder extends RecyclerView.ViewHolder {
|
||||
MaterialCardView cardView;
|
||||
ImageView typeIcon;
|
||||
TextView titleText;
|
||||
TextView previewText;
|
||||
TextView timestampText;
|
||||
|
||||
public NotesViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
cardView = itemView.findViewById(R.id.card_view);
|
||||
typeIcon = itemView.findViewById(R.id.type_icon);
|
||||
titleText = itemView.findViewById(R.id.title_text);
|
||||
previewText = itemView.findViewById(R.id.preview_text);
|
||||
timestampText = itemView.findViewById(R.id.timestamp_text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,286 @@
|
|||
package com.notesapp.fragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.notesapp.R;
|
||||
import com.notesapp.adapters.ChecklistAdapter;
|
||||
import com.notesapp.models.ChecklistItem;
|
||||
import com.notesapp.models.Note;
|
||||
import com.notesapp.utils.NotesStorage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NoteEditorFragment extends Fragment {
|
||||
private static final String ARG_NOTE = "note";
|
||||
private static final String ARG_IS_NEW = "is_new";
|
||||
|
||||
private EditText titleEditText;
|
||||
private EditText contentEditText;
|
||||
private View textContainer;
|
||||
private View checklistContainer;
|
||||
|
||||
private RecyclerView checklistRecyclerView;
|
||||
private FloatingActionButton addImageButton;
|
||||
private FloatingActionButton deleteCheckedButton;
|
||||
private TextView progressText;
|
||||
|
||||
private Note note;
|
||||
private boolean isNewNote;
|
||||
private NotesStorage storage;
|
||||
private ChecklistAdapter checklistAdapter;
|
||||
|
||||
private android.os.Handler saveHandler = new android.os.Handler();
|
||||
private Runnable saveRunnable;
|
||||
|
||||
public static NoteEditorFragment newInstance(Note note, boolean isNew) {
|
||||
NoteEditorFragment fragment = new NoteEditorFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable(ARG_NOTE, note);
|
||||
args.putBoolean(ARG_IS_NEW, isNew);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_note_editor, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
storage = new NotesStorage(requireContext());
|
||||
|
||||
if (getArguments() != null) {
|
||||
note = (Note) getArguments().getSerializable(ARG_NOTE);
|
||||
isNewNote = getArguments().getBoolean(ARG_IS_NEW);
|
||||
}
|
||||
|
||||
titleEditText = view.findViewById(R.id.title_edit_text);
|
||||
contentEditText = view.findViewById(R.id.content_edit_text);
|
||||
textContainer = view.findViewById(R.id.text_container);
|
||||
checklistContainer = view.findViewById(R.id.checklist_container);
|
||||
|
||||
checklistRecyclerView = view.findViewById(R.id.checklist_recycler_view);
|
||||
addImageButton = view.findViewById(R.id.add_item_button);
|
||||
deleteCheckedButton = view.findViewById(R.id.delete_checked_button);
|
||||
progressText = view.findViewById(R.id.progress_text);
|
||||
|
||||
setupTitleListener();
|
||||
setupBackButton(view);
|
||||
|
||||
if (note.getType() == Note.NoteType.TEXT) {
|
||||
showTextEditor();
|
||||
} else {
|
||||
showChecklistEditor();
|
||||
}
|
||||
}
|
||||
|
||||
private void setupTitleListener() {
|
||||
titleEditText.setText(note.getTitle());
|
||||
titleEditText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
note.setTitle(s.toString());
|
||||
scheduleSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {}
|
||||
});
|
||||
}
|
||||
|
||||
private void setupBackButton(View view) {
|
||||
ImageButton backButton = view.findViewById(R.id.back_button);
|
||||
backButton.setOnClickListener(v -> requireActivity().onBackPressed());
|
||||
}
|
||||
|
||||
private void showTextEditor() {
|
||||
textContainer.setVisibility(View.VISIBLE);
|
||||
checklistContainer.setVisibility(View.GONE);
|
||||
addImageButton.setVisibility(View.GONE);
|
||||
deleteCheckedButton.setVisibility(View.GONE);
|
||||
progressText.setVisibility(View.GONE);
|
||||
|
||||
contentEditText.setText(note.getContent());
|
||||
contentEditText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
note.setContent(s.toString());
|
||||
scheduleSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {}
|
||||
});
|
||||
}
|
||||
|
||||
private void showChecklistEditor() {
|
||||
textContainer.setVisibility(View.GONE);
|
||||
checklistContainer.setVisibility(View.VISIBLE);
|
||||
addImageButton.setVisibility(View.VISIBLE);
|
||||
deleteCheckedButton.setVisibility(View.VISIBLE);
|
||||
progressText.setVisibility(View.VISIBLE);
|
||||
|
||||
setupChecklistRecyclerView();
|
||||
updateProgress();
|
||||
}
|
||||
|
||||
private void setupChecklistRecyclerView() {
|
||||
if (note.getItems() == null) {
|
||||
note.setItems(new ArrayList<>());
|
||||
}
|
||||
|
||||
checklistAdapter = new ChecklistAdapter(new ChecklistAdapter.OnItemChangeListener() {
|
||||
@Override
|
||||
public void onTextChange(ChecklistItem item, String text) {
|
||||
scheduleSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckedChange(ChecklistItem item, boolean checked) {
|
||||
updateProgress();
|
||||
scheduleSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteClick(int position, ChecklistItem item) {
|
||||
note.getItems().remove(position);
|
||||
checklistAdapter.notifyItemRemoved(position);
|
||||
updateProgress();
|
||||
saveNoteImmediately();
|
||||
}
|
||||
});
|
||||
|
||||
checklistAdapter.setItems(note.getItems());
|
||||
checklistRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
checklistRecyclerView.setAdapter(checklistAdapter);
|
||||
|
||||
addImageButton.setOnClickListener(v -> {
|
||||
ChecklistItem newItem = new ChecklistItem("");
|
||||
note.getItems().add(newItem);
|
||||
checklistAdapter.notifyItemInserted(note.getItems().size() - 1);
|
||||
updateProgress();
|
||||
|
||||
androidx.recyclerview.widget.RecyclerView.ViewHolder holder =
|
||||
checklistRecyclerView.findViewHolderForAdapterPosition(note.getItems().size() - 1);
|
||||
if (holder != null) {
|
||||
EditText lastEditText = holder.itemView.findViewById(R.id.item_text);
|
||||
lastEditText.requestFocus();
|
||||
}
|
||||
});
|
||||
|
||||
deleteCheckedButton.setOnClickListener(v -> {
|
||||
int checkedCount = countCheckedItems();
|
||||
if (checkedCount > 0) {
|
||||
showDeleteCheckedConfirmation(checkedCount);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int countCheckedItems() {
|
||||
int count = 0;
|
||||
for (ChecklistItem item : note.getItems()) {
|
||||
if (item.isChecked()) count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
private void updateProgress() {
|
||||
int total = note.getItems().size();
|
||||
int checked = countCheckedItems();
|
||||
|
||||
progressText.setText(String.format("%d/%d completed", checked, total));
|
||||
|
||||
if (checked > 0) {
|
||||
deleteCheckedButton.setEnabled(true);
|
||||
} else {
|
||||
deleteCheckedButton.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void showDeleteCheckedConfirmation(int count) {
|
||||
new android.app.AlertDialog.Builder(requireContext())
|
||||
.setTitle("Delete Checked Items")
|
||||
.setMessage("Are you sure you want to delete " + count + " checked items? This cannot be undone.")
|
||||
.setPositiveButton("Delete", (dialog, which) -> {
|
||||
List<ChecklistItem> unchecked = new ArrayList<>();
|
||||
for (ChecklistItem item : note.getItems()) {
|
||||
if (!item.isChecked()) {
|
||||
unchecked.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
note.getItems().clear();
|
||||
note.getItems().addAll(unchecked);
|
||||
checklistAdapter.setItems(note.getItems());
|
||||
updateProgress();
|
||||
saveNoteImmediately();
|
||||
Toast.makeText(requireContext(), count + " items deleted", Toast.LENGTH_SHORT).show();
|
||||
})
|
||||
.setNegativeButton("Cancel", null)
|
||||
.show();
|
||||
}
|
||||
|
||||
private void scheduleSave() {
|
||||
if (saveRunnable != null) {
|
||||
saveHandler.removeCallbacks(saveRunnable);
|
||||
}
|
||||
|
||||
saveRunnable = () -> saveNoteImmediately();
|
||||
saveHandler.postDelayed(saveRunnable, 500);
|
||||
}
|
||||
|
||||
private void saveNoteImmediately() {
|
||||
note.setModifiedTimestamp(System.currentTimeMillis());
|
||||
storage.saveNote(note);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (note.getType() == Note.NoteType.TEXT) {
|
||||
contentEditText.setText(note.getContent());
|
||||
} else {
|
||||
if (checklistAdapter != null) {
|
||||
checklistAdapter.setItems(note.getItems());
|
||||
}
|
||||
updateProgress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if (saveRunnable != null) {
|
||||
saveHandler.removeCallbacks(saveRunnable);
|
||||
saveNoteImmediately();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
package com.notesapp.fragments;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.notesapp.R;
|
||||
import com.notesapp.adapters.NotesAdapter;
|
||||
import com.notesapp.models.Note;
|
||||
import com.notesapp.utils.NotesStorage;
|
||||
|
||||
public class NotesListFragment extends Fragment implements NotesAdapter.OnNoteClickListener {
|
||||
private RecyclerView recyclerView;
|
||||
private Spinner sortSpinner;
|
||||
private FloatingActionButton fab;
|
||||
private NotesAdapter adapter;
|
||||
private NotesStorage storage;
|
||||
private ItemTouchHelper itemTouchHelper;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_notes_list, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
storage = new NotesStorage(requireContext());
|
||||
|
||||
recyclerView = view.findViewById(R.id.recycler_view);
|
||||
sortSpinner = view.findViewById(R.id.sort_spinner);
|
||||
fab = view.findViewById(R.id.fab);
|
||||
|
||||
setupRecyclerView();
|
||||
setupSortSpinner();
|
||||
setupFab();
|
||||
loadNotes();
|
||||
}
|
||||
|
||||
private void setupRecyclerView() {
|
||||
adapter = new NotesAdapter(requireContext(), this);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {
|
||||
@Override
|
||||
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
|
||||
Note note = adapter.getNoteAt(viewHolder.getAdapterPosition());
|
||||
if (note != null) {
|
||||
showDeleteConfirmation(note);
|
||||
}
|
||||
}
|
||||
});
|
||||
itemTouchHelper.attachToRecyclerView(recyclerView);
|
||||
}
|
||||
|
||||
private void setupSortSpinner() {
|
||||
sortSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
String sortOrder = (String) parent.getItemAtPosition(position);
|
||||
storage.setSortOrder(sortOrder);
|
||||
loadNotes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {}
|
||||
});
|
||||
}
|
||||
|
||||
private void setupFab() {
|
||||
fab.setOnClickListener(v -> showCreateNoteDialog());
|
||||
}
|
||||
|
||||
private void loadNotes() {
|
||||
String currentSort = storage.getSortOrder();
|
||||
|
||||
switch (currentSort) {
|
||||
case "OLDEST_FIRST":
|
||||
sortSpinner.setSelection(1);
|
||||
break;
|
||||
case "A_TO_Z":
|
||||
sortSpinner.setSelection(2);
|
||||
break;
|
||||
case "Z_TO_A":
|
||||
sortSpinner.setSelection(3);
|
||||
break;
|
||||
default:
|
||||
sortSpinner.setSelection(0);
|
||||
}
|
||||
|
||||
adapter.setNotes(storage.getAllNotes());
|
||||
}
|
||||
|
||||
private void showCreateNoteDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
builder.setTitle("Create New Note");
|
||||
|
||||
String[] options = {"Text Note", "Checklist"};
|
||||
builder.setItems(options, (dialog, which) -> {
|
||||
if (which == 0) {
|
||||
openNoteEditor(Note.NoteType.TEXT);
|
||||
} else {
|
||||
openNoteEditor(Note.NoteType.CHECKLIST);
|
||||
}
|
||||
});
|
||||
|
||||
builder.setNegativeButton("Cancel", null);
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private void openNoteEditor(Note.NoteType type) {
|
||||
Note newNote = new Note(storage.getNextId() + 1, "", type);
|
||||
|
||||
NoteEditorFragment editorFragment = NoteEditorFragment.newInstance(newNote, true);
|
||||
requireActivity().getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.fragment_container, editorFragment)
|
||||
.addToBackStack(null)
|
||||
.commit();
|
||||
}
|
||||
|
||||
private void showDeleteConfirmation(Note note) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
builder.setTitle("Delete Note");
|
||||
builder.setMessage("Are you sure you want to delete \"" + (note.getTitle().isEmpty() ? "Untitled" : note.getTitle()) + "\"?");
|
||||
|
||||
builder.setPositiveButton("Delete", (dialog, which) -> {
|
||||
storage.deleteNote(note.getId());
|
||||
loadNotes();
|
||||
});
|
||||
|
||||
builder.setNegativeButton("Cancel", (dialog, which) -> {
|
||||
loadNotes();
|
||||
});
|
||||
|
||||
builder.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNoteClick(Note note) {
|
||||
NoteEditorFragment editorFragment = NoteEditorFragment.newInstance(note, false);
|
||||
requireActivity().getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.fragment_container, editorFragment)
|
||||
.addToBackStack(null)
|
||||
.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteNote(int position, Note note) {
|
||||
showDeleteConfirmation(note);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
loadNotes();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.notesapp.models;
|
||||
|
||||
public class ChecklistItem {
|
||||
private String id;
|
||||
private String text;
|
||||
private boolean checked;
|
||||
|
||||
public ChecklistItem() {
|
||||
this.id = java.util.UUID.randomUUID().toString();
|
||||
this.text = "";
|
||||
this.checked = false;
|
||||
}
|
||||
|
||||
public ChecklistItem(String text) {
|
||||
this.id = java.util.UUID.randomUUID().toString();
|
||||
this.text = text;
|
||||
this.checked = false;
|
||||
}
|
||||
|
||||
public ChecklistItem(String id, String text, boolean checked) {
|
||||
this.id = id;
|
||||
this.text = text;
|
||||
this.checked = checked;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public boolean isChecked() {
|
||||
return checked;
|
||||
}
|
||||
|
||||
public void setChecked(boolean checked) {
|
||||
this.checked = checked;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,240 @@
|
|||
package com.notesapp.models;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Note implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public enum NoteType {
|
||||
TEXT, CHECKLIST
|
||||
}
|
||||
|
||||
private int id;
|
||||
private String title;
|
||||
private NoteType type;
|
||||
private long modifiedTimestamp;
|
||||
private String content;
|
||||
private List<ChecklistItem> items;
|
||||
|
||||
public Note() {
|
||||
this.id = 0;
|
||||
this.title = "";
|
||||
this.type = NoteType.TEXT;
|
||||
this.modifiedTimestamp = System.currentTimeMillis();
|
||||
this.content = "";
|
||||
this.items = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Note(int id, String title, NoteType type) {
|
||||
this.id = id;
|
||||
this.title = title;
|
||||
this.type = type;
|
||||
this.modifiedTimestamp = System.currentTimeMillis();
|
||||
this.content = "";
|
||||
this.items = new ArrayList<>();
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public NoteType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(NoteType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public long getModifiedTimestamp() {
|
||||
return modifiedTimestamp;
|
||||
}
|
||||
|
||||
public void setModifiedTimestamp(long modifiedTimestamp) {
|
||||
this.modifiedTimestamp = modifiedTimestamp;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public List<ChecklistItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ChecklistItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public String getPreview() {
|
||||
if (type == NoteType.TEXT) {
|
||||
if (content == null || content.isEmpty()) {
|
||||
return "Empty note";
|
||||
}
|
||||
int maxLength = 50;
|
||||
String preview = content.substring(0, Math.min(content.length(), maxLength));
|
||||
if (content.length() > maxLength) {
|
||||
preview += "...";
|
||||
}
|
||||
return preview;
|
||||
} else {
|
||||
int checkedCount = 0;
|
||||
for (ChecklistItem item : items) {
|
||||
if (item.isChecked()) checkedCount++;
|
||||
}
|
||||
return String.format("%d/%d completed", checkedCount, items.size());
|
||||
}
|
||||
}
|
||||
|
||||
public static String toJson(Note note) {
|
||||
StringBuilder json = new StringBuilder();
|
||||
json.append("{");
|
||||
json.append("\"id\":").append(note.id).append(",");
|
||||
json.append("\"title\":\"").append(escapeJson(note.title)).append("\",");
|
||||
json.append("\"type\":\"").append(note.type.name()).append("\",");
|
||||
json.append("\"modified\":").append(note.modifiedTimestamp).append(",");
|
||||
|
||||
if (note.type == NoteType.TEXT) {
|
||||
json.append("\"content\":\"").append(escapeJson(note.content)).append("\",");
|
||||
json.append("\"items\":[]");
|
||||
} else {
|
||||
json.append("\"content\":\"\",");
|
||||
json.append("\"items\":[");
|
||||
for (int i = 0; i < note.items.size(); i++) {
|
||||
ChecklistItem item = note.items.get(i);
|
||||
if (i > 0) json.append(",");
|
||||
json.append("{");
|
||||
json.append("\"id\":\"").append(escapeJson(item.getId())).append("\",");
|
||||
json.append("\"text\":\"").append(escapeJson(item.getText())).append("\",");
|
||||
json.append("\"checked\":").append(item.isChecked());
|
||||
json.append("}");
|
||||
}
|
||||
json.append("]");
|
||||
}
|
||||
|
||||
json.append("}");
|
||||
return json.toString();
|
||||
}
|
||||
|
||||
public static Note fromJson(String json) {
|
||||
Note note = new Note();
|
||||
|
||||
note.id = parseInt(json, "id");
|
||||
note.title = parseString(json, "title");
|
||||
String typeStr = parseString(json, "type");
|
||||
note.type = typeStr.equals("CHECKLIST") ? NoteType.CHECKLIST : NoteType.TEXT;
|
||||
note.modifiedTimestamp = parseLong(json, "modified");
|
||||
|
||||
if (note.type == NoteType.TEXT) {
|
||||
note.content = parseString(json, "content");
|
||||
note.items = new ArrayList<>();
|
||||
} else {
|
||||
note.content = "";
|
||||
String itemsJson = extractArrayContent(json, "items");
|
||||
note.items = parseChecklistItems(itemsJson);
|
||||
}
|
||||
|
||||
return note;
|
||||
}
|
||||
|
||||
private static String escapeJson(String s) {
|
||||
if (s == null) return "";
|
||||
return s.replace("\\", "\\\\")
|
||||
.replace("\"", "\\\"")
|
||||
.replace("\n", "\\n")
|
||||
.replace("\r", "\\r")
|
||||
.replace("\t", "\\t");
|
||||
}
|
||||
|
||||
private static int parseInt(String json, String key) {
|
||||
String pattern = "\"" + key + "\":([0-9]+)";
|
||||
java.util.regex.Pattern p = java.util.regex.Pattern.compile(pattern);
|
||||
java.util.regex.Matcher m = p.matcher(json);
|
||||
if (m.find()) {
|
||||
return Integer.parseInt(m.group(1));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static long parseLong(String json, String key) {
|
||||
String pattern = "\"" + key + "\":([0-9]+)";
|
||||
java.util.regex.Pattern p = java.util.regex.Pattern.compile(pattern);
|
||||
java.util.regex.Matcher m = p.matcher(json);
|
||||
if (m.find()) {
|
||||
return Long.parseLong(m.group(1));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static String parseString(String json, String key) {
|
||||
String pattern = "\"" + key + "\":\"((?:[^\"\\\\]|\\\\.)*)\"";
|
||||
java.util.regex.Pattern p = java.util.regex.Pattern.compile(pattern);
|
||||
java.util.regex.Matcher m = p.matcher(json);
|
||||
if (m.find()) {
|
||||
return unescapeJson(m.group(1));
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private static String unescapeJson(String s) {
|
||||
if (s == null) return "";
|
||||
return s.replace("\\\\", "\\")
|
||||
.replace("\\\"", "\"")
|
||||
.replace("\\n", "\n")
|
||||
.replace("\\r", "\r")
|
||||
.replace("\\t", "\t");
|
||||
}
|
||||
|
||||
private static String extractArrayContent(String json, String key) {
|
||||
int start = json.indexOf("\"" + key + "\":[");
|
||||
if (start == -1) return "[]";
|
||||
start += ("\"" + key + "\"[").length();
|
||||
int bracketCount = 1;
|
||||
int end = start;
|
||||
while (end < json.length() && bracketCount > 0) {
|
||||
char c = json.charAt(end);
|
||||
if (c == '[') bracketCount++;
|
||||
else if (c == ']') bracketCount--;
|
||||
end++;
|
||||
}
|
||||
return json.substring(start, end - 1);
|
||||
}
|
||||
|
||||
private static List<ChecklistItem> parseChecklistItems(String itemsJson) {
|
||||
List<ChecklistItem> items = new ArrayList<>();
|
||||
if (itemsJson.isEmpty() || itemsJson.equals("[]")) {
|
||||
return items;
|
||||
}
|
||||
|
||||
String pattern = "\\{\"id\":\"((?:[^\"\\\\]|\\\\.)*)\",\"text\":\"((?:[^\"\\\\]|\\\\.)*)\",\"checked\":(true|false)\\}";
|
||||
java.util.regex.Pattern p = java.util.regex.Pattern.compile(pattern);
|
||||
java.util.regex.Matcher m = p.matcher(itemsJson);
|
||||
|
||||
while (m.find()) {
|
||||
ChecklistItem item = new ChecklistItem();
|
||||
item.setId(unescapeJson(m.group(1)));
|
||||
item.setText(unescapeJson(m.group(2)));
|
||||
item.setChecked(Boolean.parseBoolean(m.group(3)));
|
||||
items.add(item);
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
package com.notesapp.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import com.notesapp.models.ChecklistItem;
|
||||
import com.notesapp.models.Note;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class NotesStorage {
|
||||
private static final String PREFS_NAME = "notes_app_prefs";
|
||||
private static final String KEY_NOTE_COUNT = "note_count";
|
||||
private static final String KEY_SORT_ORDER = "sort_order";
|
||||
|
||||
private Context context;
|
||||
private SharedPreferences prefs;
|
||||
|
||||
public NotesStorage(Context context) {
|
||||
this.context = context.getApplicationContext();
|
||||
this.prefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public int getNextId() {
|
||||
return prefs.getInt(KEY_NOTE_COUNT, 0);
|
||||
}
|
||||
|
||||
private void incrementNoteCount() {
|
||||
int count = prefs.getInt(KEY_NOTE_COUNT, 0);
|
||||
prefs.edit().putInt(KEY_NOTE_COUNT, count + 1).apply();
|
||||
}
|
||||
|
||||
public String getNoteKey(int id) {
|
||||
return "note_" + id;
|
||||
}
|
||||
|
||||
public void saveNote(Note note) {
|
||||
String key = getNoteKey(note.getId());
|
||||
|
||||
prefs.edit()
|
||||
.putString(key + "_type", note.getType().name())
|
||||
.putString(key + "_title", note.getTitle())
|
||||
.putString(key + "_content", Note.toJson(note))
|
||||
.putLong(key + "_modified", note.getModifiedTimestamp())
|
||||
.apply();
|
||||
|
||||
int count = prefs.getInt(KEY_NOTE_COUNT, 0);
|
||||
if (note.getId() >= count) {
|
||||
prefs.edit().putInt(KEY_NOTE_COUNT, note.getId() + 1).apply();
|
||||
}
|
||||
}
|
||||
|
||||
public Note getNote(int id) {
|
||||
String key = getNoteKey(id);
|
||||
String content = prefs.getString(key + "_content", null);
|
||||
|
||||
if (content != null && !content.isEmpty()) {
|
||||
return Note.fromJson(content);
|
||||
} else if (content != null) {
|
||||
// Content exists but is empty - still try to parse it
|
||||
return Note.fromJson(content);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void deleteNote(int id) {
|
||||
String key = getNoteKey(id);
|
||||
prefs.edit()
|
||||
.remove(key + "_type")
|
||||
.remove(key + "_title")
|
||||
.remove(key + "_content")
|
||||
.remove(key + "_modified")
|
||||
.apply();
|
||||
}
|
||||
|
||||
public List<Note> getAllNotes() {
|
||||
List<Note> notes = new ArrayList<>();
|
||||
|
||||
int count = prefs.getInt(KEY_NOTE_COUNT, 0);
|
||||
for (int i = 1; i <= count; i++) {
|
||||
Note note = getNote(i);
|
||||
if (note != null) {
|
||||
notes.add(note);
|
||||
}
|
||||
}
|
||||
|
||||
String sortOrder = prefs.getString(KEY_SORT_ORDER, "MOST_RECENT");
|
||||
sortNotes(notes, sortOrder);
|
||||
|
||||
return notes;
|
||||
}
|
||||
|
||||
public void setSortOrder(String sortOrder) {
|
||||
prefs.edit().putString(KEY_SORT_ORDER, sortOrder).apply();
|
||||
}
|
||||
|
||||
public String getSortOrder() {
|
||||
return prefs.getString(KEY_SORT_ORDER, "MOST_RECENT");
|
||||
}
|
||||
|
||||
private void sortNotes(List<Note> notes, String sortOrder) {
|
||||
switch (sortOrder) {
|
||||
case "OLDEST_FIRST":
|
||||
Collections.sort(notes, new Comparator<Note>() {
|
||||
@Override
|
||||
public int compare(Note n1, Note n2) {
|
||||
return Long.compare(n1.getModifiedTimestamp(), n2.getModifiedTimestamp());
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "A_TO_Z":
|
||||
Collections.sort(notes, new Comparator<Note>() {
|
||||
@Override
|
||||
public int compare(Note n1, Note n2) {
|
||||
return n1.getTitle().compareToIgnoreCase(n2.getTitle());
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "Z_TO_A":
|
||||
Collections.sort(notes, new Comparator<Note>() {
|
||||
@Override
|
||||
public int compare(Note n1, Note n2) {
|
||||
return n2.getTitle().compareToIgnoreCase(n1.getTitle());
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "MOST_RECENT":
|
||||
default:
|
||||
Collections.sort(notes, new Comparator<Note>() {
|
||||
@Override
|
||||
public int compare(Note n1, Note n2) {
|
||||
return Long.compare(n2.getModifiedTimestamp(), n1.getModifiedTimestamp());
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteCheckedItems(List<ChecklistItem> items) {
|
||||
List<ChecklistItem> unchecked = new ArrayList<>();
|
||||
for (ChecklistItem item : items) {
|
||||
if (!item.isChecked()) {
|
||||
unchecked.add(item);
|
||||
}
|
||||
}
|
||||
items.clear();
|
||||
items.addAll(unchecked);
|
||||
}
|
||||
|
||||
public boolean hasNotes() {
|
||||
int count = prefs.getInt(KEY_NOTE_COUNT, 0);
|
||||
for (int i = 1; i < count; i++) {
|
||||
String content = prefs.getString(getNoteKey(i) + "_content", null);
|
||||
if (content != null && !content.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:pathData="M5,12h14m-7,-7v14"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:pathData="M3,6h18m-18,6h18m-18,6h18"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:pathData="M4,7h16m-4,-3v-1a1,1 0 0,0 -1,-1h-8a1,1 0 0,0 -1,1v1m12,16v-13h-12v13a1,1 0 0,0 1,1h10a1,1 0 0,0 1,-1z"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
|
||||
<!-- Note pad shape -->
|
||||
<path
|
||||
android:pathData="M36,28h36c2.2,0 4,1.8 4,4v40c0,2.2 -1.8,4 -4,4H36c-2.2,0 -4,-1.8 -4,-4V32C32,29.8 33.8,28 36,28z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
|
||||
<!-- Fold at top -->
|
||||
<path
|
||||
android:pathData="M36,38h36v-6c0,-2.2 -1.8,-4 -4,-4H40c-2.2,0 -4,1.8 -4,4v6z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
|
||||
<!-- Lines representing text -->
|
||||
<path
|
||||
android:pathData="M44,54h28"
|
||||
android:strokeWidth="2.5"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M44,66h28"
|
||||
android:strokeWidth="2.5"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M44,78h20"
|
||||
android:strokeWidth="2.5"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:pathData="M18,4a1,1 0 0,1 1,1V20a1,1 0 0,1 -1,1H6a1,1 0 0,1 -1,-1V5A1,1 0 0,1 6,4"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
<path
|
||||
android:pathData="M9,3h6a1,1 0 0,1 1,1v1a1,1 0 0,1 -1,1h-6a1,1 0 0,1 -1,-1v-1a1,1 0 0,1 1,-1z"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:pathData="M18,4a1,1 0 0,1 1,1V20a1,1 0 0,1 -1,1H6a1,1 0 0,1 -1,-1V5A1,1 0 0,1 6,4"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
<path
|
||||
android:pathData="M14,6h-4a1,1 0 0,1 -1,-1v-1a1,1 0 0,1 1,-1h4a1,1 0 0,1 1,1v1a1,1 0 0,1 -1,1z"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
<path
|
||||
android:pathData="M9,10h6m-3,0v6"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:pathData="M14,5v-2h-4v2m8.14,-1.16l0.86,5.16-.92,11.08a1,1 0 0,1 -1,.92h-10.16a1,1 0 0,1 -1,-0.92l-0.92,-11.08 0.86,-5.16a1,1 0 0,1 1,-0.84h8.3a1,1 0 0,1 1,.84m2.96,1.16h-14"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@android:drawable/ic_menu_revert"
|
||||
android:contentDescription="Back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Edit Note"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:gravity="center_vertical" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/title_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Title"
|
||||
android:textSize="24sp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textColorHint="@color/text_secondary"
|
||||
android:background="@null"
|
||||
android:padding="16dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/divider" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/text_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/content_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Start typing..."
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textColorHint="@color/text_secondary"
|
||||
android:background="@null"
|
||||
android:padding="16dp"
|
||||
android:gravity="top"
|
||||
android:inputType="textMultiLine" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/checklist_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/checklist_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/progress_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Floating Action Buttons for checklist -->
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/add_item_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_add"
|
||||
android:contentDescription="Add Item"
|
||||
app:tint="#FFFFFF" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/delete_checked_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginBottom="96dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_trash"
|
||||
android:contentDescription="Delete All Checked"
|
||||
android:enabled="false"
|
||||
app:tint="#FFFFFF" />
|
||||
|
||||
</FrameLayout>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/sort_spinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp"
|
||||
android:entries="@array/sort_options"
|
||||
android:background="?attr/selectableItemBackground" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="8dp"
|
||||
android:clipToPadding="false" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_add"
|
||||
app:tint="@android:color/white" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="4dp">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/check_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/item_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textColorHint="@color/text_secondary"
|
||||
android:background="@null"
|
||||
android:inputType="text" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/delete_button"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_delete"
|
||||
app:tint="@color/text_secondary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardBackgroundColor="@color/surface"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/type_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_text"
|
||||
app:tint="@color/primary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="12dp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="18sp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/preview_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="14sp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timestamp_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
|
||||
<path
|
||||
android:pathData="M20,16h12c2.2,0 4,1.8 4,4v20c0,2.2 -1.8,4 -4,4H20c-2.2,0 -4,-1.8 -4,-4V20C16,17.8 17.8,16 20,16z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
|
||||
<path
|
||||
android:pathData="M20,22h12v-2c0,-2.2 -1.8,-4 -4,-4H24c-2.2,0 -4,1.8 -4,4v2z"
|
||||
android:fillColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,30h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,38h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
|
||||
<path
|
||||
android:pathData="M20,16h12c2.2,0 4,1.8 4,4v20c0,2.2 -1.8,4 -4,4H20c-2.2,0 -4,-1.8 -4,-4V20C16,17.8 17.8,16 20,16z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
|
||||
<path
|
||||
android:pathData="M20,22h12v-2c0,-2.2 -1.8,-4 -4,-4H24c-2.2,0 -4,1.8 -4,4v2z"
|
||||
android:fillColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,30h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,38h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
|
||||
<path
|
||||
android:pathData="M20,16h12c2.2,0 4,1.8 4,4v20c0,2.2 -1.8,4 -4,4H20c-2.2,0 -4,-1.8 -4,-4V20C16,17.8 17.8,16 20,16z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
|
||||
<path
|
||||
android:pathData="M20,22h12v-2c0,-2.2 -1.8,-4 -4,-4H24c-2.2,0 -4,1.8 -4,4v2z"
|
||||
android:fillColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,30h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,38h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
|
||||
<path
|
||||
android:pathData="M20,16h12c2.2,0 4,1.8 4,4v20c0,2.2 -1.8,4 -4,4H20c-2.2,0 -4,-1.8 -4,-4V20C16,17.8 17.8,16 20,16z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
|
||||
<path
|
||||
android:pathData="M20,22h12v-2c0,-2.2 -1.8,-4 -4,-4H24c-2.2,0 -4,1.8 -4,4v2z"
|
||||
android:fillColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,30h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,38h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
|
||||
<path
|
||||
android:pathData="M20,16h12c2.2,0 4,1.8 4,4v20c0,2.2 -1.8,4 -4,4H20c-2.2,0 -4,-1.8 -4,-4V20C16,17.8 17.8,16 20,16z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
|
||||
<path
|
||||
android:pathData="M20,22h12v-2c0,-2.2 -1.8,-4 -4,-4H24c-2.2,0 -4,1.8 -4,4v2z"
|
||||
android:fillColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,30h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
<path
|
||||
android:pathData="M24,38h12"
|
||||
android:strokeWidth="2"
|
||||
android:strokeColor="#121212"/>
|
||||
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="background">#121212</color>
|
||||
<color name="surface">#1E1E1E</color>
|
||||
<color name="primary">#BB86FC</color>
|
||||
<color name="primary_variant">#3700B3</color>
|
||||
<color name="text_primary">#FFFFFF</color>
|
||||
<color name="text_secondary">#B0B0B0</color>
|
||||
<color name="divider">#2C2C2C</color>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Notes</string>
|
||||
|
||||
<string-array name="sort_options">
|
||||
<item>Most Recent</item>
|
||||
<item>Oldest First</item>
|
||||
<item>A to Z</item>
|
||||
<item>Z to A</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.NotesApp" parent="Theme.MaterialComponents.NoActionBar.Bridge">
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryVariant">@color/primary_variant</item>
|
||||
<item name="android:windowBackground">@color/background</item>
|
||||
<item name="android:statusBarColor">@color/background</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.1.0' apply false
|
||||
}
|
||||
|
|
@ -0,0 +1,420 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
==============================================================================
|
||||
Licenses for included components:
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Eclipse Public License 1.0
|
||||
https://opensource.org/licenses/EPL-1.0
|
||||
|
||||
junit:junit
|
||||
org.sonatype.aether:aether-api
|
||||
org.sonatype.aether:aether-connector-wagon
|
||||
org.sonatype.aether:aether-impl
|
||||
org.sonatype.aether:aether-spi
|
||||
org.sonatype.aether:aether-util
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3-Clause BSD
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
|
||||
com.google.code.findbugs:jsr305
|
||||
|
||||
org.hamcrest:hamcrest-core
|
||||
BSD License
|
||||
|
||||
Copyright (c) 2000-2015 www.hamcrest.org
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer. Redistributions in binary form must reproduce
|
||||
the above copyright notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the distribution.
|
||||
|
||||
Neither the name of Hamcrest nor the names of its contributors may be used to endorse
|
||||
or promote products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
|
||||
com.esotericsoftware.kryo:kryo
|
||||
com.esotericsoftware.minlog:minlog
|
||||
Copyright (c) 2008-2018, Nathan Sweet All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
Neither the name of Esoteric Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
org.ow2.asm:asm
|
||||
org.ow2.asm:asm-analysis
|
||||
org.ow2.asm:asm-commons
|
||||
org.ow2.asm:asm-tree
|
||||
org.ow2.asm:asm-util
|
||||
ASM: a very small and fast Java bytecode manipulation framework
|
||||
Copyright (c) 2000-2011 INRIA, France Telecom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
MIT
|
||||
|
||||
com.googlecode.plist:dd-plist
|
||||
dd-plist - An open source library to parse and generate property lists
|
||||
Copyright (C) 2016 Daniel Dreibrodt
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
org.bouncycastle:bcpg-jdk15on
|
||||
org.bouncycastle:bcprov-jdk15on
|
||||
Copyright (c) 2000 - 2019 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
org.slf4j:jcl-over-slf4j
|
||||
org.slf4j:jul-to-slf4j
|
||||
org.slf4j:log4j-over-slf4j
|
||||
org.slf4j:slf4j-api
|
||||
Copyright (c) 2004-2017 QOS.ch
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
CDDL
|
||||
https://opensource.org/licenses/CDDL-1.0
|
||||
|
||||
com.sun.xml.bind:jaxb-impl
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
LGPL 2.1
|
||||
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
|
||||
|
||||
org.samba.jcifs:jcifs
|
||||
|
||||
org.jetbrains.intellij.deps:trove4j
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
License for the GNU Trove library included by the Kotlin embeddable compiler
|
||||
------------------------------------------------------------------------------
|
||||
The source code for GNU Trove is licensed under the Lesser GNU Public License (LGPL).
|
||||
|
||||
Copyright (c) 2001, Eric D. Friedman All Rights Reserved. This library is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
Two classes (HashFunctions and PrimeFinder) included in Trove are licensed under the following terms:
|
||||
|
||||
Copyright (c) 1999 CERN - European Organization for Nuclear Research. Permission to use, copy, modify, distribute and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear in supporting documentation. CERN makes no representations about the
|
||||
suitability of this software for any purpose. It is provided "as is" without expressed or implied warranty.
|
||||
|
||||
The source code of modified GNU Trove library is available at
|
||||
https://github.com/JetBrains/intellij-deps-trove4j (with trove4j_changes.txt describing the changes)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Eclipse Distribution License 1.0
|
||||
https://www.eclipse.org/org/documents/edl-v10.php
|
||||
|
||||
org.eclipse.jgit:org.eclipse.jgit
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
BSD-style
|
||||
|
||||
com.jcraft:jsch
|
||||
com.jcraft:jzlib
|
||||
|
||||
Copyright (c) 2000-2011 ymnk, JCraft,Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. The names of the authors may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
|
||||
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Eclipse Public License 2.0
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
org.junit.platform:junit-platform-launcher
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Mozilla Public License 2.0
|
||||
https://www.mozilla.org/en-US/MPL/2.0/
|
||||
|
||||
org.mozilla:rhino
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
=========================================================================
|
||||
== NOTICE file corresponding to the section 4 d of ==
|
||||
== the Apache License, Version 2.0, ==
|
||||
== in this case for the Gradle distribution. ==
|
||||
=========================================================================
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
It includes the following other software:
|
||||
|
||||
Groovy (http://groovy-lang.org)
|
||||
SLF4J (http://www.slf4j.org)
|
||||
JUnit (http://www.junit.org)
|
||||
JCIFS (http://jcifs.samba.org)
|
||||
HttpClient (https://hc.apache.org/httpcomponents-client-4.5.x/)
|
||||
|
||||
For licenses, see the LICENSE file.
|
||||
|
||||
If any software distributed with Gradle does not have an Apache 2 License, its license is explicitly listed in the
|
||||
LICENSE file.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
Gradle is a build tool with a focus on build automation and support for multi-language development. If you are building, testing, publishing, and deploying software on any platform, Gradle offers a flexible model that can support the entire development lifecycle from compiling and packaging code to publishing web sites. Gradle has been designed to support build automation across multiple languages and platforms including Java, Scala, Android, C/C++, and Groovy, and is closely integrated with development tools and continuous integration servers including Eclipse, IntelliJ, and Jenkins.
|
||||
|
||||
For more information about Gradle, please visit: https://gradle.org
|
||||
|
||||
If you are using the "all" distribution, the User Manual is included in your distribution.
|
||||
|
||||
If you are using the "bin" distribution, a copy of the User Manual is available on https://docs.gradle.org.
|
||||
|
||||
Typing `gradle help` prints the command line help.
|
||||
|
||||
Typing `gradle tasks` shows all the tasks of a Gradle build.
|
||||
|
|
@ -0,0 +1 @@
|
|||
You can add .gradle (e.g. test.gradle) init scripts to this directory. Each one is executed at the start of the build.
|
||||
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.
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.
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.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue