Skip to content
Merged
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
13 changes: 9 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/OwnCloud">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, wanted to remove all possible Nextcloud/ownCloud-References long time ago...

android:theme="@style/AppTheme">

<activity
android:name="it.niedermann.owncloud.notes.android.activity.SplashscreenActivity"
android:theme="@style/SplashTheme">
Expand All @@ -21,9 +22,12 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name="it.niedermann.owncloud.notes.android.activity.NotesListViewActivity"
android:label="@string/app_name">
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
>

<intent-filter>
<action android:name="android.intent.action.SEARCH" />
Expand Down Expand Up @@ -78,8 +82,9 @@
/>

<activity
android:name="it.niedermann.owncloud.notes.android.activity.SelectSingleNoteActivity">

android:name=".android.activity.SelectSingleNoteActivity"
android:theme="@style/AppTheme.NoActionBar"
>
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package it.niedermann.owncloud.notes.android;

import android.content.Context;
import android.support.v7.widget.AppCompatAutoCompleteTextView;
import android.util.AttributeSet;

/**
* Extension of the {@link AppCompatAutoCompleteTextView}, but this one is always open, i.e. you can see the list of suggestions even the TextView is empty.
*/
public class AlwaysAutoCompleteTextView extends AppCompatAutoCompleteTextView {

private int myThreshold;

public AlwaysAutoCompleteTextView(Context context) {
super(context);
}

public AlwaysAutoCompleteTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}

public AlwaysAutoCompleteTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
public void setThreshold(int threshold) {
if (threshold < 0) {
threshold = 0;
}
myThreshold = threshold;
}

@Override
public boolean enoughToFilter() {
return getText().length() >= myThreshold;
}

@Override
public int getThreshold() {
return myThreshold;
}

public void showFullDropDown() {
performFiltering(getText(), 0);
showDropDown();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@
import com.yydcdut.rxmarkdown.syntax.edit.EditFactory;

import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.model.Category;
import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper;
import it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper;
import it.niedermann.owncloud.notes.util.MarkDownUtil;
import rx.Subscriber;

public class CreateNoteActivity extends AppCompatActivity {

public static final String PARAM_CATEGORY = "category";
private final static int server_settings = 2;

private RxMDEditText editTextField = null;
private Category categoryPreselection;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -39,6 +43,10 @@ protected void onCreate(Bundle savedInstanceState) {
String action = intent.getAction();
String type = intent.getType();

if(intent.hasExtra(PARAM_CATEGORY)) {
categoryPreselection = (Category) intent.getSerializableExtra(PARAM_CATEGORY);
}

if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) {
editTextField.setText(intent.getStringExtra(Intent.EXTRA_TEXT));
Expand Down Expand Up @@ -104,7 +112,9 @@ private void saveAndClose(boolean implicit) {
if(!implicit || !content.isEmpty()) {
NoteSQLiteOpenHelper db = NoteSQLiteOpenHelper.getInstance(this);
Intent data = new Intent(this, NotesListViewActivity.class);
data.putExtra(NotesListViewActivity.CREATED_NOTE, db.getNote(db.addNoteAndSync(content)));
String category = categoryPreselection==null ? null : categoryPreselection.category;
boolean favorite = categoryPreselection!=null && categoryPreselection.favorite!=null ? categoryPreselection.favorite : false;
data.putExtra(NotesListViewActivity.CREATED_NOTE, db.getNote(db.addNoteAndSync(content, category, favorite)));
setResult(RESULT_OK, data);
}
finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ private void showCategorySelector() {
@Override
public void onCategoryChosen(String category) {
DBNote note = fragment.getNote();
note.setCategory(category);
db.updateNoteAndSync(note, note.getContent(), null);
db.setCategory(note, category, null);
}

/**
Expand Down
Loading