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

Layout Simplification, by @gsantner #1775

Merged
merged 2 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@ public void onBindViewHolder(@NonNull FilesystemViewerViewHolder holder, int pos
}

//String tmp = descriptionFile.getAbsolutePath().startsWith("/storage/emulated/0/") && getCurrentFolder().getAbsolutePath().startsWith("/storage/emulated/0/") ? "/storage/emulated/0/" : "";
holder.description.setText(!_dopt.descModtimeInsteadOfParent || holder.title.getText().toString().equals("..")
? descriptionFile.getAbsolutePath() : formatFileDescription(file, _prefApp.getString("pref_key__file_description_format", "")));
holder.description.setTextColor(ContextCompat.getColor(_context, _dopt.secondaryTextColor));

holder.image.setImageResource(isSelected ? _dopt.selectedItemImage : (!file.isFile() ? _dopt.folderImage : _dopt.fileImage));
holder.image.postDelayed(() -> {
holder.image.setImageResource(isSelected ? _dopt.selectedItemImage : (!file.isFile() ? _dopt.folderImage : _dopt.fileImage));
holder.description.setText(!_dopt.descModtimeInsteadOfParent || holder.title.getText().toString().equals("..")
? descriptionFile.getAbsolutePath() : formatFileDescription(file, _prefApp.getString("pref_key__file_description_format", "")));
}, 60);
holder.image.setColorFilter(ContextCompat.getColor(_context,
isSelected ? _dopt.accentColor : _dopt.secondaryTextColor),
isSelected ? _dopt.accentColor : _dopt.secondaryTextColor),
android.graphics.PorterDuff.Mode.SRC_ATOP);
if (!isSelected && isFavourite) {
holder.image.setColorFilter(Color.parseColor("#E3B51B"));
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/document__activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
*
#########################################################*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="@style/AppTheme.Unified"
tools:context="net.gsantner.markor.activity.DocumentActivity">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="?attr/actionBarSize"
android:theme="@style/AppTheme.Light.AppBarOverlay">

<android.support.v7.widget.Toolbar
Expand Down Expand Up @@ -50,6 +49,7 @@
android:id="@+id/document__placeholder_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</LinearLayout>
</FrameLayout>
3 changes: 1 addition & 2 deletions app/src/main/res/layout/document__fragment__edit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="120dp"
android:scrollbars="vertical"
android:textCursorDrawable="@drawable/cursor_accent"
tools:ignore="UnusedAttribute" />
android:textCursorDrawable="@drawable/cursor_accent" />

</net.gsantner.markor.ui.DraggableScrollbarScrollView>

Expand Down
68 changes: 28 additions & 40 deletions app/src/main/res/layout/main__activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
#########################################################*/
-->
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_content"
Expand All @@ -23,7 +23,7 @@
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="?attr/actionBarSize"
android:theme="@style/AppTheme.Light.AppBarOverlay">

<android.support.v7.widget.Toolbar
Expand All @@ -32,51 +32,39 @@
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/LightTextToolbarOverlay"
app:title="@string/app_name">

</android.support.v7.widget.Toolbar>
app:title="@string/app_name" />

</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
android:id="@+id/main__view_pager_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="56dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<RelativeLayout
android:id="@+id/main_bottom_stuff"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom">
android:layout_marginTop="?attr/actionBarSize"
android:layout_marginBottom="?attr/actionBarSize" />

<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_add_new_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/bottom_navigation_bar"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_margin="16dp"
android:contentDescription="@string/create_new_file_or_folder"
android:src="@drawable/ic_add_white_24dp"
tools:elevation="2dp"
tools:ignore="RtlHardcoded" />

<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/primary"
app:itemBackground="@color/primary"
app:itemIconTint="@drawable/bottomnav_color_selector"
app:itemTextColor="@drawable/bottomnav_color_selector"
app:labelVisibilityMode="labeled"
app:menu="@menu/main__bottom_nav"
tools:elevation="2dp" />
<!--suppress AndroidUnknownAttribute -->
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_add_new_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="72dp"
android:contentDescription="@string/create_new_file_or_folder"
android:src="@drawable/ic_add_white_24dp" />

</RelativeLayout>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="start|bottom"
android:background="@color/primary"
app:itemBackground="@color/primary"
app:itemIconTint="@drawable/bottomnav_color_selector"
app:itemTextColor="@drawable/bottomnav_color_selector"
app:labelVisibilityMode="labeled"
app:menu="@menu/main__bottom_nav" />

</android.support.design.widget.CoordinatorLayout>
</FrameLayout>
14 changes: 4 additions & 10 deletions app/src/main/res/layout/more__fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@
*
#########################################################*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/more__fragment__placeholder_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<FrameLayout
android:id="@+id/more__fragment__placeholder_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</LinearLayout>
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
1 change: 1 addition & 0 deletions app/src/main/res/layout/new_file_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-14dp"
android:orientation="horizontal"
android:weightSum="100">

<EditText
Expand Down
62 changes: 35 additions & 27 deletions app/src/main/res/layout/opoc_file__item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
#########################################################*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -26,37 +26,45 @@
android:id="@+id/file_identifier_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:contentDescription="@null"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
<TextView
android:id="@+id/note_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/file_identifier_icon"
android:layout_alignLeft="@+id/file_identifier_icon"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:ellipsize="end"
android:lines="1"
android:paddingLeft="8dp"
android:paddingRight="8dp">
android:paddingRight="8dp"
android:textColor="@android:color/secondary_text_light"
android:textSize="19sp"
tools:text="myfile.md" />

<TextView
android:id="@+id/note_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:textColor="@android:color/secondary_text_light"
android:textSize="19sp" />

<TextView
android:id="@+id/note_extra"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:fontFamily="sans-serif-light"
android:singleLine="true"
android:textColor="@android:color/tertiary_text_dark"
android:textSize="15sp"
tools:ignore="UnusedAttribute" />
</LinearLayout>
<TextView
android:id="@+id/note_extra"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/file_identifier_icon"
android:layout_alignLeft="@+id/file_identifier_icon"
android:layout_alignTop="@+id/note_title"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:ellipsize="middle"
android:fontFamily="sans-serif-light"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:singleLine="true"
android:textColor="@android:color/tertiary_text_dark"
android:textSize="15sp"
tools:text="20kb, 19.02.2004" />

</LinearLayout>
</RelativeLayout>
5 changes: 2 additions & 3 deletions app/src/main/res/layout/opoc_filesystem_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
#########################################################*/
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ui__filesystem_dialog__root"
Expand All @@ -21,7 +21,6 @@
android:id="@+id/empty_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="64dp"
Expand All @@ -45,4 +44,4 @@
</android.support.v4.widget.SwipeRefreshLayout>


</RelativeLayout>
</FrameLayout>