Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4acea25 authored by Nihar Thakkar's avatar Nihar Thakkar
Browse files

Merge remote-tracking branch 'origin/stefan-niedermann/master'

# Conflicts:
#	app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java
#	app/src/main/res/values-b+en+001/strings.xml
#	cert4android
parents 22c532d0 93fdb504
Loading
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -8,12 +8,13 @@ An android client for [Nextcloud Notes App](https://github.com/nextcloud/notes/)

## :arrow_forward: Access

[![Download from Google Play](http://www.android.com/images/brand/android_app_on_play_large.png)](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes)
[![Download from Google Play](https://play.google.com/intl/en_us/badges/images/badge_new.png)](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes)
[![Nextcloud Notes App on fdroid.org](https://camo.githubusercontent.com/7df0eafa4433fa4919a56f87c3d99cf81b68d01c/68747470733a2f2f662d64726f69642e6f72672f77696b692f696d616765732f632f63342f462d44726f69642d627574746f6e5f617661696c61626c652d6f6e2e706e67)](https://f-droid.org/repository/browse/?fdid=it.niedermann.owncloud.notes)
[![Donate with PayPal](https://raw.githubusercontent.com/stefan-niedermann/paypal-donate-button/master/paypal-donate-button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K7HVLE6J7SXXA)
[![Donate using Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/stefan-niedermann/donate)

## :eyes: Screenshots

![Screenshot of list view](/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png)
![Screenshot of edit view](/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png)

@@ -23,19 +24,20 @@ An android client for [Nextcloud Notes App](https://github.com/nextcloud/notes/)
* Mark notes as favorite
* Bulk delete
* Render MarkDown (using [RxMarkdown](https://github.com/yydcdut/RxMarkdown))
* English, German, Russian, Armenian, French and Serbian UI
* Translated in many languages on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/)

## :checkered_flag: Planned features
* Tablet layout ([#8](https://github.com/stefan-niedermann/nextcloud-notes/issues/8))
* Simple widget for individual note ([#5](https://github.com/stefan-niedermann/nextcloud-notes/issues/5))
* Make a widget for all notes ([#15](https://github.com/stefan-niedermann/nextcloud-notes/issues/15))
* In-note search ([#106](https://github.com/stefan-niedermann/nextcloud-notes/issues/106))
* Toggle checkboxes in view mode ([#451](https://github.com/stefan-niedermann/nextcloud-notes/issues/451))
* Context based formatting ([#363](https://github.com/stefan-niedermann/nextcloud-notes/issues/363))
* Trashbin ([#238](https://github.com/stefan-niedermann/nextcloud-notes/issues/238))

## :wrench: Contribution
## :family: Join the team
* Test the app with different devices
* Write issues in the [issue tracker](https://github.com/stefan-niedermann/nextcloud-notes/issues)
* Provide pull requests
* Translate this app on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/)
* Report issues in the [issue tracker](https://github.com/stefan-niedermann/nextcloud-notes/issues)
* [Pick a good first issue](https://github.com/nextcloud/server/labels/good%20first%20issue) :notebook:
* Create a [Pull Request](https://opensource.guide/how-to-contribute/#opening-a-pull-request)
* Help translating this app on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/) :flags:
* Buy this app on [Google Play Store](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes)
* Send me a bottle of your favorite beer :beers: :wink:

+6 −4
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@ android {
        applicationId "it.niedermann.owncloud.notes"
        minSdkVersion 23
        targetSdkVersion 27
        versionCode 30
        versionName "0.18.0"
        versionCode 37
        versionName "0.22.3"
    }
    buildTypes {
        release {
@@ -26,8 +26,10 @@ android {
dependencies {
    implementation project(':cert4android')

    implementation 'com.yydcdut:rxmarkdown:0.1.1-beta'

    implementation 'io.reactivex:rxandroid:1.2.0'
    implementation 'io.reactivex:rxjava:1.1.5'
    implementation 'com.yydcdut:markdown-processor:0.1.3'
    implementation 'com.yydcdut:rxmarkdown-wrapper:0.1.3'

    implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
+3 −2
Original line number Diff line number Diff line
@@ -198,8 +198,9 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setTitle(note.getTitle());
            String subtitle = note.getCategory().isEmpty() ? getString(R.string.action_uncategorized) : NoteUtil.extendCategory(note.getCategory());
            actionBar.setSubtitle(subtitle);
            if(!note.getCategory().isEmpty()) {
                actionBar.setSubtitle(NoteUtil.extendCategory(note.getCategory()));
            }
        }
    }
}
 No newline at end of file
+35 −2
Original line number Diff line number Diff line
@@ -4,8 +4,10 @@ import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.SearchManager;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Canvas;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
@@ -32,6 +34,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;
@@ -88,6 +91,8 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
    Toolbar toolbar;
    @BindView(R.id.drawerLayout)
    DrawerLayout drawerLayout;
    @BindView(R.id.account)
    TextView account;
    @BindView(R.id.swiperefreshlayout)
    SwipeRefreshLayout swipeRefreshLayout;
    @BindView(R.id.fab_create)
@@ -284,7 +289,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap

    private void setupNavigationList(final String selectedItem) {
        itemRecent = new NavigationAdapter.NavigationItem(ADAPTER_KEY_RECENT, getString(R.string.label_all_notes), null, R.drawable.ic_access_time_grey600_24dp);
        itemFavorites = new NavigationAdapter.NavigationItem(ADAPTER_KEY_STARRED, getString(R.string.label_favorites), null, R.drawable.ic_star_grey600_24dp);
        itemFavorites = new NavigationAdapter.NavigationItem(ADAPTER_KEY_STARRED, getString(R.string.label_favorites), null, R.drawable.ic_star_yellow_24dp);
        adapterCategories = new NavigationAdapter(new NavigationAdapter.ClickListener() {
            @Override
            public void onItemClick(NavigationAdapter.NavigationItem item) {
@@ -418,10 +423,12 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
    }

    private void setupNavigationMenu() {
        final NavigationAdapter.NavigationItem itemTrashbin = new NavigationAdapter.NavigationItem("trashbin", getString(R.string.action_trashbin), null, R.drawable.ic_delete_grey600_24dp);
        final NavigationAdapter.NavigationItem itemSettings = new NavigationAdapter.NavigationItem("settings", getString(R.string.action_settings), null, R.drawable.ic_settings_grey600_24dp);
        final NavigationAdapter.NavigationItem itemAbout = new NavigationAdapter.NavigationItem("about", getString(R.string.simple_about), null, R.drawable.ic_info_outline_grey600_24dp);

        ArrayList<NavigationAdapter.NavigationItem> itemsMenu = new ArrayList<>();
        itemsMenu.add(itemTrashbin);
        itemsMenu.add(itemSettings);
        itemsMenu.add(itemAbout);

@@ -434,6 +441,10 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
                } else if (item == itemAbout) {
                    Intent aboutIntent = new Intent(getApplicationContext(), AboutActivity.class);
                    startActivityForResult(aboutIntent, about);
                } else if (item == itemTrashbin) {
                    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
                    String url = preferences.getString(SettingsActivity.SETTINGS_URL, SettingsActivity.DEFAULT_SETTINGS);
                    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url + "index.php/apps/files/?dir=/&view=trashbin")));
                }
            }

@@ -442,6 +453,18 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
                onItemClick(item);
            }
        });


        this.updateUsernameInDrawer();
        final NotesListViewActivity that = this;
        this.account.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent settingsIntent = new Intent(that, SettingsActivity.class);
                startActivityForResult(settingsIntent, server_settings);
            }
        });

        adapterMenu.setItems(itemsMenu);
        listNavigationMenu.setAdapter(adapterMenu);
    }
@@ -499,7 +522,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
                    }
                    case ItemTouchHelper.RIGHT: {
                        final DBNote dbNote = (DBNote) adapter.getItem(viewHolder.getAdapterPosition());
                        db.toggleFavorite(dbNote, null);
                        db.toggleFavorite(dbNote, syncCallBack);
                        refreshLists();
                        break;
                    }
@@ -674,6 +697,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
                // Create new Instance with new URL and credentials
                db = NoteSQLiteOpenHelper.getInstance(this);
                if (db.getNoteServerSyncHelper().isSyncPossible()) {
                    this.updateUsernameInDrawer();
                    adapter.removeAll();
                    synchronize();
                } else {
@@ -686,6 +710,15 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
        }
    }

    private void updateUsernameInDrawer() {
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        String username = preferences.getString(SettingsActivity.SETTINGS_USERNAME, SettingsActivity.DEFAULT_SETTINGS);
        String url = preferences.getString(SettingsActivity.SETTINGS_URL, SettingsActivity.DEFAULT_SETTINGS).replace("https://", "").replace("http://", "");
        if(!SettingsActivity.DEFAULT_SETTINGS.equals(username) && !SettingsActivity.DEFAULT_SETTINGS.equals(url)) {
            this.account.setText(username + "@" + url.substring(0, url.length() - 1));
        }
    }

    @Override
    public void onNoteClick(int position, View v) {
        if (mActionMode != null) {
+13 −22
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ import it.niedermann.owncloud.notes.android.appwidget.SingleNoteWidget;
import it.niedermann.owncloud.notes.model.DBNote;
import it.niedermann.owncloud.notes.model.Item;
import it.niedermann.owncloud.notes.model.ItemAdapter;
import it.niedermann.owncloud.notes.util.Notes;

public class SelectSingleNoteActivity extends NotesListViewActivity {

@@ -26,11 +27,10 @@ public class SelectSingleNoteActivity extends NotesListViewActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setResult(Activity.RESULT_CANCELED);

        SwipeRefreshLayout swipeRefreshLayout = getSwipeRefreshLayout();

        setResult(Activity.RESULT_CANCELED);

        ButterKnife.bind(this);
        fabCreate.setVisibility(View.GONE);

@@ -53,33 +53,24 @@ public class SelectSingleNoteActivity extends NotesListViewActivity {
        Item item = adapter.getItem(position);
        DBNote note = (DBNote) item;
        long noteID = note.getId();
        Intent intent = getIntent();
        Bundle extras = intent.getExtras();
        int mAppWidgetId = -1;
        final Bundle extras = getIntent().getExtras();

        if (extras != null) {
            mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
        if (extras == null) {
            finish();
        }

        int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
        SharedPreferences.Editor sp = PreferenceManager.getDefaultSharedPreferences(this).edit();

        sp.putLong(SingleNoteWidget.WIDGET_KEY + mAppWidgetId, noteID);
        sp.putLong(SingleNoteWidget.WIDGET_KEY + appWidgetId, noteID);
        sp.putBoolean(SingleNoteWidget.DARK_THEME_KEY + appWidgetId, Notes.getAppTheme(getApplicationContext()));
        sp.apply();

        Intent retIntent = new Intent(this, SingleNoteWidget.class);
        retIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
        retIntent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
        sendBroadcast(retIntent);
        setResult(RESULT_OK, retIntent);
        Intent updateIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE, null,
                                        getApplicationContext(), SingleNoteWidget.class);
        updateIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
        setResult(RESULT_OK, updateIntent);
        getApplicationContext().sendBroadcast(updateIntent);
        finish();
    }

    @Override
    public boolean onNoteLongClick(int position, View v) {
        return false;
    }

    @Override
    public void onNoteFavoriteClick(int position, View view) {
    }
}
Loading