mirror of
https://github.com/etesync/android
synced 2025-02-22 20:42:04 +00:00
Account management: Create address book (similar to create calendar)
This commit is contained in:
parent
753c4b05a5
commit
f73f6ca43c
@ -131,9 +131,9 @@
|
||||
</activity>
|
||||
<activity android:name=".ui.AccountSettingsActivity"/>
|
||||
<activity android:name=".ui.CreateAddressBookActivity"
|
||||
android:label="@string/create_address_book_title"/>
|
||||
android:label="@string/create_addressbook"/>
|
||||
<activity android:name=".ui.CreateCalendarActivity"
|
||||
android:label="@string/create_calendar_title"/>
|
||||
android:label="@string/create_calendar"/>
|
||||
<activity
|
||||
android:name=".ui.DebugInfoActivity"
|
||||
android:exported="true"
|
||||
|
@ -10,13 +10,14 @@ package at.bitfire.davdroid.log;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
public class LogcatHandler extends Handler {
|
||||
private static final String TAG = "davdroid";
|
||||
|
||||
private static final int MAX_LINE_LENGTH = 3000;
|
||||
public static final LogcatHandler INSTANCE = new LogcatHandler();
|
||||
|
||||
private LogcatHandler() {
|
||||
@ -27,19 +28,24 @@ public class LogcatHandler extends Handler {
|
||||
|
||||
@Override
|
||||
public void publish(LogRecord r) {
|
||||
String line = getFormatter().format(r);
|
||||
String text = getFormatter().format(r);
|
||||
int level = r.getLevel().intValue();
|
||||
|
||||
if (level >= Level.SEVERE.intValue())
|
||||
Log.e(r.getLoggerName(), line);
|
||||
else if (level >= Level.WARNING.intValue())
|
||||
Log.w(r.getLoggerName(), line);
|
||||
else if (level >= Level.CONFIG.intValue())
|
||||
Log.i(r.getLoggerName(), line);
|
||||
else if (level >= Level.FINER.intValue())
|
||||
Log.d(r.getLoggerName(), line);
|
||||
else
|
||||
Log.v(r.getLoggerName(), line);
|
||||
int end = text.length();
|
||||
for (int pos = 0; pos < end; pos += MAX_LINE_LENGTH) {
|
||||
String line = text.substring(pos, NumberUtils.min(pos + MAX_LINE_LENGTH, end));
|
||||
|
||||
if (level >= Level.SEVERE.intValue())
|
||||
Log.e(r.getLoggerName(), line);
|
||||
else if (level >= Level.WARNING.intValue())
|
||||
Log.w(r.getLoggerName(), line);
|
||||
else if (level >= Level.CONFIG.intValue())
|
||||
Log.i(r.getLoggerName(), line);
|
||||
else if (level >= Level.FINER.intValue())
|
||||
Log.d(r.getLoggerName(), line);
|
||||
else
|
||||
Log.v(r.getLoggerName(), line);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,6 +34,7 @@ import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.provider.CalendarContract;
|
||||
import android.provider.ContactsContract;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.AppCompatRadioButton;
|
||||
@ -65,6 +66,7 @@ import at.bitfire.davdroid.App;
|
||||
import at.bitfire.davdroid.DavService;
|
||||
import at.bitfire.davdroid.R;
|
||||
import at.bitfire.davdroid.model.CollectionInfo;
|
||||
import at.bitfire.davdroid.model.ServiceDB;
|
||||
import at.bitfire.davdroid.model.ServiceDB.Collections;
|
||||
import at.bitfire.davdroid.model.ServiceDB.OpenHelper;
|
||||
import at.bitfire.davdroid.model.ServiceDB.Services;
|
||||
@ -253,6 +255,7 @@ public class AccountActivity extends AppCompatActivity implements Toolbar.OnMenu
|
||||
long id;
|
||||
boolean refreshing;
|
||||
|
||||
boolean hasHomeSets;
|
||||
List<CollectionInfo> collections;
|
||||
}
|
||||
}
|
||||
@ -279,6 +282,8 @@ public class AccountActivity extends AppCompatActivity implements Toolbar.OnMenu
|
||||
listCardDAV.setEnabled(!info.carddav.refreshing);
|
||||
listCardDAV.setAlpha(info.carddav.refreshing ? 0.5f : 1);
|
||||
|
||||
tbCardDAV.getMenu().findItem(R.id.create_address_book).setVisible(info.carddav.hasHomeSets);
|
||||
|
||||
AddressBookAdapter adapter = new AddressBookAdapter(this);
|
||||
adapter.addAll(info.carddav.collections);
|
||||
listCardDAV.setAdapter(adapter);
|
||||
@ -296,6 +301,8 @@ public class AccountActivity extends AppCompatActivity implements Toolbar.OnMenu
|
||||
listCalDAV.setEnabled(!info.caldav.refreshing);
|
||||
listCalDAV.setAlpha(info.caldav.refreshing ? 0.5f : 1);
|
||||
|
||||
tbCalDAV.getMenu().findItem(R.id.create_calendar).setVisible(info.caldav.hasHomeSets);
|
||||
|
||||
final CalendarAdapter adapter = new CalendarAdapter(this);
|
||||
adapter.addAll(info.caldav.collections);
|
||||
listCalDAV.setAdapter(adapter);
|
||||
@ -370,12 +377,14 @@ public class AccountActivity extends AppCompatActivity implements Toolbar.OnMenu
|
||||
info.carddav = new AccountInfo.ServiceInfo();
|
||||
info.carddav.id = id;
|
||||
info.carddav.refreshing = davService.isRefreshing(id);
|
||||
info.carddav.hasHomeSets = hasHomeSets(db, id);
|
||||
info.carddav.collections = readCollections(db, id);
|
||||
|
||||
} else if (Services.SERVICE_CALDAV.equals(service)) {
|
||||
info.caldav = new AccountInfo.ServiceInfo();
|
||||
info.caldav.id = id;
|
||||
info.caldav.refreshing = davService.isRefreshing(id);
|
||||
info.caldav.hasHomeSets = hasHomeSets(db, id);
|
||||
info.caldav.collections = readCollections(db, id);
|
||||
}
|
||||
}
|
||||
@ -385,10 +394,16 @@ public class AccountActivity extends AppCompatActivity implements Toolbar.OnMenu
|
||||
return info;
|
||||
}
|
||||
|
||||
private List<CollectionInfo> readCollections(SQLiteDatabase db, long service) {
|
||||
private boolean hasHomeSets(@NonNull SQLiteDatabase db, long service) {
|
||||
@Cleanup Cursor cursor = db.query(ServiceDB.HomeSets._TABLE, null, ServiceDB.HomeSets.SERVICE_ID + "=?",
|
||||
new String[] { String.valueOf(service) }, null, null, null);
|
||||
return cursor.getCount() > 0;
|
||||
}
|
||||
|
||||
private List<CollectionInfo> readCollections(@NonNull SQLiteDatabase db, long service) {
|
||||
List<CollectionInfo> collections = new LinkedList<>();
|
||||
@Cleanup Cursor cursor = db.query(Collections._TABLE, Collections._COLUMNS, Collections.SERVICE_ID + "=?", new String[]{String.valueOf(service)},
|
||||
null, null, Collections.SUPPORTS_VEVENT + " DESC," + Collections.DISPLAY_NAME);
|
||||
@Cleanup Cursor cursor = db.query(Collections._TABLE, Collections._COLUMNS, Collections.SERVICE_ID + "=?",
|
||||
new String[]{ String.valueOf(service )}, null, null, Collections.SUPPORTS_VEVENT + " DESC," + Collections.DISPLAY_NAME);
|
||||
while (cursor.moveToNext()) {
|
||||
ContentValues values = new ContentValues();
|
||||
DatabaseUtils.cursorRowToContentValues(cursor, values);
|
||||
|
@ -9,17 +9,11 @@
|
||||
package at.bitfire.davdroid.ui;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.database.DatabaseUtils;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.LoaderManager;
|
||||
import android.support.v4.app.NavUtils;
|
||||
import android.support.v4.content.AsyncTaskLoader;
|
||||
@ -28,250 +22,92 @@ import android.support.v7.app.AppCompatActivity;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.SimpleAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.xmlpull.v1.XmlSerializer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import at.bitfire.dav4android.DavResource;
|
||||
import at.bitfire.dav4android.XmlUtils;
|
||||
import at.bitfire.dav4android.exception.HttpException;
|
||||
import at.bitfire.davdroid.HttpClient;
|
||||
import at.bitfire.davdroid.R;
|
||||
import at.bitfire.davdroid.model.CollectionInfo;
|
||||
import at.bitfire.davdroid.model.HomeSet;
|
||||
import at.bitfire.davdroid.model.Service;
|
||||
import at.bitfire.davdroid.model.ServiceDB;
|
||||
import lombok.Cleanup;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
public class CreateAddressBookActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<CreateAddressBookActivity.AccountInfo> {
|
||||
public final static String EXTRA_ACCOUNT = "account";
|
||||
public static final String EXTRA_ACCOUNT = "account";
|
||||
|
||||
private Account account;
|
||||
protected Account account;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_create_address_book);
|
||||
|
||||
account = getIntent().getParcelableExtra(EXTRA_ACCOUNT);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setContentView(R.layout.activity_create_address_book);
|
||||
|
||||
getSupportLoaderManager().initLoader(0, getIntent().getExtras(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.activity_create_address_book, menu);
|
||||
getMenuInflater().inflate(R.menu.activity_create_collection, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
Intent intent = new Intent(this, AccountActivity.class);
|
||||
intent.putExtra(AccountActivity.EXTRA_ACCOUNT, account);
|
||||
NavUtils.navigateUpTo(this, intent);
|
||||
break;
|
||||
case R.id.create_address_book:
|
||||
createAddressBook();
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
Intent intent = new Intent(this, AccountActivity.class);
|
||||
intent.putExtra(AccountActivity.EXTRA_ACCOUNT, account);
|
||||
NavUtils.navigateUpTo(this, intent);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void createAddressBook() {
|
||||
Spinner spnrHomeSets = (Spinner)findViewById(R.id.homeset);
|
||||
HashMap<String, String> homeSet = (HashMap<String, String>)spnrHomeSets.getSelectedItem();
|
||||
HttpUrl urlHomeSet = HttpUrl.parse(homeSet.get(ServiceDB.HomeSets.URL));
|
||||
|
||||
CollectionInfo info = new CollectionInfo();
|
||||
public void onCreateCollection(MenuItem item) {
|
||||
boolean ok = true;
|
||||
CollectionInfo info = new CollectionInfo();
|
||||
|
||||
String displayName = ((EditText)findViewById(R.id.title)).getText().toString();
|
||||
if (!TextUtils.isEmpty(displayName))
|
||||
info.displayName = displayName;
|
||||
Spinner spinner = (Spinner)findViewById(R.id.home_sets);
|
||||
String homeSet = (String)spinner.getSelectedItem();
|
||||
|
||||
EditText editPathSegment = (EditText)findViewById(R.id.path_segment);
|
||||
String pathSegment = editPathSegment.getText().toString();
|
||||
if (TextUtils.isEmpty(pathSegment)) { // TODO further validations
|
||||
editPathSegment.setError("MUST NOT BE EMPTY");
|
||||
EditText edit = (EditText)findViewById(R.id.display_name);
|
||||
info.displayName = edit.getText().toString();
|
||||
if (TextUtils.isEmpty(info.displayName)) {
|
||||
edit.setError(getString(R.string.create_collection_display_name_required));
|
||||
ok = false;
|
||||
} else
|
||||
info.url = urlHomeSet.resolve(pathSegment).toString();
|
||||
|
||||
String description = ((EditText)findViewById(R.id.description)).getText().toString();
|
||||
if (!TextUtils.isEmpty(description))
|
||||
info.description = description;
|
||||
|
||||
if (ok)
|
||||
CreatingAddressBookFragment.newInstance(account, info).show(getSupportFragmentManager(), null);
|
||||
}
|
||||
|
||||
|
||||
public static class CreatingAddressBookFragment extends DialogFragment implements LoaderManager.LoaderCallbacks<Exception> {
|
||||
protected static final String
|
||||
ARGS_ACCOUNT = "account",
|
||||
ARGS_COLLECTION_INFO = "collectionInfo";
|
||||
|
||||
public static CreatingAddressBookFragment newInstance(Account account, CollectionInfo info) {
|
||||
CreatingAddressBookFragment frag = new CreatingAddressBookFragment();
|
||||
Bundle args = new Bundle(2);
|
||||
args.putParcelable(ARGS_ACCOUNT, account);
|
||||
args.putSerializable(ARGS_COLLECTION_INFO, info);
|
||||
frag.setArguments(args);
|
||||
return frag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
edit = (EditText)findViewById(R.id.description);
|
||||
info.description = StringUtils.trimToNull(edit.getText().toString());
|
||||
|
||||
getLoaderManager().initLoader(0, getArguments(), this);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
Dialog dialog = new ProgressDialog.Builder(getActivity())
|
||||
.setTitle(R.string.create_address_book_creating)
|
||||
.setMessage(R.string.please_wait)
|
||||
.setCancelable(false)
|
||||
.create();
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Loader<Exception> onCreateLoader(int id, Bundle args) {
|
||||
Account account = args.getParcelable(ARGS_ACCOUNT);
|
||||
CollectionInfo info = (CollectionInfo)args.getSerializable(ARGS_COLLECTION_INFO);
|
||||
return new AddressBookCreator(getActivity(), account, info);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(Loader<Exception> loader, Exception exception) {
|
||||
dismissAllowingStateLoss();
|
||||
|
||||
if (exception == null)
|
||||
getActivity().finish();
|
||||
else
|
||||
Toast.makeText(getActivity(), exception.getLocalizedMessage(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(Loader<Exception> loader) {
|
||||
}
|
||||
|
||||
protected static class AddressBookCreator extends AsyncTaskLoader<Exception> {
|
||||
final Account account;
|
||||
final CollectionInfo info;
|
||||
final ServiceDB.OpenHelper dbHelper;
|
||||
|
||||
public AddressBookCreator(Context context, Account account, CollectionInfo collectionInfo) {
|
||||
super(context);
|
||||
this.account = account;
|
||||
info = collectionInfo;
|
||||
dbHelper = new ServiceDB.OpenHelper(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStartLoading() {
|
||||
forceLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Exception loadInBackground() {
|
||||
OkHttpClient client = HttpClient.create(getContext(), account);
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
try {
|
||||
XmlSerializer serializer = XmlUtils.newSerializer();
|
||||
serializer.setOutput(writer);
|
||||
serializer.startDocument("UTF-8", null);
|
||||
serializer.setPrefix("", XmlUtils.NS_WEBDAV);
|
||||
serializer.setPrefix("CARD", XmlUtils.NS_CARDDAV);
|
||||
|
||||
serializer.startTag(XmlUtils.NS_WEBDAV, "mkcol");
|
||||
serializer.startTag(XmlUtils.NS_WEBDAV, "set");
|
||||
serializer.startTag(XmlUtils.NS_WEBDAV, "prop");
|
||||
serializer.startTag(XmlUtils.NS_WEBDAV, "resourcetype");
|
||||
serializer.startTag(XmlUtils.NS_WEBDAV, "collection");
|
||||
serializer.endTag(XmlUtils.NS_WEBDAV, "collection");
|
||||
serializer.startTag(XmlUtils.NS_CARDDAV, "addressbook");
|
||||
serializer.endTag(XmlUtils.NS_CARDDAV, "addressbook");
|
||||
serializer.endTag(XmlUtils.NS_WEBDAV, "resourcetype");
|
||||
if (info.displayName != null) {
|
||||
serializer.startTag(XmlUtils.NS_WEBDAV, "displayname");
|
||||
serializer.text(info.displayName);
|
||||
serializer.endTag(XmlUtils.NS_WEBDAV, "displayname");
|
||||
}
|
||||
if (info.description != null) {
|
||||
serializer.startTag(XmlUtils.NS_CARDDAV, "addressbook-description");
|
||||
serializer.text(info.description);
|
||||
serializer.endTag(XmlUtils.NS_CARDDAV, "addressbook-description");
|
||||
}
|
||||
serializer.endTag(XmlUtils.NS_WEBDAV, "prop");
|
||||
serializer.endTag(XmlUtils.NS_WEBDAV, "set");
|
||||
serializer.endTag(XmlUtils.NS_WEBDAV, "mkcol");
|
||||
serializer.endDocument();
|
||||
} catch (IOException e) {
|
||||
//App.log.severe("Couldn't assemble MKCOL request", e);
|
||||
}
|
||||
|
||||
DavResource addressBook = new DavResource(client, HttpUrl.parse(info.url));
|
||||
try {
|
||||
addressBook.mkCol(writer.toString());
|
||||
|
||||
// TODO
|
||||
/*SQLiteDatabase db = dbHelper.getWritableDatabase();
|
||||
db.insert(ServiceDB.Collections._TABLE, null, info.toDB());*/
|
||||
|
||||
// TODO add to database
|
||||
} catch (IOException|HttpException e) {
|
||||
return e;
|
||||
} finally {
|
||||
dbHelper.close();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (ok) {
|
||||
info.type = CollectionInfo.Type.ADDRESS_BOOK;
|
||||
info.url = HttpUrl.parse(homeSet).resolve(UUID.randomUUID().toString() + "/").toString();
|
||||
CreateCollectionFragment.newInstance(account, info).show(getSupportFragmentManager(), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// loader
|
||||
|
||||
@Override
|
||||
public Loader<AccountInfo> onCreateLoader(int id, Bundle args) {
|
||||
return new AccountLoader(this, account);
|
||||
return new AccountInfoLoader(this, account);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(Loader<AccountInfo> loader, AccountInfo data) {
|
||||
Spinner spnrHomeSets = (Spinner)findViewById(R.id.homeset);
|
||||
|
||||
List<HashMap<String, String>> adapterData = new LinkedList<>();
|
||||
for (HomeSet homeSet : data.homeSets) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put(ServiceDB.HomeSets.ID, String.valueOf(homeSet.id));
|
||||
map.put(ServiceDB.HomeSets.URL, homeSet.URL);
|
||||
adapterData.add(map);
|
||||
public void onLoadFinished(Loader<AccountInfo> loader, AccountInfo info) {
|
||||
if (info != null) {
|
||||
Spinner spinner = (Spinner)findViewById(R.id.home_sets);
|
||||
spinner.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, info.homeSets));
|
||||
}
|
||||
|
||||
spnrHomeSets.setAdapter(new SimpleAdapter(this, adapterData, android.R.layout.simple_spinner_item, new String[] { ServiceDB.HomeSets.URL }, new int[] { android.R.id.text1 } ));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -279,15 +115,14 @@ public class CreateAddressBookActivity extends AppCompatActivity implements Load
|
||||
}
|
||||
|
||||
protected static class AccountInfo {
|
||||
Service service;
|
||||
List<HomeSet> homeSets = new LinkedList<>();
|
||||
List<String> homeSets = new LinkedList<>();
|
||||
}
|
||||
|
||||
private static class AccountLoader extends AsyncTaskLoader<AccountInfo> {
|
||||
protected static class AccountInfoLoader extends AsyncTaskLoader<AccountInfo> {
|
||||
private final Account account;
|
||||
private final ServiceDB.OpenHelper dbHelper;
|
||||
|
||||
public AccountLoader(Context context, Account account) {
|
||||
public AccountInfoLoader(Context context, Account account) {
|
||||
super(context);
|
||||
this.account = account;
|
||||
dbHelper = new ServiceDB.OpenHelper(context);
|
||||
@ -300,31 +135,27 @@ public class CreateAddressBookActivity extends AppCompatActivity implements Load
|
||||
|
||||
@Override
|
||||
public AccountInfo loadInBackground() {
|
||||
final AccountInfo info = new AccountInfo();
|
||||
|
||||
// find DAV service and home sets
|
||||
SQLiteDatabase db = dbHelper.getReadableDatabase();
|
||||
try {
|
||||
@Cleanup Cursor cursorService = db.query(ServiceDB.Services._TABLE, null, ServiceDB.Services.ACCOUNT_NAME + "=? AND " + ServiceDB.Services.SERVICE + "=?",
|
||||
@Cleanup Cursor cursorService = db.query(ServiceDB.Services._TABLE, new String[] { ServiceDB.Services.ID },
|
||||
ServiceDB.Services.ACCOUNT_NAME + "=? AND " + ServiceDB.Services.SERVICE + "=?",
|
||||
new String[] { account.name, ServiceDB.Services.SERVICE_CARDDAV }, null, null, null);
|
||||
if (!cursorService.moveToNext())
|
||||
return null;
|
||||
String strServiceID = cursorService.getString(0);
|
||||
|
||||
AccountInfo info = new AccountInfo();
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
DatabaseUtils.cursorRowToContentValues(cursorService, values);
|
||||
info.service = Service.fromDB(values);
|
||||
|
||||
@Cleanup Cursor cursorHomeSets = db.query(ServiceDB.HomeSets._TABLE, null, ServiceDB.HomeSets.SERVICE_ID + "=?",
|
||||
new String[] { String.valueOf(info.service.id) }, null, null, null);
|
||||
while (cursorHomeSets.moveToNext()) {
|
||||
values.clear();
|
||||
DatabaseUtils.cursorRowToContentValues(cursorHomeSets, values);
|
||||
info.homeSets.add(HomeSet.fromDB(values));
|
||||
}
|
||||
|
||||
return info;
|
||||
@Cleanup Cursor cursorHomeSets = db.query(ServiceDB.HomeSets._TABLE, new String[] { ServiceDB.HomeSets.URL },
|
||||
ServiceDB.HomeSets.SERVICE_ID + "=?", new String[] { strServiceID }, null, null, null);
|
||||
while (cursorHomeSets.moveToNext())
|
||||
info.homeSets.add(cursorHomeSets.getString(0));
|
||||
} finally {
|
||||
dbHelper.close();
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import android.support.v4.app.NavUtils;
|
||||
import android.support.v4.content.AsyncTaskLoader;
|
||||
import android.support.v4.content.Loader;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.AppCompatSpinner;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@ -28,6 +27,7 @@ import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import net.fortuna.ical4j.model.Calendar;
|
||||
|
||||
@ -82,7 +82,7 @@ public class CreateCalendarActivity extends AppCompatActivity implements LoaderM
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.activity_create_calendar, menu);
|
||||
getMenuInflater().inflate(R.menu.activity_create_collection, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -97,17 +97,17 @@ public class CreateCalendarActivity extends AppCompatActivity implements LoaderM
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onCreateCalendar(MenuItem item) {
|
||||
public void onCreateCollection(MenuItem item) {
|
||||
boolean ok = true;
|
||||
CollectionInfo info = new CollectionInfo();
|
||||
|
||||
AppCompatSpinner spinner = (AppCompatSpinner)findViewById(R.id.home_set);
|
||||
Spinner spinner = (Spinner)findViewById(R.id.home_sets);
|
||||
String homeSet = (String)spinner.getSelectedItem();
|
||||
|
||||
EditText edit = (EditText)findViewById(R.id.display_name);
|
||||
info.displayName = edit.getText().toString();
|
||||
if (TextUtils.isEmpty(info.displayName)) {
|
||||
edit.setError("Enter a calendar title.");
|
||||
edit.setError(getString(R.string.create_collection_display_name_required));
|
||||
ok = false;
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ public class CreateCalendarActivity extends AppCompatActivity implements LoaderM
|
||||
View view = findViewById(R.id.color);
|
||||
info.color = ((ColorDrawable)view.getBackground()).getColor();
|
||||
|
||||
spinner = (AppCompatSpinner)findViewById(R.id.time_zone);
|
||||
spinner = (Spinner)findViewById(R.id.time_zone);
|
||||
net.fortuna.ical4j.model.TimeZone tz = DateUtils.tzRegistry.getTimeZone((String)spinner.getSelectedItem());
|
||||
if (tz != null) {
|
||||
Calendar cal = new Calendar();
|
||||
@ -154,7 +154,7 @@ public class CreateCalendarActivity extends AppCompatActivity implements LoaderM
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(Loader<AccountInfo> loader, AccountInfo info) {
|
||||
AppCompatSpinner spinner = (AppCompatSpinner)findViewById(R.id.time_zone);
|
||||
Spinner spinner = (Spinner)findViewById(R.id.time_zone);
|
||||
String[] timeZones = TimeZone.getAvailableIDs();
|
||||
spinner.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, timeZones));
|
||||
// select system time zone
|
||||
@ -166,7 +166,7 @@ public class CreateCalendarActivity extends AppCompatActivity implements LoaderM
|
||||
}
|
||||
|
||||
if (info != null) {
|
||||
spinner = (AppCompatSpinner)findViewById(R.id.home_set);
|
||||
spinner = (Spinner)findViewById(R.id.home_sets);
|
||||
spinner.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, info.homeSets));
|
||||
}
|
||||
}
|
||||
|
@ -7,11 +7,7 @@
|
||||
~ http://www.gnu.org/licenses/gpl.html
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item android:id="@+id/create_address_book"
|
||||
app:showAsAction="always"
|
||||
android:title="Create address book"/>
|
||||
|
||||
</menu>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:color="@android:color/darker_gray"/>
|
||||
<item android:color="@android:color/black"/>
|
||||
</selector>
|
@ -14,7 +14,7 @@
|
||||
android:padding="8dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<android.support.v7.widget.AppCompatRadioButton
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="4dp"
|
||||
|
@ -14,11 +14,8 @@
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin">
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/activity_margin">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/carddav"
|
||||
|
@ -7,37 +7,53 @@
|
||||
~ http://www.gnu.org/licenses/gpl.html
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/homeset_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Home set:"/>
|
||||
<Spinner
|
||||
android:id="@+id/homeset"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/activity_margin">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/create_addressbook"
|
||||
android:textAppearance="@style/TextView.Heading"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/path_segment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Path segment (collection name)"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/create_collection_home_set"/>
|
||||
<Spinner
|
||||
android:id="@+id/home_sets"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Description"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/create_collection_display_name"/>
|
||||
<EditText
|
||||
android:id="@+id/display_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="@string/create_addressbook_display_name_hint"/>
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/create_collection_description"/>
|
||||
<EditText
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:inputType="textAutoCorrect"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
@ -13,20 +13,21 @@
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/activity_margin">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Create CalDAV collection"
|
||||
android:text="@string/create_calendar"
|
||||
android:textAppearance="@style/TextView.Heading"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Home set:"/>
|
||||
<android.support.v7.widget.AppCompatSpinner
|
||||
android:id="@+id/home_set"
|
||||
android:text="@string/create_collection_home_set"/>
|
||||
<Spinner
|
||||
android:id="@+id/home_sets"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
@ -34,24 +35,24 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Display name (title) of this collection:"/>
|
||||
android:text="@string/create_collection_display_name"/>
|
||||
<EditText
|
||||
android:id="@+id/display_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="My Calendar"/>
|
||||
android:hint="@string/create_calendar_display_name_hint"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Description (optional):"/>
|
||||
android:text="@string/create_collection_description"/>
|
||||
<EditText
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="Calendar description"/>
|
||||
android:inputType="textAutoCorrect"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -71,15 +72,15 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Set a collection color"/>
|
||||
android:text="@string/create_collection_color"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Time zone:"/>
|
||||
<android.support.v7.widget.AppCompatSpinner
|
||||
android:text="@string/create_calendar_time_zone"/>
|
||||
<Spinner
|
||||
android:id="@+id/time_zone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
@ -87,7 +88,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Collection type"
|
||||
android:text="@string/create_calendar_type"
|
||||
android:textAppearance="@style/TextView.Heading"/>
|
||||
|
||||
<RadioGroup
|
||||
@ -95,24 +96,24 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.v7.widget.AppCompatRadioButton
|
||||
<RadioButton
|
||||
android:id="@+id/type_events"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="Calendar (only events)"/>
|
||||
android:text="@string/create_calendar_type_only_events"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatRadioButton
|
||||
<RadioButton
|
||||
android:id="@+id/type_tasks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Task list (only tasks)"/>
|
||||
android:text="@string/create_calendar_type_only_tasks"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatRadioButton
|
||||
<RadioButton
|
||||
android:id="@+id/type_events_and_tasks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Combined (events and tasks)"/>
|
||||
android:text="@string/create_calendar_type_events_and_tasks"/>
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright © 2013 – 2016 Ricki Hirner (bitfire web engineering).
|
||||
~ All rights reserved. This program and the accompanying materials
|
||||
~ are made available under the terms of the GNU Public License v3.0
|
||||
~ which accompanies this distribution, and is available at
|
||||
~ http://www.gnu.org/licenses/gpl.html
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/displayName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Display name"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Description"
|
||||
android:lines="2"/>
|
||||
|
||||
</LinearLayout>
|
@ -18,7 +18,7 @@
|
||||
android:layout_weight="1"
|
||||
android:inputType="textPassword"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatCheckBox
|
||||
<CheckBox
|
||||
android:id="@+id/show_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -16,10 +16,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginRight="@dimen/activity_horizontal_margin">
|
||||
android:layout_margin="@dimen/activity_margin">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -25,10 +25,7 @@
|
||||
<ScrollView android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginRight="@dimen/activity_horizontal_margin">
|
||||
android:layout_margin="@dimen/activity_margin">
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
@ -36,7 +33,7 @@
|
||||
android:orientation="vertical"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<android.support.v7.widget.AppCompatRadioButton
|
||||
<RadioButton
|
||||
android:id="@+id/login_type_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -63,7 +60,7 @@
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.AppCompatRadioButton
|
||||
<RadioButton
|
||||
android:id="@+id/login_type_url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -96,7 +93,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/login_password"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatCheckBox
|
||||
<CheckBox
|
||||
android:id="@+id/preemptive_auth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -13,10 +13,7 @@
|
||||
android:background="@drawable/side_nav_bar"
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
|
||||
<ImageView
|
||||
|
@ -10,6 +10,6 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:id="@+id/delete_collection"
|
||||
android:title="Delete collection"/>
|
||||
android:title="@string/delete_collection"/>
|
||||
|
||||
</menu>
|
@ -10,8 +10,8 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item android:title="Create calendar"
|
||||
android:onClick="onCreateCalendar"
|
||||
<item android:title="Create"
|
||||
android:onClick="onCreateCollection"
|
||||
app:showAsAction="always"/>
|
||||
|
||||
</menu>
|
@ -12,8 +12,6 @@
|
||||
<item android:id="@+id/refresh_calendars"
|
||||
android:title="@string/account_refresh_calendar_list"/>
|
||||
|
||||
<item android:id="@+id/add_calendar"
|
||||
android:title="@string/account_add_existing_calendar"/>
|
||||
<item android:id="@+id/create_calendar"
|
||||
android:title="@string/account_create_new_calendar"/>
|
||||
|
||||
|
@ -12,8 +12,6 @@
|
||||
<item android:id="@+id/refresh_address_books"
|
||||
android:title="@string/account_refresh_address_book_list"/>
|
||||
|
||||
<item android:id="@+id/add_address_book"
|
||||
android:title="@string/account_add_existing_address_book"/>
|
||||
<item android:id="@+id/create_address_book"
|
||||
android:title="@string/account_create_new_address_book"/>
|
||||
|
||||
|
@ -10,8 +10,7 @@
|
||||
<resources>
|
||||
<dimen name="leftcol_width">320dp</dimen>
|
||||
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">20dp</dimen>
|
||||
<dimen name="activity_margin">16dp</dimen>
|
||||
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
~ http://www.gnu.org/licenses/gpl.html
|
||||
-->
|
||||
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<resources>
|
||||
<item name="ic_menu_camera" type="drawable">@android:drawable/ic_menu_camera</item>
|
||||
<item name="ic_menu_gallery" type="drawable">@android:drawable/ic_menu_gallery</item>
|
||||
<item name="ic_menu_slideshow" type="drawable">@android:drawable/ic_menu_slideshow</item>
|
||||
|
@ -178,12 +178,24 @@
|
||||
<string name="settings_sync_time_range_past_message">Events which are more than this number of days in the past (may be 0) will be ignored. Leave blank to synchronize all events.</string>
|
||||
|
||||
<!-- collection management -->
|
||||
<string name="create_address_book_title">Create address book</string>
|
||||
<string name="create_address_book_creating">Creating address book</string>
|
||||
<string name="create_calendar_title">Create calendar</string>
|
||||
<string name="create_addressbook">Create address book</string>
|
||||
<string name="create_addressbook_display_name_hint">My Address Book</string>
|
||||
<string name="create_calendar">Create CalDAV collection</string>
|
||||
<string name="create_calendar_display_name_hint">My Calendar</string>
|
||||
<string name="create_calendar_time_zone">Time zone:</string>
|
||||
<string name="create_calendar_type">Collection type:</string>
|
||||
<string name="create_calendar_type_only_events">Calendar (only events)</string>
|
||||
<string name="create_calendar_type_only_tasks">Task list (only tasks)</string>
|
||||
<string name="create_calendar_type_events_and_tasks">Combined (events and tasks)</string>
|
||||
<string name="create_collection_color">Set a collection color</string>
|
||||
<string name="create_collection_creating">Creating collection</string>
|
||||
<string name="create_collection_display_name">Display name (title) of this collection:</string>
|
||||
<string name="create_collection_display_name_required">A title is required</string>
|
||||
<string name="create_collection_description">Description (optional):</string>
|
||||
<string name="create_collection_home_set">Home set:</string>
|
||||
<string name="delete_collection">Delete collection</string>
|
||||
<string name="delete_collection_confirm_title">Are you sure?</string>
|
||||
<string name="delete_collection_confirm_warning">This collection (%s) and all its entries from the server will be removed from the server.</string>
|
||||
<string name="delete_collection_confirm_warning">This collection (%s) and all its data will be removed from the server.</string>
|
||||
<string name="delete_collection_deleting_collection">Deleting collection</string>
|
||||
|
||||
<!-- ExceptionInfoFragment -->
|
||||
|
@ -30,10 +30,11 @@
|
||||
<!-- app theme -->
|
||||
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light">
|
||||
<item name="alertDialogTheme">@style/AppTheme.Dialog.Alert</item>
|
||||
<item name="colorPrimary">@color/light_green500</item>
|
||||
<item name="colorPrimaryDark">@color/light_green700</item>
|
||||
<item name="colorAccent">@color/orangeA700</item>
|
||||
<item name="android:textColorPrimary">@color/black</item>
|
||||
<item name="android:textColorPrimary">@drawable/text_color</item>
|
||||
<item name="android:textColorSecondary">@color/grey</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
|
||||
</style>
|
||||
@ -44,6 +45,13 @@
|
||||
</style>
|
||||
|
||||
|
||||
<!-- dialogs -->
|
||||
|
||||
<style name="AppTheme.Dialog.Alert" parent="Theme.AppCompat.Light.Dialog.Alert">
|
||||
<item name="colorAccent">@color/orangeA700</item>
|
||||
</style>
|
||||
|
||||
|
||||
<!-- AddAccountActivity -->
|
||||
|
||||
<style name="login_type_headline">
|
||||
@ -93,7 +101,6 @@
|
||||
<!-- text content -->
|
||||
|
||||
<style name="TextView.Heading" parent="AppTheme">
|
||||
<item name="android:layout_marginBottom">8dp</item>
|
||||
<item name="android:textSize">22sp</item>
|
||||
<item name="android:textColor">@color/orangeA700</item>
|
||||
</style>
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit d3cb90c629824e5e95b2c9236c2fc91e9a6dd7c9
|
||||
Subproject commit 5e7334cea2bbaacde7f61b9806c907ba7404753d
|
Loading…
Reference in New Issue
Block a user