Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2374428
Updated to API 33, Gradle 8.0.0, Java 17
federicoiosue May 3, 2023
11c97fd
Replaced unattended (my fault) Facebook community with Telegram channel
federicoiosue May 4, 2023
b576f82
feature #236: PDF Notes export
unic77 May 23, 2023
eed4604
feature #236: added tests and removed PDF creating to a diffrent class
unic77 May 23, 2023
fc529ec
feature #236: added test case, made new clas to convert notes to PDF
unic77 May 25, 2023
3d12da8
Merge pull request #1 from unic77/feature/omni_note_to_pdf
unic77 May 25, 2023
10ec563
Version 6.2.7 code 322
federicoiosue Apr 29, 2023
56f53dc
Removed outdated icon
federicoiosue Apr 30, 2023
01c770d
Added graphic for F-Droid
federicoiosue Apr 30, 2023
7d04363
Completelly removed legacy Butterknife dependency and usage
federicoiosue May 3, 2023
c5a8721
Updated to API 33, Gradle 8.0.0, Java 17
federicoiosue May 3, 2023
0d3d6a1
Replaced unattended (my fault) Facebook community with Telegram channel
federicoiosue May 4, 2023
64a3d67
feature #236: PDF Notes export
unic77 May 23, 2023
0c07e51
feature #236: added tests and removed PDF creating to a diffrent class
unic77 May 23, 2023
8a05898
feature #236: added test case, made new clas to convert notes to PDF
unic77 May 25, 2023
8a66ebb
Merge branch 'develop' of https://github.com/unic77/Omni-Notes into d…
unic77 May 26, 2023
eaf537a
Update main.yml
unic77 May 26, 2023
6e42c09
Update play_store_description.txt
unic77 May 26, 2023
394ca99
Update README.md
unic77 May 26, 2023
0b6b92a
Update gradle.properties
unic77 May 26, 2023
0f68319
Update gradle-wrapper.properties
unic77 May 26, 2023
fc2c093
Update about.html
unic77 May 26, 2023
b865ec2
Update about.html
unic77 May 26, 2023
13a70e7
Update IntroSlide6.java
unic77 May 26, 2023
3cdffb3
Update ConstantsBase.java
unic77 May 26, 2023
7d89ea7
feature #236: PDF Notes export
unic77 May 23, 2023
160581d
feature #236: added tests and removed PDF creating to a diffrent class
unic77 May 23, 2023
4549099
feature #236: added test case, made new clas to convert notes to PDF
unic77 May 25, 2023
89817ac
Merge pull request #2 from unic77/feature/Pdf_converter_rebase
unic77 May 26, 2023
3ddcba3
Update play_store_description.txt
unic77 May 26, 2023
4449050
Update build.gradle
unic77 May 26, 2023
342cad9
Update main.yml
unic77 May 26, 2023
6e4d970
Update ConstantsBase.java
unic77 May 26, 2023
f352874
Update gradle-wrapper.properties
unic77 May 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonarqube -Dsonar.login="$SONAR_TOKEN"
run: ./gradlew sonarqube -Dsonar.login="$SONAR_TOKEN"
Binary file removed assets/ic_launcher-web.png
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/translations/play_store_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Your help in translating the app is welcome. Send me an e-mail If you want to le

Current features:
☆ Material Design interface
☆ Basic add, modify, archive, trash and delete notes actions
☆ Basic add, modify, archive, trash and delete notes actions,
☆ Share, merge and search notes
☆ Image, audio and generic file attachments
☆ Manage your notes using tags and categories
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fastlane/metadata/android/en-US/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
VERSION_NAME=6.2.6
VERSION_CODE=321
VERSION_NAME=6.2.7
VERSION_CODE=322
PACKAGE=it.feio.android.omninotes
MIN_SDK=21
TARGET_SDK=31
Expand Down Expand Up @@ -44,3 +44,7 @@ VERSION_CHECK_URL=
# Google Maps API key to provide addresses autocompletion feature
MAPS_API_KEY=
org.gradle.unsafe.configuration-cache=on
android.enableR8.fullMode=false
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 0 additions & 2 deletions omniNotes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ dependencies {
transitive = true
exclude group: "com.android.support"
}
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
implementation('org.mnode.ical4j:ical4j:3.0.11') {
exclude group: 'commons.io'
}
Expand Down
7 changes: 6 additions & 1 deletion omniNotes/proguard-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,9 @@
-keepnames class com.appeaser.sublimepickerlibrary.datepicker.** {
<fields>;
<methods>;
}
}



