Changes from code review

This commit is contained in:
David A. Velasco 2015-12-17 15:49:55 +01:00
parent 71e87d98a8
commit d5c4d7ab92
9 changed files with 61 additions and 257 deletions

View file

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
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"
android:id="@+id/list_item"
android:layout_width="match_parent"
android:layout_height="48dp"
android:paddingStart="16dip"
android:paddingEnd="16dip"
android:paddingRight="16dip"
android:paddingLeft="16dip"
android:minWidth="196dip"
android:background="?android:attr/activatedBackgroundIndicator"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:duplicateParentState="true" >
<ImageView
android:id="@+id/icon"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dip"
android:layout_marginRight="8dip"
android:duplicateParentState="true" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
android:duplicateParentState="true"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
</LinearLayout>
</LinearLayout>

View file

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
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"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView android:id="@+id/icon"
android:layout_width="@android:dimen/notification_large_icon_width"
android:layout_height="@android:dimen/notification_large_icon_height"
android:scaleType="center"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:minHeight="64dp"
android:orientation="vertical"
android:paddingRight="12dp"
android:paddingLeft="12dp"
>
<TextView android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
style="@style/Theme.ownCloud.NotificationText.Title"
/>
<TextView android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-2dp"
android:layout_marginBottom="-2dp"
android:singleLine="true"
android:fadingEdge="horizontal"
android:ellipsize="marquee"
style="@style/Theme.ownCloud.NotificationText.Content"
/>
<FrameLayout android:id="@+id/progressHolder"
android:layout_width="match_parent"
android:layout_height="12dp"
>
<!-- the FrameLayout is needed to change visibility of the
progress bar in Android 2.2, even though
https://code.google.com/p/android/issues/detail?id=11040 -->
<ProgressBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="?android:attr/progressBarStyleHorizontal"
/>
</FrameLayout>
</LinearLayout>
</LinearLayout>

View file

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_color"
android:id="@+id/explanation"
android:orientation="vertical">
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:padding="10dip"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:text="@string/placeholder_sentence"
/>
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:padding="10dip"
/>
<LinearLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<!-- 'OK' / 'CANCEL' BUTTONS CHANGE THEIR ORDER FROM ANDROID 4.0 ; THANKS, GOOGLE -->
<android.support.v7.widget.AppCompatButton
android:id="@+id/cancel"
android:theme="@style/Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/common_cancel" />
<android.support.v7.widget.AppCompatButton
android:id="@+id/ok"
android:theme="@style/Button.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/common_ok" />
</LinearLayout>
</LinearLayout>

View file

@ -21,9 +21,12 @@
android:id="@+id/list_item" android:id="@+id/list_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:paddingStart="16dip"
android:paddingEnd="16dip"
android:paddingRight="16dip" android:paddingRight="16dip"
android:paddingLeft="16dip" android:paddingLeft="16dip"
android:minWidth="196dip" android:minWidth="196dip"
android:background="?android:attr/activatedBackgroundIndicator"
android:orientation="vertical" > android:orientation="vertical" >
<LinearLayout <LinearLayout
@ -36,6 +39,7 @@
android:layout_width="40dip" android:layout_width="40dip"
android:layout_height="40dip" android:layout_height="40dip"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="8dip"
android:layout_marginRight="8dip" android:layout_marginRight="8dip"
android:duplicateParentState="true" /> android:duplicateParentState="true" />
@ -44,7 +48,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
android:duplicateParentState="true" android:duplicateParentState="true"
android:singleLine="true" android:singleLine="true"
android:ellipsize="marquee" android:ellipsize="marquee"

View file

@ -75,8 +75,8 @@
<ImageView <ImageView
android:id="@+id/itemIcon" android:id="@+id/itemIcon"
android:layout_width="24sp" android:layout_width="24dp"
android:layout_height="24sp" android:layout_height="24dp"
android:layout_marginLeft="@dimen/standard_padding" android:layout_marginLeft="@dimen/standard_padding"
android:layout_marginBottom="3dp" android:layout_marginBottom="3dp"
android:layout_gravity="bottom" android:layout_gravity="bottom"

