First commit: customized structure from Nextcloud SSO Example: https://github.com/matiasdelellis/app-tutorial-android
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
70
app/build.gradle
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Nextcloud Geofavorites for Android
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
|
||||
defaultConfig {
|
||||
applicationId "it.danieleverducci.nextcloudmaps"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
// Needed for Nextcloud SSO
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
|
||||
implementation 'com.android.support:design:30.0.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
implementation "androidx.cardview:cardview:1.0.0"
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||
implementation "androidx.preference:preference:1.1.1"
|
||||
|
||||
testImplementation 'junit:junit:4.13'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
|
||||
// Retrofif2
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
|
||||
|
||||
// Nextcloud SSO
|
||||
implementation "com.github.nextcloud:Android-SingleSignOn:0.5.6"
|
||||
}
|
21
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
55
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="it.danieleverducci.nextcloudmaps">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<queries>
|
||||
<package android:name="com.nextcloud.client" />
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
<activity android:name=".activity.login.LoginActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".activity.main.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activity.about.AboutActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppTheme"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
BIN
app/src/main/ic_launcher-playstore.png
Normal file
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Nextcloud Geofavorites for Android
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.activity.about;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.BuildConfig;
|
||||
import it.danieleverducci.nextcloudmaps.R;
|
||||
|
||||
public class AboutActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_about);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayShowTitleEnabled(false);
|
||||
}
|
||||
|
||||
fillAboutActivity();
|
||||
}
|
||||
|
||||
private void fillAboutActivity () {
|
||||
TextView tvVersion = findViewById(R.id.about_version);
|
||||
tvVersion.setText(Html.fromHtml(getString(R.string.about_version, "v" + BuildConfig.VERSION_NAME)));
|
||||
|
||||
Button btLicence = findViewById(R.id.about_app_license_button);
|
||||
btLicence.setOnClickListener(view -> openUtl(getString(R.string.url_license)));
|
||||
|
||||
TextView tvSource = findViewById(R.id.about_source);
|
||||
tvSource.setText(Html.fromHtml(getString(R.string.about_source, getString(R.string.url_source))));
|
||||
tvSource.setOnClickListener(view -> openUtl(getString(R.string.url_source)));
|
||||
|
||||
TextView tvIssues = findViewById(R.id.about_issues);
|
||||
tvIssues.setText(Html.fromHtml(getString(R.string.about_issues, getString(R.string.url_issues))));
|
||||
tvIssues.setOnClickListener(view -> openUtl(getString(R.string.url_issues)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void openUtl(String url) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
|
||||
}
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Nextcloud Geofavorites for Android
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.activity.login;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.nextcloud.android.sso.AccountImporter;
|
||||
import com.nextcloud.android.sso.api.NextcloudAPI;
|
||||
import com.nextcloud.android.sso.exceptions.AccountImportCancelledException;
|
||||
import com.nextcloud.android.sso.exceptions.AndroidGetAccountsPermissionNotGranted;
|
||||
import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException;
|
||||
import com.nextcloud.android.sso.exceptions.NextcloudFilesAppNotInstalledException;
|
||||
import com.nextcloud.android.sso.exceptions.NoCurrentAccountSelectedException;
|
||||
import com.nextcloud.android.sso.helper.SingleAccountHelper;
|
||||
import com.nextcloud.android.sso.model.SingleSignOnAccount;
|
||||
import com.nextcloud.android.sso.ui.UiExceptionManager;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.R;
|
||||
import it.danieleverducci.nextcloudmaps.activity.main.MainActivity;
|
||||
import it.danieleverducci.nextcloudmaps.api.ApiProvider;
|
||||
|
||||
public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
protected ApiProvider mApi;
|
||||
protected ProgressBar progress;
|
||||
protected Button button;
|
||||
|
||||
protected SingleSignOnAccount ssoAccount;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
|
||||
progress = findViewById(R.id.progress);
|
||||
button = findViewById(R.id.chose_button);
|
||||
button.setOnClickListener(view -> {
|
||||
progress.setVisibility(View.VISIBLE);
|
||||
openAccountChooser();
|
||||
});
|
||||
|
||||
try {
|
||||
ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(getApplicationContext());
|
||||
SingleAccountHelper.setCurrentAccount(getApplicationContext(), ssoAccount.name);
|
||||
accountAccessDone();
|
||||
} catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) {
|
||||
}
|
||||
}
|
||||
private void openAccountChooser() {
|
||||
try {
|
||||
AccountImporter.pickNewAccount(this);
|
||||
} catch (NextcloudFilesAppNotInstalledException | AndroidGetAccountsPermissionNotGranted e) {
|
||||
UiExceptionManager.showDialogForException(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
try {
|
||||
AccountImporter.onActivityResult(requestCode, resultCode, data, this, new AccountImporter.IAccountAccessGranted() {
|
||||
NextcloudAPI.ApiConnectedListener callback = new NextcloudAPI.ApiConnectedListener() {
|
||||
@Override
|
||||
public void onConnected() {
|
||||
// ignore this one… see 5)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
// TODO handle errors
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void accountAccessGranted(SingleSignOnAccount account) {
|
||||
Context l_context = getApplicationContext();
|
||||
SingleAccountHelper.setCurrentAccount(l_context, account.name);
|
||||
|
||||
accountAccessDone();
|
||||
}
|
||||
});
|
||||
} catch (AccountImportCancelledException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
AccountImporter.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
|
||||
}
|
||||
|
||||
private void accountAccessDone() {
|
||||
Context l_context = getApplicationContext();
|
||||
mApi = new ApiProvider(l_context);
|
||||
|
||||
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
finish();
|
||||
}
|
||||
}
|
@ -0,0 +1,296 @@
|
||||
/*
|
||||
* Nextcloud Maps Geofavorites for Android
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.activity.main;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.AppCompatImageButton;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.view.GravityCompat;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.nextcloud.android.sso.helper.SingleAccountHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.R;
|
||||
import it.danieleverducci.nextcloudmaps.activity.about.AboutActivity;
|
||||
import it.danieleverducci.nextcloudmaps.activity.login.LoginActivity;
|
||||
import it.danieleverducci.nextcloudmaps.activity.main.NavigationAdapter.NavigationItem;
|
||||
import it.danieleverducci.nextcloudmaps.activity.main.SortingOrderDialogFragment.OnSortingOrderListener;
|
||||
import it.danieleverducci.nextcloudmaps.api.ApiProvider;
|
||||
import it.danieleverducci.nextcloudmaps.model.Note;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static it.danieleverducci.nextcloudmaps.activity.main.NoteAdapter.*;
|
||||
import static it.danieleverducci.nextcloudmaps.activity.main.NoteAdapter.SORT_BY_CREATED;
|
||||
import static it.danieleverducci.nextcloudmaps.activity.main.NoteAdapter.SORT_BY_TITLE;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements MainView, OnSortingOrderListener {
|
||||
|
||||
private static final int INTENT_ADD = 100;
|
||||
private static final int INTENT_EDIT = 200;
|
||||
|
||||
public static final String NAVIGATION_KEY_ADD_NOTE = "add";
|
||||
public static final String NAVIGATION_KEY_SHOW_ABOUT = "about";
|
||||
public static final String NAVIGATION_KEY_SWITCH_ACCOUNT = "switch_account";
|
||||
|
||||
private SharedPreferences preferences;
|
||||
|
||||
private DrawerLayout drawerLayout;
|
||||
private Toolbar toolbar;
|
||||
private MaterialCardView homeToolbar;
|
||||
private SearchView searchView;
|
||||
private SwipeRefreshLayout swipeRefresh;
|
||||
private RecyclerView recyclerView;
|
||||
private StaggeredGridLayoutManager layoutManager;
|
||||
private FloatingActionButton fab;
|
||||
|
||||
private MainPresenter presenter;
|
||||
private NoteAdapter noteAdapter;
|
||||
private ItemClickListener itemClickListener;
|
||||
|
||||
NavigationAdapter navigationCommonAdapter;
|
||||
|
||||
private ApiProvider mApi;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
|
||||
int sortRule = preferences.getInt(getString(R.string.setting_sort_by), SORT_BY_CREATED);
|
||||
boolean gridViewEnabled = preferences.getBoolean(getString(R.string.setting_grid_view_enabled), true);
|
||||
|
||||
recyclerView = findViewById(R.id.recycler_view);
|
||||
layoutManager = new StaggeredGridLayoutManager(gridViewEnabled ? 2 : 1, StaggeredGridLayoutManager.VERTICAL);
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
|
||||
presenter = new MainPresenter(this);
|
||||
|
||||
itemClickListener = ((view, position) -> {
|
||||
Note note = noteAdapter.get(position);
|
||||
|
||||
/*Intent intent = new Intent(this, EditorActivity.class);
|
||||
intent.putExtra("note", note);
|
||||
|
||||
startActivityForResult(intent, INTENT_EDIT);*/
|
||||
});
|
||||
|
||||
noteAdapter = new NoteAdapter(getApplicationContext(), itemClickListener);
|
||||
recyclerView.setAdapter(noteAdapter);
|
||||
|
||||
noteAdapter.setSortRule(sortRule);
|
||||
|
||||
swipeRefresh = findViewById(R.id.swipe_refresh);
|
||||
swipeRefresh.setOnRefreshListener(() -> presenter.getNotes());
|
||||
|
||||
fab = findViewById(R.id.add);
|
||||
fab.setOnClickListener(view -> add_note());
|
||||
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
homeToolbar = findViewById(R.id.home_toolbar);
|
||||
|
||||
searchView = findViewById(R.id.search_view);
|
||||
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String query) {
|
||||
noteAdapter.getFilter().filter(query);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
searchView.setOnCloseListener(() -> {
|
||||
if (toolbar.getVisibility() == VISIBLE && TextUtils.isEmpty(searchView.getQuery())) {
|
||||
updateToolbars(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
setSupportActionBar(toolbar);
|
||||
setupNavigationMenu();
|
||||
|
||||
homeToolbar.setOnClickListener(view -> updateToolbars(false));
|
||||
|
||||
AppCompatImageView sortButton = findViewById(R.id.sort_mode);
|
||||
sortButton.setOnClickListener(view -> openSortingOrderDialogFragment(getSupportFragmentManager(), noteAdapter.getSortRule()));
|
||||
|
||||
drawerLayout = findViewById(R.id.drawerLayout);
|
||||
AppCompatImageButton menuButton = findViewById(R.id.menu_button);
|
||||
menuButton.setOnClickListener(view -> drawerLayout.openDrawer(GravityCompat.START));
|
||||
|
||||
AppCompatImageView viewButton = findViewById(R.id.view_mode);
|
||||
viewButton.setOnClickListener(view -> {
|
||||
boolean gridEnabled = layoutManager.getSpanCount() == 1;
|
||||
onGridIconChosen(gridEnabled);
|
||||
});
|
||||
|
||||
updateSortingIcon(sortRule);
|
||||
updateGridIcon(gridViewEnabled);
|
||||
|
||||
mApi = new ApiProvider(getApplicationContext());
|
||||
presenter.getNotes();
|
||||
}
|
||||
|
||||
private void setupNavigationMenu() {
|
||||
ArrayList<NavigationItem> navItems = new ArrayList<>();
|
||||
|
||||
navigationCommonAdapter = new NavigationAdapter(this, item -> {
|
||||
switch (item.id) {
|
||||
case NAVIGATION_KEY_ADD_NOTE:
|
||||
add_note();
|
||||
break;
|
||||
case NAVIGATION_KEY_SHOW_ABOUT:
|
||||
show_about();
|
||||
break;
|
||||
case NAVIGATION_KEY_SWITCH_ACCOUNT:
|
||||
switch_account();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
navItems.add(new NavigationItem(NAVIGATION_KEY_ADD_NOTE, getString(R.string.new_geobookmark), R.drawable.ic_add));
|
||||
navItems.add(new NavigationItem(NAVIGATION_KEY_SHOW_ABOUT, getString(R.string.about), R.drawable.ic_info_grey));
|
||||
navItems.add(new NavigationItem(NAVIGATION_KEY_SWITCH_ACCOUNT, getString(R.string.switch_account), R.drawable.ic_logout_grey));
|
||||
navigationCommonAdapter.setItems(navItems);
|
||||
|
||||
RecyclerView navigationMenuCommon = findViewById(R.id.navigationCommon);
|
||||
navigationMenuCommon.setAdapter(navigationCommonAdapter);
|
||||
}
|
||||
|
||||
private void updateToolbars(boolean disableSearch) {
|
||||
homeToolbar.setVisibility(disableSearch ? VISIBLE : GONE);
|
||||
toolbar.setVisibility(disableSearch ? GONE : VISIBLE);
|
||||
if (disableSearch) {
|
||||
searchView.setQuery(null, true);
|
||||
}
|
||||
searchView.setIconified(disableSearch);
|
||||
}
|
||||
|
||||
private void openSortingOrderDialogFragment(FragmentManager supportFragmentManager, int sortOrder) {
|
||||
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
|
||||
fragmentTransaction.addToBackStack(null);
|
||||
|
||||
SortingOrderDialogFragment.newInstance(sortOrder).show(fragmentTransaction, SortingOrderDialogFragment.SORTING_ORDER_FRAGMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == INTENT_ADD && resultCode == RESULT_OK) {
|
||||
presenter.getNotes();
|
||||
} else if (requestCode == INTENT_EDIT && resultCode == RESULT_OK) {
|
||||
presenter.getNotes();
|
||||
}
|
||||
}
|
||||
|
||||
private void add_note() {
|
||||
/*startActivityForResult(
|
||||
new Intent(this, EditorActivity.class), INTENT_ADD);
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
private void show_about() {
|
||||
startActivity(new Intent(this, AboutActivity.class));
|
||||
}
|
||||
|
||||
private void switch_account() {
|
||||
SingleAccountHelper.setCurrentAccount(this, null);
|
||||
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoading() {
|
||||
swipeRefresh.setRefreshing(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideLoading() {
|
||||
swipeRefresh.setRefreshing(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetResult(List<Note> note_list) {
|
||||
noteAdapter.setNoteList(note_list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onErrorLoading(String message) {
|
||||
Toast.makeText(MainActivity.this, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSortingOrderChosen(int sortSelection) {
|
||||
noteAdapter.setSortRule(sortSelection);
|
||||
updateSortingIcon(sortSelection);
|
||||
|
||||
preferences.edit().putInt(getString(R.string.setting_sort_by), sortSelection).apply();
|
||||
}
|
||||
|
||||
public void updateSortingIcon(int sortSelection) {
|
||||
AppCompatImageView sortButton = findViewById(R.id.sort_mode);
|
||||
switch (sortSelection) {
|
||||
case SORT_BY_TITLE:
|
||||
sortButton.setImageResource(R.drawable.ic_alphabetical_asc);
|
||||
break;
|
||||
case SORT_BY_CREATED:
|
||||
sortButton.setImageResource(R.drawable.ic_modification_asc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onGridIconChosen(boolean gridEnabled) {
|
||||
layoutManager.setSpanCount(gridEnabled ? 2 : 1);
|
||||
updateGridIcon(gridEnabled);
|
||||
|
||||
preferences.edit().putBoolean(getString(R.string.setting_grid_view_enabled), gridEnabled).apply();
|
||||
}
|
||||
|
||||
public void updateGridIcon(boolean gridEnabled) {
|
||||
AppCompatImageView viewButton = findViewById(R.id.view_mode);
|
||||
viewButton.setImageResource(gridEnabled ? R.drawable.ic_view_list : R.drawable.ic_view_module);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.activity.main;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.api.ApiProvider;
|
||||
import it.danieleverducci.nextcloudmaps.model.Note;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class MainPresenter {
|
||||
private MainView view;
|
||||
|
||||
public MainPresenter(MainView view) {
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
public void getNotes() {
|
||||
view.showLoading();
|
||||
Call<List<Note>> call = ApiProvider.getAPI().getNotes();
|
||||
call.enqueue(new Callback<List<Note>>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<Note>> call, @NonNull Response<List<Note>> response) {
|
||||
((AppCompatActivity) view).runOnUiThread(() -> {
|
||||
view.hideLoading();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
view.onGetResult(response.body());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<List<Note>> call, @NonNull Throwable t) {
|
||||
((AppCompatActivity) view).runOnUiThread(() -> {
|
||||
view.hideLoading();
|
||||
view.onErrorLoading(t.getLocalizedMessage());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.activity.main;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.model.Note;
|
||||
|
||||
public interface MainView {
|
||||
void showLoading();
|
||||
void hideLoading();
|
||||
void onGetResult(List<Note> notes);
|
||||
void onErrorLoading(String message);
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.activity.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.R;
|
||||
|
||||
public class NavigationAdapter extends RecyclerView.Adapter<NavigationAdapter.ViewHolder> {
|
||||
|
||||
@NonNull
|
||||
private final Context context;
|
||||
|
||||
public static class NavigationItem {
|
||||
@NonNull
|
||||
public String id;
|
||||
@NonNull
|
||||
public String label;
|
||||
@DrawableRes
|
||||
public int icon;
|
||||
|
||||
public NavigationItem(@NonNull String id, @NonNull String label, @DrawableRes int icon) {
|
||||
this.id = id;
|
||||
this.label = label;
|
||||
this.icon = icon;
|
||||
}
|
||||
}
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder {
|
||||
@NonNull
|
||||
private final View view;
|
||||
|
||||
@NonNull
|
||||
private final TextView name;
|
||||
@NonNull
|
||||
private final ImageView icon;
|
||||
|
||||
private NavigationItem currentItem;
|
||||
|
||||
ViewHolder(@NonNull View itemView, @NonNull final ClickListener clickListener) {
|
||||
super(itemView);
|
||||
view = itemView;
|
||||
|
||||
this.name = itemView.findViewById(R.id.navigationItemLabel);
|
||||
this.icon = itemView.findViewById(R.id.navigationItemIcon);
|
||||
|
||||
icon.setOnClickListener(view -> clickListener.onItemClick(currentItem));
|
||||
itemView.setOnClickListener(view -> clickListener.onItemClick(currentItem));
|
||||
}
|
||||
|
||||
private void bind(@NonNull NavigationItem item) {
|
||||
int color = view.getResources().getColor(R.color.accent);
|
||||
|
||||
currentItem = item;
|
||||
name.setText(item.label);
|
||||
|
||||
name.setTextColor(color);
|
||||
|
||||
icon.setImageDrawable(DrawableCompat.wrap(icon.getResources().getDrawable(item.icon)));
|
||||
icon.setColorFilter(color);
|
||||
icon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public interface ClickListener {
|
||||
void onItemClick(NavigationItem item);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private List<NavigationItem> items = new ArrayList<>();
|
||||
private String selectedItem = null;
|
||||
@NonNull
|
||||
private final ClickListener clickListener;
|
||||
|
||||
public NavigationAdapter(@NonNull Context context, @NonNull ClickListener clickListener) {
|
||||
this.context = context;
|
||||
this.clickListener = clickListener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_navigation, parent, false);
|
||||
return new ViewHolder(v, clickListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.bind(items.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public void setItems(@NonNull List<NavigationItem> items) {
|
||||
this.items = items;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,180 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.activity.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.R;
|
||||
import it.danieleverducci.nextcloudmaps.model.Note;
|
||||
|
||||
public class NoteAdapter extends RecyclerView.Adapter<NoteAdapter.RecyclerViewAdapter> implements Filterable {
|
||||
|
||||
public static final int SORT_BY_TITLE = 0;
|
||||
public static final int SORT_BY_CREATED = 1;
|
||||
|
||||
private Context context;
|
||||
private ItemClickListener itemClickListener;
|
||||
|
||||
private List<Note> noteList = new ArrayList<>();
|
||||
private List<Note> noteListFiltered = new ArrayList<>();
|
||||
private int sortRule = SORT_BY_CREATED;
|
||||
|
||||
public NoteAdapter(Context context, ItemClickListener itemClickListener) {
|
||||
this.context = context;
|
||||
this.itemClickListener = itemClickListener;
|
||||
}
|
||||
|
||||
public void setNoteList(@NonNull List<Note> noteList) {
|
||||
this.noteList = noteList;
|
||||
this.noteListFiltered = new ArrayList<>(noteList);
|
||||
|
||||
performSort();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public Note get(int position) {
|
||||
return noteListFiltered.get(position);
|
||||
}
|
||||
|
||||
public int getSortRule() {
|
||||
return sortRule;
|
||||
}
|
||||
|
||||
public void setSortRule(int sortRule) {
|
||||
this.sortRule = sortRule;
|
||||
|
||||
performSort();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerViewAdapter onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_note, parent, false);
|
||||
return new RecyclerViewAdapter(view, itemClickListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerViewAdapter holder, int position) {
|
||||
Note note = noteListFiltered.get(position);
|
||||
|
||||
holder.tv_title.setText(Html.fromHtml(note.getTitle().trim()));
|
||||
holder.tv_content.setText(note.getContent().trim());
|
||||
holder.card_item.setCardBackgroundColor(context.getResources().getColor(R.color.defaultNoteColor));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return noteListFiltered.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filter getFilter() {
|
||||
return filter;
|
||||
}
|
||||
|
||||
Filter filter = new Filter() {
|
||||
@Override
|
||||
// Run on Background thread.
|
||||
protected FilterResults performFiltering(CharSequence charSequence) {
|
||||
FilterResults filterResults = new FilterResults();
|
||||
List <Note> filteredNotes = new ArrayList<>();
|
||||
|
||||
if (charSequence.toString().isEmpty()) {
|
||||
filteredNotes.addAll(noteList);
|
||||
} else {
|
||||
for (Note note: noteList) {
|
||||
String query = charSequence.toString().toLowerCase();
|
||||
if (note.getTitle().toLowerCase().contains(query)) {
|
||||
filteredNotes.add(note);
|
||||
} else if (note.getContent().toLowerCase().contains(query)) {
|
||||
filteredNotes.add(note);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
filterResults.values = filteredNotes;
|
||||
return filterResults;
|
||||
}
|
||||
//Run on ui thread
|
||||
@Override
|
||||
protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
|
||||
noteListFiltered.clear();
|
||||
noteListFiltered.addAll((Collection<? extends Note>) filterResults.values);
|
||||
|
||||
performSort();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
|
||||
class RecyclerViewAdapter extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
CardView card_item;
|
||||
TextView tv_title, tv_content;
|
||||
|
||||
ItemClickListener itemClickListener;
|
||||
|
||||
RecyclerViewAdapter(@NonNull View itemView, ItemClickListener itemClickListener) {
|
||||
super(itemView);
|
||||
|
||||
card_item = itemView.findViewById(R.id.card_item);
|
||||
tv_title = itemView.findViewById(R.id.title);
|
||||
tv_content = itemView.findViewById(R.id.content);
|
||||
|
||||
this.itemClickListener = itemClickListener;
|
||||
card_item.setOnClickListener(this);
|
||||
|
||||
tv_content.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
itemClickListener.onItemClick(view, getAdapterPosition());
|
||||
}
|
||||
}
|
||||
|
||||
private void performSort() {
|
||||
if (sortRule == SORT_BY_TITLE) {
|
||||
Collections.sort(noteListFiltered, Note.ByTitleAZ);
|
||||
} else if (sortRule == SORT_BY_CREATED) {
|
||||
Collections.sort(noteListFiltered, Note.ByLastCreated);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ItemClickListener {
|
||||
void onItemClick(View view, int position);
|
||||
}
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.activity.main;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.R;
|
||||
|
||||
/**
|
||||
* Dialog to show and choose the sorting order for the file listing.
|
||||
*/
|
||||
public class SortingOrderDialogFragment extends DialogFragment {
|
||||
|
||||
private final static String TAG = SortingOrderDialogFragment.class.getSimpleName();
|
||||
|
||||
public static final String SORTING_ORDER_FRAGMENT = "SORTING_ORDER_FRAGMENT";
|
||||
private static final String KEY_SORT_ORDER = "SORT_ORDER";
|
||||
|
||||
private View mView;
|
||||
private View[] mTaggedViews;
|
||||
private Button mCancel;
|
||||
|
||||
private int mCurrentSortOrder;
|
||||
|
||||
public static SortingOrderDialogFragment newInstance(int sortOrder) {
|
||||
SortingOrderDialogFragment dialogFragment = new SortingOrderDialogFragment();
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putInt(KEY_SORT_ORDER, sortOrder);
|
||||
dialogFragment.setArguments(args);
|
||||
|
||||
return dialogFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// keep the state of the fragment on configuration changes
|
||||
setRetainInstance(true);
|
||||
|
||||
mView = null;
|
||||
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments == null) {
|
||||
throw new IllegalArgumentException("Arguments may not be null");
|
||||
}
|
||||
mCurrentSortOrder = arguments.getInt(KEY_SORT_ORDER, NoteAdapter.SORT_BY_TITLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
mView = inflater.inflate(R.layout.sorting_order_fragment, container, false);
|
||||
|
||||
setupDialogElements(mView);
|
||||
setupListeners();
|
||||
|
||||
return mView;
|
||||
}
|
||||
|
||||
/**
|
||||
* find all relevant UI elements and set their values.
|
||||
*
|
||||
* @param view the parent view
|
||||
*/
|
||||
private void setupDialogElements(View view) {
|
||||
mCancel = view.findViewById(R.id.cancel);
|
||||
|
||||
mTaggedViews = new View[4];
|
||||
mTaggedViews[0] = view.findViewById(R.id.sortByTitleAscending);
|
||||
mTaggedViews[0].setTag(NoteAdapter.SORT_BY_TITLE);
|
||||
mTaggedViews[1] = view.findViewById(R.id.sortByTitleAscendingText);
|
||||
mTaggedViews[1].setTag(NoteAdapter.SORT_BY_TITLE);
|
||||
mTaggedViews[2] = view.findViewById(R.id.sortByCreationDateDescending);
|
||||
mTaggedViews[2].setTag(NoteAdapter.SORT_BY_CREATED);
|
||||
mTaggedViews[3] = view.findViewById(R.id.sortByCreationDateDescendingText);
|
||||
mTaggedViews[3].setTag(NoteAdapter.SORT_BY_CREATED);
|
||||
|
||||
setupActiveOrderSelection();
|
||||
}
|
||||
|
||||
/**
|
||||
* tints the icon reflecting the actual sorting choice in the apps primary color.
|
||||
*/
|
||||
private void setupActiveOrderSelection() {
|
||||
for (View view: mTaggedViews) {
|
||||
if (mCurrentSortOrder != (int) view.getTag()) {
|
||||
continue;
|
||||
}
|
||||
if (view instanceof ImageButton) {
|
||||
Drawable normalDrawable = ((ImageButton) view).getDrawable();
|
||||
Drawable wrapDrawable = DrawableCompat.wrap(normalDrawable);
|
||||
DrawableCompat.setTint(wrapDrawable, this.getResources().getColor(R.color.defaultNoteTint));
|
||||
}
|
||||
if (view instanceof TextView) {
|
||||
((TextView)view).setTextColor(this.getResources().getColor(R.color.defaultNoteTint));
|
||||
((TextView)view).setTypeface(Typeface.DEFAULT_BOLD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setup all listeners.
|
||||
*/
|
||||
private void setupListeners() {
|
||||
mCancel.setOnClickListener(view -> dismiss());
|
||||
|
||||
OnSortOrderClickListener sortOrderClickListener = new OnSortOrderClickListener();
|
||||
|
||||
for (View view : mTaggedViews) {
|
||||
view.setOnClickListener(sortOrderClickListener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return super.onCreateDialog(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (getDialog() != null && getRetainInstance()) {
|
||||
getDialog().setDismissMessage(null);
|
||||
}
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
private class OnSortOrderClickListener implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismissAllowingStateLoss();
|
||||
((SortingOrderDialogFragment.OnSortingOrderListener) getActivity())
|
||||
.onSortingOrderChosen((int) v.getTag());
|
||||
}
|
||||
}
|
||||
|
||||
public interface OnSortingOrderListener {
|
||||
void onSortingOrderChosen(int sortSelection);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.model.Note;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.DELETE;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Path;
|
||||
|
||||
public interface API {
|
||||
String mApiEndpoint = "/index.php/apps/notestutorial/api/0.1";
|
||||
|
||||
@GET("/notes")
|
||||
Call<List<Note>> getNotes();
|
||||
|
||||
@POST("/notes")
|
||||
Call<Note> create(
|
||||
@Body Note note
|
||||
);
|
||||
|
||||
@PUT("/notes/{id}")
|
||||
Call<Note> updateNote(
|
||||
@Path("id") int id,
|
||||
@Body Note note
|
||||
);
|
||||
|
||||
@DELETE("/notes/{id}")
|
||||
Call<Note> deleteNote(
|
||||
@Path("id") int id
|
||||
);
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.api;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.nextcloud.android.sso.api.NextcloudAPI;
|
||||
import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException;
|
||||
import com.nextcloud.android.sso.exceptions.NoCurrentAccountSelectedException;
|
||||
import com.nextcloud.android.sso.helper.SingleAccountHelper;
|
||||
import com.nextcloud.android.sso.model.SingleSignOnAccount;
|
||||
|
||||
import retrofit2.NextcloudRetrofitApiBuilder;
|
||||
|
||||
public class ApiProvider {
|
||||
private final String TAG = ApiProvider.class.getCanonicalName();
|
||||
|
||||
@NonNull
|
||||
protected Context context;
|
||||
protected static API mApi;
|
||||
|
||||
protected static String ssoAccountName;
|
||||
|
||||
public ApiProvider(Context context) {
|
||||
this.context = context;
|
||||
initSsoApi(new NextcloudAPI.ApiConnectedListener() {
|
||||
@Override
|
||||
public void onConnected() {
|
||||
// Ignore..
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
// Ignore...
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void initSsoApi(final NextcloudAPI.ApiConnectedListener callback) {
|
||||
try {
|
||||
SingleSignOnAccount ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(context);
|
||||
NextcloudAPI nextcloudAPI = new NextcloudAPI(context, ssoAccount, new GsonBuilder().create(), callback);
|
||||
|
||||
ssoAccountName = ssoAccount.name;
|
||||
mApi = new NextcloudRetrofitApiBuilder(nextcloudAPI, API.mApiEndpoint).create(API.class);
|
||||
} catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) {
|
||||
Log.d(TAG, "setAccout() called with: ex = [" + e + "]");
|
||||
}
|
||||
}
|
||||
|
||||
public static API getAPI() {
|
||||
return mApi;
|
||||
}
|
||||
|
||||
public static String getAccountName() {
|
||||
return ssoAccountName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Comparator;
|
||||
|
||||
public class Note implements Serializable {
|
||||
@Expose
|
||||
@SerializedName("id") private int id;
|
||||
|
||||
@Expose
|
||||
@SerializedName("title") private String title;
|
||||
|
||||
@Expose
|
||||
@SerializedName("content") private String content;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public static Comparator<Note> ByTitleAZ = (note, t1) -> note.title.compareTo(t1.title);
|
||||
|
||||
public static Comparator<Note> ByLastCreated = (note, t1) -> t1.id - note.id;
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Nextcloud Notes Tutorial for Android
|
||||
*
|
||||
* @copyright Copyright (c) 2020 John Doe <john@doe.com>
|
||||
* @author John Doe <john@doe.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package it.danieleverducci.nextcloudmaps.util;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
public class ColorUtil {
|
||||
|
||||
public static void menuItemTintColor(MenuItem item, @ColorInt int color) {
|
||||
Drawable normalDrawable = item.getIcon();
|
||||
Drawable wrapDrawable = DrawableCompat.wrap(normalDrawable);
|
||||
DrawableCompat.setTint(wrapDrawable, color);
|
||||
item.setIcon(wrapDrawable);
|
||||
}
|
||||
|
||||
}
|
27
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="m6,2c-2.216,0 -4,1.784 -4,4v20c0,2.216 1.784,4 4,4h20c2.216,0 4,-1.784 4,-4v-16.719l-0.906,0.9068 -5.282,-5.2818 2.907,-2.9062h-20.719zM21.812,6.9062l5.282,5.2818 -8.313,8.312 -8.781,3.5 3.5,-8.781 8.312,-8.3128zM14.406,16.094l-2.656,4.406 1.75,1.75 4.406,-2.656 -3.5,-3.5z"
|
||||
android:fillColor="#FFF"/>
|
||||
</vector>
|
26
app/src/main/res/drawable/ic_add.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24"
|
||||
android:width="24dp"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white"
|
||||
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
|
||||
</vector>
|
23
app/src/main/res/drawable/ic_alphabetical_asc.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#757575" android:pathData="M20.401,13.623L18.877,13.621L18.868,20.218L17.228,18.57L16.145,19.651L19.627,23.145L23.12,19.663L22.039,18.58L20.392,20.219L20.401,13.623ZM15.034,12.122L15.034,13.376L10.691,19.609L10.691,19.684L15.1,19.684L15.1,21.481L7.847,21.481L7.847,20.302L12.292,13.967L12.292,13.91L8.268,13.91L8.268,12.122L15.034,12.122ZM13.051,1.85L15.981,11.208L13.678,11.208L12.949,8.68L10.244,8.68L9.571,11.208L7.352,11.208L10.244,1.85L13.051,1.85ZM12.64,7.165L12.05,5.182L11.807,4.273L11.573,3.374L11.545,3.374L11.339,4.283L11.114,5.2L10.553,7.165L12.64,7.165Z" />
|
||||
</vector>
|
5
app/src/main/res/drawable/ic_app.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
|
||||
</vector>
|
27
app/src/main/res/drawable/ic_back_grey.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:autoMirrored="true"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path android:fillColor="#FF757575"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
27
app/src/main/res/drawable/ic_delete_grey.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#FF757575"
|
||||
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
|
||||
</vector>
|
27
app/src/main/res/drawable/ic_info_grey.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0"
|
||||
android:tint="#757575">
|
||||
<path android:fillColor="#FF757575"
|
||||
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
|
||||
</vector>
|
74
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
14
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<group android:scaleX="1.5525"
|
||||
android:scaleY="1.5525"
|
||||
android:translateX="29.16"
|
||||
android:translateY="29.16">
|
||||
<path
|
||||
android:pathData="m6,2c-2.216,0 -4,1.784 -4,4v20c0,2.216 1.784,4 4,4h20c2.216,0 4,-1.784 4,-4v-16.719l-0.906,0.9068 -5.282,-5.2818 2.907,-2.9062h-20.719zM21.812,6.9062l5.282,5.2818 -8.313,8.312 -8.781,3.5 3.5,-8.781 8.312,-8.3128zM14.406,16.094l-2.656,4.406 1.75,1.75 4.406,-2.656 -3.5,-3.5z"
|
||||
android:fillColor="#FFF"/>
|
||||
</group>
|
||||
</vector>
|
31
app/src/main/res/drawable/ic_logout_grey.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportHeight="16"
|
||||
android:viewportWidth="16"
|
||||
android:tint="#757575">
|
||||
<path android:fillColor="#00000000"
|
||||
android:pathData="m10.75,3.9862a5.5,5.5 0,0 1,2.563 6.1868,5.5 5.5,0 0,1 -5.3131,4.077 5.5,5.5 0,0 1,-5.3127 -4.077,5.5 5.5,0 0,1 2.5627,-6.1867"
|
||||
android:strokeColor="#000" android:strokeLineCap="round" android:strokeWidth="2"/>
|
||||
<path android:fillColor="#00000000"
|
||||
android:pathData="m8,1.7637v5.972" android:strokeColor="#000"
|
||||
android:strokeLineCap="round" android:strokeWidth="2"/>
|
||||
</vector>
|
28
app/src/main/res/drawable/ic_menu_grey.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24"
|
||||
android:tint="#757575">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
|
||||
</vector>
|
23
app/src/main/res/drawable/ic_modification_asc.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#757575" android:pathData="M17.611,20.838L17.611,22.69L14.635,22.69L14.635,20.838L17.611,20.838ZM11.59,2.133C16.177,2.138 20.131,5.479 20.902,10L18.979,10C18.232,6.53 15.139,4.029 11.59,4.025C7.44,4.026 4.026,7.44 4.025,11.59C4.025,15.74 7.44,19.156 11.59,19.156C12.068,19.155 12.546,19.109 13.016,19.018L13.016,20.922C12.544,21 12.068,21.043 11.59,21.049C6.36,21.049 2.133,16.791 2.133,11.59C2.133,6.402 6.402,2.133 11.59,2.133ZM20.587,16.208L20.587,18.06L14.635,18.06L14.635,16.208L20.587,16.208ZM12.062,6.863L12.062,11.826L13.016,12.393L13.016,13.957L10.645,12.535L10.645,6.863L12.062,6.863ZM23.563,11.577L23.563,13.429L14.635,13.429L14.635,11.577L23.563,11.577Z" />
|
||||
</vector>
|
27
app/src/main/res/drawable/ic_save_grey.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:fillColor="#FF757575"
|
||||
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
</vector>
|
27
app/src/main/res/drawable/ic_time_grey.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="#757575">
|
||||
<path android:fillColor="#FF757575"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
|
||||
</vector>
|
23
app/src/main/res/drawable/ic_view_list.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M9,5V9H21V5M9,19H21V15H9M9,14H21V10H9M4,9H8V5H4M4,19H8V15H4M4,14H8V10H4V14Z" />
|
||||
</vector>
|
25
app/src/main/res/drawable/ic_view_module.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#FFFFFF"
|
||||
android:pathData="M16,5V11H21V5M10,11H15V5H10M16,18H21V12H16M10,18H15V12H10M4,18H9V12H4M4,11H9V5H4V11Z" />
|
||||
</vector>
|
122
app/src/main/res/layout/activity_about.xml
Normal file
@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/primary"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:contentInsetStartWithNavigation="0dp"
|
||||
app:navigationIcon="@drawable/ic_back_grey"
|
||||
app:titleMarginStart="0dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/spacer_2x">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:text="@string/app_name"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textSize="26sp"
|
||||
app:drawableTopCompat="@mipmap/ic_launcher"/>
|
||||
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about_version_title"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about_version"
|
||||
style="?android:attr/editTextPreferenceStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="@string/about_version"/>
|
||||
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about_app_license_title"/>
|
||||
|
||||
<TextView
|
||||
style="?android:attr/editTextPreferenceStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="@string/about_app_license" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/about_app_license_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about_app_license_button"
|
||||
app:backgroundTint="@color/defaultBrand"
|
||||
style="@style/Widget.AppCompat.Button.Colored"/>
|
||||
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about_source_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about_source"
|
||||
style="?android:attr/editTextPreferenceStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="@string/about_source" />
|
||||
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about_issues_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about_issues"
|
||||
style="?android:attr/editTextPreferenceStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="@string/about_issues" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
</ScrollView>
|
166
app/src/main/res/layout/activity_list_view.xml
Normal file
@ -0,0 +1,166 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/activity_list_view"
|
||||
android:background="@color/primary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:elevation="0dp">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/toolbar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:toolbarId="@+id/toolbar" >
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible"
|
||||
app:contentInsetStartWithNavigation="0dp"
|
||||
app:titleMarginStart="0dp"
|
||||
tools:title="@string/app_name">
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</androidx.appcompat.widget.SearchView>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/home_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacer_2x"
|
||||
android:layout_marginTop="@dimen/spacer_1hx"
|
||||
android:layout_marginEnd="@dimen/spacer_2x"
|
||||
android:layout_marginBottom="@dimen/spacer_1hx"
|
||||
app:cardBackgroundColor="@color/appbar"
|
||||
app:cardCornerRadius="@dimen/spacer_1x"
|
||||
app:cardElevation="2dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/menu_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:paddingStart="@dimen/spacer_1x"
|
||||
android:paddingTop="@dimen/spacer_2x"
|
||||
android:paddingEnd="@dimen/spacer_1x"
|
||||
android:paddingBottom="@dimen/spacer_2x"
|
||||
android:tint="?attr/colorAccent"
|
||||
android:src="@drawable/ic_menu_grey"/>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/search_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/spacer_1x"
|
||||
android:layout_marginEnd="@dimen/spacer_1x"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start"
|
||||
android:lines="1"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/search_in_all"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/sort_mode"
|
||||
android:layout_width="?attr/actionBarSize"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/list_mode"
|
||||
android:padding="@dimen/spacer_2x"
|
||||
android:tint="?attr/colorAccent"
|
||||
android:translationX="@dimen/spacer_1x"
|
||||
android:src="@drawable/ic_alphabetical_asc" />
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/view_mode"
|
||||
android:layout_width="?attr/actionBarSize"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/list_mode"
|
||||
android:padding="@dimen/spacer_2x"
|
||||
android:tint="?attr/colorAccent"
|
||||
android:translationX="@dimen/spacer_1x"
|
||||
android:src="@drawable/ic_view_module" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/spacer_1hx"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/item_note">
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/add"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_add"
|
||||
app:backgroundTint="@color/defaultBrand"/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
76
app/src/main/res/layout/activity_login.xml
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/spacer_2x"
|
||||
android:theme="@style/SplashTheme"
|
||||
tools:context="it.danieleverducci.nextcloudmaps.activity.login.LoginActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_above="@+id/text_logo"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:src="@drawable/ic_app"
|
||||
app:tint="@color/defaultBrand"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_logo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/welcome"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginBottom="48dp"
|
||||
android:textSize="24sp"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="@color/accent"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/chose_button"
|
||||
style="@style/Widget.AppCompat.Button.Colored"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/text_logo"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingEnd="32dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:text="@string/choose_account"
|
||||
app:backgroundTint="@color/defaultBrand" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="35dp"
|
||||
android:layout_below="@id/chose_button"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:visibility="gone"
|
||||
android:progressTint="@color/defaultBrand"/>
|
||||
|
||||
</RelativeLayout>
|
95
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:openDrawer="start"
|
||||
tools:context=".activity.main.MainActivity">
|
||||
|
||||
<include layout="@layout/activity_list_view"
|
||||
android:id="@+id/activity_list_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<!-- TODO: Is use another layout for that is fill screen. -->
|
||||
<com.google.android.material.navigation.NavigationView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorPrimary">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/header_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/drawer_header_height"
|
||||
android:background="@color/defaultBrand">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/logo"
|
||||
android:layout_width="@dimen/drawer_header_logo_size"
|
||||
android:layout_height="@dimen/drawer_header_logo_size"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="@dimen/spacer_2x"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_app" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@id/logo"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="24sp"
|
||||
android:layout_toRightOf="@id/logo" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/navigationCommon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/spacer_1x"
|
||||
android:paddingBottom="@dimen/spacer_1x"
|
||||
app:layoutManager="LinearLayoutManager"
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/item_navigation" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</com.google.android.material.navigation.NavigationView>
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
49
app/src/main/res/layout/item_navigation.xml
Normal file
@ -0,0 +1,49 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="@dimen/spacer_1x"
|
||||
android:paddingEnd="@dimen/spacer_2x"
|
||||
android:paddingLeft="@dimen/spacer_1x"
|
||||
android:paddingRight="@dimen/spacer_2x">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/navigationItemIcon"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:contentDescription="@null"
|
||||
android:focusable="false"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_time_grey"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/navigationItemLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacer_1x"
|
||||
android:layout_marginLeft="@dimen/spacer_1x"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
tools:text="@tools:sample/lorem/random"/>
|
||||
|
||||
</LinearLayout>
|
70
app/src/main/res/layout/item_note.xml
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/card_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="1dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
tools:backgroundTint="@color/defaultNoteColor">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textSize="@dimen/note_font_size_item_title"
|
||||
android:textColor="@color/note_font_color_default"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="@tools:sample/lorem/random">
|
||||
</TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="@dimen/note_font_size_item_content"
|
||||
android:textColor="@color/note_font_color_default"
|
||||
tools:text="@tools:sample/lorem/random">
|
||||
</TextView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
22
app/src/main/res/layout/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
BIN
app/src/main/res/layout/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/layout/mipmap-hdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/layout/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
app/src/main/res/layout/mipmap-mdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/layout/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
app/src/main/res/layout/mipmap-xhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/layout/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
app/src/main/res/layout/mipmap-xxhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/layout/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/layout/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
After Width: | Height: | Size: 18 KiB |
132
app/src/main/res/layout/sorting_order_fragment.xml
Normal file
@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<LinearLayout
|
||||
android:id="@+id/root"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="300dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/header"
|
||||
style="@style/Base.DialogWindowTitle.AppCompat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/standard_margin"
|
||||
android:text="@string/sort_by"/>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scrollableSortings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/standard_half_margin">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sortByTitleAscending"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/transparent"
|
||||
android:paddingStart="@dimen/standard_padding"
|
||||
android:paddingTop="@dimen/standard_half_padding"
|
||||
android:paddingEnd="@dimen/standard_half_padding"
|
||||
android:paddingBottom="@dimen/standard_half_padding"
|
||||
android:contentDescription="@string/menu_item_sort_by_title_a_z"
|
||||
android:src="@drawable/ic_alphabetical_asc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sortByTitleAscendingText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="middle"
|
||||
android:paddingStart="@dimen/zero"
|
||||
android:paddingTop="@dimen/standard_half_padding"
|
||||
android:paddingEnd="@dimen/standard_half_padding"
|
||||
android:paddingBottom="@dimen/standard_half_padding"
|
||||
android:singleLine="true"
|
||||
android:text="@string/menu_item_sort_by_title_a_z"
|
||||
android:textSize="@dimen/two_line_primary_text_size"/>
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/standard_half_margin">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sortByCreationDateDescending"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/transparent"
|
||||
android:paddingStart="@dimen/standard_padding"
|
||||
android:paddingTop="@dimen/standard_half_padding"
|
||||
android:paddingEnd="@dimen/standard_half_padding"
|
||||
android:paddingBottom="@dimen/standard_half_padding"
|
||||
android:contentDescription="@string/menu_item_sort_by_date_newest_first"
|
||||
android:src="@drawable/ic_modification_asc"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sortByCreationDateDescendingText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="middle"
|
||||
android:paddingStart="@dimen/zero"
|
||||
android:paddingTop="@dimen/standard_half_padding"
|
||||
android:paddingEnd="@dimen/standard_half_padding"
|
||||
android:paddingBottom="@dimen/standard_half_padding"
|
||||
android:singleLine="true"
|
||||
android:text="@string/menu_item_sort_by_date_newest_first"
|
||||
android:textSize="@dimen/two_line_primary_text_size" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end">
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/common_cancel"
|
||||
android:layout_marginTop="@dimen/standard_half_margin"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 12 KiB |
26
app/src/main/res/values-v23/styles.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="BaseTheme">
|
||||
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
28
app/src/main/res/values-v27/styles.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="BaseTheme">
|
||||
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="android:navigationBarColor">?attr/colorPrimary</item>
|
||||
<item name="android:windowLightNavigationBar">true</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
36
app/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Colors -->
|
||||
|
||||
<color name="primary">#ffffff</color>
|
||||
<color name="accent">#121212</color>
|
||||
<color name="transparent">#00000000</color>
|
||||
|
||||
<color name="defaultBrand">#0082C9</color>
|
||||
|
||||
<color name="note_font_color_default">#202124</color>
|
||||
|
||||
<color name="appbar">@android:color/white</color>
|
||||
|
||||
<color name="defaultNoteColor">#F7EB96</color>
|
||||
<color name="defaultNoteTint">#202124</color>
|
||||
<color name="defaultNoteHintTint">#1A202124</color>
|
||||
|
||||
</resources>
|
41
app/src/main/res/values/dimens.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="spacer_1hx">4dp</dimen>
|
||||
<dimen name="spacer_1x">8dp</dimen>
|
||||
<dimen name="spacer_2x">16dp</dimen>
|
||||
|
||||
<!-- Drawer header -->
|
||||
<dimen name="drawer_header_height">100dp</dimen>
|
||||
<dimen name="drawer_header_logo_size">42dp</dimen>
|
||||
|
||||
<!-- Font Sizes -->
|
||||
<dimen name="note_font_size_item_title">18sp</dimen>
|
||||
<dimen name="note_font_size_item_content">14sp</dimen>
|
||||
|
||||
<dimen name="zero">0dp</dimen>
|
||||
<dimen name="standard_margin">16dp</dimen>
|
||||
<dimen name="standard_half_margin">8dp</dimen>
|
||||
<dimen name="standard_padding">16dp</dimen>
|
||||
<dimen name="standard_half_padding">8dp</dimen>
|
||||
<dimen name="two_line_primary_text_size">16sp</dimen>
|
||||
|
||||
</resources>
|
21
app/src/main/res/values/ic_launcher_background.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#0082C9</color>
|
||||
</resources>
|
63
app/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,63 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- App strings -->
|
||||
<string name="app_name">Nextcloud Maps Geobookmarks</string>
|
||||
<string name="welcome">Welcome to Nextcloud Maps Geobookmarks</string>
|
||||
|
||||
<!-- Login Activity -->
|
||||
<string name="choose_account">Choose account</string>
|
||||
|
||||
<!-- Geobookmarks list -->
|
||||
<string name="new_geobookmark">New geobookmark</string>
|
||||
<string name="about">About</string>
|
||||
<string name="switch_account">Switch account</string>
|
||||
<string name="list_mode">List</string>
|
||||
<string name="search_in_all">Search by name</string>
|
||||
|
||||
<!-- Sort dialog -->
|
||||
<string name="sort_by">Sort by</string>
|
||||
<string name="menu_item_sort_by_title_a_z">A - Z</string>
|
||||
<string name="menu_item_sort_by_date_newest_first">Newest first</string>
|
||||
<string name="menu_item_sort_by_distance">Distance</string>
|
||||
|
||||
<!-- About -->
|
||||
<string name="about_version_title">Version</string>
|
||||
<string name="about_version">You are currently using <strong>%1$s</strong></string>
|
||||
<string name="about_source_title">Source code</string>
|
||||
<string name="about_source">This project is hosted on GitHub: <a href="%1$s">%1$s</a></string>
|
||||
<string name="about_issues_title">Issues</string>
|
||||
<string name="about_issues">You can report bugs, enhancement proposals and feature requests at the GitHub issue tracker: <a href="%1$s">%1$s</a></string>
|
||||
<string name="about_app_license_title">App license</string>
|
||||
<string name="about_app_license">This application is licensed under the GNU GENERAL PUBLIC LICENSE v3+.</string>
|
||||
<string name="about_app_license_button">View license</string>
|
||||
|
||||
<!-- Common strings -->
|
||||
<string name="common_yes">Yes</string>
|
||||
<string name="common_cancel">Cancel</string>
|
||||
|
||||
<!-- URLs -->
|
||||
<string name="url_source" translatable="false">https://github.com/penguin86/nextcloud-maps-client</string>
|
||||
<string name="url_issues" translatable="false">https://github.com/penguin86/nextcloud-maps-client/issues/new/choose</string>
|
||||
<string name="url_license" translatable="false">https://raw.githubusercontent.com/penguin86/nextcloud-maps-client/master/LICENSE</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="setting_sort_by">SETTING_SORT_BY</string>
|
||||
<string name="setting_grid_view_enabled">SETTING_GRID_VIEW_ENABLED</string>
|
||||
|
||||
</resources>
|
51
app/src/main/res/values/styles.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<!--
|
||||
~ Nextcloud Maps Geofavorites for Android
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="BaseTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">@color/primary</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="android:actionModeBackground">?attr/colorPrimary</item>
|
||||
<item name="colorControlNormal">?attr/colorAccent</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="toolbarStyle">@style/toolbarStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme" parent="BaseTheme"/>
|
||||
|
||||
<style name="EditorTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@android:color/transparent</item>
|
||||
<item name="colorPrimaryDark">@color/accent</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
</style>
|
||||
|
||||
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
</style>
|
||||
|
||||
<style name="toolbarStyle" parent="@style/Widget.AppCompat.Toolbar">
|
||||
<item name="android:background">?attr/colorPrimary</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
BIN
app/src/main/web_hi_res_512.png
Normal file
After Width: | Height: | Size: 15 KiB |