Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: notes page #123

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@
android:label="Clues"
android:theme="@style/Theme.Shortyz"
android:configChanges="orientation"
/>
/>
<activity
android:name="com.totsp.crossword.NotesActivity"
android:label="Notes"
android:theme="@style/Theme.Shortyz"
/>
<activity
android:name="com.totsp.crossword.HTMLActivity"
android:label="Shortyz"
Expand Down
14 changes: 13 additions & 1 deletion app/src/main/java/com/totsp/crossword/ClueListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.support.v4.content.ContextCompat;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
Expand Down Expand Up @@ -75,6 +76,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
if(item == null || item.getItemId() == android.R.id.home) {
finish();
return true;
} else if (item.getTitle().toString().equals("Notes")) {
Intent i = new Intent(ClueListActivity.this, NotesActivity.class);
ClueListActivity.this.startActivityForResult(i, 0);
return true;
} else {
return super.onOptionsItemSelected(item);
}
Expand Down Expand Up @@ -318,6 +323,12 @@ public void onNothingSelected(AdapterView<?> arg0) {
this.render();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add("Notes").setIcon(android.R.drawable.ic_menu_agenda);
return true;
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Word w = ShortyzApplication.BOARD.getCurrentWord();
Expand Down Expand Up @@ -472,6 +483,7 @@ private void render() {
this.keyboardView.setVisibility(View.GONE);
}

this.imageView.setBitmap(renderer.drawWord());
boolean displayScratch = prefs.getBoolean("displayScratch", false);
this.imageView.setBitmap(renderer.drawWord(displayScratch, displayScratch));
}
}
Loading