Android: Better layout for read-only documents

This commit is contained in:
jendib 2016-05-14 02:05:03 +02:00
parent ef18581e71
commit d84d1428b2
No known key found for this signature in database
GPG Key ID: 06EE7F699579166F
5 changed files with 44 additions and 42 deletions

View File

@ -101,7 +101,7 @@ public class DocumentEditActivity extends AppCompatActivity {
finish(); finish();
return; return;
} }
JSONArray tagArray = tags.optJSONArray("stats"); JSONArray tagArray = tags.optJSONArray("tags");
List<JSONObject> tagList = new ArrayList<>(); List<JSONObject> tagList = new ArrayList<>();
for (int i = 0; i < tagArray.length(); i++) { for (int i = 0; i < tagArray.length(); i++) {

View File

@ -642,10 +642,10 @@ public class DocumentViewActivity extends AppCompatActivity {
} }
// Action only available if the document is writable // Action only available if the document is writable
findViewById(R.id.actionEditDocument).setVisibility(writable ? View.VISIBLE : View.INVISIBLE); findViewById(R.id.actionEditDocument).setVisibility(writable ? View.VISIBLE : View.GONE);
findViewById(R.id.actionUploadFile).setVisibility(writable ? View.VISIBLE : View.INVISIBLE); findViewById(R.id.actionUploadFile).setVisibility(writable ? View.VISIBLE : View.GONE);
findViewById(R.id.actionSharing).setVisibility(writable ? View.VISIBLE : View.INVISIBLE); findViewById(R.id.actionSharing).setVisibility(writable ? View.VISIBLE : View.GONE);
findViewById(R.id.actionDelete).setVisibility(writable ? View.VISIBLE : View.INVISIBLE); findViewById(R.id.actionDelete).setVisibility(writable ? View.VISIBLE : View.GONE);
// ACLs // ACLs
ListView aclListView = (ListView) findViewById(R.id.aclListView); ListView aclListView = (ListView) findViewById(R.id.aclListView);

View File

@ -73,7 +73,7 @@ public class SearchFragment extends DialogFragment {
dialog.cancel(); dialog.cancel();
return dialog; return dialog;
} }
JSONArray tagArray = tags.optJSONArray("stats"); JSONArray tagArray = tags.optJSONArray("tags");
List<JSONObject> tagList = new ArrayList<>(); List<JSONObject> tagList = new ArrayList<>();
for (int i = 0; i < tagArray.length(); i++) { for (int i = 0; i < tagArray.length(); i++) {

View File

@ -166,28 +166,6 @@
android:orientation="horizontal" android:orientation="horizontal"
style="?android:buttonBarStyle"> style="?android:buttonBarStyle">
<Button
android:id="@+id/actionEditDocument"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_create_grey600_24dp"
style="?android:buttonBarButtonStyle"
android:text="@string/edit_document"
android:textColor="#ff5a595b"
android:textAllCaps="false"
android:layout_margin="8dp"/>
<Button
android:id="@+id/actionUploadFile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_file_upload_grey600_24dp"
style="?android:buttonBarButtonStyle"
android:text="@string/upload_file"
android:textColor="#ff5a595b"
android:textAllCaps="false"
android:layout_margin="8dp"/>
<Button <Button
android:id="@+id/actionDownload" android:id="@+id/actionDownload"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -199,6 +177,28 @@
android:textAllCaps="false" android:textAllCaps="false"
android:layout_margin="8dp"/> android:layout_margin="8dp"/>
<Button
android:id="@+id/actionExportPdf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_description_grey600_24dp"
style="?android:buttonBarButtonStyle"
android:text="@string/export_pdf"
android:textColor="#ff5a595b"
android:textAllCaps="false"
android:layout_margin="8dp"/>
<Button
android:id="@+id/actionAuditLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_assignment_grey600_24dp"
style="?android:buttonBarButtonStyle"
android:text="@string/activity"
android:textColor="#ff5a595b"
android:textAllCaps="false"
android:layout_margin="8dp"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -208,12 +208,23 @@
style="?android:buttonBarStyle"> style="?android:buttonBarStyle">
<Button <Button
android:id="@+id/actionExportPdf" android:id="@+id/actionEditDocument"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_description_grey600_24dp" android:drawableTop="@drawable/ic_create_grey600_24dp"
style="?android:buttonBarButtonStyle" style="?android:buttonBarButtonStyle"
android:text="@string/export_pdf" android:text="@string/edit_document"
android:textColor="#ff5a595b"
android:textAllCaps="false"
android:layout_margin="0dp"/>
<Button
android:id="@+id/actionUploadFile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_file_upload_grey600_24dp"
style="?android:buttonBarButtonStyle"
android:text="@string/upload_file"
android:textColor="#ff5a595b" android:textColor="#ff5a595b"
android:textAllCaps="false" android:textAllCaps="false"
android:layout_margin="0dp"/> android:layout_margin="0dp"/>
@ -229,17 +240,6 @@
android:textAllCaps="false" android:textAllCaps="false"
android:layout_margin="0dp"/> android:layout_margin="0dp"/>
<Button
android:id="@+id/actionAuditLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_assignment_grey600_24dp"
style="?android:buttonBarButtonStyle"
android:text="@string/activity"
android:textColor="#ff5a595b"
android:textAllCaps="false"
android:layout_margin="0dp"/>
<Button <Button
android:id="@+id/actionDelete" android:id="@+id/actionDelete"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -12,6 +12,8 @@
# Default value: -Xmx10248m -XX:MaxPermSize=256m # Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx3072m
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects