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

Full nested folder support #95

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<uses-permission android:name="org.tint.permissions.services.ADDONS" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

Expand All @@ -69,6 +70,12 @@
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="text/html" />
</intent-filter>
</activity>

<activity android:name=".ui.preferences.PreferencesActivity" android:label="@string/PreferencesActivityTitle"></activity>
Expand Down
Binary file added res/drawable-hdpi/ic_add_folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_folder_mini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_add_folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_folder_mini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion res/layout/bookmarks_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
android:id="@+id/BookmarksBreadCrumb"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|left" />
android:gravity="center_vertical|start"
android:layout_weight="1" />

</LinearLayout>

<ImageView
Expand Down
18 changes: 5 additions & 13 deletions res/layout/edit_bookmark_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,13 @@
android:text="@string/Folder"
android:textAppearance="?android:attr/textAppearanceMedium" />

<Spinner
android:id="@+id/EditBookmarkActivity.FolderSpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip" />
<Button android:id="@+id/PickFolder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I AM BEAUTIFUL"
android:onClick="pickFolder" />
</TableRow>

<EditText
android:id="@+id/EditBookmarkActivity.FolderValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:hint="@string/NewFolderHint"
android:inputType="text" >
</EditText>
</TableLayout>
</ScrollView>
</FrameLayout>
Expand Down
106 changes: 106 additions & 0 deletions res/layout/foldersonly_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Tint Browser for Android

Copyright (C) 2012 - to infinity and beyond J. Devauchelle and contributors.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 3 as published by the Free Software Foundation.

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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dip"
android:orientation="vertical" >

<LinearLayout
android:id="@+id/BookmarksBreadCrumbGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/bookmarks_fragment_margin_top_bottom"
android:layout_marginBottom="10dip"
android:layout_marginLeft="@dimen/bookmarks_fragment_breadcrumb_margin_left_right"
android:layout_marginRight="@dimen/bookmarks_fragment_breadcrumb_margin_left_right"
android:orientation="horizontal" >

<ImageView
android:id="@+id/BookmarksBreadCrumbBackHierarchy"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/ContentDescriptionBookmarksFoldersBack"
android:focusable="true"
android:src="@drawable/ic_back_hierarchy" />

<android.app.FragmentBreadCrumbs
android:id="@+id/BookmarksBreadCrumb"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|start"
android:layout_weight="1" />

<ImageView
android:id="@+id/BookmarksBreadCrumbAddFolder"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/NewFolder"
android:focusable="true"
android:src="@drawable/ic_add_folder" />

</LinearLayout>

<ImageView
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bookmarks_fragment_margin_left_right"
android:layout_marginRight="@dimen/bookmarks_fragment_margin_left_right"
android:contentDescription="@string/ContentDescriptionDivider"
android:paddingRight="5dip"
android:scaleType="fitXY"
android:src="?android:attr/dividerHorizontal" />

</LinearLayout>

<RelativeLayout
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ListView
android:id="@+id/BookmarksGridView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="@dimen/bookmarks_fragment_margin_top_bottom"
android:layout_marginLeft="@dimen/bookmarks_fragment_margin_left_right"
android:layout_marginRight="@dimen/bookmarks_fragment_margin_left_right"
android:layout_marginTop="10dip"
android:columnWidth="@dimen/bookmarks_fragment_column_width"
android:gravity="center"
android:horizontalSpacing="@dimen/bookmarks_fragment_horizontal_spacing"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:verticalSpacing="@dimen/bookmarks_fragment_vertical_spacing" />

<ProgressBar
android:id="@+id/BookmarksProgressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>

</LinearLayout>
59 changes: 59 additions & 0 deletions res/layout/foldersonly_row.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Tint Browser for Android

Copyright (C) 2012 - to infinity and beyond J. Devauchelle and contributors.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 3 as published by the Free Software Foundation.

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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:layout_gravity="center_vertical"
android:orientation="horizontal" >

<ImageView
android:id="@+id/divider"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingRight="5dip"
android:scaleType="fitXY"
android:src="@drawable/ic_folder_mini" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical"
android:orientation="vertical" >

<TextView
android:id="@+id/BookmarkRow.Title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:ellipsize="marquee"
android:singleLine="true"
android:text="" />

</LinearLayout>

</LinearLayout>

</LinearLayout>
8 changes: 7 additions & 1 deletion res/menu/bookmarks_activity_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
android:title="@string/AddBookmark"
android:icon="@drawable/ic_add_bookmark"
android:showAsAction="ifRoom|withText" />


<item
android:id="@+id/BookmarksActivityMenuAddFolder"
android:title="@string/NewFolder"
android:icon="@drawable/ic_add_folder"
android:showAsAction="ifRoom|withText" />

<item
android:id="@+id/BookmarksActivityMenuSortBookmarks"
android:title="@string/SortBookmarks" />
Expand Down
6 changes: 5 additions & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -576,5 +576,9 @@
<string name="PreferenceJsLogOnLocatSummary">Redirect javascript logs to the logcat buffer.</string>

<string name="ContextMenuViewImageInNewTab">View image in a new tab</string>

<string name="RenameFolder">Rename folder</string>
<string name="MoveFolder">Move folder</string>
<string name="MoveBookmark">Move bookmark</string>
<string name="PickFolder">Pick folder</string>

</resources>
39 changes: 39 additions & 0 deletions src/org/tint/model/FoldersOnlyAdapter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Tint Browser for Android
*
* Copyright (C) 2012 - to infinity and beyond J. Devauchelle and contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 3 as published by the Free Software Foundation.
*
* 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.
*/

package org.tint.model;

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SimpleCursorAdapter;

public class FoldersOnlyAdapter extends SimpleCursorAdapter {

public FoldersOnlyAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) {
super(context, layout, c, from, to, flags);
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
View superView = super.getView(position, convertView, parent);

//until we have something

return superView;
}

}
Loading