Skip to content

Commit

Permalink
- Attachment support
Browse files Browse the repository at this point in the history
 - Attachment preview for tablets
 - Bugfixing
  • Loading branch information
konradrenner committed May 1, 2016
1 parent bb40862 commit a5d0ead
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.kore.kolabnotes.android"
minSdkVersion 16
targetSdkVersion 23
versionCode 65
versionName "1.11.0"
versionCode 66
versionName "2.0.0"

//Running test
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,16 @@ public void onBindViewHolder(final ViewHolder viewHolder, int i) {
}
}

public void restoreElevation(RecyclerView recyclerView){
for(int i=0; i < recyclerView.getChildCount(); i++){
final View childAt = recyclerView.getChildAt(i);
Utils.setElevation(childAt,5);
if(i == recyclerView.getChildAdapterPosition(childAt)){
Utils.setElevation(childAt,30);
}
}
}

@Override
public int getItemCount() {
return notes == null ? 0 : notes.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,11 @@ public void onActivityResult(int requestCode, int resultCode,

String alt = path;

/* Set focus, as after rotate focus is lost and it's impossible to insert an image */
editor.focusEditor();
//issue 125
if(!editor.isFocused()){
/* Set focus, as after rotate focus is lost and it's impossible to insert an image */
editor.focusEditor();
}
editor.insertImage(imageEncoded, alt);
putImage(alt,imageEncoded);

Expand Down Expand Up @@ -739,6 +742,10 @@ public void onActivityResult(int requestCode, int resultCode,
}
}
}
}else if(requestCode == ATTACHMENT_ACTIVITY_RESULT_CODE){
if (activity instanceof OnFragmentCallback) {
((OnFragmentCallback) activity).fileSelected();
}
}
}

Expand Down Expand Up @@ -1404,7 +1411,7 @@ public boolean checkDifferences(){
Spinner spinner = (Spinner) activity.findViewById(R.id.spinner_notebook);

boolean differences = false;
if(summary != null && spinner != null){
if(summary != null && spinner != null && note != null){

Note newNote = new Note(note.getIdentification(), note.getAuditInformation(),
selectedClassification == null ? Note.Classification.PUBLIC : selectedClassification,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,10 @@ void setDetailFragment(Note note, boolean sameSelection){

public void preventBlankDisplaying(){
this.preventBlankDisplaying = true;

if(mAdapter != null && mRecyclerView != null){
mAdapter.restoreElevation(mRecyclerView);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,13 @@ public void onDetach() {
@Override
public void onStop() {
super.onStop();
mediaController.hide();
mediaPlayer.stop();
mediaPlayer.release();
if(mediaController != null) {
mediaController.hide();
}
if(mediaPlayer != null){
mediaPlayer.stop();
mediaPlayer.release();
}
}

@Override
Expand Down

0 comments on commit a5d0ead

Please sign in to comment.