Skip to content
Draft
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
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</activity>

<activity
android:name=".share.NoteShareActivity" />
android:name=".itemdetails.ItemDetailsActivity" />

<activity
android:name=".share.NoteShareDetailActivity" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package it.niedermann.owncloud.notes.activities

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import it.niedermann.owncloud.notes.branding.BrandedFragment
import it.niedermann.owncloud.notes.databinding.FragmentActivitiesBinding

class ActivitiesFragment : BrandedFragment() {

lateinit var binding : FragmentActivitiesBinding

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
binding = FragmentActivitiesBinding.inflate(inflater)
return super.onCreateView(inflater, container, savedInstanceState)
}

override fun applyBrand(color: Int) {
// TODO
}

companion object {
fun newInstance() : ActivitiesFragment {
return ActivitiesFragment()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import it.niedermann.owncloud.notes.edit.category.CategoryDialogFragment.CategoryDialogListener;
import it.niedermann.owncloud.notes.edit.title.EditTitleDialogFragment;
import it.niedermann.owncloud.notes.edit.title.EditTitleDialogFragment.EditTitleListener;
import it.niedermann.owncloud.notes.itemdetails.ItemDetailsActivity;
import it.niedermann.owncloud.notes.persistence.NotesRepository;
import it.niedermann.owncloud.notes.persistence.entity.Account;
import it.niedermann.owncloud.notes.persistence.entity.Note;
Expand Down Expand Up @@ -305,8 +306,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
.newInstance(new ArrayList<>(repo.getAccounts()), note.getAccountId())
.show(requireActivity().getSupportFragmentManager(), BaseNoteFragment.class.getSimpleName()));
return true;
} else if (itemId == R.id.menu_share) {
shareNote();
} else if (itemId == R.id.menu_details) {
Intent detailsIntent = new Intent(requireContext(), ItemDetailsActivity.class);
startActivity(detailsIntent);
//shareNote(); // TODO
return false;
} else if (itemId == MENU_ID_PIN) {
pinNoteToHome();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void onPrepareOptionsMenu(@NonNull Menu menu) {
menu.findItem(R.id.menu_preview).setVisible(false);
menu.findItem(R.id.menu_cancel).setVisible(false);
menu.findItem(R.id.menu_delete).setVisible(false);
menu.findItem(R.id.menu_share).setVisible(false);
menu.findItem(R.id.menu_details).setVisible(false);
menu.findItem(R.id.menu_move).setVisible(false);
menu.findItem(R.id.menu_category).setVisible(false);
menu.findItem(R.id.menu_title).setVisible(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package it.niedermann.owncloud.notes.itemdetails

import android.os.Bundle
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.google.android.material.tabs.TabLayoutMediator
import it.niedermann.owncloud.notes.R
import it.niedermann.owncloud.notes.activities.ActivitiesFragment
import it.niedermann.owncloud.notes.branding.BrandedActivity
import it.niedermann.owncloud.notes.branding.BrandedFragment
import it.niedermann.owncloud.notes.databinding.ActivityItemDetailsBinding
import it.niedermann.owncloud.notes.share.NoteShareActivity

class ItemDetailsActivity : BrandedActivity() {

lateinit var binding : ActivityItemDetailsBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityItemDetailsBinding.inflate(layoutInflater)
setContentView(binding.root)

val pages = listOf<Pair<String,BrandedFragment>>(
Pair(getString(R.string.activities_title), ActivitiesFragment.newInstance())
// TODO: convert NoteShareActivity to Kotlin and refactor to be a BrandedFragment
//Pair(getString(R.string.share), NoteShareFragment.newInstance())
)

binding.pager.adapter = PagerAdapter(pages)
TabLayoutMediator(binding.tabLayout, binding.pager) { tab, position ->
tab.text = pages[position].first
}.attach()
}

override fun applyBrand(color: Int) {
// TODO
}

private inner class PagerAdapter(val fragments: List<Pair<String,BrandedFragment>>) :
FragmentStateAdapter(this@ItemDetailsActivity)
{
override fun getItemCount() = fragments.size
override fun createFragment(position: Int) = fragments[position].second
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import it.niedermann.owncloud.notes.accountpicker.AccountPickerDialogFragment;
import it.niedermann.owncloud.notes.branding.BrandedSnackbar;
import it.niedermann.owncloud.notes.edit.category.CategoryDialogFragment;
import it.niedermann.owncloud.notes.itemdetails.ItemDetailsActivity;
import it.niedermann.owncloud.notes.share.NoteShareActivity;
import it.niedermann.owncloud.notes.shared.util.ShareUtil;

Expand Down Expand Up @@ -153,7 +154,7 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
.show(fragmentManager, AccountPickerDialogFragment.class.getSimpleName()));
});
return true;
} else if (itemId == R.id.menu_share) {
} /*else if (itemId == R.id.menu_share) {
final var selection = new ArrayList<Long>(tracker.getSelection().size());
for (final var sel : tracker.getSelection()) {
selection.add(sel);
Expand All @@ -177,7 +178,7 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
}

return true;
} else if (itemId == R.id.menu_category) {// TODO detect whether all selected notes do have the same category - in this case preselect it
}*/ else if (itemId == R.id.menu_category) {// TODO detect whether all selected notes do have the same category - in this case preselect it
final var accountLiveData = mainViewModel.getCurrentAccount();
accountLiveData.observe(lifecycleOwner, account -> {
accountLiveData.removeObservers(lifecycleOwner);
Expand All @@ -186,6 +187,9 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
.show(fragmentManager, CategoryDialogFragment.class.getSimpleName());
});
return true;
} else if (itemId == R.id.menu_details) {
Intent detailsIntent = new Intent(context, ItemDetailsActivity.class);
mainActivity.startActivity(detailsIntent);
}
return false;
}
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/res/drawable/ic_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2018-2025 Google LLC
~ SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#757575"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M320,880L360,600L160,600L520,80L600,80L560,400L800,400L400,880L320,880Z" />
</vector>
117 changes: 117 additions & 0 deletions app/src/main/res/layout/activity_item_details.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Nextcloud Notes - Android Client
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: GPL-2.0-only AND (AGPL-3.0-or-later OR GPL-2.0-only)
-->
<LinearLayout 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/detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/standard_padding"
android:orientation="vertical">

