Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizing the uploader layout & taking user configured sorting into account #5

Merged
merged 24 commits into from
Jun 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cecab96
implementation of #1193 - optimizing the uploader layout and taking u…
AndyScherzinger Nov 9, 2015
a3359d0
fix background color
AndyScherzinger Nov 10, 2015
f2e9365
implementation of #1193 - optimizing the uploader layout and taking u…
AndyScherzinger Nov 9, 2015
df013d2
Fixes after rebase
AndyScherzinger Mar 31, 2016
cd0082c
proper padding for the choose upload folder buttons
AndyScherzinger Mar 31, 2016
3ca1033
fixed menu, since grid view hasn't been part of the uploader screen
AndyScherzinger Mar 31, 2016
af9c055
removed duplicate method call
AndyScherzinger Apr 14, 2016
6a66b0a
fix after rebase
AndyScherzinger Apr 14, 2016
a931baf
moved the preference accessing to the oC Preference Manager
AndyScherzinger Apr 14, 2016
3b43040
moved the preference accessing to the oC Preference Manager
AndyScherzinger Apr 14, 2016
10594f4
removed now unused code
AndyScherzinger Apr 14, 2016
6376103
streamlined PrefManager API for simpler usage
AndyScherzinger Apr 14, 2016
1a12fe2
fix preference manager call after rebase
AndyScherzinger Jun 1, 2016
74fa109
implementation of #1193 - optimizing the uploader layout and taking u…
AndyScherzinger Nov 9, 2015
acdd68d
fix background color
AndyScherzinger Nov 10, 2015
60d71a9
Fixes after rebase
AndyScherzinger Mar 31, 2016
593e3e9
proper padding for the choose upload folder buttons
AndyScherzinger Mar 31, 2016
225cd23
removed duplicate method call
AndyScherzinger Apr 14, 2016
e0a283a
rebase changes with master
AndyScherzinger Jun 11, 2016
b5b1aab
revert filtering out files in the external file upload view
AndyScherzinger Jun 10, 2016
bce26b4
changes padding
AndyScherzinger Jun 11, 2016
20fc4b8
revert, to show app name for upload from other app
AndyScherzinger Jun 13, 2016
944af7e
code review plus fixed for the layouts and data to be displayed
AndyScherzinger Jun 13, 2016
8073679
further review comments
AndyScherzinger Jun 13, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
<activity android:name=".ui.activity.UploadFilesActivity" />
<activity android:name=".ui.activity.ReceiveExternalFilesActivity"
android:taskAffinity=""
android:excludeFromRecents="true">
android:excludeFromRecents="true"
android:theme="@style/Theme.ownCloud">
<intent-filter>
<action android:name="android.intent.action.SEND" />

Expand Down
4 changes: 2 additions & 2 deletions res/layout/grid_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<ImageView
android:id="@+id/thumbnail"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_width="@dimen/standard_list_item_size"
android:layout_height="@dimen/standard_list_item_size"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
Expand Down
2 changes: 1 addition & 1 deletion res/layout/list_footer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/secondaryTextColor"
android:layout_marginBottom="56dp"
android:layout_marginBottom="@dimen/min_list_item_size"
/>

</LinearLayout>
4 changes: 2 additions & 2 deletions res/layout/list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:layout_width="match_parent"
android:background="@drawable/list_selector"
android:orientation="vertical"
android:layout_height="72dp">
android:layout_height="@dimen/standard_list_item_size">

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -31,7 +31,7 @@

<FrameLayout
android:layout_width="60dp"
android:layout_height="72dp"
android:layout_height="@dimen/standard_list_item_size"
android:paddingLeft="12dp"
android:paddingBottom="@dimen/standard_padding"
android:paddingTop="@dimen/standard_padding"
Expand Down
2 changes: 1 addition & 1 deletion res/layout/listrow_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<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="56dp"
android:layout_height="@dimen/min_list_item_size"
android:clickable="true"
android:orientation="vertical"
android:background="#fff"
Expand Down
6 changes: 3 additions & 3 deletions res/layout/listrow_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:background="#fff"
android:layout_height="56dp"
android:layout_marginLeft="8dp"
android:layout_height="@dimen/min_list_item_size"
android:layout_marginLeft="@dimen/standard_half_margin"
android:gravity="left"
android:paddingLeft="@dimen/standard_padding"
android:paddingTop="8dp"
android:paddingTop="@dimen/standard_half_padding"
android:textSize="16dp"
android:groupIndicator="@android:color/transparent"
/>
6 changes: 3 additions & 3 deletions res/layout/upload_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<FrameLayout
android:layout_width="60dp"
android:layout_height="72dp"
android:layout_height="@dimen/standard_list_item_size"
android:focusable="false"
android:focusableInTouchMode="false">