-dontwarn javax.annotation.processing.AbstractProcessor
-dontwarn javax.annotation.processing.SupportedOptions
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package it.feio.android.omninotes.utils;

import android.graphics.pdf.PdfDocument;

import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.io.File;

import it.feio.android.omninotes.helpers.NoteToPdfHelper;
import it.feio.android.omninotes.models.Note;
import it.feio.android.omninotes.testutils.BaseAndroidTestCase;

@RunWith(AndroidJUnit4.class)
public class NoteToPdfHelperTest extends BaseAndroidTestCase {

private NoteToPdfHelper pdfConverter;
private Note note;

@Before
public void setup(){
pdfConverter = new NoteToPdfHelper();
note = new Note();
}

@Test
public void testNotePdfCreateWithSpaces(){
note.setContent("this is a test note");
note.setTitle("test with spaces in name");
File file = pdfConverter.createFilePath(note.getTitle());
File filePath = new File("/storage/emulated/0/Documents/test with spaces in name.pdf");
Assert.assertEquals(file,filePath);
}

@Test
public void testNotePdfCreateWithoutSpaces(){
note.setContent("this is a test note");
note.setTitle("testWithoutSpacesInName");
File file = pdfConverter.createFilePath(note.getTitle());
File filePath = new File("/storage/emulated/0/Documents/testWithoutSpacesInName.pdf");
Assert.assertEquals(file,filePath);
}

@Test
public void testNotePdfCreateWithOtherTypeCharSpaces(){
note.setContent("this is a test note");
note.setTitle("test.WithoutSpacesInName");
File file = pdfConverter.createFilePath(note.getTitle());
Assert.assertNull(file);
}

@Test
public void testIfPdfIsCreated(){
PdfDocument pdf = new PdfDocument();

PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(524,830,1).create();
PdfDocument.Page page = pdf.startPage(pageInfo);

pdf.finishPage(page);
File file = pdfConverter.createFilePath(note.getTitle());
pdfConverter.writePdfToFillePath(pdf,file);
Assert.assertTrue(file.exists());
}

}
2 changes: 1 addition & 1 deletion omniNotes/src/main/assets/html/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<p>
Give a look at our <a href="https://www.facebook.com/OmniNotes">Community</a> for
Beta releases and at <a href="https://goo.gl/TJaDzV">developer&#39;s personal mini-site</a> for
other softwares,
other softwares,
libraries and trashware!
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,29 @@
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.pdf.PdfDocument;
import android.location.Location;
import android.media.MediaPlayer;
import android.media.MediaRecorder;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.provider.MediaStore;
import android.text.Editable;
import android.text.Selection;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand All @@ -108,6 +113,7 @@
import android.widget.AutoCompleteTextView;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.content.ContextCompat;
import androidx.core.util.Pair;
Expand Down Expand Up @@ -137,6 +143,7 @@
import it.feio.android.omninotes.helpers.AttachmentsHelper;
import it.feio.android.omninotes.helpers.IntentHelper;
import it.feio.android.omninotes.helpers.LogDelegate;
import it.feio.android.omninotes.helpers.NoteToPdfHelper;
import it.feio.android.omninotes.helpers.PermissionsHelper;
import it.feio.android.omninotes.helpers.TagOpenerHelper;
import it.feio.android.omninotes.helpers.date.DateHelper;
Expand Down Expand Up @@ -175,6 +182,8 @@
import it.feio.android.omninotes.utils.date.ReminderPickers;
import it.feio.android.pixlui.links.TextLinkClickListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.text.DateFormat;
Expand Down Expand Up @@ -1102,12 +1111,26 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.menu_note_info:
showNoteInfo();
break;
case R.id.menu_convert_PDF:
createPDF();
break;
default:
LogDelegate.w("Invalid menu option selected");
}
return super.onOptionsItemSelected(item);
}

private void createPDF(){
NoteToPdfHelper pdfHelper = new NoteToPdfHelper();
Intent intent = pdfHelper.convertStringToPDF(getNoteTitle(),getNoteContent(),this.getContext());
if(intent != null){
startActivity(intent);
}
else{
Toast.makeText(getContext(), "PDF file wasnt created.", Toast.LENGTH_SHORT).show();
}
}