<TextView
android:id="@+id/filename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:text="@string/placeholder_filename"
android:textColor="@color/text_color"
android:textSize="20sp"
android:textStyle="bold"
tools:text="@string/placeholder_filename" />

<LinearLayout
android:id="@+id/filedetails"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">

<ImageView
android:id="@+id/favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/zero"
android:layout_marginEnd="@dimen/spacer_1qx"
android:contentDescription="@string/activities_favorite"
android:src="@drawable/ic_star_border_grey_ccc_24dp" />

<TextView
android:id="@+id/size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/primary_font_size"
android:textColor="@color/activity_lastmod_and_filesize_text"
tools:text="@string/placeholder_fileSize" />

<TextView
android:id="@+id/file_separator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:paddingStart="@dimen/zero"
android:paddingEnd="@dimen/spacer_1hx"
android:text="@string/info_separator"
android:textColor="@color/activity_lastmod_and_filesize_text"
android:textSize="@dimen/primary_font_size" />

<TextView
android:id="@+id/last_modification_timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:textSize="@dimen/primary_font_size"
android:textColor="@color/activity_lastmod_and_filesize_text"
tools:text="@string/placeholder_media_time" />

</LinearLayout>

</LinearLayout>

</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/list_divider_background" />

<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bg_default"
app:tabGravity="center"
app:tabMode="fixed"
app:tabTextColor="@color/text_color"
app:tabInlineLabel="true" />

<androidx.viewpager2.widget.ViewPager2
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<FrameLayout
android:layout_width="match_parent"
android:visibility="gone"
android:id="@+id/sharing_frame_container"
android:layout_height="match_parent"/>

<include
android:id="@+id/empty_list"
layout="@layout/empty_content_view" />
</LinearLayout>
11 changes: 11 additions & 0 deletions app/src/main/res/layout/fragment_activities.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="WIP..."/>

</LinearLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/menu/menu_list_context_multiple.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
app:showAsAction="ifRoom" />

<item
android:id="@+id/menu_share"
android:icon="@drawable/ic_share_white_24dp"
android:id="@+id/menu_details"
android:icon="@drawable/ic_info_outline_grey600_24dp"
android:orderInCategory="90"
android:title="@string/menu_share"
android:title="@string/menu_details"
app:showAsAction="ifRoom" />

<item
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/menu/menu_note_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
android:title="@string/menu_change_category"
app:showAsAction="ifRoom" />
<item
android:id="@+id/menu_share"
android:icon="@drawable/ic_share_white_24dp"
android:id="@+id/menu_details"
android:icon="@drawable/ic_info_outline_grey600_24dp"
android:orderInCategory="100"
android:title="@string/menu_share"
android:title="@string/menu_details"
app:showAsAction="never" />
<item
android:id="@+id/menu_move"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@

<color name="category_widget_background">@color/material_dynamic_secondary20</color>
<color name="category_border">@color/transparent</color>

<color name="list_divider_background">#49454F</color>

</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,9 @@
<color name="offline">@color/high_emphasis_text</color>

<color name="category_widget_background">@color/transparent</color>

<color name="list_divider_background">#CAC4D0</color>
<color name="activity_lastmod_and_filesize_text">@color/secondary_text_color</color>


</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@
<dimen name="sharee_list_item_size">56dp</dimen>
<dimen name="online_status_item_height">60dp</dimen>
<dimen name="iconized_single_line_item_icon_size">24dp</dimen>

<dimen name="standard_padding">@dimen/spacer_2x</dimen>
</resources>
11 changes: 10 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<string name="menu_change_category">Category</string>
<string name="menu_favorite">Favorite</string>
<string name="menu_preview">Preview</string>
<string name="menu_share">Share</string>
<string name="menu_shared_note">Shared note</string>
<string name="common_loading">Loading…</string>

Expand Down Expand Up @@ -537,4 +536,14 @@
<string name="share_expires">Share expires on %1$s</string>
<string name="dismiss">Dismiss</string>
<string name="account_not_found">Account not found!</string>

<string name="menu_details">Details</string>
<string name="activities_title">Activities</string>

<string name="placeholder_filename">Note.md</string>
<string name="activities_favorite">Favorite</string>
<string name="placeholder_fileSize" translatable="false">389 KB</string>
<string name="info_separator" translatable="false">&#160;&#x2022;</string>
<string name="placeholder_media_time" translatable="false">12:23:45</string>

</resources>
Loading