mirror of
https://github.com/etesync/android
synced 2025-03-25 03:45:46 +00:00
AccountActivity changes
* CalDAV/CardDAV resource list views now always contain all elements without scrolling (NonScrollingListView) * synchronization action in activity now overriddes system sync settings
This commit is contained in:
parent
3ca063416e
commit
c30195d9ba
@ -18,7 +18,7 @@ android {
|
||||
targetSdkVersion 22
|
||||
|
||||
versionCode 87
|
||||
versionName "0.9.1.3"
|
||||
versionName "1.0-alpha1"
|
||||
|
||||
buildConfigField "long", "buildTime", System.currentTimeMillis() + "L"
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.Loader;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.SyncRequest;
|
||||
import android.database.Cursor;
|
||||
import android.database.DatabaseUtils;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
@ -470,12 +469,11 @@ public class AccountActivity extends AppCompatActivity implements Toolbar.OnMenu
|
||||
|
||||
for (String authority : authorities) {
|
||||
Bundle extras = new Bundle();
|
||||
extras.putInt(ContentResolver.SYNC_EXTRAS_EXPEDITED, 1);
|
||||
extras.putInt(ContentResolver.SYNC_EXTRAS_MANUAL, 1);
|
||||
extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
|
||||
ContentResolver.requestSync(account, authority, extras);
|
||||
}
|
||||
|
||||
Snackbar.make(getWindow().getDecorView(), R.string.account_synchronization_scheduled, Snackbar.LENGTH_LONG).show();
|
||||
Snackbar.make(getWindow().getDecorView(), R.string.account_synchronizing_now, Snackbar.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
package at.bitfire.davdroid.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
public class NonScrollingListView extends ListView {
|
||||
|
||||
public NonScrollingListView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
int widthMode = MeasureSpec.getMode(widthMeasureSpec),
|
||||
widthSize = MeasureSpec.getSize(widthMeasureSpec),
|
||||
heightMode = MeasureSpec.getMode(heightMeasureSpec),
|
||||
heightSize = MeasureSpec.getSize(heightMeasureSpec);
|
||||
|
||||
int width = 0, height = 0;
|
||||
|
||||
if (widthMode == MeasureSpec.EXACTLY || widthMode == MeasureSpec.AT_MOST)
|
||||
width = widthSize;
|
||||
|
||||
if (heightMode == MeasureSpec.EXACTLY)
|
||||
height = heightSize;
|
||||
else {
|
||||
ListAdapter listAdapter = getAdapter();
|
||||
if (listAdapter != null) {
|
||||
int widthSpec = View.MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);
|
||||
for (int i = 0; i < listAdapter.getCount(); i++) {
|
||||
View listItem = listAdapter.getView(i, null, this);
|
||||
listItem.measure(widthSpec, View.MeasureSpec.UNSPECIFIED);
|
||||
height += listItem.getMeasuredHeight();
|
||||
}
|
||||
height += getDividerHeight() * (listAdapter.getCount() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
setMeasuredDimension(width, height);
|
||||
}
|
||||
|
||||
}
|
17
app/src/main/res/drawable/ic_event_light.xml
Normal file
17
app/src/main/res/drawable/ic_event_light.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<!--
|
||||
~ 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
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M17,12h-5v5h5v-5zM16,1v2H8V1H6v2H5c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2h-1V1h-2zm3,18H5V8h14v11z"/>
|
||||
</vector>
|
@ -26,8 +26,8 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/color"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginRight="4dp"
|
||||
tools:background="@color/green700"/>
|
||||
|
||||
@ -41,14 +41,14 @@
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
tools:text="My Calendar"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="Calendar Description"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -32,14 +32,14 @@
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
tools:text="My Address Book"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="Address Book Description"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -7,92 +7,98 @@
|
||||
~ http://www.gnu.org/licenses/gpl.html
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin">
|
||||
<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="wrap_content">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/carddav"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardElevation="8dp">
|
||||
<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">
|
||||
|
||||
<LinearLayout
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/carddav"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:cardElevation="8dp">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/carddav_menu"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/toolbar_theme"
|
||||
style="@style/toolbar_style"
|
||||
app:navigationIcon="@drawable/ic_people_light"
|
||||
app:title="CardDAV"/>
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/carddav_refreshing"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:indeterminate="true"/>
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/carddav_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/toolbar_theme"
|
||||
style="@style/toolbar_style"
|
||||
app:navigationIcon="@drawable/ic_people_light"
|
||||
app:title="CardDAV"/>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/address_books"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:choiceMode="singleChoice"/>
|
||||
<ProgressBar
|
||||
android:id="@+id/carddav_refreshing"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
</LinearLayout>
|
||||
<at.bitfire.davdroid.ui.widget.NonScrollingListView
|
||||
android:id="@+id/address_books"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:choiceMode="singleChoice"/>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/caldav"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="8dp">
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/caldav"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
app:cardUseCompatPadding="true"
|
||||
app:cardElevation="8dp">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/caldav_menu"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/toolbar_theme"
|
||||
style="@style/toolbar_style"
|
||||
app:navigationIcon="@drawable/ic_people_light"
|
||||
app:title="CalDAV"/>
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/caldav_refreshing"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:indeterminate="true"/>
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/caldav_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/toolbar_theme"
|
||||
style="@style/toolbar_style"
|
||||
app:navigationIcon="@drawable/ic_event_light"
|
||||
app:title="CalDAV"/>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/calendars"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:choiceMode="multipleChoice"
|
||||
android:descendantFocusability="beforeDescendants"/>
|
||||
<ProgressBar
|
||||
android:id="@+id/caldav_refreshing"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
</LinearLayout>
|
||||
<at.bitfire.davdroid.ui.widget.NonScrollingListView
|
||||
android:id="@+id/calendars"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:choiceMode="multipleChoice"
|
||||
android:descendantFocusability="beforeDescendants"/>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
@ -30,7 +30,7 @@
|
||||
|
||||
<!-- AccountActivity -->
|
||||
<string name="account_synchronize_now">Synchronize now</string>
|
||||
<string name="account_synchronization_scheduled">Synchronization has been scheduled</string>
|
||||
<string name="account_synchronizing_now">Synchronizing now</string>
|
||||
<string name="account_settings">Account settings</string>
|
||||
<string name="account_delete">Delete account</string>
|
||||
<string name="account_delete_confirmation_title">Really delete account?</string>
|
||||
|
Loading…
Reference in New Issue
Block a user