private void showNoteInfo() {
noteTmp.setTitle(getNoteTitle());
noteTmp.setContent(getNoteContent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ private void initSharedPreferences() {
private void enableStrictMode() {
if (isDebugBuild()) {
StrictMode.enableDefaults();
StrictMode.allowThreadDiskWrites();
StrictMode.allowThreadDiskReads();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@
import android.content.res.TypedArray;
import android.os.AsyncTask;
import androidx.fragment.app.Fragment;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.pixplicity.easyprefs.library.Prefs;
import de.greenrobot.event.EventBus;
import it.feio.android.omninotes.MainActivity;
import it.feio.android.omninotes.R;
import it.feio.android.omninotes.async.bus.NavigationUpdatedEvent;
import it.feio.android.omninotes.databinding.FragmentNavigationDrawerBinding;
import it.feio.android.omninotes.models.NavigationItem;
import it.feio.android.omninotes.models.adapters.NavDrawerAdapter;
import it.feio.android.omninotes.models.misc.DynamicNavigationLookupTable;
import it.feio.android.omninotes.models.views.NonScrollableListView;
import it.feio.android.omninotes.utils.Navigation;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
Expand All @@ -43,18 +41,15 @@

public class MainMenuTask extends AsyncTask<Void, Void, List<NavigationItem>> {

private final WeakReference<Fragment> mFragmentWeakReference;
private final WeakReference<Fragment> fragmentWeakReference;
private final MainActivity mainActivity;
@BindView(R.id.drawer_nav_list)
NonScrollableListView mDrawerList;
@BindView(R.id.drawer_tag_list)
NonScrollableListView mDrawerCategoriesList;

FragmentNavigationDrawerBinding navDrawer;

public MainMenuTask(Fragment mFragment) {
mFragmentWeakReference = new WeakReference<>(mFragment);
this.mainActivity = (MainActivity) mFragment.getActivity();
ButterKnife.bind(this, mFragment.getView());
public MainMenuTask(Fragment fragment) {
fragmentWeakReference = new WeakReference<>(fragment);
mainActivity = (MainActivity) fragment.getActivity();
navDrawer = FragmentNavigationDrawerBinding.inflate(fragment.getLayoutInflater());
}

@Override
Expand All @@ -65,33 +60,31 @@ protected List<NavigationItem> doInBackground(Void... params) {
@Override
protected void onPostExecute(final List<NavigationItem> items) {
if (isAlive()) {
mDrawerList.setAdapter(new NavDrawerAdapter(mainActivity, items));
mDrawerList.setOnItemClickListener((arg0, arg1, position, arg3) -> {
String navigation = mFragmentWeakReference.get().getResources().getStringArray(R.array
navDrawer.drawerNavList.setAdapter(new NavDrawerAdapter(mainActivity, items));
navDrawer.drawerNavList.setOnItemClickListener((arg0, arg1, position, arg3) -> {
String navigation = fragmentWeakReference.get().getResources().getStringArray(R.array
.navigation_list_codes)[items.get(position).getArrayIndex()];
updateNavigation(position, navigation);
});
mDrawerList.justifyListViewHeightBasedOnChildren();
navDrawer.drawerNavList.justifyListViewHeightBasedOnChildren();
}
}

private void updateNavigation(int position, String navigation) {
if (mainActivity.updateNavigation(navigation)) {
mDrawerList.setItemChecked(position, true);
if (mDrawerCategoriesList != null) {
mDrawerCategoriesList.setItemChecked(0, false); // Called to force redraw
}
navDrawer.drawerNavList.setItemChecked(position, true);
navDrawer.drawerTagList.setItemChecked(0, false); // Called to force redraw
mainActivity.getIntent().setAction(Intent.ACTION_MAIN);
EventBus.getDefault()
.post(new NavigationUpdatedEvent(mDrawerList.getItemAtPosition(position)));
.post(new NavigationUpdatedEvent(navDrawer.drawerNavList.getItemAtPosition(position)));
}
}

private boolean isAlive() {
return mFragmentWeakReference.get() != null
&& mFragmentWeakReference.get().isAdded()
&& mFragmentWeakReference.get().getActivity() != null
&& !mFragmentWeakReference.get().getActivity().isFinishing();
return fragmentWeakReference.get() != null
&& fragmentWeakReference.get().isAdded()
&& fragmentWeakReference.get().getActivity() != null
&& !fragmentWeakReference.get().getActivity().isFinishing();
}

private List<NavigationItem> buildMainMenu() {
Expand Down
Loading