Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
ui: Open files & add App section & grid improv.
Browse files Browse the repository at this point in the history
I also made some clean-ups, so this commit is a
bit messy for that reason.

Grid size should now grow and shrink depending
on display density.

Finally, apps can now be shared using Web Share
(split apk will be zipped similarly to folders).
  • Loading branch information
velitasali committed Aug 10, 2021
1 parent e119d73 commit 1d50f4e
Show file tree
Hide file tree
Showing 69 changed files with 936 additions and 2,117 deletions.
6 changes: 1 addition & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,9 @@
android:label="@string/text_welcome"
android:theme="@style/Theme.TrebleShot.NoActionBar" />

<activity
android:name="org.monora.uprotocol.client.android.activity.WebShareActivity"
android:label="@string/text_webShare" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:authorities="@string/file_provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
Expand Down
30 changes: 30 additions & 0 deletions app/src/main/assets/web/template/list/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--
~ Copyright (C) 2021 Veli Tasalı
~
~ This program is free software; you can redistribute it and/or
~ modify it under the terms of the GNU General Public License
~ as published by the Free Software Foundation; either version 2
~ of the License, or (at your option) any later version.
~
~ 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, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->

<div class="col-6 col-md-4 col-lg-3 mb-4">
<div class="card h-100">
<div class="card-img-top p-4" style="background-color: #88888822">
<img src="/thumbnail/${id}" class="w-100" alt="${title}">
</div>
<div class="card-body">
<h5 class="card-title">${title}</h5>
<p class="card-text">${size}${sizeSuffix}</p>
<a href="/${downloadType}/${id}/${name}${nameSuffix}" class="btn btn-primary">Download</a>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class ContentBrowserActivity : Activity() {
else -> toolbarDefaultBg
}
if (Build.VERSION.SDK_INT < 16) {
@Suppress("DEPRECATION")
appBarLayout.setBackgroundDrawable(bg)
} else {
appBarLayout.background = bg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package org.monora.uprotocol.client.android.activity

import androidx.fragment.app.FragmentActivity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class HomeActivity : Activity(), NavigationView.OnNavigationItemSelectedListener

when (pendingMenuItemId) {
R.id.edit_profile -> navController.navigate(NavHomeDirections.actionGlobalProfileEditorFragment())
R.id.manage_devices -> navController.navigate(NavHomeDirections.actionGlobalNavManageDevices())
R.id.manage_clients -> navController.navigate(NavHomeDirections.actionGlobalNavManageDevices())
R.id.about -> startActivity(Intent(this, AboutActivity::class.java))
R.id.preferences -> navController.navigate(NavHomeDirections.actionGlobalNavPreferences())
R.id.donate -> try {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class FileAdapter(

companion object {
const val VIEW_TYPE_SECTION = 0

const val VIEW_TYPE_FILE = 1
}
}
Loading

0 comments on commit 1d50f4e

Please sign in to comment.