Skip to content

Commit

Permalink
Finish remaining changes to move from SealNote to SealNote Plus. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajburley committed Jul 21, 2019
1 parent 24c0367 commit d9d256e
Show file tree
Hide file tree
Showing 35 changed files with 144 additions and 155 deletions.
8 changes: 4 additions & 4 deletions SealNotePlusApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ android {

signingConfigs {
release {
storeFile file(String.valueOf(System.getenv("SEALNOTE_KEYSTORE")))
storePassword System.getenv("SEALNOTE_KEYSTORE_PASSWORD")
keyAlias System.getenv("SEALNOTE_KEY_ALIAS")
keyPassword System.getenv("SEALNOTE_KEY_PASSWORD")
storeFile file(String.valueOf(System.getenv("SEALNOTEPLUS_KEYSTORE")))
storePassword System.getenv("SEALNOTEPLUS_KEYSTORE_PASSWORD")
keyAlias System.getenv("SEALNOTEPLUS_KEY_ALIAS")
keyPassword System.getenv("SEALNOTEPLUS_KEY_PASSWORD")
}
}

Expand Down
32 changes: 16 additions & 16 deletions SealNotePlusApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<application
android:icon="@drawable/ic_launcher"
android:label="@string/short_app_name"
android:theme="@style/Sealnote.Theme.Main"
android:name="org.hawknetwork.sealnoteplus.SealnoteApplication">
android:theme="@style/SealNotePlus.Theme.Main"
android:name="org.hawknetwork.sealnoteplus.SealNotePlusApplication">
<activity
android:name="org.hawknetwork.sealnoteplus.SealnoteActivity"
android:theme="@style/Sealnote.Theme.Sealnote">
android:name="org.hawknetwork.sealnoteplus.NoteListActivity"
android:theme="@style/SealNotePlus.Theme.NoteList">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand All @@ -21,11 +21,11 @@
<activity
android:name="org.hawknetwork.sealnoteplus.NoteActivity"
android:label="@string/title_activity_note"
android:parentActivityName="org.hawknetwork.sealnoteplus.SealnoteActivity"
android:theme="@style/Sealnote.Theme.Note">
android:parentActivityName="org.hawknetwork.sealnoteplus.NoteListActivity"
android:theme="@style/SealNotePlus.Theme.Note">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.hawknetwork.sealnoteplus.SealnoteActivity"/>
android:value="org.hawknetwork.sealnoteplus.NoteListActivity"/>
</activity>
<activity
android:name="org.hawknetwork.sealnoteplus.PasswordActivity"
Expand All @@ -35,26 +35,26 @@
<activity
android:name="org.hawknetwork.sealnoteplus.SettingsActivity"
android:label="@string/title_activity_settings"
android:parentActivityName="org.hawknetwork.sealnoteplus.SealnoteActivity"
android:theme="@style/Sealnote.Theme.Main">
android:parentActivityName="org.hawknetwork.sealnoteplus.NoteListActivity"
android:theme="@style/SealNotePlus.Theme.Main">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.hawknetwork.sealnoteplus.SealnoteActivity"/>
android:value="org.hawknetwork.sealnoteplus.NoteListActivity"/>
</activity>
<activity
android:name="org.hawknetwork.sealnoteplus.TagsEditorActivity"
android:label="@string/title_activity_edit_tags"
android:parentActivityName="org.hawknetwork.sealnoteplus.SealnoteActivity"
android:theme="@style/Sealnote.Theme.Main">
android:parentActivityName="org.hawknetwork.sealnoteplus.NoteListActivity"
android:theme="@style/SealNotePlus.Theme.Main">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.hawknetwork.sealnoteplus.SealnoteActivity"/>
android:value="org.hawknetwork.sealnoteplus.NoteListActivity"/>
</activity>

<activity
android:name="org.hawknetwork.sealnoteplus.WebViewActivity"
android:parentActivityName="org.hawknetwork.sealnoteplus.SettingsActivity"
android:theme="@style/Sealnote.Theme.Main">
android:theme="@style/SealNotePlus.Theme.Main">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.hawknetwork.sealnoteplus.SettingsActivity"/>
Expand All @@ -63,7 +63,7 @@
<activity
android:name="org.hawknetwork.sealnoteplus.BackupActivity"
android:parentActivityName="org.hawknetwork.sealnoteplus.SettingsActivity"
android:theme="@style/Sealnote.Theme.Main"
android:theme="@style/SealNotePlus.Theme.Main"
android:label="@string/backup">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
Expand All @@ -73,7 +73,7 @@
<activity
android:name="org.hawknetwork.sealnoteplus.RestoreActivity"
android:parentActivityName="org.hawknetwork.sealnoteplus.SettingsActivity"
android:theme="@style/Sealnote.Theme.Main"
android:theme="@style/SealNotePlus.Theme.Main"
android:label="@string/restore">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import android.widget.Toast;

import com.google.common.collect.Sets;
import org.hawknetwork.sealnoteplus.R;

import org.hawknetwork.sealnoteplus.data.DatabaseHandler;
import org.hawknetwork.sealnoteplus.data.Note;
Expand Down Expand Up @@ -183,7 +182,7 @@ private void init(boolean isNewNote, Note.Type type) {

// load suggestions
// TODO: Do this asynchronously if required
mTagEditText.loadSuggestions(SealnoteApplication.getDatabase().getAllTags().keySet());
mTagEditText.loadSuggestions(SealNotePlusApplication.getDatabase().getAllTags().keySet());
mTagEditText.setThreshold(1);

// TextWatcher to update share intent
Expand Down Expand Up @@ -456,7 +455,7 @@ private boolean isContentChanged() {
* @return true if note saved
*/
public boolean saveNote(boolean forceSave) {
final DatabaseHandler handler = SealnoteApplication.getDatabase();
final DatabaseHandler handler = SealNotePlusApplication.getDatabase();
final String title = mTitleView.getText().toString();
final NoteContent noteContent = mNoteView.getNoteContent();
final String text = noteContent.toString();
Expand Down Expand Up @@ -498,7 +497,7 @@ public boolean saveNote(boolean forceSave) {
* Delete current note
*/
public void doDelete() {
final DatabaseHandler handler = SealnoteApplication.getDatabase();
final DatabaseHandler handler = SealNotePlusApplication.getDatabase();
handler.trashNote(mNote.getId(), true);
mNote = null;
Toast.makeText(this, getResources().getString(R.string.note_deleted), Toast.LENGTH_SHORT).show();
Expand All @@ -514,7 +513,7 @@ public void doDelete() {
* Un-archive a note
*/
public void doUnarchive() {
final DatabaseHandler handler = SealnoteApplication.getDatabase();
final DatabaseHandler handler = SealNotePlusApplication.getDatabase();
handler.archiveNote(mNote.getId(), false);
mNote = null;
Toast.makeText(this, getResources().getString(R.string.note_unarchived), Toast.LENGTH_SHORT).show();
Expand All @@ -541,7 +540,7 @@ public void doArchive() {
* Archive current note
*/
private void doArchiveNote() {
final DatabaseHandler handler = SealnoteApplication.getDatabase();
final DatabaseHandler handler = SealNotePlusApplication.getDatabase();
handler.archiveNote(mNote.getId(), true);
mNote = null;
Toast.makeText(this, getResources().getString(R.string.note_archived), Toast.LENGTH_SHORT).show();
Expand Down Expand Up @@ -581,7 +580,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
* Restores note from trash
*/
public void doRestore() {
final DatabaseHandler handler = SealnoteApplication.getDatabase();
final DatabaseHandler handler = SealNotePlusApplication.getDatabase();
handler.trashNote(mNote.getId(), false);
mNote = null;
Toast.makeText(this, getResources().getString(R.string.note_restored), Toast.LENGTH_SHORT).show();
Expand Down Expand Up @@ -650,7 +649,7 @@ protected void onPreExecute() {
*/
@Override
protected Note doInBackground(Integer... integers) {
DatabaseHandler db = SealnoteApplication.getDatabase();
DatabaseHandler db = SealNotePlusApplication.getDatabase();
return db.getNote(integers[0]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
import android.view.*;
import android.widget.*;

import org.hawknetwork.sealnoteplus.R;

import org.hawknetwork.sealnoteplus.data.DatabaseHandler;
import org.hawknetwork.sealnoteplus.data.Note;
import org.hawknetwork.sealnoteplus.fragment.SealnoteFragment;
import org.hawknetwork.sealnoteplus.fragment.NoteListFragment;
import org.hawknetwork.sealnoteplus.utils.FontCache;
import org.hawknetwork.sealnoteplus.utils.Misc;
import org.hawknetwork.sealnoteplus.utils.PreferenceHandler;
Expand All @@ -40,9 +38,9 @@
/**
* Main activity where all cards are listed in a staggered grid
*/
public class SealnoteActivity extends Activity
public class NoteListActivity extends Activity
implements SharedPreferences.OnSharedPreferenceChangeListener {
public final static String TAG = "SealnoteActivity";
public final static String TAG = "NoteListActivity";

private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mDrawerToggle;
Expand All @@ -53,7 +51,7 @@ public class SealnoteActivity extends Activity
private int mTagId;
private String mTagName;

private SealnoteFragment mSealnoteFragment;
private NoteListFragment mNoteListFragment;
private boolean mReloadFragment = false;

/**
Expand All @@ -64,7 +62,7 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "Creating main activity...");

if (SealnoteApplication.getDatabase().getPassword() == null) {
if (SealNotePlusApplication.getDatabase().getPassword() == null) {
// onResume will follow up which will start PasswordActivity and setup database password
Log.d(TAG, "Password can't be found while creating activity. Start PasswordActivity");
return;
Expand Down Expand Up @@ -117,23 +115,23 @@ private void loadNotesView() {

switch (type) {
case VIEW_TILES:
mSealnoteFragment = new StaggeredGridFragment();
mNoteListFragment = new StaggeredGridFragment();
break;
case VIEW_COLUMN:
mSealnoteFragment = new StaggeredGridFragment();
mNoteListFragment = new StaggeredGridFragment();
break;
case VIEW_SIMPLE_LIST:
mSealnoteFragment = new SimpleListFragment();
mNoteListFragment = new SimpleListFragment();
break;
}

Bundle bundle = new Bundle();
bundle.putString("SN_FOLDER", mCurrentFolder.name());
bundle.putInt("SN_TAGID", mTagId);
mSealnoteFragment.setArguments(bundle);
mNoteListFragment.setArguments(bundle);

FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, mSealnoteFragment);
transaction.replace(R.id.fragment_container, mNoteListFragment);
transaction.commit();
}

Expand All @@ -159,7 +157,7 @@ private void initNavigationDrawer() {
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
if (mReloadFragment) {
mSealnoteFragment.setFolder(mCurrentFolder, mTagId);
mNoteListFragment.setFolder(mCurrentFolder, mTagId);
getActionBar().setTitle(mTagName);
mReloadFragment = false;
}
Expand Down Expand Up @@ -254,7 +252,7 @@ public void onItemClick(AdapterView<?> adapterView, View view, int pos, long id)
}

private void reloadTagsAdapter() {
DatabaseHandler handler = SealnoteApplication.getDatabase();
DatabaseHandler handler = SealNotePlusApplication.getDatabase();
mTags = handler.getAllTags();
Set<String> tagSet = mTags.keySet();
String []tags = mTags.keySet().toArray(new String[tagSet.size()]);
Expand Down Expand Up @@ -396,10 +394,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
onCreateNoteClick(null);
return true;
case R.id.action_new_note_card:
NoteActivity.startForNoteId(SealnoteActivity.this, -1, Note.Type.TYPE_CARD);
NoteActivity.startForNoteId(NoteListActivity.this, -1, Note.Type.TYPE_CARD);
return true;
case R.id.action_new_note_login:
NoteActivity.startForNoteId(SealnoteActivity.this, -1, Note.Type.TYPE_LOGIN);
NoteActivity.startForNoteId(NoteListActivity.this, -1, Note.Type.TYPE_LOGIN);
return true;
case R.id.action_edit_tags:
showEditTagsDialog();
Expand Down Expand Up @@ -443,7 +441,7 @@ private void showEditTagsDialog() {
* Called when any create new button/action is clicked.
*/
public void onCreateNoteClick(View view) {
NoteActivity.startForNoteId(SealnoteActivity.this, -1, null);
NoteActivity.startForNoteId(NoteListActivity.this, -1, null);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import android.widget.TextView;
import android.widget.Toast;

import org.hawknetwork.sealnoteplus.R;

import org.hawknetwork.sealnoteplus.data.DatabaseHandler;
import org.hawknetwork.sealnoteplus.utils.TimeoutHandler;
import org.hawknetwork.sealnoteplus.view.PasswordInput;
Expand Down Expand Up @@ -150,10 +148,10 @@ private class LoginTask extends AsyncTask<String, Void, Boolean> {
* @return true is successfully created/login to encrypted database
*/
protected Boolean doInBackground(String... args) {
DatabaseHandler handler = SealnoteApplication.getDatabase();
DatabaseHandler handler = SealNotePlusApplication.getDatabase();
handler.recycle();
try {
SealnoteApplication.getDatabase().setPassword(args[0]);
SealNotePlusApplication.getDatabase().setPassword(args[0]);
handler.update();
} catch (SQLiteException e) {
// Most likely wrong password provided
Expand All @@ -173,7 +171,7 @@ protected void onPostExecute(Boolean result) {
// clear all timers if any to avoid bouncing back here from activity
TimeoutHandler.instance().passwordTimeoutClear();

Intent intent = new Intent(PasswordActivity.this, SealnoteActivity.class);
Intent intent = new Intent(PasswordActivity.this, NoteListActivity.class);
PasswordActivity.this.startActivity(intent);
PasswordActivity.this.finish();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import java.lang.reflect.Field;

public class SealnoteApplication extends Application {
public final static String TAG = "SealnoteApplication";
public class SealNotePlusApplication extends Application {
public final static String TAG = "SealNotePlusApplication";

private static DatabaseHandler mDatabase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import android.view.ViewGroup;
import android.widget.*;

import org.hawknetwork.sealnoteplus.R;

import org.hawknetwork.sealnoteplus.data.DatabaseHandler;
import org.hawknetwork.sealnoteplus.utils.Misc;
import org.hawknetwork.sealnoteplus.utils.TimeoutHandler;
Expand All @@ -36,7 +34,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Misc.secureWindow(this);

mHandler = SealnoteApplication.getDatabase();
mHandler = SealNotePlusApplication.getDatabase();
mTagMap = mHandler.getAllTags();
mTagCount = mHandler.getAllTagsCount();
mAdapterData = new ArrayList<String>(mTagMap.keySet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import android.content.Context;
import android.database.Cursor;
import android.util.Log;
import org.hawknetwork.sealnoteplus.SealnoteApplication;
import org.hawknetwork.sealnoteplus.fragment.SealnoteFragment;
import org.hawknetwork.sealnoteplus.SealNotePlusApplication;
import org.hawknetwork.sealnoteplus.fragment.NoteListFragment;

/**
* Loader for loading notes in Adapter
Expand All @@ -20,9 +20,9 @@ public class AdapterLoader extends AsyncTaskLoader<Cursor> {
*/
@Override
public Cursor loadInBackground() {
Log.d(SealnoteFragment.TAG, "Adapter loader started!");
Log.d(NoteListFragment.TAG, "Adapter loader started!");

final DatabaseHandler db = SealnoteApplication.getDatabase();
final DatabaseHandler db = SealNotePlusApplication.getDatabase();
final Cursor cursor;

switch (currentFolder) {
Expand All @@ -47,7 +47,7 @@ public Cursor loadInBackground() {

public AdapterLoader(Context context, Note.Folder currentFolder, int tagid) {
super(context);
Log.d(SealnoteFragment.TAG, "New adapter loader created");
Log.d(NoteListFragment.TAG, "New adapter loader created");
this.currentFolder = currentFolder;
this.tagid = tagid;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
import org.hawknetwork.sealnoteplus.SealnoteApplication;
import org.hawknetwork.sealnoteplus.SealNotePlusApplication;
import org.hawknetwork.sealnoteplus.utils.EasyDate;

import java.text.ParseException;
Expand Down Expand Up @@ -234,7 +234,7 @@ public void setTags(Set<String> tagSet) {
* tags from database and return them. Use getTags() later
*/
public Set<String> loadGetTags() {
final DatabaseHandler handler = SealnoteApplication.getDatabase();
final DatabaseHandler handler = SealNotePlusApplication.getDatabase();
mTags = handler.getNoteTags(mId);
return mTags;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.database.Cursor;
import android.widget.ListAdapter;

public interface SealnoteAdapter extends ListAdapter {
public interface NoteListAdapter extends ListAdapter {
public Cursor getCursor();
public void clearCursor();
public void changeCursor(Cursor cursor);
Expand Down
Loading

0 comments on commit d9d256e

Please sign in to comment.