View file

@ -48,14 +48,6 @@
android:gravity="center" android:gravity="center"
android:orientation="horizontal" > android:orientation="horizontal" >
<android.support.v7.widget.AppCompatButton
android:id="@+id/ok"
android:theme="@style/Button.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/common_ok" />
<android.support.v7.widget.AppCompatButton <android.support.v7.widget.AppCompatButton
android:id="@+id/cancel" android:id="@+id/cancel"
android:theme="@style/Button" android:theme="@style/Button"
@ -64,6 +56,14 @@
android:layout_weight="1" android:layout_weight="1"
android:text="@string/common_cancel" /> android:text="@string/common_cancel" />
<android.support.v7.widget.AppCompatButton
android:id="@+id/ok"
android:theme="@style/Button.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/common_ok" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -54,7 +54,7 @@
android:layout_marginLeft="@dimen/standard_margin" android:layout_marginLeft="@dimen/standard_margin"
android:layout_marginRight="@dimen/standard_margin"> android:layout_marginRight="@dimen/standard_margin">
<Button <android.support.v7.widget.AppCompatButton
android:id="@+id/deleteLogHistoryButton" android:id="@+id/deleteLogHistoryButton"
android:theme="@style/Button" android:theme="@style/Button"
android:layout_width="fill_parent" android:layout_width="fill_parent"

View file

@ -18,45 +18,42 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="5dp"
android:paddingLeft="5dp"
> >
<ImageView android:id="@+id/icon"
android:layout_width="@android:dimen/notification_large_icon_width"
android:layout_height="@android:dimen/notification_large_icon_height"
android:scaleType="center"
/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:layout_gravity="center"
android:paddingTop="3dp" android:minHeight="64dp"
android:orientation="vertical"
android:paddingRight="12dp"
android:paddingLeft="12dp"
> >
<ImageView android:id="@+id/icon"
android:layout_width="25dp"
android:layout_height="25dp"
android:scaleType="centerInside"
/>
<TextView android:id="@+id/title" <TextView android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:paddingLeft="4dp"
style="@style/Theme.ownCloud.NotificationText.Title"
/>
</LinearLayout>
<TextView android:id="@+id/text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
style="@style/Theme.ownCloud.NotificationText.Title"
/>
<TextView android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-2dp"
android:layout_marginBottom="-2dp"
android:singleLine="true"
android:fadingEdge="horizontal"
android:ellipsize="marquee"
style="@style/Theme.ownCloud.NotificationText.Content" style="@style/Theme.ownCloud.NotificationText.Content"
/> />
<FrameLayout android:id="@+id/progressHolder" <FrameLayout android:id="@+id/progressHolder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="10dp" android:layout_height="12dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
> >
<!-- the FrameLayout is needed to change visibility of the <!-- the FrameLayout is needed to change visibility of the
progress bar in Android 2.2, even though progress bar in Android 2.2, even though
@ -69,3 +66,4 @@
/> />
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
</LinearLayout>

View file

@ -445,7 +445,7 @@ public class FileActivity extends AppCompatActivity
* @param account the account to be set in the drawer * @param account the account to be set in the drawer
*/ */
protected void setUsernameInDrawer(RelativeLayout navigationDrawerLayout, Account account) { protected void setUsernameInDrawer(RelativeLayout navigationDrawerLayout, Account account) {
if (navigationDrawerLayout != null && getAccount() != null) { if (navigationDrawerLayout != null && account != null) {
TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username); TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username);
int lastAtPos = account.name.lastIndexOf("@"); int lastAtPos = account.name.lastIndexOf("@");
username.setText(account.name.substring(0, lastAtPos)); username.setText(account.name.substring(0, lastAtPos));