Expand Down Expand Up @@ -105,8 +105,8 @@


<FrameLayout
android:layout_width="56dp"
android:layout_height="72dp"
android:layout_width="@dimen/min_list_item_size"
android:layout_height="@dimen/standard_list_item_size"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_gravity="center_vertical"
Expand Down
32 changes: 14 additions & 18 deletions res/layout/uploader_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" android:orientation="vertical"
android:layout_width="wrap_content" android:background="#fefefe"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_width="wrap_content"
android:background="@color/white"
android:gravity="center">

<TextView android:layout_width="fill_parent"
android:text="@string/uploader_top_message"
android:layout_height="wrap_content"
android:id="@+id/drawer_username"
android:textColor="@android:color/black"
android:gravity="center_horizontal">
</TextView>
<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/upload_list"
android:layout_above="@+id/upload_actions">

<FrameLayout android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:id="@+id/frameLayout1"
android:layout_below="@+id/drawer_username"
android:layout_above="@+id/linearLayout1">

<ListView android:id="@android:id/list"
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="@color/list_divider_background"
Expand All @@ -46,11 +41,12 @@
</FrameLayout>

<LinearLayout
android:id="@+id/linearLayout1"
android:id="@+id/upload_actions"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
android:orientation="horizontal"
android:padding="@dimen/standard_padding">

<android.support.v7.widget.AppCompatButton
android:theme="@style/Button"
Expand Down
91 changes: 69 additions & 22 deletions res/layout/uploader_list_item_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,75 @@
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="fill_parent"
android:background="#fefefe"
android:orientation="horizontal"
android:layout_height="72dp"
android:padding="@dimen/standard_padding">

<ImageView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/standard_list_item_size"
android:background="@drawable/list_selector"
android:orientation="horizontal">

<ImageView
android:id="@+id/thumbnail"
android:layout_width="@dimen/file_icon_size"
android:layout_height="@dimen/file_icon_size"
android:layout_gravity="center_vertical|center"
android:src="@drawable/ic_menu_archive"
android:id="@+id/thumbnail"
android:layout_marginRight="@dimen/standard_padding"/>

<TextView
android:text="TextView"
android:layout_width="fill_parent"
android:id="@+id/filename"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="16sp" />

android:layout_gravity="center_vertical"
android:layout_margin="12dp"
android:src="@drawable/ic_menu_archive" />

<LinearLayout
android:layout_width="0dp"
android:layout_height="@dimen/standard_list_item_size"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical">

<TextView
android:id="@+id/filename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="0dp"
android:layout_marginRight="4dp"
android:ellipsize="middle"
android:singleLine="true"
android:text="TextView"
android:textColor="@color/textColor"
android:textSize="16dip" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginRight="4dp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constants pls

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for 4dp? or for 0dp or for 16dip? 😄
And again this would rather be a complete refactoring task where one would need to go through all the layouts and replace 4dp with the @dims value so I would again (for now) vote against it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

android:orientation="horizontal">

<TextView
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to have one text view and format string when inserting?

Copy link
Member Author

@AndyScherzinger AndyScherzinger Jun 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@przybylski I vote no since this would be the next change that doesn't add additional value but let's the code diverge from oC

android:id="@+id/file_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Size MB"
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:textSize="@dimen/two_line_secondary_text_size"/>

<TextView
android:id="@+id/file_separator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text=", "
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:textSize="@dimen/two_line_secondary_text_size"/>

<TextView
android:id="@+id/last_mod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="Mod Date"
android:textColor="@color/list_item_lastmod_and_filesize_text"
android:textSize="@dimen/two_line_secondary_text_size"/>

</LinearLayout>

</LinearLayout>

</LinearLayout>
2 changes: 2 additions & 0 deletions res/values/dims.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<dimen name="standard_half_padding">8dp</dimen>
<dimen name="standard_margin">16dp</dimen>
<dimen name="standard_half_margin">8dp</dimen>
<dimen name="min_list_item_size">56dp</dimen>
<dimen name="standard_list_item_size">72dp</dimen>

<dimen name="two_line_primary_text_size">16sp</dimen>
<dimen name="two_line_secondary_text_size">14sp</dimen>
Expand Down
2 changes: 1 addition & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<string name="sync_string_files">Files</string>
<string name="setup_btn_connect">Connect</string>
<string name="uploader_btn_upload_text">Upload</string>
<string name="uploader_top_message">Choose upload folder:</string>
<string name="uploader_top_message">Choose upload folder</string>
<string name="uploader_wrn_no_account_title">No account found</string>
<string name="uploader_wrn_no_account_text">There are no %1$s accounts on your device. Please set up an account first.</string>
<string name="uploader_wrn_no_account_setup_btn_text">Setup</string>
Expand Down
Loading