Skip to content

Commit

Permalink
v1.0.8 Rollup
Browse files Browse the repository at this point in the history
*Fixes related to v1.0.8 release. 
*Update widgets when backup is restored. 
*Create empty view for Notes Widget. 
*Delete notes correctly. 
*Remove unused import.
  • Loading branch information
rayliverified committed Sep 25, 2017
1 parent db786bf commit 75e20a9
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![GitHub release](https://img.shields.io/github/release/searchy2/Rocket-Notes.svg?style=flat-square)](https://github.com/searchy2/Rocket-Notes/releases) [![Libraries.io for GitHub](https://img.shields.io/librariesio/github/searchy2/Rocket-Notes.svg?style=flat-square)](https://github.com/searchy2/CustomRecentImages)
# Rocket Notes
### World's Fastest Note Taking App
---
Expand Down
8 changes: 5 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
jumboMode true
}
}

repositories {
Expand Down Expand Up @@ -58,10 +61,9 @@ dependencies {
compile 'com.github.zcweng:switch-button:0.0.3' //https://github.com/zcweng/SwitchButton
compile 'org.zeroturnaround:zt-zip:1.9'
compile 'com.github.Kennyc1012:BottomSheet:2.3.4' //https://github.com/Kennyc1012/BottomSheet
compile 'com.github.jetradarmobile.desertplaceholder:desertplaceholder:+' //https://github.com/JetradarMobile/desertplaceholder
compile 'com.github.delight-im:Android-AdvancedWebView:+' //https://github.com/delight-im/Android-AdvancedWebView
compile 'com.github.jetradarmobile.desertplaceholder:desertplaceholder:1.2.4' //https://github.com/JetradarMobile/desertplaceholder
compile 'com.github.delight-im:Android-AdvancedWebView:v3.0.0' //https://github.com/delight-im/Android-AdvancedWebView
compile 'com.flurry.android:analytics:7.2.3'
compile 'com.uxcam:uxcam:2.6.2-beta.4'
compile 'com.pyze:PyzeLibrary:3.0.0'
//Custom filter chips from https://github.com/claudiodegio/MsvSearch
//Image viewer from https://github.com/stfalcon-studio/FrescoImageViewer
Expand Down
13 changes: 10 additions & 3 deletions app/src/main/java/stream/rocketnotes/EditActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ protected void onCreate(Bundle savedInstanceState) {
if (getIntent().getAction().equals(Constants.OPEN_NOTE)) {
AnalyticsUtils.AnalyticEvent(mActivity, "Note Type", Constants.OPEN_NOTE);

savedNote = true;

mEditor.clearFocus();
noteID = getIntent().getIntExtra(Constants.ID, -1);
Log.d("Received Note ID", String.valueOf(noteID));
Expand Down Expand Up @@ -176,13 +178,13 @@ private void saveNote() {
if (!TextUtils.isEmpty(stream.rocketnotes.utils.TextUtils.Clean(mEditor.getHtml())) && !noteTextRaw.equals(stream.rocketnotes.utils.TextUtils.Clean(mEditor.getHtml()))) {
Intent saveNote = new Intent(mContext, SaveNoteService.class);
if (noteStatus.equals(Constants.OPEN_NOTE)) {
Log.d("Edit Activity", Constants.UPDATE_NOTE);
Log.d(mActivity, Constants.UPDATE_NOTE);
saveNote.putExtra(Constants.ID, noteID);
saveNote.putExtra(Constants.BODY, stream.rocketnotes.utils.TextUtils.Clean(mEditor.getHtml()));
saveNote.setAction(Constants.UPDATE_NOTE);
mContext.startService(saveNote);
} else {
Log.d("Edit Activity", Constants.NEW_NOTE);
Log.d(mActivity, Constants.NEW_NOTE);
saveNote.putExtra(Constants.BODY, stream.rocketnotes.utils.TextUtils.Clean(mEditor.getHtml()));
saveNote.setAction(Constants.NEW_NOTE);
mContext.startService(saveNote);
Expand Down Expand Up @@ -210,13 +212,18 @@ private void openShareIntent() {
private void openDeleteIntent() {
if (savedNote == false && originalNew == true) {
//Note has not been saved and no database methods need to be called. Finish activity.
Log.d(mActivity, "Delete Unsaved Note");
} else if (savedNote == true && originalNew == true) {
//New note has been saved. Must get saved ID and pass to DeleteNote.
Log.d("Edit Activity", "Delete New Note");
Log.d(mActivity, "Delete New Note");
DatabaseHelper dbHelper = new DatabaseHelper(this);
noteID = dbHelper.GetLatestID();
DeleteNote();
}
else if (savedNote == true)
{
DeleteNote();
}
finish();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.widget.ImageView;

import com.squareup.picasso.Picasso;
import com.uxcam.UXCam;

import java.util.List;

Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/stream/rocketnotes/NoteItemViewholder.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.view.MenuItem;
Expand All @@ -17,9 +16,6 @@

import com.kennyc.bottomsheet.BottomSheet;
import com.kennyc.bottomsheet.BottomSheetListener;
import com.uxcam.UXCam;

import org.greenrobot.eventbus.EventBus;

import java.util.ArrayList;
import java.util.List;
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/stream/rocketnotes/NotesWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a

RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_notes_listview);
remoteViews.setRemoteAdapter(R.id.notes_listview, intent);

// rv.setEmptyView(R.id.notes_listview, R.id.rocket_icon);
remoteViews.setEmptyView(R.id.notes_listview, R.id.notes_empty);

//Register widget onClickListeners
Intent noteAddIntent = new Intent(context, NotesWidget.class);
Expand Down
28 changes: 23 additions & 5 deletions app/src/main/java/stream/rocketnotes/SettingsFragment.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package stream.rocketnotes;

import android.app.Dialog;
import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
Expand Down Expand Up @@ -87,11 +89,8 @@ public void onCreate(Bundle savedInstanceState) {
showQuickActions.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
//Refresh MainActivity
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(mContext);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putBoolean(Constants.REFRESH, true);
editor.apply();

RefreshMainActivity();
return false;
}
});
Expand Down Expand Up @@ -145,6 +144,16 @@ public boolean onPreferenceClick(Preference arg0) {
public void onSelectedFilePaths(String[] files) {
if (files.length >= 1) {
RestoreDatabase(files[0]);
RefreshMainActivity();
int widgetIDs[] = AppWidgetManager.getInstance(getActivity().getApplication()).getAppWidgetIds(new ComponentName(mContext, NotesWidget.class));
for (int id : widgetIDs) {
AppWidgetManager.getInstance(getActivity().getApplication()).notifyAppWidgetViewDataChanged(id, R.id.notes_listview);
}

int imageWidgetIDs[] = AppWidgetManager.getInstance(getActivity().getApplication()).getAppWidgetIds(new ComponentName(mContext, ImageWidget.class));
for (int id : imageWidgetIDs) {
AppWidgetManager.getInstance(getActivity().getApplication()).notifyAppWidgetViewDataChanged(id, R.id.image_gridview);
}
} else {
Toasty.error(mContext, "No File Selected", Toast.LENGTH_SHORT).show();
}
Expand Down Expand Up @@ -319,4 +328,13 @@ public void RestoreDatabase(String restorePath) {
Toasty.error(mContext, "Invalid Backup File", Toast.LENGTH_SHORT).show();
}
}

public void RefreshMainActivity()
{
//Refresh MainActivity
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(mContext);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putBoolean(Constants.REFRESH, true);
editor.apply();
}
}
11 changes: 11 additions & 0 deletions app/src/main/res/layout/widget_notes_listview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,15 @@
android:divider="@drawable/list_divider"
android:dividerHeight="1dp">
</ListView>

<TextView
android:id="@+id/notes_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@color/white"
android:text="No notes yet..."
android:textSize="16sp"
android:textColor="@color/textPrimary"
android:visibility="gone"/>
</LinearLayout>

0 comments on commit 75e20a9

Please sign in to comment.